Skip to content

Conversation

@lgarber-akamai
Copy link
Contributor

@lgarber-akamai lgarber-akamai commented Mar 20, 2025

📝 Description

This pull request updates the --debug flag to additionally set the Python logging package's log level to DEBUG. This allows users to more easily diagnose issues with underlying dependencies (e.g. urllib3) and introduces a standardized logging format we can use for debugging.

This pull request also introduces various log statements to the linode-cli bake command, which should make build issues easier to diagnose in CI.

✔️ How to Test

The following test steps assume you have pulled down this PR locally and run make install.

Unit Testing

make test-unit

Manual Testing

  1. Attempt to re-bake the OpenAPI spec:
make bake
  1. Ensure the output contains debug lines similar to the following:
DEBUG:linodecli.cli:GET /{apiVersion}/vpcs/{vpcId}/subnets/{vpcSubnetId}: Attempting to generate command for operation
DEBUG:linodecli.cli:GET /{apiVersion}/vpcs/{vpcId}/subnets/{vpcSubnetId}: Successfully built command for operation: command='vpcs subnet-view'; summary='Get a VPC subnet'; paginated=False; num_args=0; num_attrs=8
  1. Run an arbitrary command using the --debug flag:
linode-cli linodes create --debug --type g6-nanode-1 --region us-mia --label test
  1. Ensure urllib3 debug information is displayed alongside the API request/response data.

@lgarber-akamai lgarber-akamai added the new-feature for new features in the changelog. label Mar 20, 2025
@lgarber-akamai lgarber-akamai force-pushed the new/build-debug-logging branch from 0cd5bef to e3569b0 Compare March 21, 2025 14:06
@lgarber-akamai lgarber-akamai changed the title Introduce verbose logging for baking process Configure Python logging level when debug flag is specified; add debug logs to bake command Mar 21, 2025
@lgarber-akamai lgarber-akamai marked this pull request as ready for review March 21, 2025 14:36
@lgarber-akamai lgarber-akamai requested a review from a team as a code owner March 21, 2025 14:36
@lgarber-akamai lgarber-akamai requested review from ezilber-akamai and yec-akamai and removed request for a team March 21, 2025 14:36
Copy link
Contributor

@ezilber-akamai ezilber-akamai left a comment

Choose a reason for hiding this comment

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

Works well locally. LGTM!

Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

Nice work! Tests passed locally 🎉

Co-authored-by: Ye Chen <127243817+yec-akamai@users.noreply.github.com>
@lgarber-akamai lgarber-akamai merged commit 6583a5f into linode:dev Mar 31, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants