137 Commits

Author SHA1 Message Date
David Spickett
f243d8656b
[llvm][utils] Handle Issue/PR authors having no display name set (#186094)
user.login is the account name and user.name is an optional display name
(often their full name). I got an email generated from a colleague's PR
that said:
```
Author: None (<their username>)
```

As they hadn't set user.name in their account. Which isn't a problem,
but it would be neater if we didn't print None.

So I've added a helper function to handle that. If the user has set
both, the output is as it was before, if the user has not, we just show
the login name.

The login name can apparently be None too. In that case we'll print
"None" for it. This does not seem to be a common case though, and I'm
not sure printing anything else would be any more useful.
2026-03-24 09:54:09 +00:00
Kleis Auke Wolthuizen
61c237b837
github-automation.py: Avoid duplicate pings (#184321)
Follow-up to: #149653.

As noticed in:
https://github.com/llvm/llvm-project/pull/184288#issuecomment-3988440497.
2026-03-11 11:05:02 +00:00
Kleis Auke Wolthuizen
0c89071fa3
github-automation.py: Fix mis-indented statement (#149653)
Ensure all reviewers who approved the original PR are properly notified
and added as reviewers on backport PRs.

Resolves: #109429.
2026-03-02 10:06:46 +00:00
Michael Buch
763fbee264
[CI][lldb] Add a github workflow that runs pylint on LLDB API test changes (#182003)
The motivator here is that Python allows class methods to be redefined.
But in the vast majority of cases this is a bug. E.g., in our API
test-suite two methods with the same name cause the latest definition to
shadow the earlier, in which case only one test-case runs. This happens
silently. Every couple of months i've been running the script from
https://github.com/llvm/llvm-project/pull/97043 manually on the
code-base and it catches a handful of these every time.

This patch sets up a github action that runs on pull requests that
change any files under `lldb/test/API`. The action runs `pylint` on the
changed Python files. The caveat here is that `pylint` isn't set up to
run cleanly on our test-suite. So I just use the [specific redefinition
error
code](https://pylint.readthedocs.io/en/stable/user_guide/messages/error/function-redefined.html).
Any other errors won't cause `pylint` to fail for now (hence the
`--error-under=0`).

Here's an example:
<img width="1412" height="367" alt="Screenshot From 2026-02-20 10-29-28"
src="https://github.com/user-attachments/assets/20093be8-a122-4e17-944a-4472eb12ab25"
/>
2026-02-20 19:07:25 +00:00
Aiden Grossman
94b5adc01e
[Github] Update requirements_formatting.txt (#181184)
We should not need to be explicitly adding transitive dependencies to
requirements_formatting.txt.in to enforce a higher version is used. We
also should always be using == to ensure a strict version match, not
just a compatible version (~=). This patch removes transitive
dependencies introduced in 6fdf93c5d812197dd5dc9362f324b944105b2e8e and
updates the lockfile (although only unnecessary packages are removed).
2026-02-13 08:32:53 -08:00
Nikita Kornev
6fdf93c5d8
Update requirements_formatting.txt.in (#180963)
At https://github.com/intel/llvm dependabot reports a few alerts
regarding use of:
- urllib3 < v2.6.3 (CVE-2026-21441)
- pynacl < 1.6.2 (CVE-2025-69277)
- cryptography <= 46.0.4 (CVE-2026-26007)

Update requirements_formatting.txt.in & re-generate
requirements_formatting.txt.
2026-02-11 19:49:12 +00:00
Tom Stellard
6de2b513c6
workflows/release-binaries: Add support for Windows ARM builds (#177609) 2026-02-04 14:36:41 -08:00
Aiden Grossman
182835658f
[Github] Fully remove use of login_or_token (#179258)
PyGithub deprecated this a while back. An earlier patch attempted to fix
all the deprecations, but it looks like my grep expression missed a
bunch of cases. This patch should catch the remaining ones (minus libc++
which have been split for review by libc++ maintainers).
2026-02-02 10:36:51 -08:00
Nikita Popov
f646b9150a
[ci][ids] Fix pattern prefix check (#176334)
The prefix check did not include the trailing /, so llvm-c headers were
treated like llvm headers, resulting in incorrect suggestions to use
LLVM_ABI where LLVM_C_ABI was already present.

See
https://github.com/llvm/llvm-project/pull/176309#issuecomment-3757987748
for an example.
2026-01-16 12:03:48 +01:00
Nikita Popov
7f2ee74518
[ci] Fix header paths in ids workflow (#175905)
Includes should not be prefixed with `include/llvm`.
2026-01-14 11:35:29 +01:00
Petr Hosek
b491241734
[utils][git] Skip subscribers for PRs labeled as skip-precommit-approval (#174819)
skip-precommit-approval label is intended for simple PR that don't
require approval. To reduce the volume of notifications, avoid sending
notifications to subscribers for PRs labeled as such.
2026-01-12 13:55:14 -08:00
Fabrice de Gans
d0235a150d
[ci] Add ids workflow for checking llvm apis have been annotated with LLVM_ABI (#172673)
This PR adds a workflow which checks that llvm apis have been annotated
with LLVM_ABI.

Co-authored-by: mcbarton <matthew.c.barton@hotmail.co.uk>
2026-01-12 12:59:28 -05:00
Max Kudryavtsev
335eb33091
[llvm][utils] Bump urllib to 2.6.3 (#174880)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.3 to 2.6.3
to address
CVE-2025-66418 and CVE-2025-66471 vulnerabilities
2026-01-07 16:04:38 -08:00
mitchell
4567327b9e
[clang-tidy][NFC] Fix formatting issue in clang-tidy documentations (#168722)
Co-authored-by: EugeneZelenko <eugene.zelenko@gmail.com>
Co-authored-by: Baranov Victor <bar.victor.2002@gmail.com>
2025-12-22 19:39:57 +08:00
mitchell
5dd302406d
[Github][CI] Introduce doc8 to code-lint-helper.py (#172123)
Closes #167098

---------

Co-authored-by: EugeneZelenko <eugene.zelenko@gmail.com>
Co-authored-by: Baranov Victor <bar.victor.2002@gmail.com>
2025-12-22 09:25:20 +08:00
mitchell
f19c83f344
[Github][CI] Add doc8 to code-linter dependency (#172256)
This is needed by https://github.com/llvm/llvm-project/pull/172123 to
avoid potential CI failures.
2025-12-16 09:48:24 +08:00
Aiden Grossman
3a522b1080
[Github] Remove use of deprecated login_or_token (#172240)
This function was deprecated recently. Update to the auth parameter to
get ahead of the deprecation.
2025-12-15 09:45:28 -08:00
mitchell
472fd70ace
[Github][CI] Introduce LintHelper class in code-lint-helper.py (#168827)
This commit introduces a new `LintHelper` class to
`llvm/utils/git/code-lint-helper.py`, which lays the groundwork for
integrating additional linters (`doc8`) into Github Action workflow.

---------

Co-authored-by: EugeneZelenko <eugene.zelenko@gmail.com>
2025-12-06 10:21:21 +08:00
Ryan Mast
2f71e606c9
github-upload-release.py: add requirements and lock files for installing dependencies (#169461)
Adds requirements.txt and lock files for installing dependencies for
github-upload-release.py script.

Signed-off-by: Ryan Mast <mast.ryan@gmail.com>
2025-11-26 15:14:33 -08:00
Ellis Hoag
d7dcc108fc
[GitHub] Add review instructions for commit access requests (#168971)
As discussed in
https://discourse.llvm.org/t/clarification-on-how-to-accept-commit-access-requests/88728,
clarify reviewer instructions for how to accept commit access requests.
2025-11-25 10:22:23 -08:00
Baranov Victor
6c1678abce
[CI] Remove unused variable in code-format job (#165454)
`comments` were never used plus generated pylint error
2025-10-31 00:42:31 +03:00
Baranov Victor
a449c349ec
[CI] fix typo in code-format job (#165461) 2025-10-28 22:01:27 +03:00
Nuno Lopes
5fb788be03 github actions/undef warnings: allow newlines after undef 2025-10-16 02:26:18 +01:00
Nuno Lopes
4e996e5d17 fix #163478: false positive in the github actions undef warning
Happened with 'undef,' -- comma not being recognized as a word boundary
2025-10-16 02:12:14 +01:00
Aiden Grossman
ed0ca8402c
[Github] Add --diff_from_common_commit to code format repro command (#163043)
This ensures that we are not including any branches on main that are not
in the current user's branch in the diff. We can add this to the command
now that --diff_from_common_commit (or at least the fixed version) has
landed in a release (21.1.1).
2025-10-12 19:14:10 -07:00
Mehdi Amini
26e370bdbe
Fix the formatting script: do not try to update a GitHub PR without checking for should_update_gh (#159276) 2025-09-26 19:59:03 +00:00
David Peixotto
c924e7a867
[workflows] Update commit access request PR links (#146169)
This PR updates the links used to show the PR contribution stats of the
user requesting commit access to the LLVM project. Previously we would
only show the PRs that were currently opened by the user because the
`/pulls/<username>` endpoint automatically applies the `is:open` filter.

The contribution guidelines suggest that the user should have at least 3
merged PRs to be considered for commit access so this seems like a
relevant data point to add.

We now show all PRs that a user has created (not just the open ones) and
a separate link for the PRs that are merged.
2025-09-25 10:35:59 -07:00
Baranov Victor
722b25114a
[Github][CI] fix invalid path in clang-tidy helper (#160014)
This path was left untouched after refactoring made in
https://github.com/llvm/llvm-project/pull/159967 which broke clang-tidy
runner.
2025-09-21 21:53:22 +00:00
Baranov Victor
2ed7b9f29b
[GitHub][CI] Add clang-tidy premerge workflow (#154829)
**KEY POINTS**

- MVP workflow to automatically lint C++ files, located **only** in
`clang-tools-extra/clang-tidy`. It's chosen this way as
`clang-tools-extra/clang-tidy` is almost 100% `clang-tidy` complaint,
thus we would automatically enforce a [high quality standard for
clang-tidy source
code](https://discourse.llvm.org/t/rfc-create-hardened-clang-tidy-config-for-clang-tidy-directory/87247).
(https://github.com/llvm/llvm-project/pull/147793)
- Implementation is very similar to code-format job, but without the
ability to run `code-lint-helper.py` locally.

**FOUND ISSUES** + open questions

- Speed: it takes ~ 1m40sec to download and unpack `clang-tidy` plus
additional ~4 mins to configure and CodeGen targets. I see that
`premerge.yaml` runs on special `llvm-premerge-linux-runners` runners
which can use `sccache` for speed. Can we use the same runners for this
job? Exact timings can be found
[here](https://github.com/llvm/llvm-project/actions/runs/17135749067/job/48611150680?pr=154223).

**TO DO**
 
- Place common components from `code-lint-helper.py` and
`code-format-helper.py` into a separate file and reuse it in both CI's.
- Compute CodeGen targets based on `projects_to_build`, for now
`clang-tablegen-targets` is hardcoded for `clang-tools-extra/`.
- Automatically generate and upload `.yaml` for
`clang-apply-replacements`
- Create an RFC with a plan how to enable `clang-tidy` in other projects
so that Maintainers of LLVM components could choose if they want
`clang-tidy` or not.
- Add more linters like `pylint`, `ruff` in the future.
2025-09-20 23:27:02 +03:00
Mehdi Amini
7949c2a931 Remove Phabricator-specific handling in pre-push.py, also don't print commits beyond 10
If you push a new branch, it would tend to explode printing all the commits.
2025-09-03 12:50:10 -07:00
Aiden Grossman
fdde57defd
[Github] Fix revisions in code format action reproducers (#155193)
This patch makes it so the revisions that the code format action returns
in its reproducers actually work when applying them locally given the
differences in how revisions are setup in CI.

Fixes #154294
2025-08-27 06:09:41 -07:00
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
Wenju He
cf2399a2ee
[CI] enable code-format-helper for .cl files (#135748)
In clang-format, OpenCL .cl file uses default C++ formatting. There are
many pull-requests in libclc project that change OpenCL files. It is
beneficial to enable clang-format for them in CI.
2025-04-16 12:34:59 +01:00
Nuno Lopes
bf0de88696 code format checker: fix python error when the diff becomes empty 2025-04-16 08:38:37 +01:00
Nuno Lopes
b416e7f592 [CI] adjust the undef warning regex so it doesn't catch %undef in .ll files 2025-04-08 16:56:38 +01:00
Benjamin Maxwell
e1fc118f3a
[CI] Reduce false positives in undef checker (#134687)
Only check for diffs containing "undef" in .ll files, this prevents
comments like `// We should not have undef values...` triggering the
undef checker bot.
2025-04-08 09:53:33 +01:00
Aaron Siddhartha Mondal
55ae118db7
[GitHub] Skip undefcheck if no relevant files changed (#126749)
If the list of filtered files was empty the check would process every
file in the diff.
2025-02-11 18:43:27 +01: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
Aiden Grossman
c84f5a9e00
[Github] Skip MIR files for undef check (#120919)
This patch skips checking files with a .mir extension for the presence
of undef. This was creating false positives that got reported on
discourse.
2024-12-24 01:09:34 -08:00
Nuno Lopes
0c629206b0 undef reviewer: tweak the regex so it doesn't warn about #undef 2024-12-20 19:48:23 +00:00
Nuno Lopes
19bc282320
Add PR check to suggest alternatives to using undef (#118506)
As discussed in
https://discourse.llvm.org/t/please-dont-use-undef-in-tests-part-2/83388,
this patch adds a comment to PRs that introduce new uses of undef.

It uses the the `git diff -S' command to find new uses, avoiding warning
about old uses. It further trims down with a regex to get only added (+)
lines.
2024-12-11 21:09:05 +00:00
Tom Stellard
0d5ae3632d
workflows/commit-access-review: Use Python APIs for graphql queries (#108903) 2024-12-06 18:34:03 -08:00
Mehdi Amini
c4aa83840b
Improve slightly the pre-commit git hook usage of the auto-format helper (#117326)
The default mode does not provide a way to see the actual failure of the
formatters without modifying the code. Instead offer the user the option
to rerun with a `FORMAT_HOOK_VERBOSE=1` environment variable to print
the actual formatting diff.
2024-11-22 16:58:12 +01:00
Tom Stellard
f14fd32602
workflows/commit-access-review: Use get_collaborators() function (#108313)
This gets us the full list of users with commit access to
llvm/llvm-project rather than the list of people in the llvm-committers
team. This will ensure we are able everyone to track everyone with
commit access in case they receive access some other way.
2024-09-16 13:37:49 -07:00
Nicolas van Kempen
c49770c60f
[NFC] Prefer subprocess.DEVNULL over os.devnull (#106500)
There is no need to support Python 2.7 anymore, Python 3.3+ has
`subprocess.DEVNULL`. This is good practice and also prevents file
handles from
staying open unnecessarily.

Also remove a couple unused or unneeded `__future__` imports.
2024-08-30 19:26:49 +01:00
Stephan T. Lavavej
7036394048
Update Python requirements to fix more CVEs (#105853)
Followup to #90109.

In Microsoft, our automated scans are warning that LLVM has vulnerable
dependencies. Specifically:

* [CVE-2024-35195](https://nvd.nist.gov/vuln/detail/CVE-2024-35195) was
fixed in `requests` 2.32.0.
* [CVE-2024-37891](https://nvd.nist.gov/vuln/detail/CVE-2024-37891) was
fixed in `urllib3` 2.2.2.

I've updated LLVM's dependencies by running the following commands in
`llvm/utils/git`:

```
pip-compile --upgrade --generate-hashes --output-file=requirements.txt requirements.txt.in
pip-compile --upgrade --generate-hashes --output-file=requirements_formatting.txt requirements_formatting.txt.in
```

Note that for `requirements_formatting.txt` this adds
`--generate-hashes` (according to my vague understanding, it's highly
desirable and was already used for `requirements.txt`) and was locally
run within `llvm/utils/git` (changing the recorded command, which
apparently was originally run from the repo root - again,
`requirements.txt` was already being regenerated with a locally run
command, so this increases consistency).

I observe that this has updated the relevant components to pick up the
CVE fixes. Note that I am largely clueless in this area, so I hope that
(like #90109) no other changes will be necessary.
2024-08-24 09:51:08 -07: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