jenkinsci / jenkinsci/gitlab-branch-source-plugin

[JENKINS-61320] MR status doesn't replace branch status

Open
#665 7 comments 0 reactions 0 assignees View on GitHub
component:gitlab-branch-source-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
134
Forks
113
PR merge metrics
No merged PRs in 30d

Description

Consider a branch source job with the following configuration:


  • Discover branches: Only branches that are not also filed as MRs

  • Discover merge requests from origin: Merging the merge request with the current target branch revision

Scenario:


  1. A user pushes a branch

    • A new job is created for the branch

    • The branch is built, but the build fails

    • The plugin pushes a "failed" status with name "jenkinsci/branch" to GitLab



  2. The user creates a merge request

    • A new job is created for the merge request

    • The branch job is disabled

    • The MR job is built and also fails

    • The plugin pushes a "failed" status with the name "jenkinsci/mr-head" to GitLab



  3. User realizes the build is broken and fixes a bug in the build system (not sure if this is only a problem if the HEAD of the branch doesn't change of if that always happens)

    • The MR job is built and is now successful

    • The plugin pushes a "passed" status with the name "jenkinsci/mr-head" to GitLab



The result is now a merge request which is still considered as "failed" by GitLab, because the Job "jenkinsci/branch" will forever be "failed":

---
Originally reported by tgr, imported from: MR status doesn't replace branch status


  • assignee: surenpi
  • status: Open
  • priority: Major
  • component(s): gitlab-branch-source-plugin
  • resolution: Unresolved
  • votes: 6
  • watchers: 9
  • imported: 20251216-182730

Raw content of original issue

Consider a branch source job with the following configuration:


  • Discover branches: Only branches that are not also filed as MRs

  • Discover merge requests from origin: Merging the merge request with the current target branch revision

Scenario:


  1. A user pushes a branch

    • A new job is created for the branch

    • The branch is built, but the build fails

    • The plugin pushes a "failed" status with name "jenkinsci/branch" to GitLab



  2. The user creates a merge request

    • A new job is created for the merge request

    • The branch job is disabled

    • The MR job is built and also fails

    • The plugin pushes a "failed" status with the name "jenkinsci/mr-head" to GitLab



  3. User realizes the build is broken and fixes a bug in the build system (not sure if this is only a problem if the HEAD of the branch doesn't change of if that always happens)

    • The MR job is built and is now successful

    • The plugin pushes a "passed" status with the name "jenkinsci/mr-head" to GitLab



The result is now a merge request which is still considered as "failed" by GitLab, because the Job "jenkinsci/branch" will forever be "failed":

environment

```
Jenkins ver. 2.204.2

gitlab-branch-source-plugin 1.4.4
```

1 attachment

- [image-2020-03-04-10-55-07-801.png](https://issues.jenkins.io/secure/attachment/50552/image-2020-03-04-10-55-07-801.png)
> ![image-2020-03-04-10-55-07-801.png](https://issues.jenkins.io/secure/attachment/50552/image-2020-03-04-10-55-07-801.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.