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

Skip PCT by default on PRs #2034

Merged
merged 6 commits into from May 3, 2023
Merged

Skip PCT by default on PRs #2034

merged 6 commits into from May 3, 2023

Conversation

jglick
Copy link
Member

@jglick jglick commented May 2, 2023

Simpler alternative to #2031 to consider. By comparison, it retains the straightforward release-from-master behavior, so CD configuration should not need any adjustment, and there is no need to track the status of release branch merges. Also keeps #1993, so PCT will be run only when you ask for it in a PR, or explicitly test master (perhaps when planning a release). We can also consider running master builds on a schedule, such as @nightly.

I believe it is unnecessary to use a dedicated release branch. Such a system makes sense for repositories which:

  • Have a lot of untested code coming in which is likely to cause frequent test failures or genuine regressions.
  • Must be able to be released on short notice, for example to address a security vulnerability.
  • Cannot tolerate much risk of regression.

None of those criteria seem to apply to a developer tool like a BOM which after all is merely a convenience to help you manage a dependency list. If some change introduced a PCT regression, we can generally take our time fixing it, whether by releasing some plugin with a test or behavioral change and integrating it; reverting the problematic update; or adding a test to an exclusion list.

@jglick jglick added the chore Reduces future maintenance label May 2, 2023
@jglick jglick requested a review from a team May 2, 2023 15:44
launchable("record tests --session ${session} --group ${repository} maven './**/target/surefire-reports' './**/target/failsafe-reports'")
if (BRANCH_NAME == 'master' || env.CHANGE_ID && pullRequest.labels.contains('full-test')) {
branches = [failFast: false]
lines.each {line ->
Copy link
Member Author

Choose a reason for hiding this comment

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

Hide whitespace to see real change

def session = readFile(sessionFile).trim()
launchable("record tests --session ${session} --group ${repository} maven './**/target/surefire-reports' './**/target/failsafe-reports'")
if (BRANCH_NAME == 'master' || env.CHANGE_ID && pullRequest.labels.contains('full-test')) {
branches = [failFast: false]
Copy link
Member Author

Choose a reason for hiding this comment

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

equivalently,

Suggested change
branches = [failFast: false]
branches = [:]

@@ -43,3 +43,4 @@ actions:
spec:
labels:
- dependencies
- full-test
Copy link
Member Author

Choose a reason for hiding this comment

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

If we are updating PCT, presumably we want to run it!

@jglick
Copy link
Member Author

jglick commented May 2, 2023

Could also consider adding full-test to

- package-ecosystem: "maven"
open-pull-requests-limit: 10
directory: "/sample-plugin"
reviewers:
- "jglick"
schedule:
interval: "daily"
so that core bumps run PCT. Would want to suppress this on plugin-pom bumps as well as groovy-maven-plugin and groovy-all; not sure if DB makes that possible.

@jglick
Copy link
Member Author

jglick commented May 2, 2023

Could also consider .github/workflows/dependabot-automerge.yml as seen in #2031, though we would need to then be somewhat more careful about what is going into a release. I tend to glance at plugin release notes before approving PRs just out of interest, but it would be really unusual to specifically reject such a bump if it passes CI.

@jglick
Copy link
Member Author

jglick commented May 2, 2023

We could also revert #2032 for the prep stage, keeping it only for the pct branches, so that PRs get tested more promptly.

Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

This places the burden of running the full test suite and dealing with the failures on whoever happens to be cutting a release, whenever they happen to be cutting a release. I think this negatively incentivizes running tests and cutting releases. We want to create positive incentives for maintainership duties, not negative ones.

In contrast, my proposal creates positive incentives for maintainership duties by having automation open PRs to run automated tests early (before release) and often (three times a week). More positive incentives are created by opening PRs (thus allowing for group discussion), which sends out notifications and thus urges people to take action early (as opposed to this proposal, in which nobody would notice if a test started failing until they happened to be interested in doing a release).

The only situation in which I would accept your proposal is one in which you volunteer to regularly (at least once a month) run the build, deal with failures, re-run the build if necessary, and cut the release. And this would mean doing the work, not leaving comments about what "needs to be" done.

@dduportal
Copy link
Contributor

We could also revert #2032 for the prep stage, keeping it only for the pct branches, so that PRs get tested more promptly.

🤔 did you mean #2031 (instead of #2032)? I'm not sure to see the link with using another label (to run on another node pool) with your proposal here?

@jglick
Copy link
Member Author

jglick commented May 2, 2023

@dduportal no, I meant #2032: use the maven-bom label for pct-* branches, but revert to maven-11 for the quick prep stage. Somewhat orthogonal and could be done independently; I just noticed here that the build was being held up waiting the dedicated node pool, which is only really needed for the much more expensive PCT runs.

@MarkEWaite
Copy link
Contributor

I have some preference for #2031 but would also be willing to use the workflow proposed in this pull request. I agree with the observation from @basil that this method places a greater burden on the maintainer that generates a release, but I think that can be acceptable if we have some form of rotation of maintainers that are working to assure a release happens at least once a week.

I suggest a release at least once a week because in the past 40 BOM releases we've averaged 13 commits per release and we easily have 13 pull requests per week.

@basil
Copy link
Member

basil commented May 2, 2023

I agree with the observation from @basil that this method places a greater burden on the maintainer that generates a release

Not just the maintainer that performs a BOM release, but also anyone who happens to need to do a full test run: e.g. someone doing unrelated core/PCT work that happens to require a full test run. Unless a full test run is regularly scheduled and unless BOM maintainers are notified to take action when it fails, it is possible that we would fall behind on these fronts and that the unlucky person doing a BOM release or a core/PCT change would have to face the consequences (which would negatively incentivize them to do such work).

@basil
Copy link
Member

basil commented May 2, 2023

I think that can be acceptable if we have some form of rotation of maintainers that are working to assure a release happens at least once a week.

A rotation would alleviate my concern about negative incentives. If the other maintainers agree to form such a rotation, I would support the approach in this PR and would even be willing to participate as one of the members of the rotation. If the other maintainers want to proceed with this PR but will not commit to such a rotation, then I would remain hesitant about the approach in this PR.

I suggest a release at least once a week

Yes, a once a week cadence (similar to weekly core releases) sounds about right to me for the reasons you gave.

@timja
Copy link
Member

timja commented May 2, 2023

I do not support a rotation / commitment on this.

@jglick
Copy link
Member Author

jglick commented May 2, 2023

I was not proposing any sort of rotation, whatever that means.

I sketched a way for trunk to be automatically tested on a regular schedule (weekly, as an example) that ought to deliver the usual GitHub notifications, as well as providing a placeholder PR that could be self-assigned, used to collect notes about bisections in progress, etc. It could be amended with actual fixes I suppose, or simply be closed and real PRs opened (with full-test) from forks. Like most other things involving GHA workflows, it is not straightforward to test this in advance (the workflow_dispatch is for debugging).

I had hoped to be able to open a PR with no commits, which would be beneficial since if it passed then master would already be green and so you could proceed straight to release, but it seems GH goes out of its way to prevent this. (If you try to trick it by resetting the head branch to the base branch, it marks the PR closed.) Would be possible, but a bit more effort, to rerun the master head and then have another workflow triggered on a failing check from it which would (re-)open an issue.

Just an option. Probably not worth spending too much time debating design since it is simple enough to revert or modify any proposal if it is not working out the way it was hoped.

Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

I was not proposing any sort of rotation, whatever that means.

Yeah I know, my point was that some positive incentive is needed for the system to sustain itself, and it was missing in the first version of this PR. That would have led to a negative incentive for doing certain types of work, hence my negative feedback about the first version of this PR. In my mind the problem can be solved by creating a positive incentive to test early and often, either by creating automation that runs builds and pings people regularly or by having the maintainers commit to doing this manually. Since this PR now creates a positive incentive in the form of cron-scheduled builds and an automated PR, my concern is now alleviated. And since it is simpler than #2031, I think I prefer this PR to #2031.

@jetersen
Copy link
Member

jetersen commented May 3, 2023

I like simplicity over what #2031 was suggesting 😅

Copy link
Member

@jetersen jetersen left a comment

Choose a reason for hiding this comment

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

One minor issue otherwise LGTM.

.github/workflows/run-full-test.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Looks good to me.

The suggested change from @jetersen seems like a good safety measure by always deleting the full-tests branch whether or not it has been pushed. I was unable to create a condition where the git branch -d full-tests would fail, but there may be such a case. Pull request is approved whether or not the suggestion is accepted.

@basil
Copy link
Member

basil commented May 3, 2023

Still a bit incomplete without the following portions that were discussed:

  • Dependabot auto-merge of dependencies
  • Use regular container agents rather than BOM agents for prep.sh stage.

+0 from me in this incomplete state. This would be a +1 if these action items were completed.

Co-authored-by: Joseph Petersen <me@jetersen.dev>
@jglick
Copy link
Member Author

jglick commented May 3, 2023

Dependabot auto-merge of dependencies

#2034 (comment) but sure, fine with me to add that here.

Use regular container agents rather than BOM agents for prep.sh stage

Yes, could be done independently but may as well prepare it here since it seems there is consensus we should try this approach.

Will try to do both today.

@dduportal
Copy link
Contributor

@dduportal no, I meant #2032: use the maven-bom label for pct-* branches, but revert to maven-11 for the quick prep stage. Somewhat orthogonal and could be done independently; I just noticed here that the build was being held up waiting the dedicated node pool, which is only really needed for the much more expensive PCT runs.

Use regular container agents rather than BOM agents for prep.sh stage.

+0 on this: I'm not in favor neither I'm against this:

  • Keeping all bom builds in the "BOM" node pools is easier to mentally map when dealing with costs and setup on infrastructure side.
  • Moving the "prep" phase on the "NOT bom" node pool increase partially the probability to immediately have an agent instead of having to wait for a node scale up (but only partially: if you have 3, 6, 9 plugins being built, then you'll wait the same time as it would trigger a scale up.

I don't see a reason to block this PR for this chore.

Thanks for the work, proposals, reviews and solutions on this and on #2031 .

@basil
Copy link
Member

basil commented May 3, 2023

The prep.sh phase is pretty light and is effectively equivalent to a normal plugin build. It's only the PCT phase that is heavyweight, massively parallel, and requires a dedicated node pool. The "BOM" node pool could conceptually be thought of as the "PCT" node pool from the perspective of resource requirements.

@jglick jglick added the full-test Test all LTS lines in this PR and do not halt upon first error. label May 3, 2023
@jglick
Copy link
Member Author

jglick commented May 3, 2023

I think this is ready to go if there are no objections from the last couple of commits? We can see how it goes for a couple of weeks and adjust as needed.

@MarkEWaite MarkEWaite merged commit 06df805 into jenkinsci:master May 3, 2023
473 checks passed
@MarkEWaite
Copy link
Contributor

I've started a separate build of the master branch in hopes that the DNS resolution failures won't hit this time. Infra team is investigating those failures in jenkins-infra/helpdesk#3559

@jglick jglick deleted the miser branch May 3, 2023 21:02
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
Copy link
Member Author

Choose a reason for hiding this comment

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

Working on #2036, #2038, #2039.

@jglick jglick mentioned this pull request May 4, 2023
git commit --allow-empty --message 'Phony commit'
git push origin full-tests
# Not using --draft to ensure notifications are sent:
gh pr create --head --title 'Testing master (do not merge)' --body 'Close this PR if it passes; otherwise please fix failures.' --reviewer jenkinsci/bom-developers --label full-test
Copy link
Member Author

Choose a reason for hiding this comment

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

Tested in #2052.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Reduces future maintenance full-test Test all LTS lines in this PR and do not halt upon first error.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants