Skip to content
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

[JENKINS-54052] Honor quietPeriod on children of multibranch pipeline job #190

Merged
merged 5 commits into from Aug 27, 2020

Conversation

g-doc
Copy link

@g-doc g-doc commented Apr 14, 2020

Updated PR with change provided in comments of

full credits to @atanasenko in PR #131

@bitwiseman
Copy link
Contributor

@g-doc This is great! Still 3 test failures. Can your reproduce them locally?

@bitwiseman bitwiseman closed this Apr 23, 2020
@bitwiseman
Copy link
Contributor

Build was clean on rerun. Trying again to see if we are stable.

@bitwiseman bitwiseman reopened this Apr 23, 2020
@bdellegrazie
Copy link

Any chance this could be re-examined? The test failure looks like failed infra (channel closed).

@bitwiseman bitwiseman closed this Jul 17, 2020
@bitwiseman bitwiseman reopened this Jul 17, 2020
@brianjmurrell
Copy link

brianjmurrell commented Jul 21, 2020

This would be useful in GitHub if one has a GitHub Action that pushes a commit to one's PR -- to prevent the the PR from building prior to the GH Actions adding the new commit.

Can it be resuscitated?

@ityaad
Copy link

ityaad commented Jul 21, 2020

Now, that the build has been successful on three consecutive runs, are we good to merge?

@@ -47,6 +47,11 @@ public BasicBranchProjectFactory() {
public FreeStyleProject newInstance(Branch branch) {
FreeStyleProject job = new FreeStyleProject(getOwner(), branch.getEncodedName());
setBranch(job, branch);
try {
job.setQuietPeriod(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

For test stability we maintain the previous quiet period of 0. But live behavior will change.

@bitwiseman bitwiseman self-requested a review July 22, 2020 21:40
@bitwiseman
Copy link
Contributor

I approve, but I'm thinking this through a bit deeper. We should get some additional testing, both manual and running other plugin tests using this version.

@bitwiseman bitwiseman closed this Jul 23, 2020
@bitwiseman bitwiseman reopened this Jul 23, 2020
@ityaad
Copy link

ityaad commented Jul 23, 2020

@bitwiseman, I have performed some quick manual tests with branch-api-2.5.9-rc884.9435363784d2.hpi available in the incremental repo with:

  • Jenkins 2.235.2
  • Pipeline: Multibranch 2.21
  • GitHub Enterprise 2.20.7

The following are my observations:

  • In declarative pipelines, quietPeriod(<num>) is respected for both PR creation and merge.
  • The specified quiet period takes effect immediately on the very first run. However, removing it takes effect only after the next run.
  • The global quiet period is respected if not specified in Jenkinsfile. If specified in Jenkinsfile, this takes precedence over the global settings.
  • Manual repository scans too make the build wait until the quiet period is elapsed.
  • PR builds triggered via PR comments (GitHub PR Comment Build Plugin 2.1) do not consider the quiet period. I guess this must be the expected behavior.
  • The quiet period is not visible in multibranch project configuration GUI but is visible in the branch configuration GUI, though it remains uneditable.

I can help with further manual testing based on your inputs.

@bitwiseman
Copy link
Contributor

Okay, we now have an incremental that we can work with: branch-api/2.5.9-rc884.9435363784d2.

@bitwiseman
Copy link
Contributor

@Addib
Thanks for doing that!

  • In declarative pipelines, quietPeriod(<num>) is respected for both PR creation and merge.

Yay!

  • The specified quiet period takes effect immediately on the very first run. However, removing it takes effect only after the next run.

This is expected/known behavior, similar to the way build parameters work in declarative. It is due to a limitation in Jenkins.

  • The global quiet period is respected if not specified in Jenkinsfile. If specified in Jenkinsfile, this takes precedence over the global settings.
  • Manual repository scans too make the build wait until the quiet period is elapsed.
  • PR builds triggered via PR comments (GitHub PR Comment Build Plugin 2.1) do not consider the quiet period. I guess this must be the expected behavior.

This is probably a bug in that plugin that should be filed and fixed separately.

  • The quiet period is not visible in multibranch project configuration GUI but is visible in the branch configuration GUI, though it remains uneditable.

This is a separate issue. Please file it on the Jenkins JIRA with screenshots (if it hasn't already been filed).

@bitwiseman
Copy link
Contributor

bitwiseman commented Jul 23, 2020

I'm trying this with some downstream plugins, starting with branch-api. Look like there's one automated test that fails with this change. Not sure why yet.

@hemp
Copy link

hemp commented Aug 25, 2020

Found this in searching for a solution to multiple merges coming in at once on github. Not a typical merge pattern for feature PRs...but with PRs made by dependabot doing a bunch of minor bumps on a regular cadence seems to be common.

Not sure how to help. Would running an RC be useful?

@bitwiseman
Copy link
Contributor

bitwiseman commented Aug 27, 2020

The failure in jenkinsci/workflow-multibranch-plugin#99 should be fixed now.
Moving on to try on bitbucket-branch-source and github-branch-source.

@hemp
Results have looked good so far.
Please go ahead and install the incremental linked above and report back anything you find.

@bitwiseman bitwiseman changed the title JENKINS-54052 - Honor quietPeriod when scheduling multibranch builds - updated [JENKINS-54052] Honor quietPeriod on children of multibranch pipeline job Aug 27, 2020
@bitwiseman bitwiseman merged commit 75d97a7 into jenkinsci:master Aug 27, 2020
@hemp
Copy link

hemp commented Sep 3, 2020

We've had this live today and I reviewed our build history. This is working great with a 30 second quiet period for a github org with a few hundred repos. Merging multiple dependabot PRs (highs / criticals) can now be automated. Thanks! 🎉

jglick added a commit to jenkinsci/bom that referenced this pull request Oct 23, 2020
dependabot bot pushed a commit to jenkinsci/bom that referenced this pull request Oct 23, 2020
jglick added a commit to jglick/blueocean-plugin that referenced this pull request Mar 3, 2021
olamy pushed a commit to jenkinsci/blueocean-plugin that referenced this pull request Mar 4, 2021
…itor (#2132)

* [JENKINS-58732] Remove docker-workflow dep from blueocean-pipeline-editor

* Was not correctly excluding snakeyaml from uap-java

* Also had a deps problem on json from unirest-java

* Adapt to jenkinsci/branch-api-plugin#190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants