Skip to content

Return typed Bitbucket and Azure comparison commits - #16962

Merged
JamieMagee merged 1 commit into
mainfrom
jamiemagee/typed-comparison-commits
Nov 18, 2026
Merged

JamieMagee merged 1 commit into
mainfrom
jamiemagee/typed-comparison-commits

Conversation

@JamieMagee

Copy link
Copy Markdown
Member

What are you trying to accomplish?

Parse Bitbucket and Azure comparison responses into immutable ComparisonCommit records so metadata readers can use typed fields.

- validate response hashes, then cast their fields
+ ComparisonCommit records retained through metadata lookup

Anything you want to highlight for special attention from reviewers?

The clients' compare return types change; CommitsFinder keeps the same hash output. Required commit fields are decoded at the client boundary with contextual PrivateSourceBadResponse errors.

How will you know you've accomplished your goal?

Passed in containers:

# common/: 115 examples, 0 failures
bundle exec rspec spec/dependabot/clients/comparison_commit_spec.rb \
  spec/dependabot/clients/bitbucket_spec.rb \
  spec/dependabot/clients/azure_spec.rb \
  spec/dependabot/clients/bitbucket_with_retries_spec.rb \
  spec/dependabot/metadata_finders/base/commits_finder_spec.rb

# Repository root: both passed
bundle exec srb tc
bundle exec tapioca gem --verify

The full common suite was not run.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@JamieMagee
JamieMagee requested a review from a team as a code owner November 17, 2026 19:31
Copilot AI balanced review requested due to automatic review settings November 17, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the refactor that moves comparison-response decoding into typed client records.

No open issues 🎉

1 file not reviewed
  • sorbet/rbi/shims/bitbucket_with_retries.rbi: File type not supported
What changed in this PR

This PR moves Bitbucket and Azure comparison-response decoding into the clients, returning typed ComparisonCommit records while preserving CommitsFinder’s existing hash output.

Changes:

  • Add an immutable commit record with typed fields and hash conversion.
  • Decode required fields at the client boundary and remove redundant parsing helpers.
  • Update the retry-client signature and add coverage for ordering, empty results, and malformed fields.
File Description
sorbet/​rbi/​shims/​bitbucket_with_retries.rbi Update the comparison return type to typed records.
common/​spec/​dependabot/​clients/​comparison_commit_spec.rb Test comparison decoding for both providers.
common/​lib/​dependabot/​metadata_finders/​base/​commits_finder.rb Convert typed records to the existing hash output.
common/​lib/​dependabot/​metadata_finders/​base/​commit_response_parser.rb Remove the Azure field parser now handled by the client.
common/​lib/​dependabot/​clients/​json_response_parser.rb Remove the obsolete string-path validation helper.
common/​lib/​dependabot/​clients/​comparison_commit.rb Define the immutable commit record and hash conversion.
common/​lib/​dependabot/​clients/​bitbucket.rb Decode comparison responses into typed records.
common/​lib/​dependabot/​clients/​azure.rb Decode comparison responses and validate required fields.

Review effort: Balanced

@JamieMagee
JamieMagee force-pushed the jamiemagee/typed-comparison-commits branch from 0678c5a to 61840d1 Compare November 18, 2026 17:22
Copilot AI balanced review requested due to automatic review settings November 18, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the change moving Bitbucket and Azure comparison decoding into typed client records.

No open issues 🎉

1 file not reviewed
  • sorbet/rbi/shims/bitbucket_with_retries.rbi: File type not supported

Review effort: Balanced

@JamieMagee
JamieMagee merged commit a613b30 into main Nov 18, 2026
270 of 278 checks passed
@JamieMagee
JamieMagee deleted the jamiemagee/typed-comparison-commits branch November 18, 2026 19:39
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.

3 participants