Skip to content

Fix issue linking build status to unrelated PRs #905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Fix issue linking build status to unrelated PRs #905

wants to merge 1 commit into from

Conversation

haresahani
Copy link

Description:
This pull request resolves Issue #877 in the Bitbucket Branch Source Plugin, where there was an issue with associating build statuses correctly with pull requests.

What I did:
Fixed Build Status Association: Adjusted the logic to ensure that build statuses are properly associated with the corresponding pull request, even in cases where multiple pull requests reference the same commit.

Improved Pull Request Handling: Enhanced the plugin’s ability to correctly associate build statuses with pull requests, ensuring accurate build notifications for users.

Testing:
Added relevant unit tests to ensure the correct mapping of build statuses to pull requests.

Performed tests in a Jenkins environment to confirm that the fix works as expected.

Comment on lines +28 to +33
class ChangeRequestCheckoutStrategy {

static Object HEAD;
static Object HEAD;

}
Copy link
Contributor

Choose a reason for hiding this comment

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

How can this pass tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/jenkinsci/bitbucket-branch-source-plugin/actions/runs/11724191362/job/32657525556?pr=905 shows multiple compilation errors:

[ERROR] /home/runner/work/bitbucket-branch-source-plugin/bitbucket-branch-source-plugin/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/ChangeRequestCheckoutStrategy.java:[31,19] variable HEAD is already defined in class com.cloudbees.jenkins.plugins.bitbucket.ChangeRequestCheckoutStrategy
[ERROR] /home/runner/work/bitbucket-branch-source-plugin/bitbucket-branch-source-plugin/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/MigrationTest.java:[5,36] package com.palantir.gradle.versions does not exist
[ERROR] /home/runner/work/bitbucket-branch-source-plugin/bitbucket-branch-source-plugin/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/MigrationTest.java:[23,9] cannot find symbol
  symbol:   class FixLegacy
  location: class com.cloudbees.jenkins.plugins.bitbucket.MigrationTest
[ERROR] /home/runner/work/bitbucket-branch-source-plugin/bitbucket-branch-source-plugin/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/MigrationTest.java:[23,36] cannot find symbol
  symbol:   class FixLegacyJavaConfigurationsPlugin
  location: class com.cloudbees.jenkins.plugins.bitbucket.MigrationTest
[ERROR] /home/runner/work/bitbucket-branch-source-plugin/bitbucket-branch-source-plugin/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/MigrationTest.java:[31,47] cannot find symbol
  symbol:   class FixLegacyMigration1
  location: class com.cloudbees.jenkins.plugins.bitbucket.MigrationTest

Copy link
Contributor

@KalleOlaviNiemitalo KalleOlaviNiemitalo left a comment

Choose a reason for hiding this comment

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

This doesn't build, and even if it did, I don't believe it would fix #877.

@nfalco79
Copy link
Member

nfalco79 commented Nov 8, 2024

It's not clear how these changes can solve the issues of unrelated build status to a pull request

@haresahani haresahani closed this by deleting the head repository Nov 8, 2024
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