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

tidy: add triagebot checks #137885

Merged
merged 2 commits into from
Mar 9, 2025
Merged

tidy: add triagebot checks #137885

merged 2 commits into from
Mar 9, 2025

Conversation

klensy
Copy link
Contributor

@klensy klensy commented Mar 2, 2025

Validates triagebot.toml to have existing paths:

[mentions."*"] sections, i.e.

[mentions."compiler/rustc_const_eval/src/"]

or

[assign.owners]
"/.github/workflows" = ["infra-ci"]

or

trigger_files = [
 "src/librustdoc/html/static/js/search.js",
 "tests/rustdoc-js",
 "tests/rustdoc-js-std",
 ]

Looked at #137876 and implemented check.

@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 2, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2025

triagebot.toml has been modified, there may have been changes to the review queue.

cc @davidtwco, @wesleywiser

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@klensy
Copy link
Contributor Author

klensy commented Mar 2, 2025

Few errors left, how to fix them?

tidy error: triagebot.toml [mentions.*] contains path 'compiler/rustc_attr_validation' which doesn't exist
tidy error: triagebot.toml [mentions.*] contains path 'compiler/rustc_lint/src/context/diagnostics/check_cfg.rs' which doesn't exist
tidy error: triagebot.toml [assign.owners] contains path 'compiler/rustc_const_eval/src/transform' which doesn't exist

@rustbot blocked #137876 the same fix

Will add more fixes...

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 2, 2025
@rust-log-analyzer

This comment has been minimized.

@fmease
Copy link
Member

fmease commented Mar 2, 2025

tidy error: triagebot.toml [mentions.*] contains path 'compiler/rustc_attr_validation' which doesn't exist

Can be removed for now (cc #136643 (comment)).

tidy error: triagebot.toml [mentions.*] contains path 'compiler/rustc_lint/src/context/diagnostics/check_cfg.rs' which doesn't exist

Change it to compiler/rustc_lint/src/early/diagnostics/check_cfg.rs.

@klensy
Copy link
Contributor Author

klensy commented Mar 2, 2025

Added check for trigger_files and pushed fix from #137885 (comment):

tidy error: triagebot.toml [assign.owners] contains path 'compiler/rustc_const_eval/src/transform' which doesn't exist
tidy error: triagebot.toml [autolabel.A-meta] contains trigger_files path '.reuse' which doesn't exist
tidy error: triagebot.toml [autolabel.O-apple] contains trigger_files path 'library/std/src/sys/pal/unix/thread_parking/darwin.rs' which doesn't exist
tidy error: triagebot.toml [autolabel.O-wasm] contains trigger_files path 'library/std/src/os/wasm' which doesn't exist
tidy error: triagebot.toml [autolabel.T-libs] contains trigger_files path 'library/term' which doesn't exist
tidy error: triagebot.toml [autolabel.WG-trait-system-refactor] contains trigger_files path 'compiler/rustc_middle/src/traits/solve' which doesn't exist

@rust-log-analyzer

This comment has been minimized.

@fmease
Copy link
Member

fmease commented Mar 2, 2025

There's one thing to discuss:

With this check theoretically being r-l/r agnostic why don't we move it into triagebot itself? Ofc, triagebot wouldn't be able to make CI fail then (well, it could cancel it I guess lol).

For context, in the past if triagebot.toml wasn't valid TOML all checks would still pass and triagebot would essentially ignore it / no longer consider it. Triagebot (not tidy) was then changed to at least post an error message as a comment (example) but iinm it still doesn't block a PR, so hypothetically a reviewer could still miss it and approve the PR regardless.

@jieyouxu
Copy link
Member

jieyouxu commented Mar 2, 2025

I do agree it feels like the check belongs in triagebot (since it should be generalizable to repos that use triagebot), but I'm also okay with it being in tidy if it's a hassle to implement in triagebot.

cc @apiraino for vibes

@Noratrieb
Copy link
Member

Noratrieb commented Mar 2, 2025

This should make CI fail, and triagebot can't make CI fail, so needs to be in tidy. Even if conceptually the code fits more into triagebot. I would much rather merge this instead of trying very hard to figure out a solution to make this more repo agnostic. We can always put something into triagebot in the future.

@klensy
Copy link
Contributor Author

klensy commented Mar 2, 2025

Implementing checks in triagebot is right thing (and should be there), but current impl is "just works" TM.

@fmease
Copy link
Member

fmease commented Mar 2, 2025

This should make CI fail, and triagebot can't make CI fail, so needs to be in tidy

I do see that. On the other hand as I mentioned above, a PR can simply disable triagebot for the entire repository (arguably more severe than dead paths) by introducing a TOML syntax error or a schema error without it affecting CI or bors (iinm). /perfect is the enemy of good

@Noratrieb
Copy link
Member

tidy error: triagebot.toml [assign.owners] contains path 'compiler/rustc_const_eval/src/transform' which doesn't exist

you can delete this

tidy error: triagebot.toml [autolabel.A-meta] contains trigger_files path '.reuse' which doesn't exist

change to REUSE.toml

tidy error: triagebot.toml [autolabel.O-apple] contains trigger_files path 'library/std/src/sys/pal/unix/thread_parking/darwin.rs' which doesn't exist

change to library/std/src/sys/sync/thread_parking/darwin.rs

tidy error: triagebot.toml [autolabel.O-wasm] contains trigger_files path 'library/std/src/os/wasm' which doesn't exist

change to library/std/src/os/wasi and library/std/src/os/wasip2

tidy error: triagebot.toml [autolabel.T-libs] contains trigger_files path 'library/term' which doesn't exist

remove

tidy error: triagebot.toml [autolabel.WG-trait-system-refactor] contains trigger_files path 'compiler/rustc_middle/src/traits/solve' which doesn't exist

remove

@bors
Copy link
Contributor

bors commented Mar 3, 2025

☔ The latest upstream changes (presumably #137900) made this pull request unmergeable. Please resolve the merge conflicts.

@apiraino
Copy link
Contributor

apiraino commented Mar 3, 2025

This should make CI fail, and triagebot can't make CI fail, so needs to be in tidy.

This seems a convincing argument to keep this check in tidy rather than moving it to the triagebot server

@klensy
Copy link
Contributor Author

klensy commented Mar 3, 2025

@rustbot label -S-blocked
#137876 merged

@rustbot rustbot removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Mar 3, 2025
Copy link
Member

@jieyouxu jieyouxu 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 PR. I have two requests:

  1. Ensure that for rust-lang/rust this tidy check fails if triagebot.toml is missing [assign] or [mentions] sections.
  2. Squash the commits into 2: 1 commit for tidy changes, and 1 commit for triagebot.toml fixes. Or just squish everything.

@jieyouxu jieyouxu added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 3, 2025
@klensy
Copy link
Contributor Author

klensy commented Mar 5, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 5, 2025
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks!

@jieyouxu
Copy link
Member

jieyouxu commented Mar 9, 2025

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 9, 2025

📌 Commit aa72de9 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 9, 2025
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Mar 9, 2025
tidy: add triagebot checks

Validates triagebot.toml to have existing paths:

`[mentions."*"]` sections, i.e.
```toml
[mentions."compiler/rustc_const_eval/src/"]
```
or
```toml
[assign.owners]
"/.github/workflows" = ["infra-ci"]
```
or

```toml
trigger_files = [
 "src/librustdoc/html/static/js/search.js",
 "tests/rustdoc-js",
 "tests/rustdoc-js-std",
 ]
```
Looked at rust-lang#137876 and implemented check.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 9, 2025
Rollup of 16 pull requests

Successful merges:

 - rust-lang#122790 (Apply dllimport in ThinLTO)
 - rust-lang#136127 (Allow `*const W<dyn A> -> *const dyn A` ptr cast)
 - rust-lang#136968 (Turn order dependent trait objects future incompat warning into a hard error)
 - rust-lang#137147 (Add exclude to config.toml)
 - rust-lang#137319 (Stabilize `const_vec_string_slice`)
 - rust-lang#137885 (tidy: add triagebot checks)
 - rust-lang#138040 (compiler: Use `size_of` from the prelude instead of imported)
 - rust-lang#138052 (strip `-Wlinker-messages` wrappers from `rust-lld` rmake test)
 - rust-lang#138084 (Use workspace lints for crates in `compiler/`)
 - rust-lang#138158 (Move more layouting logic to `rustc_abi`)
 - rust-lang#138160 (depend more on attr_data_structures and move find_attr! there)
 - rust-lang#138192 (crashes: couple more tests)
 - rust-lang#138216 (bootstrap: Fix stack printing when a step cycle is detected)
 - rust-lang#138232 (Reduce verbosity of GCC build log)
 - rust-lang#138233 (Windows: Don't link std (and run-make) against advapi32, except on win7)
 - rust-lang#138242 (Revert "Don't test new error messages with the stage 0 compiler")

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 9, 2025
…iaskrgr

Rollup of 12 pull requests

Successful merges:

 - rust-lang#136127 (Allow `*const W<dyn A> -> *const dyn A` ptr cast)
 - rust-lang#136968 (Turn order dependent trait objects future incompat warning into a hard error)
 - rust-lang#137319 (Stabilize `const_vec_string_slice`)
 - rust-lang#137885 (tidy: add triagebot checks)
 - rust-lang#138040 (compiler: Use `size_of` from the prelude instead of imported)
 - rust-lang#138084 (Use workspace lints for crates in `compiler/`)
 - rust-lang#138158 (Move more layouting logic to `rustc_abi`)
 - rust-lang#138160 (depend more on attr_data_structures and move find_attr! there)
 - rust-lang#138192 (crashes: couple more tests)
 - rust-lang#138216 (bootstrap: Fix stack printing when a step cycle is detected)
 - rust-lang#138232 (Reduce verbosity of GCC build log)
 - rust-lang#138242 (Revert "Don't test new error messages with the stage 0 compiler")

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cdd97ba into rust-lang:master Mar 9, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 9, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 9, 2025
Rollup merge of rust-lang#137885 - klensy:tidy-triagebot, r=jieyouxu

tidy: add triagebot checks

Validates triagebot.toml to have existing paths:

`[mentions."*"]` sections, i.e.
```toml
[mentions."compiler/rustc_const_eval/src/"]
```
or
```toml
[assign.owners]
"/.github/workflows" = ["infra-ci"]
```
or

```toml
trigger_files = [
 "src/librustdoc/html/static/js/search.js",
 "tests/rustdoc-js",
 "tests/rustdoc-js-std",
 ]
```
Looked at rust-lang#137876 and implemented check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-tidy Area: The tidy tool S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants