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

auto-bless tests/formatting on rust-lang/rust #760

Open
Mark-Simulacrum opened this issue Aug 12, 2020 · 6 comments
Open

auto-bless tests/formatting on rust-lang/rust #760

Mark-Simulacrum opened this issue Aug 12, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@Mark-Simulacrum
Copy link
Member

This is intended to be somewhat compatible with other repositories wishing to do the same, but for now it is reasonable to hardcode assumptions that can be made for rust-lang/rust.

I believe these are reasonable steps to making this work:

Adjust compiletest to have a --bless-into $DIR flag which acts like --bless but writes new files at a different root (e.g., if editing src/test/ui/issue-3433.stderr, we'd instead save to $DIR/src/test/ui/issue-3433.stderr). It should not change the status reported by tests, merely write new files (i.e., it is safe to always pass this on CI).

We will want to do the same for rustfmt blessing; it is not entirely clear what the best way to do this is though. We wouldn't want to write all files to the new directory, just those that have changed when rustfmt is applied.

Once both of these are done, we will want to fetch this directory from CI somehow. I suspect we want this to be in the PR CI job so that everyone can use it (vs. waiting for bors to fail, which seems suboptimal). Eventually we'll want to add to the bors builders as well, so that all bless-able failures can be resolved via this bot.

This is somewhat hard -- we can't readily grant PR CI keys to write into an S3 bucket or anything like that. I suspect that a good way to do this might be GitHub Action's artifacts. AFAICT, we get a unique location guaranteed by GitHub via these artifacts so they should be safe to use.

Once all of that is done, we will already have a manual way to bless without building Rust: download the zip file from GHA, and "merge" in the new files locally, and push up a commit. This step can be automated via triagebot as well without too much trouble (though identifying the workflow ID is IIRC annoying).

@Mark-Simulacrum
Copy link
Member Author

@lcnr you expressed interested in working on this, so pinging you.

@jyn514
Copy link
Member

jyn514 commented Aug 12, 2020

"merge" in the new files locally

We shouldn't need to merge the files, just overwrite them with the new ones, right?

@Mark-Simulacrum
Copy link
Member Author

Right, yes, I just mean that the downloaded zipfile contains a subset of the files rather than all of them.

@lcnr
Copy link

lcnr commented Sep 5, 2020

Adjust compiletest to have a --bless-into $DIR flag which acts like --bless but writes new files at a different root (e.g., if editing src/test/ui/issue-3433.stderr, we'd instead save to $DIR/src/test/ui/issue-3433.stderr). It should not change the status reported by tests, merely write new files (i.e., it is safe to always pass this on CI).

We already save these files to /build/x86_64-unknown-linux-gnu/test/ui/, so it might make sense to instead just read them from there 🤔 Is there something that makes using these files more difficult than writing them in a seperate dir?

@Mark-Simulacrum
Copy link
Member Author

Well, no, not particularly - that should be fine. It might be a bit more annoying to construct that path on different builders, but probably not too hard - we really only need 1 or 2 builders for pretty complete coverage anyway.

@lcnr
Copy link

lcnr commented Sep 18, 2020

Looks like this is slightly too complex for me to implement with my current time budget, so if someone else in interested in picking this up, please do! 😬

@ehuss ehuss added the enhancement New feature or request label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants