jenkinsci / jenkinsci/ghprb-plugin

The plugin does not respect the job quiet period

Open Beginner friendly
#752 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
512
Forks
601
PR merge metrics
No merged PRs in 30d

Description

We have 2 jobs triggering from a single pull request (`A` and `B`).
Job `B` depends on job `A`, meaning job `A` has to finish before job `B` starts.
We have configured a blocking job for `B` to be `A`, but it can only block if job `A` is in the queue.

Some of the times job `B` is added to the queue faster than job `A` and because job `A` is not in the queue, job `B` starts (and fails).

We wanted to use a quiet period for job `B` to make sure job `A` is put to the queue before job `B` is considered for starting.
There are 2 places to set the job quiet time, on a global Jenkins configuration and on the Job itself.

The plugin respects the global configuration but doesn't respect the job quiet period configuration as can be seen from this line:
https://github.com/jenkinsci/ghprb-plugin/blob/4e86ed47a96a01eeaa51a479ff604252109635f6/src/main/java/org/jenkinsci/plugins/ghprb/GhprbTrigger.java#L458

The `job` object also has a `getQuietPeriod()` function which can be used in combination with the global settings. (if the job quiet period is not set, use the global, otherwise use the job setting)

Contributor guide

Open the contributing guide

Research direction

Start in src/main/java/org/jenkinsci/plugins/ghprb/GhprbTrigger.java at line 458, where the quiet period is selected. Check how the global setting is used and how the job's getQuietPeriod() can provide an override. Done means a configured job quiet period is respected, with the global setting used when no job-specific value is set.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
ci-cd
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.