Skip to content

Revert on-path-change on pr merge in bitbucket#2247

Merged
chmouel merged 1 commit intotektoncd:mainfrom
zakisk:revert-bitbucket-fix-pr-2145
Sep 17, 2025
Merged

Revert on-path-change on pr merge in bitbucket#2247
chmouel merged 1 commit intotektoncd:mainfrom
zakisk:revert-bitbucket-fix-pr-2145

Conversation

@zakisk
Copy link
Copy Markdown
Member

@zakisk zakisk commented Sep 16, 2025

Description of the Change

This pull request reverts the changes made in a previous fix for Bitbucket Data Center (commit f9fd3f3f7ba68db845ec2a0b723798ed812f4a1e). The original change aimed to fix an issue where on-path-change annotations were not working on merge commits, but it introduced a new, critical regression.

The primary issue with the previous fix is that the {{ revision }} dynamic variable no longer correctly fetches the ID of the newest merge commit when a pull request is merged on Bitbucket Data Center. Instead, it was incorrectly fetching the commit ID of the source branch's HEAD. This behavior is a blocker for a customer who relies on the merge-commit ID for their workflows and cannot change their existing git strategies.

By reverting the change, we restore the expected behavior of the {{ revision }} variable, allowing customers to upgrade to the latest versions. The underlying problem of on-path-change not working with Bitbucket merge commits (SRVKP-7432) is a separate issue that will be addressed in a future, more comprehensive fix.

Linked Jira Tickets

Type of Change

  • 🐛 Bug fix
  • 💥 Breaking change (Reverting a previous breaking change to restore expected behavior)

Testing Strategy

  • Unit tests
  • End-to-end tests (Reverting the previous test changes to ensure proper behavior is restored)

Reviewer Checklist

  • The change has been reviewed and approved.
  • The commit message is clear and includes a reason for the revert and links to the relevant Jira tickets.
  • The PR description accurately explains the change and its impact.

📝 Description of the Change

🔗 Linked GitHub Issue

Fixes #

👨🏻‍ Linked Jira

🚀 Type of Change

  • 🐛 Bug fix (fix:)
  • ✨ New feature (feat:)
  • 💥 Breaking change (feat!:, fix!:)
  • 📚 Documentation update (docs:)
  • ⚙️ Chore (chore:)
  • 💅 Refactor (refactor:)
  • 🔧 Enhancement (enhance:)
  • 📦 Dependency update (deps:)

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @zakisk, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request is a direct revert of a previous commit that introduced a specific handling mechanism for merge commits in Bitbucket Data Center push events, intended to fix an on-path-change issue. By reverting this change, the complex logic for identifying the 'second parent commit SHA' and its corresponding test cases are removed, effectively undoing the prior attempt to resolve the problem and returning to the previous state of payload parsing for Bitbucket Data Center.

Highlights

  • Revert Previous Change: This pull request fully reverts commit f9fd3f3f7ba68db845ec2a0b723798ed812f4a1e, which aimed to address an issue with on-path-change on PR merge events in Bitbucket Data Center.
  • Bitbucket Data Center Payload Parsing: The logic that attempted to identify and use the 'second parent commit SHA' for merge commits in Bitbucket Data Center push events has been removed from the ParsePayload function.
  • Test Code Cleanup: Associated test code, including a specific test case for on-path-change on PR merge and related wantSHA assertions, has been removed from parse_payload_test.go and bitbucket_datacenter_pull_request_test.go.
  • E2E Test Simplification: The CreatePR function in the Bitbucket Data Center E2E test suite has been simplified by removing the BaseBranch option and hardcoding 'main' as the base branch for PR creation. The TearDown function now accepts a PR ID instead of a full PR object.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pipelines-as-code pipelines-as-code bot added bitbucket-datacenter go Pull requests that update Go code providers labels Sep 16, 2025
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request reverts a previous commit that introduced a fix for handling on-path-change during pull request merges in Bitbucket Data Center. The changes primarily involve removing the logic that identified the correct commit SHA for merge commits. The corresponding unit and end-to-end tests have also been removed, and related test helper functions have been cleaned up and simplified. The revert appears to be clean and complete.

@aThorp96
Copy link
Copy Markdown
Member

/lgtm

Please link the ticket and update release notes

Copy link
Copy Markdown

@pipelines-as-code pipelines-as-code bot left a comment

Choose a reason for hiding this comment

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

Congrats @zakisk your PR Has been approved 🎉

✅ Pull Request Approved

Approval Status:

  • Required Approvals: 1
  • Current Approvals: 1

👥 Reviewers Who Approved:

Reviewer Permission Level Approval Status
@aThorp96 admin

📝 Next Steps

  • Ensure all required checks pass
  • Comply with branch protection rules
  • Request a maintainer to merge using the /merge command (or merge it
    directly if you have repository permission).

Automated by the PAC Boussole 🧭

@zakisk
Copy link
Copy Markdown
Member Author

zakisk commented Sep 17, 2025

/retest linters

@chmouel
Copy link
Copy Markdown
Member

chmouel commented Sep 17, 2025

Please dont' do lazy revert like this, explains the reason why we are reverting. and the jira ticket about it

This reverts commit f9fd3f3.

Reason for Revert:
The previous fix for SRVKP-7432 introduced an unexpected bug
(SRVKP-8616) where the `{{ revision }}` dynamic variable in Pipelines as
Code no longer fetches the correct, newest merge commit in Bitbucket
Data Center. Instead, it was fetching the last commit of the source
branch.

Customer feedback indicates this change breaks their CI/CD workflow, as
their teams rely on the merge-commit ID and do not wish to alter their
git strategies. This is a critical blocker for them, preventing them
from upgrading to versions 1.19.x and accessing other important fixes,
such as the one for CAP-724.

This revert restores the previous behavior, ensuring the `{{ revision
}}` variable correctly references the merge commit. A long-term solution
to address both issues (SRVKP-7432 and SRVKP-8616) will be developed in
separate, newly-created tickets (SRVKP-8619 and SRVKP-8620).

Fixes: SRVKP-8616
Related: SRVKP-7432, SRVKP-8619, SRVKP-8620

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
@chmouel chmouel force-pushed the revert-bitbucket-fix-pr-2145 branch from e22324a to b8a5204 Compare September 17, 2025 07:53
@chmouel chmouel changed the title revert: "fix: issue in on-path-change on pr merge in bitbucket data center" Revert on-path-change on pr merge in bitbucket Sep 17, 2025
@chmouel
Copy link
Copy Markdown
Member

chmouel commented Sep 17, 2025

since it's an urgency I fixed the PR and add a proper commit.... @zakisk

@chmouel
Copy link
Copy Markdown
Member

chmouel commented Sep 17, 2025

/test linters

@chmouel chmouel merged commit 95d7eda into tektoncd:main Sep 17, 2025
5 checks passed
@zakisk
Copy link
Copy Markdown
Member Author

zakisk commented Sep 17, 2025

since it's an urgency I fixed the PR and add a proper commit.... @zakisk

thanks @chmouel yeah we need to be descriptive

@savitaashture
Copy link
Copy Markdown
Contributor

/cherry-pick release-v0.35.x

@chmouel
Copy link
Copy Markdown
Member

chmouel commented Jan 5, 2026

@savitaashture we don't use prow on pac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants