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

Log full request path and responses in dry-run.rb #6459

Merged
merged 1 commit into from
Jan 19, 2023
Merged

Log full request path and responses in dry-run.rb #6459

merged 1 commit into from
Jan 19, 2023

Conversation

mburumaxwell
Copy link
Contributor

@mburumaxwell mburumaxwell commented Jan 18, 2023

When executing dry-run.rb script, it would be ideal to log the full URL (built using Excon::Utils.request_uri(payload)) for requests that share the path but different query parameters, especially in Azure DevOps.

Logging the response is also useful when debugging.

This is a result of excon/excon#803 hence the bump in excon version

Sample log with this change:

🌍 --> GET https://dev.azure.com/tingle/dependabot/_apis/git/repositories/repro-366
🌍 <-- 200 https://dev.azure.com:443/tingle/dependabot/_apis/git/repositories/repro-366
🌍 --> GET https://dev.azure.com/tingle/dependabot/_apis/git/repositories/repro-366/stats/branches?name=main
🌍 <-- 200 https://dev.azure.com:443/tingle/dependabot/_apis/git/repositories/repro-366/stats/branches?name=main
🌍 --> GET https://dev.azure.com/tingle/dependabot/_apis/git/repositories/repro-366/items?path=.github/dependabot.yml&versionDescriptor.versionType=commit&versionDescriptor.version=484e0dccc2d7b6a3bbb886a01c1da23544de8c36
🌍 <-- 200 https://dev.azure.com:443/tingle/dependabot/_apis/git/repositories/repro-366/items?path=.github/dependabot.yml&versionDescriptor.versionType=commit&versionDescriptor.version=484e0dccc2d7b6a3bbb886a01c1da23544de8c36
=> fetching dependency files
🌍 --> GET https://dev.azure.com/tingle/dependabot/_apis/git/repositories/repro-366

When a requests return 404, we can check if the path is correct or where an issue could be. In scenarios where the body is necessary, EXCON_DEBUG=1 can be used.

Copy link
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

This looks like a nice improvement, thanks!

I think we may want to hold this PR for a bit until we're sure we're ready to jump to the most recent excon version since we had to pin ourselves to 0.93.1 recently. See 6d59a5a.

.gitignore Outdated Show resolved Hide resolved
Copy link
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

I think all you really need here is the dry-run.rb change? The gemspec / Gemfile.lock aren't needed for this PR IIUC??

@mburumaxwell
Copy link
Contributor Author

I think all you really need here is the dry-run.rb change? The gemspec / Gemfile.lock aren't needed for this PR IIUC??

How about the changes in excon/excon#803 without which the response doesn't have crucial aspects of the URI?

@jeffwidman
Copy link
Member

Ah, that's why you're bumping the minimum version... makes sense. I was only thinking about how it will default to the max version.

@jeffwidman
Copy link
Member

Can you fix merge conflicts so we can merge?

@mburumaxwell
Copy link
Contributor Author

Can you fix merge conflicts so we can merge?

Done

@jeffwidman jeffwidman enabled auto-merge (rebase) January 19, 2023 17:09
@jeffwidman jeffwidman merged commit 6e3222b into dependabot:main Jan 19, 2023
@jeffwidman
Copy link
Member

Thanks again!

@mburumaxwell mburumaxwell deleted the log-responses-dry-run branch January 20, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants