56 Commits

Author SHA1 Message Date
cor3ntin
50937ebff3
[Github] Tweak the good-first-issue message not to require assignment. (#139858)
New contributors can just indicate that they are working on the issue
without requesting assignment.

That shouldd reduce the burden of assigned issues that are not actually
being worked on, and new contributors waiting for a maintainer to
asssign them the issue.

---------

Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-05-27 17:50:46 +02:00
Tom Stellard
768d3ba743
github-automation.py: Add debug output to the commit-request-greeter (#137104)
This script is not working any more in the GitHub actions jobs and I
can't reproduce this locally, so I've added some debug output to try to
help find the problem.
2025-04-24 15:32:32 -07:00
David Spickett
19fc8e3846 [GitHub] Correct word in commit access request greeting 2025-02-11 10:28:31 +00:00
Tom Stellard
cd26c112b2
[llvm][GitHub] Move PR project status to Done once backport PR is made (#126374)
It's common to use the /cherry-pick command on a PR to create a backport
request. However, this creates a lot of clutter in the LLVM Release
Status project, because we end up with two items in the project, one for
the original PR and one for the new PR.

This change will set the status of the original PR to Done once the new
PR (for the release branch) is created. This will save release managers
a lot of work of having to manually updated the status for PRs that
contain backport requests.
2025-02-10 13:06:51 -08:00
Tom Stellard
f8ef2699d8
workflows: Add some automation for commit access requests (#123113)
* Greet the user and ask them to read the developer policy.
* Post their contribution stats on the issue.
2025-01-30 20:05:05 -08:00
David Spickett
5adbce072c [llvm][GitHub] Fix formatting of new contributor comments
GitHub won't reflow the text unless we put it all on one line.

If we try to make our own paragrpahs it comes out too narrow or
too wide.
2024-08-20 09:26:09 +00:00
Tom Stellard
2879a03647
[workflows] Fix release note request workflow (#94784)
We need to use the issue-write workflow to write the comments, because
pull_request targets don't have permissions to write comments.
2024-06-27 15:54:22 -07:00
Tom Stellard
c99d1156c2
[workflows] Add a job for requesting a release note on release branch PRs (#91826)
We have been collecting release notes from the PRs for most of the
18.1.x releases and this just helps automate the process.
2024-05-13 16:31:21 -07:00
J. Ryan Stinnett
8a7f021f9e
[GitHub] Fix typos in automation (#86886) 2024-03-28 10:37:31 +00:00
Danny Mösch
cd8286a667
[GitHub] Allow shortcut for "introductory issue" and request linking to issue in PR (#84635)
The answer to many requests in issues to be assigned to users is often
"just create a pull request". That's in contradiction to the
"introductory issue" instructions posted by the GitHub bot.

This change updates the instructions, mentioning the shortcut of "just
creating a PR". Moreover, it now explains linking PRs to issues in order
to close them automatically upon merge.
2024-03-22 18:51:44 +01:00
Tom Stellard
d125d5576e
github-automation.py: Set maintainer_can_modify=True for backport PRs (#84819)
This makes it possible to rebase the branch using the Web UI, which
makes it easier to manually merge the PRs. Manual merge is required when
squash merge won't preserve author information of the backport.
2024-03-11 16:04:44 -07:00
Shourya Goel
9a894e7d84
[Github Automation] Allow colon after cherry-pick command (#81002)
Fixes: https://github.com/llvm/llvm-project/issues/64803

Removed unsupported branch command and changed Regex to
accept /cherry-pick: command.
2024-03-05 09:28:44 +01:00
Nikita Popov
124cd11d7f Revert "[GitHub][workflows] Ask reviewers to merge PRs when author cannot (#81142)"
This reverts commit 38c706e30f5f339bfb0bfb26fd7b5c2d5086064a.

This workflow always fails in cases where it needs to create a
comment, due to a permissions issue, see the discussion at:
https://discourse.llvm.org/t/rfc-fyi-pull-request-greetings-for-new-contributors/75458/20
2024-02-14 11:33:36 +01:00
David Spickett
38c706e30f
[GitHub][workflows] Ask reviewers to merge PRs when author cannot (#81142)
This uses
https://pygithub.readthedocs.io/en/stable/github_objects/Repository.html?highlight=get_collaborator_permission#github.Repository.Repository.get_collaborator_permission.

Which does
https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2022-11-28#get-repository-permissions-for-a-user
and returns the top level "permission" key.

This is less detailed than the user/permissions key but should be fine
for this
use case.

When a review is submitted we check:
* If it's an approval.
* Whether we have already left a merge on behalf comment (by looking for
a hidden HTML comment).
* Whether the author has permissions to merge their own PR. 
* Whether the reviewer has permissions to merge.

If needed we leave a comment tagging the reviewer. If the reviewer also
doesn't have merge permission, then it asks them to find someone else
who does.
2024-02-13 14:52:02 +00:00
Tom Stellard
bd65547805
[workflows] Create a more descriptive title and body when creating a PR for backports (#80396)
When a backport request is made, the resulting pull request will have a
title like this:

<release branch>: <First line of HEAD commit for the branch>

And a body that says:

Backport <commit0> <commit1> ..

Requested By: <user>
2024-02-09 13:04:49 -08:00
Tom Stellard
9805c051f7
[workflows] Close issues used for backports once the PR has been created (#80394)
This will allow us to track the state of the backport request in the PR,
rather than in the issue. The state updates for PRs can be automated, so
this will save us some triage work.
2024-02-05 10:59:14 -08:00
David Spickett
96a3d05ed9 [GitHub][workflows] Reflow some text in buildbot info PR comment
When the markdown link renders the line gets a lot shorter.
2024-02-01 10:44:25 +00:00
David Spickett
44ba4c732b
[GitHub][workflows] Add buildbot information comment to first merged PR from a new contributor (#78292)
This change adds a comment to the first PR from a new contributor that
is merged, which tells them what to expect post merge from the build
bots.

How they will be notified, where to ask questions, that you're more
likely to be reverted than in other projects, etc. The information
overlaps with, and links to
https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr.
So that users who simply read the email are still aware, and know where
to follow up if they do get reports.

To do this, I have added a hidden HTML comment to the new contributor
greeting comment. This workflow will look for that to tell if the author
of the PR was a new contributor at the time they opened the merge. It
has to be done this way because as soon as the PR is merged, they are by
GitHub's definition no longer a new contributor and I suspect that their
author association will be "contributor" instead.

I cannot 100% confirm that without a whole lot of effort and probably
breaking GitHub's terms of service, but it's fairly cheap to work around
anyway. It seems rare / almost impossible to reopen a PR in llvm at
least, but in case it does happen the buildbot info comment has its own
hidden HTML comment. If we find this we will not post another copy of
the same information.
2024-01-31 10:11:24 +00:00
Tom Stellard
e99edf6bcb
[workflows] Drop the intermediate /branch comment for release workflow (#79481)
We used to support a /branch comment to specify a branch with commits to
backport to the release branch. However, now that we can use pull
requests this is not needed.

This also simplifies the process, because now the cherry-pick job can
create the pull request directly instead of having it split across two
separate jobs.
2024-01-25 13:11:09 -08:00
Nikita Popov
56444d5687
Remove fork handling from release issue workflow (#79310)
This is currently broken, because the check is performed on the wrong
repository. repo here is llvm/llvm-project, which is not a fork (so this
will always trigger), then we'll push a new branch to
llvmbot/llvm-project, and then again set the wrong owner, so we'll look
for the branch in llvm/llvm-project rather than llvmbot/llvm-project.

Rather than fixing this, I'm removing the code entirely, as it shouldn't
be needed anymore (llvmbot/llvm-project is a fork of llvm/llvm-project).
2024-01-24 17:39:10 +01:00
Nikita Popov
416b079336
Fix release issue workflow (#79268)
Remove the `--phab-token` argument (which currently eats the subsequent
"auto" as the token no longer exists) and related code.

I think this will fix the workflow failure in
https://github.com/llvm/llvm-project/issues/79253#issuecomment-1907679229.
2024-01-24 11:23:28 +01:00
Tom Stellard
f33e9276e2
github-automation: Use the llvm/llvm-project repo for backport pull requests (#71727)
Now that the project uses PRs for code review, we don't need to use the
llvm/llvm-project-release-prs repo for reviewing backports.
2024-01-11 17:06:27 -08:00
David Spickett
77249546aa
[GitHub] Add greeting comment to opened PRs from new contributors (#72384)
This includes some commonly needed information like how to add
reviewers.

This is implemented as a job before the labeler, so that on a new PR the
comment is added before there are any subscribers and only the author
gets a nofitication.

The labeler job depends on the greeter having run or having been
skipped. So if the PR wasn't just opened, or it's from a regular
contributor, the labeling still happens.

But we can be sure that when a greeting comment is left, it's the very
first thing we do.
2023-12-05 11:28:43 +00:00
Danny Mösch
6a4489a733
[GitHub] Use proper Markdown syntax and avoid child list items (#73700) 2023-11-29 08:47:57 +01:00
Da-Viper
dc8b055c71
[GitHub] Update bot message to suggest GitHub pull requests (#65914)
Fixes #65890.

---------

Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2023-11-26 16:53:37 +01:00
Timm Baeder
81761bd0f1
Try to fix good-first-issue bot (#71816)
The previous code was just overriding the `comment` variable. Fix this by writing two comments if necessary instead.
2023-11-24 07:57:14 +01:00
Aiden Grossman
5d39f3f685
[Github] Fix github automation script on empty descriptions (#71274)
Before this patch, the github automation script would fail when trying
to escape the text of a PR/issue description that was empty as the
Github library returns None instead of an empty string in those
scenarios. This patch special cases this and makes the escape function
return an empty string when given a value of None.
2023-11-06 21:46:39 -08:00
Aiden Grossman
f8148e4815
[Github] Add PR author name to subscription email (#68440)
Currently the email that gets sent out to people subscribing to a label
that the bot tags on the PR doesn't include any authorship information
which some people are interested in having. This patch adds an author
field to the message with the relevant information.
2023-10-09 15:46:53 -07:00
Corentin Jabot
3ce8eda592 [Github] Add a new line before the line separator to avoid paragraphs being treated as titles 2023-09-18 16:17:38 +02:00
Corentin Jabot
3058d2908e [Github] Fix issue number escaping 2023-09-15 17:40:09 +02:00
cor3ntin
1b18e98642
[Github] Improve formating of PR diffs in bot notifications (#66118)
* This avoid pinging folks on all issue when they got pinged on bugzilla
eons ago
* Avoid formatting bugs when there is html in the issue description
* Truncate the list of files and the diff independently of each other.
This avoids truncating cutting a file line in 2 and to cut in the middle
of html markup. This is a fringe case but it does happen when people
accidentally push weird branches conflicting on all the files.
2023-09-15 16:58:05 +02:00
Mehdi Amini
d2cd5a4595
Fix PR description HTML escaping, the surrounding <pre> tag shouldn't be escaped (#66322) 2023-09-13 21:40:57 -07:00
Tom Stellard
64751ea2c5
github-automation: Use a single comment for team mentions on pull requests (#66037)
This will reduce the number of notifications created when a pull request
label is added. Each team will only get a notification when their team's
label is added and not when other teams' labels are added.
2023-09-12 13:21:29 -07:00
Tom Stellard
cff72d7022
workflows/pr-subscriber: Handle libc++ and libc++abi labels (#66029) 2023-09-12 13:06:57 -07:00
Mehdi Amini
38e9006896
Include the issue description in the subscription comment so that email notification is self-contained (#65839)
This makes it so that we don't need to open the issue to have the
description in our inbox on subscription.
2023-09-11 22:39:01 -07:00
Mehdi Amini
4085cb380d
Improve the pull-request subcription notification format by adding the description and files statistics (#65828) 2023-09-08 22:54:53 -07:00
Tom Stellard
5f16a3a489
workflows: Add a simple pull request subscription workflow (#64913)
This new workflow will make it possible for people to subscribe to pull
requests based on the labels that are added. Labels will be added
automatically to the pull requests based on the modified files and each
label will be associated with a GitHub team that will be notified when
the label is added.

See
https://discourse.llvm.org/t/changes-to-pull-request-subscription-system/73296
2023-09-08 09:40:37 -07:00
Timm Bäder
405932afc0 [llvm][github] Allow github links in /cherry-pick actions
Differential Revision: https://reviews.llvm.org/D151191
2023-05-23 12:31:07 +02:00
Tobias Hieta
b71edfaa4e
[NFC][Py Reformat] Reformat python files in llvm
This is the first commit in a series that will reformat
all the python files in the LLVM repository.

Reformatting is done with `black`.

See more information here:

https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Reviewed By: jhenderson, JDevlieghere, MatzeB

Differential Revision: https://reviews.llvm.org/D150545
2023-05-17 10:48:52 +02:00
Timm Bäder
7a356de83c [clang][github] Try to fix multi-line py comment
Introduced in 09effa706a026c7ebcc01bf14f9f710cb1a8fa87
2023-04-13 14:47:24 +02:00
Timm Bäder
09effa706a [llvm][github] Add good-first-issue comment to issues
Differential Revision: https://reviews.llvm.org/D146819
2023-04-13 14:39:59 +02:00
Keith Smiley
c116bd9f60
[github] Fix minor lint warnings (NFC)
Differential Revision: https://reviews.llvm.org/D135532
2022-10-14 15:46:57 -07:00
Kazu Hirata
a2d4501718 [llvm] Fix comment typos (NFC) 2022-08-07 00:16:14 -07:00
Tom Stellard
560efad701 workflows: Release Workflow - Avoid selecting random reviewers when no phab review
If you pass a NULL reivew ID to the differential.revision.search API,
it returns all revisions and we were just taking the first one and
assuming it was associated with the commit in the PR.

We need to exit early if we can't find a Phabricator review associated
with a commit.
2022-08-02 14:07:22 -07:00
Tom Stellard
e0a3964aff workflows: Fix error when searching for backport reviewers 2022-08-02 01:09:02 -07:00
Tom Stellard
89d3c9634b workflows: Fix pull request creation for backports
This was broken by 17d4796cc84618e9b15f9484e5576127c431bc60.
2022-07-27 13:12:07 -07:00
Tom Stellard
f673dcc693 github: Automatically assign reviewers for backport requests
When there is a backport request, the GitHub Action that handles the
backport will now automatically assign the issue to the user(s) who
approved the commit in Phabricator and create an issue comment asking
them to review the request.

Reviewed By: thieta, kwk

Differential Revision: https://reviews.llvm.org/D126423
2022-07-26 15:30:27 -07:00
Tom Stellard
17d4796cc8 github: Fix release automation /branch command with new repo
We started using the llvm/llvm-project-release-prs repo for
backport pull requests, but since this repo is not a fork of
llvm/llvm-project it will reject pull requests from other repos. In
order to fix this, when ever someone uses the /branch command to request
a branch be merged into the release branch, we first copy the branch to
the llvm-project-release-prs repo and then create the pull request.

Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D126940
2022-07-26 15:05:05 -07:00
Tom Stellard
51eaaa3092 github: Add a helpful message for issues without milestones
The /branch and /cherry-pick commands only work when an isssue has
a milestone, so give the user a helpful error message when they
try these commands on issue without a milestone.

Reviewed By: thieta, kwk

Differential Revision: https://reviews.llvm.org/D125744
2022-07-15 10:11:40 -07:00
Tobias Hieta
fde9ef5214 [NFC][workflow] Fix issue where the workflow would say all PR's already exists 2022-06-02 08:20:21 +02:00