Skip to content

fix(bitbucket): match PR and release metadata correctly#907

Merged
orhun merged 3 commits intoorhun:mainfrom
mcwarman:fix/bitbucket-pr-matching
Oct 7, 2024
Merged

fix(bitbucket): match PR and release metadata correctly#907
orhun merged 3 commits intoorhun:mainfrom
mcwarman:fix/bitbucket-pr-matching

Conversation

@mcwarman
Copy link
Contributor

@mcwarman mcwarman commented Oct 6, 2024

Description

Fixes Bitbucket pull request matching to release metadata:

  • update BitbucketPullRequest struct to use merge_commit
  • update metadata matching to support short sha format
  • add tests for Bitbucket remote

Motivation and Context

When testing the Bitbucket integration the pull request matching does not work. Commits are not being matched to pull requests looking into the API response it looks to be for two reasons

Fixes #905

How Has This Been Tested?

git clone git@bitbucket.org:mcwarman-playground/playground.git
cd playground
~/code/src/github.com/orhun/git-cliff/target/debug/git-cliff --current --context --bitbucket-repo "mcwarman-playground/playground" | jq .

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have formatted the code with rustfmt.
  • I checked the lints with clippy.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

- update BitbucketPullRequest struct to use merge_commit
- update metadata matching to support short sha format
- add tests for Bitbucket remote
@mcwarman mcwarman requested a review from orhun as a code owner October 6, 2024 14:23
@welcome
Copy link

welcome bot commented Oct 6, 2024

Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️

@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.85%. Comparing base (508a97e) to head (cb169a3).
Report is 96 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #907      +/-   ##
==========================================
+ Coverage   40.12%   40.85%   +0.73%     
==========================================
  Files          21       21              
  Lines        1675     1677       +2     
==========================================
+ Hits          672      685      +13     
+ Misses       1003      992      -11     
Flag Coverage Δ
unit-tests 40.85% <100.00%> (+0.73%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

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

LGTM!

One thing that we can do is to assert this behavior is updating the test-bitbucket-integration fixture to use your playground repository instead of my testing repository (git-cliff-readme-example)

Here you can find some instructions about how the test fixtures work. It should be pretty straightforward though.

I think I initially missed this bug since the fixture does not contain anything about handling the PRs :)

@mcwarman
Copy link
Contributor Author

mcwarman commented Oct 6, 2024

I've updated the fixtures, I decided to fork your repo and add a PR to it.

@mcwarman mcwarman requested a review from orhun October 6, 2024 21:38
Copy link
Owner

@orhun orhun left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@orhun orhun merged commit e936ed5 into orhun:main Oct 7, 2024
@orhun orhun changed the title fix(bitbucket): pull requests release metadata not matched correctly fix(bitbucket): match PR and release metadata correctly Oct 7, 2024
@welcome
Copy link

welcome bot commented Oct 7, 2024

Congrats on merging your first pull request! ⛰️

@mcwarman mcwarman deleted the fix/bitbucket-pr-matching branch October 7, 2024 07:18
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.

Bitbucket pull request matching does not work

3 participants