SalesforceCommerceCloud / sfcc-ci

Salesforce Commerce Cloud CLI
https://npmjs.com/package/sfcc-ci
BSD 3-Clause "New" or "Revised" License
231 stars 94 forks source link

SLAS shortcode and tenant options switched #265

Open drewzboto opened 3 years ago

drewzboto commented 3 years ago

I was trying to use the new slas commands, but I believe on v2.8.0 the options are accidentally switched. It looks like sfcc-ci is picking up the tenant from the shortcode option and the shortcode from the tenant option

sfcc-ci slas:client:list -help
Usage: slas:client:list [options]

Lists all SLAS clients that belong to a given tenant

Options:
  --tenant <tenant>        the tenant id used for slas
  --shortcode <shortcode>  the organizations short code
  -j, --json               Formats the output in json
  -h, --help               output usage information

Steps to reproduce:

  1. Auth sfcc-ci
  2. Attempt to list clients: sfcc-ci slas:client:list --shortcode kv7kzm78 --tenant zzrf_001

Expected results: List of SLAS clients is displayed for tenant zzrf_001 for shortcode kv7kzm78

Actual results: Error is displayed: Could not get tenants: request to https://zzrf_001.api.commercecloud.salesforce.com/shopper/auth-admin/v1/tenants/kv7kzm78/clients failed, reason: getaddrinfo ENOTFOUND zzrf_001.api.commercecloud.salesforce.com

However, if you flip the tenant and shortcode it works: sfcc-ci slas:client:list --tenant kv7kzm78 --shortcode zzrf_001

drewzboto commented 3 years ago

@hnestmann can you reproduce this?

drewzboto commented 3 years ago

Related... i'm not sure if this is working as expected for listing tenants:

 ~/code/ sfcc-ci slas:tenant:list -help
Usage: slas:tenant:list [options]

Lists all tenants that belong to a given organization

Options:
  --shortcode <shortcode>  the organizations short code
  -j, --json               Formats the output in json
  -h, --help               output usage information

 ~/code/ sfcc-ci slas:tenant:list --shortcode kv7kzm78
Could not get tenants: tenantId is not defined
hnestmann commented 3 years ago

Hi Drew, I heard from a partner the same thing- Thanks for raising - we'l have a look

johnboxall commented 2 years ago

WIP here: https://github.com/SalesforceCommerceCloud/sfcc-ci/compare/master...johnboxall:fix-slas