49 Commits

Author SHA1 Message Date
Louis Dionne
3e28e1ec56
[code-format] Also include libc++ extensionless headers and .inc and .cppm (#73142)
These headers were skipped by the job because they didn't have an
extension. However, such headers are extremely common in libc++.

As a drive-by change, also include `.cppm` and `.inc` extensions since
those are also common in libc++.
2023-11-22 13:03:05 -05:00
Aiden Grossman
56d0e8ccf4
[Github] Print diff in code format helper (#72742)
Currently, when the code format action fails, it leaves no log of the
diff in the output within the action itself. This has caused confusion
for some users of the action, especially when the comment becomes buried
in a 100+ comment review and someone isn't super familiar with the inner
workings of the CI. This patch prints the diff produced by the code
formatter to stdout so that it is viewable by clicking on the failed
action. This should have very little cost and make things slightly less
confusing for those that run into this situation.
2023-11-18 01:06:40 -08: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
Ryan Prichard
56cadac85b
[Workflow] Expand code-format-helper.py error reporting (#69686)
* Consider the darker/clang-format command to have failed if the exit
   code is non-zero, regardless of the stdout/stderr output.
* Propagate stderr from the formatter command to the script's
   caller (and into the GitHub log).
* On success, dump stdout to the caller, so it ends up in GitHub's log.
   I'm not sure what this would ever be, but if it exists, it should be
   preserved.
* Just before the script exits, if any formatter failed, print a line
   showing which formatters failed.
2023-10-26 19:13:20 -07:00
Ryan Prichard
af25304319
[Workflow] make code-format-helper.py mypy-safe (NFC) (#69691)
Fix type errors that mypy reports with code-format-helper.py.

Add a few return type annotations and change `param: [str]` to
`param: list[str]`.

Leave a few required FormatHelper members missing instead of defining a
placeholder:
 - FormatHelper.name
 - FormatHelper.friendly_name
 - FormatHelper.format_run: NotImplementedError() instead of `pass`
2023-10-20 15:07:59 -07: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
Tobias Hieta
a1177b0bdb
Reland: [Workflow] Add new code format helper.
I landed this format helper, but unfortunately, it didn't work because
of permissions, it could not add comments on a fork's PR. @cor3ntin
informed me there are fixes for this that you had worked on @tstellar -
but I didn't have time to read up on it too much. Can you explain what
changes are needed to get the action to be able to write comments on
fork's PR?
2023-09-22 10:26:09 +02:00
Tobias Hieta
fe5c185641
Revert "[Workflow] Add new code format helper. (#66684)"
This reverts commit da94bf0d561109529e4ab3dabfcbb8b6c258ea39.
2023-09-20 10:01:37 +02:00
Tobias Hieta
da94bf0d56
[Workflow] Add new code format helper. (#66684)
This helper will format python files with black/darker and
C/C++ files with clang-format.

The format helper is written so that we can expand it with new
formatters in the future like clang-tidy.
2023-09-20 08:52:29 +02: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
Tom Stellard
c532db0133
workflows/pr-subscriber: Use our own custom concurrency implementation (#66263)
The builtin concurrency functionality for the workflows will cancel a
pending job if there is another job from the same workflow running. For
the pr-subscriber job, this means that if multiple labels are added at
the same time, then some of the pr-subscriber jobs will be cancelled and
the PR will not have all the necessary mentions.
2023-09-13 23:46:23 -07: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
Krasimir Georgiev
eb6277e554 update certifi to 2023.7.22
For CVE-2023-37920: https://security.snyk.io/vuln/SNYK-PYTHON-CERTIFI-5805047
2023-08-25 11:19:08 +00:00
Krasimir Georgiev
d282781290 update gitpython to 3.1.32
For CVE-2023-40267: https://security.snyk.io/vuln/SNYK-PYTHON-GITPYTHON-5840584.
2023-08-25 11:08:54 +00:00
Tobias Hieta
28226e5a1b
[Workflow] Run the repository sync script from GH.
Also various fixes to the script to work correctly
in GH actions.

Differential Revision: https://reviews.llvm.org/D156873
2023-08-10 09:01:18 +02:00
Yuanfang Chen
5da248c08f [LLVM Utils] Update Certifi to 2023.5.7
Certifi 2022.12.07 removes root certificates from "TrustCor" from the
root store. These are in the process of being removed from Mozilla's
trust store.

https://groups.google.com/a/mozilla.org/g/dev-security-policy/c/oxX69KFvsm4/m/yLohoVqtCgAJ
2023-05-30 14:45:12 -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
Tobias Hieta
1e658ad172
[Workflow] Add Release Repo sync script
Adds a bash script that syncs llvm/llvm-project and llvm/llvm-project-release-prs.
This should run on pushes to any of the repositories release branches.

I will follow this up with a change to the github actions to run this
script.

This breaks out the sync script from: https://reviews.llvm.org/D133476
so we can keep them separate.

Reviewed By: kwk

Differential Revision: https://reviews.llvm.org/D142726
2023-02-10 14:41:24 +01:00
John Demme
f2eb551801 [LLVM Utils] Update GitPython for CVE-2022-24439
GitPython 3.1.28 has a security vulnerability which was fixed in 3.1.30:
	https://nvd.nist.gov/vuln/detail/CVE-2022-24439

Differential Revision: https://reviews.llvm.org/D143238
2023-02-03 23:29:36 +00: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
Keith Smiley
14e4d92f8d
[github] Update pip deps (NFC)
Minor dep updates identified in https://github.com/llvm/llvm-project/issues/57907

Differential Revision: https://reviews.llvm.org/D135531
2022-10-14 15:46:56 -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
Tobias Hieta
49ad577c07 [workflow] Don't fail workflow if we already have a PR for an issue
When running /cherry-pick several times you will get an
error when it tries to create a new PR since there already
is one.

This checks if we have PR first.

Fixes #54862

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D123657
2022-05-27 16:02:39 +02:00
Tom Stellard
21c060c497 github: Switch release PR repository to llvm/llvm-project-release-prs
As discussed in https://discourse.llvm.org/t/creating-a-new-repository-for-release-branch-pull-requests/61339

Reviewed By: asl

Differential Revision: https://reviews.llvm.org/D125851
2022-05-23 15:10:27 -07:00
Tobias Hieta
1889170aeb workflow: When updating the issueXX branch, use force push
Otherwise if you try to update the branch with a new /cherry-pick
from the same issue you will run into problems similar as to the
one shown in this workflow:
https://github.com/llvm/llvm-project/runs/5864672298?check_suite_focus=true

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D123365
2022-04-12 08:03:59 +02:00
Tom Stellard
3929f91397 Release Workflow: Remove cherry-pick-failed label when pull request is created
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D121032
2022-03-25 00:45:28 -07:00
Tom Stellard
daf82a51a0 github: Add actions to automate part of the release workflow
This adds support for automatically cherry-picking and testing fixes for the
release branch using 'commands' in issue comments.  The two supported commands are:

/cherry-pick <commit1> <commit2> ...

Which will backport and test commits from main.  And also

/branch owner/repo/branch

Which will test commits from the given branch.

Reviewed By: alexbatashev, kwk

Differential Revision: https://reviews.llvm.org/D117386
2022-02-03 15:03:59 -08:00
Tom Stellard
a2adebf409 workflows: Make issue-subscriber more robust for labels with special characters
Also, replace the existing actionscript implementation with a python
script that can be run outside of GitHub Actions.  The intention is
that going forward, all github action functionality would be implemented
in this script.

Reviewed By: kwk

Differential Revision: https://reviews.llvm.org/D116762
2022-01-14 22:04:54 -08:00
Mehdi Amini
a61c73dbe3 Add a git hook script that can be manually setup to run some checks on every push
Right now it just catches arcanist noisy tags, and include a script to
automatically clean these.

Follow up on http://lists.llvm.org/pipermail/llvm-dev/2019-December/137848.html

Differential Revision: https://reviews.llvm.org/D80978
2020-06-24 21:13:43 +00:00
Nico Weber
61eedd10c5 Remove llvm/utils/git/find-rev
It assumes git-svn, hasn't been touched in ages, and it's replaced
by llvm-git in llvm/utils/git-svn.

Differential Revision: https://reviews.llvm.org/D66193

llvm-svn: 369478
2019-08-20 23:59:07 +00:00
Daniel Dunbar
8bbf26f59e [utils] Update find-rev utility to take a branch argument (name of the git-svn
branch).

llvm-svn: 172740
2013-01-17 18:57:21 +00:00
Daniel Dunbar
ce33de5b98 Add simple script for finding most-recent-rev-before-N in a git-svn repo; useful
when bisecting multiple repos in sync.

llvm-svn: 97150
2010-02-25 18:07:07 +00:00