Skip to content

feat(bitbucketserver): get changes from all commits in a single push event#5748

Merged
qwerty287 merged 5 commits into
woodpecker-ci:mainfrom
hhamalai:bitbucketdc_push_event_with_all_changes
Nov 18, 2025
Merged

feat(bitbucketserver): get changes from all commits in a single push event#5748
qwerty287 merged 5 commits into
woodpecker-ci:mainfrom
hhamalai:bitbucketdc_push_event_with_all_changes

Conversation

@hhamalai

Copy link
Copy Markdown
Contributor

Currently, on a push event, only the changed files from the last commit are used e.g. to check path conditions:

# ... pipeline
when:
  - path:
      include: ['*.md']

In general the push event can contain multiple commits, which currently leads to missed pipeline executions. An example with the snippet above would a user commiting changes to their *.md files, after which making other commits targeting other files. Pushing commits would not trigger the pipeline above if the last commit would not have any changes to .md files.

The proposed change uses the range of commits (From&To) in the webhook payload with Bitbucket data center compare commits API to list the changed files across a set of commits.

In case the branch is created/deleted, bitbucket reports commit as 0000000000000000000000000000000000000000". The current implementation then checks changes against the default branch. This has its own problems and might cause too wide executions, but the bitbucket webhook implementation also truncates the list of commits to include in the payload to max 5 commits, so there are no information in the payload that could be used as an anchor point as "the earliest" commit/reference in case of new branch.

This change requires changes to neticdk/go-bitbucket (pr open neticdk/go-bitbucket#37)

@qwerty287 qwerty287 added enhancement improve existing features forge/bitbucket bitbucket forge related blocked something external is blocking it labels Nov 13, 2025

@qwerty287 qwerty287 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.

Thanks, looks good already. Just some style improvements. And then let's wait for the lib to merge the PR.

Comment thread server/forge/bitbucketdatacenter/parse.go Outdated
Comment thread server/forge/bitbucketdatacenter/parse_test.go Outdated
@hhamalai hhamalai changed the title feat: get changes from all commits in a single push event feat(bitbucketserver): get changes from all commits in a single push event Nov 13, 2025
@hhamalai

hhamalai commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

And then let's wait for the lib to merge the PR.

new release is out from go-bitbucket library, and this PR is updated to use it

@codecov

codecov Bot commented Nov 18, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.47%. Comparing base (6e7bb51) to head (e551ed8).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
...r/forge/bitbucketdatacenter/bitbucketdatacenter.go 0.00% 11 Missing ⚠️
server/forge/bitbucketdatacenter/convert.go 27.27% 5 Missing and 3 partials ⚠️
server/forge/bitbucketdatacenter/parse.go 66.66% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5748   +/-   ##
=======================================
  Coverage   21.46%   21.47%           
=======================================
  Files         428      428           
  Lines       38603    38622   +19     
=======================================
+ Hits         8288     8293    +5     
- Misses      29550    29561   +11     
- Partials      765      768    +3     

☔ 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.

@qwerty287 qwerty287 merged commit 5b279af into woodpecker-ci:main Nov 18, 2025
9 checks passed
@woodpecker-bot woodpecker-bot mentioned this pull request Nov 18, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked something external is blocking it enhancement improve existing features forge/bitbucket bitbucket forge related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants