Repository navigation
Better error reporting/debugging for BitBucket - #816
Merged
Merged
Conversation
0x2b3bfa0
reviewed
Nov 19, 2021
duijf
force-pushed
the
debug-bb-requests
branch
from
November 19, 2021 12:40
06080c3 to
018b915
Compare
0x2b3bfa0
reviewed
Nov 19, 2021
duijf
force-pushed
the
debug-bb-requests
branch
from
November 19, 2021 15:04
018b915 to
05c0f4a
Compare
duijf
force-pushed
the
debug-bb-requests
branch
from
November 19, 2021 15:05
05c0f4a to
239bbeb
Compare
0x2b3bfa0
approved these changes
Nov 19, 2021
7 of 15 tasks
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continued from #813, this PR improves the logging related to BitBucket API calls.
Summary
This addresses two papercuts / UX problems:
Background
I tried to make CML post BitBucket comments on a commit. The API requests were failing because I did not have the "Pull requests links" application installed (this requirement is documented here)
This didn't work. CML gave me the following output:
With
--log debug, I also didn't get enough information about what was happening to debug the problem. I had to add the debug logging to CML directly.The error response in this case was slightly different than what BitBucket sends normally (and what their documentation says it they send):
{"error": "Invalid or unknown installation"}.{"error": {"message": "Some message"}}That was causing the
undefinedto be printed.The lack of context made things take a bit longer to debug than I wanted. I would have expected a request log when I passed
--log debug, but it turns out we didn't have any debug logging for these requests yet. That meant I had to add the debug logging myself to get the full API response from BB.Changes
undefined.Let me know if we want to add tests for this or want to reorganize the code somewhat :)