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

Fix PR labeling and generate nightly build notes from them. #4077

Merged
merged 4 commits into from
Jun 24, 2024

Conversation

chandlerc
Copy link
Contributor

This configures the nightly build to generate release notes and provides a template for organizing them. The organization is done through labeling of PRs and categorizing them based on those labels. I've tried to provide a rough categorization that seems reasonable for folks.

While doing this I looked at our PR labeling and found a few bugs that were preventing many labels form being attached. I've fixed those and significantly expanded the coverage of file-based labeling. I've also added code to do author-based labeling for automated PRs so those can be separated out from human PRs.

This configures the nightly build to generate release notes and provides
a template for organizing them. The organization is done through
labeling of PRs and categorizing them based on those labels. I've tried
to provide a rough categorization that seems reasonable for folks.

While doing this I looked at our PR labeling and found a few bugs that
were preventing many labels form being attached. I've fixed those and
significantly expanded the coverage of file-based labeling. I've also
added code to do author-based labeling for automated PRs so those can be
separated out from human PRs.
@github-actions github-actions bot requested a review from jonmeow June 23, 2024 03:05
Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

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

This looks like a good improvement for the releases, I see I missed a bug in PR labeling.

.github/release.yaml Outdated Show resolved Hide resolved
.github/workflows/label_prs.yaml Outdated Show resolved Hide resolved
Comment on lines +81 to +87
- id: proposal
if: steps.filter.outputs.proposal == 'true'
run: |
gh pr edit "${PR}" --add-label "proposal"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Proposals should be getting labels from the proposal_labeled and proposal_ready flows, are you seeing issues with them? I'm wary of having multiple actions trying to set labels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, I believe that proposal_labeled.yaml only handles keeping updates between the draft, rfc, accepted, and declined labels consistent. And proposal_ready.yaml only handles a PR that has some proposal label getting marked as ready_for_review, and triggering the proposal rfc label for that. A human has to apply the proposal (or proposal draft) label first.

And those workflows don't seem the right place to do this proposal labeling as we really want to trigger on the paths here and more events. So I think this is a reasonably clean breakdown of logic based on the events that trigger workflows.

I can try to merge all the proposal label management into a single workflow if you want, but we already have 3 actions setting labels, and so I don't think this PR is making things much worse there.

Copy link
Contributor

Choose a reason for hiding this comment

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

So, new_proposal.py adds the proposal label. Should PRs that don't use the new_proposal script that add files here generally be marked as proposals? That will probably include non-proposal things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, hopefully this actually matches what we want and gives coverage for proposals that aren't created with the script.

I've also added a comment to highlight how it is different.

.github/workflows/label_prs.yaml Show resolved Hide resolved
.github/release.yaml Outdated Show resolved Hide resolved
Copy link
Contributor Author

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

(still not back to where I can hack on this, but asking a quick question below that would be useful for me when I do get a chance to circle back)

.github/workflows/label_prs.yaml Outdated Show resolved Hide resolved
Copy link
Contributor Author

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

Thanks for the review, PTAL!

.github/release.yaml Outdated Show resolved Hide resolved
.github/release.yaml Outdated Show resolved Hide resolved
Comment on lines +81 to +87
- id: proposal
if: steps.filter.outputs.proposal == 'true'
run: |
gh pr edit "${PR}" --add-label "proposal"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, I believe that proposal_labeled.yaml only handles keeping updates between the draft, rfc, accepted, and declined labels consistent. And proposal_ready.yaml only handles a PR that has some proposal label getting marked as ready_for_review, and triggering the proposal rfc label for that. A human has to apply the proposal (or proposal draft) label first.

And those workflows don't seem the right place to do this proposal labeling as we really want to trigger on the paths here and more events. So I think this is a reasonably clean breakdown of logic based on the events that trigger workflows.

I can try to merge all the proposal label management into a single workflow if you want, but we already have 3 actions setting labels, and so I don't think this PR is making things much worse there.

.github/workflows/label_prs.yaml Show resolved Hide resolved
.github/workflows/label_prs.yaml Outdated Show resolved Hide resolved
.github/workflows/label_prs.yaml Show resolved Hide resolved
- 'proposal/scripts/**'
- 'scripts/**'
- 'testing/**'
- 'third_party/**'
- 'utils/**'
proposal:
- added: 'proposals/*'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this exclude proposals/scripts?

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 believe it does because it only is one *, so this should only match added files (or new directories) directly under proposals.

Comment on lines +81 to +87
- id: proposal
if: steps.filter.outputs.proposal == 'true'
run: |
gh pr edit "${PR}" --add-label "proposal"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}
Copy link
Contributor

Choose a reason for hiding this comment

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

So, new_proposal.py adds the proposal label. Should PRs that don't use the new_proposal script that add files here generally be marked as proposals? That will probably include non-proposal things.

@chandlerc
Copy link
Contributor Author

Thanks, merging. That said, if any of the comments need improving, happy to do that in a follow-up!

@chandlerc chandlerc added this pull request to the merge queue Jun 24, 2024
Merged via the queue into carbon-language:trunk with commit f4b20fc Jun 24, 2024
7 checks passed
@chandlerc chandlerc deleted the rel-notes branch June 24, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants