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

CI: On vX.Y-rhel branches, ensure that some downstream Jira issue is linked #23622

Merged

Conversation

alexlarsson
Copy link
Contributor

@alexlarsson alexlarsson commented Aug 14, 2024

In the RHEL specific branches we want to ensure that all MRs link to at least one downstream Jira ticket. To do this we add a new test in validate-source similar to the existing pr-should-include-tests. This test only runs on actual pull requests.

The syntax for linking to a Jira is "Fixes " followed by one jira links, like so:

Fixes https://issues.redhat.com/browse/RHEL-50506

Note: This is the same syntax as for a regular github issue reference.

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None labels Aug 14, 2024
@alexlarsson
Copy link
Contributor Author

@baude @mheon @TomSweeneyRedHat @edsantiago follow up from the email discussion.

The exact syntax, as well as the label name for the override is just an initial proposal for me, and is up for discussion.

@alexlarsson alexlarsson force-pushed the ci-require-jira-links branch from 8f59aaf to c0d5bfd Compare August 14, 2024 14:04
@alexlarsson
Copy link
Contributor Author

Btw, the DEST_BRANCH in .cirrus.yml on the "v4.9-rhel" branch is wrong (it is "v4.9"), and we have to update it if we want this to work there.

@mheon
Copy link
Member

mheon commented Aug 14, 2024

I'm thinking we're going to mandate all PRs on upstream that fix an issue reference that issue as "Fixes " where issue could be a Github issue ID, a URL, or a Jira reference. So I think matching "Fixes Jira -\n" would be preferable. But the overall approach LGTM.
This will need to be backported to each -rhel branch, we take CI from per-branch config not main.

@mheon
Copy link
Member

mheon commented Aug 14, 2024

@cevich Is there any way we can enforce Cirrus DEST_BRANCH being set correctly, because I think we're especially bad about remembering to do this for -rhel branches?

@alexlarsson
Copy link
Contributor Author

Maybe we can have a github action (not in cirrus) that validates the cirrus DEST_BRANCH value? I think you can get that from $GITHUB_BASE_REF

@cevich
Copy link
Member

cevich commented Aug 14, 2024

Maybe we can have a github action (not in cirrus) that validates the cirrus DEST_BRANCH value? I think you can get that from $GITHUB_BASE_REF

That's not a bad suggestion actually since github actions on this repo can send e-mail to our monitoring list.

OTOH, the base-branch name is exposed in a Cirrus-CI env. var. (can't recall the exact name) to PR-level tasks but nowhere else (i.e. not in tag or branch-level jobs). So maybe a simple check could be done if $CIRRUS_BASE_BRANCH != main && $CIRRUS_BASE_BRANCH != $DEST_BRANCH or something to that effect.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

Not against this per se, just marking that I don't think we should merge this until we have a general accept format defined and documented before we "enforce" anything

@mheon
Copy link
Member

mheon commented Aug 14, 2024

@Luap99 I'm going to proposal the generic Fixes [issue] formatting on Monday at standup.

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

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

@alexlarsson
Copy link
Contributor Author

@Luap99 I'm going to proposal the generic Fixes [issue] formatting on Monday at standup.

Any chance I can join that?

@mheon
Copy link
Member

mheon commented Aug 15, 2024

@alexlarsson Sure, I can invite you.

@alexlarsson alexlarsson force-pushed the ci-require-jira-links branch from c0d5bfd to b91bfaa Compare August 19, 2024 14:37
@alexlarsson
Copy link
Contributor Author

Hmm, github actually also allows a colon, like "Fixes: ", and that is what CONTRIBUTING.md says. I'll make the PR handle that as well.

@alexlarsson alexlarsson force-pushed the ci-require-jira-links branch from b91bfaa to 9cb44e5 Compare August 19, 2024 14:44
@alexlarsson alexlarsson changed the title WIP: CI: On vX.Y-rhel branches, ensure that some downstream Jira issue is linked CI: On vX.Y-rhel branches, ensure that some downstream Jira issue is linked Aug 19, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 19, 2024
@alexlarsson
Copy link
Contributor Author

@mheon Updated the PR

@mheon
Copy link
Member

mheon commented Aug 19, 2024

Someone who is better at regexes than I should review, but LGTM

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Good start, but a few suggestions inline

contrib/cirrus/pr-should-link-jira.t Outdated Show resolved Hide resolved
contrib/cirrus/pr-should-link-jira.t Outdated Show resolved Hide resolved
contrib/cirrus/pr-should-link-jira.t Outdated Show resolved Hide resolved
@alexlarsson alexlarsson force-pushed the ci-require-jira-links branch 3 times, most recently from 82f252c to 4473d75 Compare August 20, 2024 12:52
Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

LGTM. One gripe, not worth a repush. Thank you!

fi
fi

export CIRRUS_REPO_CLONE_TOKEN
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't belong here (it should be on line 11) but it's not worth yet another repush.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it there so i could test it with:

CIRRUS_REPO_CLONE_TOKEN=... ./pr-should-link-jira.t

Otherwise it would not get propagated to the test.
That said, one might very well not want to support that...

Copy link
Member

Choose a reason for hiding this comment

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

If you do want to keep this here, I would be helpful to add a comment suggesting it's needed for pr-should-link-jira.t to function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it.

Copy link
Contributor

openshift-ci bot commented Aug 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexlarsson, edsantiago

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2024
@alexlarsson
Copy link
Contributor Author

The mac build always seems to time out on the linter. I assume that is not my fault?

@cevich
Copy link
Member

cevich commented Aug 21, 2024

The mac build always seems to time out on the linter. I assume that is not my fault?

I think there was a fix for that recently and rebasing on main should fix it. I might be wrong though.

@alexlarsson alexlarsson force-pushed the ci-require-jira-links branch from 6493cca to ba46e56 Compare August 22, 2024 08:17
@alexlarsson
Copy link
Contributor Author

The mac build always seems to time out on the linter. I assume that is not my fault?

I think there was a fix for that recently and rebasing on main should fix it. I might be wrong though.

I tried rebasing, lets see.

Copy link

Cockpit tests failed for commit ba46e5651476150655ba3f250b230110a5542f6b. @martinpitt, @jelly, @mvollmer please check.

…linked

In the RHEL specific branches we want to ensure that all MRs link to
at least one downstream Jira ticket. To do this we add a new test in
validate-source similar to the existing pr-should-include-tests. This
test only runs on actual pull requests.

The syntax for linking to a Jira is "Fixes " or "Fixes: ", followed by
one jira links, like so:

```
Fixes https://issues.redhat.com/browse/RHEL-50506
Fixes: https://issues.redhat.com/browse/RHEL-50506
```

Note: This is the same syntax as for a regular github issue reference.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
@alexlarsson alexlarsson force-pushed the ci-require-jira-links branch from ba46e56 to 17193af Compare August 22, 2024 09:53
@edsantiago
Copy link
Member

Still LGTM

@alexlarsson
Copy link
Contributor Author

Ok, all requested changes are done, and now we passed CI. Can I get this merged?

@alexlarsson
Copy link
Contributor Author

(Note: Once this is merged we need to backport to active rhel branches.

@mheon
Copy link
Member

mheon commented Aug 22, 2024

/lgtm from me

@openshift-ci openshift-ci bot removed the do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None label Aug 22, 2024
@mheon
Copy link
Member

mheon commented Aug 22, 2024

That might have confused the bot
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 0a9f49b into containers:main Aug 22, 2024
94 checks passed
alexlarsson added a commit to alexlarsson/podman that referenced this pull request Aug 22, 2024
…linked

This is a backport of #17193af962453a3cfde2d9f25c0fea29e3c91cf3
(from containers#23622)

In the RHEL specific branches we want to ensure that all MRs link to
at least one downstream Jira ticket. To do this we add a new test in
validate-source similar to the existing pr-should-include-tests. This
test only runs on actual pull requests.

The syntax for linking to a Jira is "Fixes " or "Fixes: ", followed by
one jira links, like so:

```
Fixes https://issues.redhat.com/browse/RHEL-50506
Fixes: https://issues.redhat.com/browse/RHEL-50506
```

Note: This is the same syntax as for a regular github issue reference.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
@cevich
Copy link
Member

cevich commented Aug 22, 2024

Thanks for taking this on and following it through @alexlarsson

alexlarsson added a commit to alexlarsson/podman that referenced this pull request Aug 27, 2024
…linked

This is a backport of #17193af962453a3cfde2d9f25c0fea29e3c91cf3
(from containers#23622)

In the RHEL specific branches we want to ensure that all MRs link to
at least one downstream Jira ticket. To do this we add a new test in
validate-source similar to the existing pr-should-include-tests. This
test only runs on actual pull requests.

The syntax for linking to a Jira is "Fixes " or "Fixes: ", followed by
one jira links, like so:

```
Fixes https://issues.redhat.com/browse/RHEL-50506
Fixes: https://issues.redhat.com/browse/RHEL-50506
```

Note: This is the same syntax as for a regular github issue reference.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 21, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants