Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Service ID to --verbose output #383

Merged
merged 8 commits into from Sep 6, 2021

Conversation

Integralist
Copy link
Collaborator

@Integralist Integralist commented Sep 3, 2021

The --verbose flag prints the Fastly API token source as well as the Fastly API endpoint, but it would be helpful for users to also see the Service ID as this can be sourced from multiple locations:

  1. Flag
  2. Environment
  3. Manifest

The motivation behind this change is that we received a report from a user to say they ran into an issue where the Service ID within the manifest file was being overridden by the FASTLY_SERVICE_ID environment variable. The root cause was that they had reused the same shell from an earlier test experiment and hadn't notice the environment variable being set.

Adding the Service ID to the --verbose output should help users to pinpoint a possible issue like this.

NOTE: We've added the new display logic within the existing cmd.ServiceDetails() function, which is used over ~90% of the files, but we still need to add an explicit call to the new cmd.DisplayServiceID() function from within those functions that don't use cmd.ServiceDetails().

For example, some commands don't require a service version (e.g. versionless resources like Edge Dictionaries and ACL entries) and so we don't call cmd.ServiceDetails() as that would also waste time on a bunch of unnecessary service API calls.

@Integralist Integralist added the enhancement New feature or request label Sep 3, 2021
@Integralist Integralist force-pushed the integralist/add-sid-to-verbose-output branch 3 times, most recently from e0df51e to 4d7eac2 Compare September 3, 2021 18:37
@Integralist Integralist marked this pull request as ready for review September 3, 2021 18:37
@Integralist Integralist requested review from a team and doramatadora and removed request for a team September 4, 2021 15:32
Copy link
Contributor

@doramatadora doramatadora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼

@Integralist Integralist force-pushed the integralist/add-sid-to-verbose-output branch from 4d7eac2 to 8b118fb Compare September 6, 2021 11:11
@Integralist Integralist changed the title add Service ID to --verbose output Add Service ID to --verbose output Sep 6, 2021
@Integralist Integralist merged commit 9c3be6f into main Sep 6, 2021
@Integralist Integralist deleted the integralist/add-sid-to-verbose-output branch September 6, 2021 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants