Skip to content

Support for file changes in Bitbucket Cloud#5730

Merged
qwerty287 merged 10 commits into
woodpecker-ci:mainfrom
MeurillonGuillaume:feature/bitbucket-cloud-changed-files-hook
Nov 12, 2025
Merged

Support for file changes in Bitbucket Cloud#5730
qwerty287 merged 10 commits into
woodpecker-ci:mainfrom
MeurillonGuillaume:feature/bitbucket-cloud-changed-files-hook

Conversation

@MeurillonGuillaume
Copy link
Copy Markdown
Contributor

This pull-request implements the when.path filter for Bitbucket Cloud by requesting the changed files for a commit when a /api/hook is received.

Similar to #5205, but for the Bitbucket Cloud forge.

@qwerty287 qwerty287 added enhancement improve existing features forge/bitbucket bitbucket forge related labels Nov 7, 2025
@qwerty287
Copy link
Copy Markdown
Contributor

qwerty287 commented Nov 8, 2025

Thanks! Looks very good already. Could you check the formatting? https://ci.woodpecker-ci.org/repos/3780/pipeline/29586/16

And a question: How does that work with pull requests?

@MeurillonGuillaume
Copy link
Copy Markdown
Contributor Author

@qwerty287 thanks for the heads-up, I fixed the formatting of the docs.

For pull-requests the source commit is set as Pipeline Commit:

pipeline := &model.Pipeline{
Event: event,
Commit: from.PullRequest.Source.Commit.Hash,

and so it will work the same as the Commit Hook as the diffstat is loaded after parsing the Hook content. I just tested it on my instance and everything worked as expected.

@qwerty287
Copy link
Copy Markdown
Contributor

OK, but for PRs it should load the changes for the full PR. So all commits together. That's how the other forges work.

@MeurillonGuillaume
Copy link
Copy Markdown
Contributor Author

@qwerty287 Good catch. I've updated the PR so that it lists all changes between the source & destination branch using the diffstat API.

Copy link
Copy Markdown
Contributor

@qwerty287 qwerty287 left a comment

Choose a reason for hiding this comment

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

Thanks. Seems good so far, just a simple question

Comment thread server/forge/bitbucket/bitbucket.go Outdated
@woodpecker-bot
Copy link
Copy Markdown
Contributor

woodpecker-bot commented Nov 12, 2025

Surge PR preview deployment was removed

@qwerty287 qwerty287 enabled auto-merge (squash) November 12, 2025 16:29
@qwerty287 qwerty287 merged commit 58f0108 into woodpecker-ci:main Nov 12, 2025
7 checks passed
@woodpecker-bot woodpecker-bot mentioned this pull request Nov 12, 2025
1 task
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 21.81818% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.46%. Comparing base (c54943c) to head (9d8674c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
server/forge/bitbucket/internal/client.go 0.00% 26 Missing ⚠️
server/forge/bitbucket/bitbucket.go 27.77% 12 Missing and 1 partial ⚠️
server/forge/bitbucket/fixtures/handler.go 0.00% 3 Missing ⚠️
server/forge/bitbucket/parse.go 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5730      +/-   ##
==========================================
- Coverage   21.48%   21.46%   -0.03%     
==========================================
  Files         428      428              
  Lines       38550    38597      +47     
==========================================
  Hits         8283     8283              
- Misses      29503    29549      +46     
- Partials      764      765       +1     

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

@MeurillonGuillaume MeurillonGuillaume deleted the feature/bitbucket-cloud-changed-files-hook branch November 13, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement improve existing features forge/bitbucket bitbucket forge related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants