Skip to content

Commit 625effb

Browse files
committed
Add policy for adding custom test jobs/components to rust-lang/rust CI
1 parent ed93e45 commit 625effb

File tree

4 files changed

+95
-0
lines changed

4 files changed

+95
-0
lines changed

src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
- [Resources](./compiler/resources.md)
5151
- [Review Policy](./compiler/reviews.md)
5252
- [Proposals, Approval and Stabilization](./compiler/proposals-and-stabilization.md)
53+
- [Adding custom test jobs/components to rust-lang/rust CI](./compiler/proposals-and-stabilization/custom-test-jobs.md)
5354
- [Third-party and Out-of-tree Crates Policy](./compiler/third-party-out-of-tree.md)
5455
- [Triage and Prioritization](./compiler/prioritization.md)
5556
- [Operations](./compiler/operations.md)

src/compiler/proposals-and-stabilization.md

+6
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,15 @@ circumstance.
329329
- **Approve using:** r+ (compiler leads)
330330
- Open a PR with the change affecting licensing and assign it to the team leads for review
331331

332+
### Adding new custom test jobs/components to rust-lang/rust CI
333+
334+
See [Adding custom test jobs or adding custom test components to rust-lang/rust CI](./proposals-and-stabilization/custom-test-jobs.md).
335+
336+
332337
[stabilization_guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html
333338
[tier_policy]: https://doc.rust-lang.org/rustc/target-tier-policy.html
334339
[mcps]: https://github.com/rust-lang/compiler-team/issues?q=label%3Amajor-change
335340
[rfcs]: https://github.com/rust-lang/rfcs
336341
[rust]: https://github.com/rust-lang/rust
337342
[compiler_lint_eg]: https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#explicit-builtin-cfgs-in-flags
343+
[ecosystem_testing]: https://rustc-dev-guide.rust-lang.org/tests/ecosystem.html
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Adding custom test jobs or adding custom test components to rust-lang/rust CI
2+
3+
## Scope
4+
5+
This policy is applicable to proposals for adding new test jobs or adjusting existing test jobs to build additional custom things that are *not* shipped to the end users, but may still cause [rust-lang/rust] PR CI or Full CI (the "CI") to fail, or produce a failure message, which may impact compiler/library/tools contributors who also use the [rust-lang/rust] CI.
6+
7+
For example, this includes but is not limited to:
8+
9+
- Ecosystem test jobs, such as Rust for Linux or Fuchsia;
10+
- Custom codegen backend test components, such as `codegen_cranelift` or `codegen_gcc`, which are not part of the "main" distributed toolchain.
11+
12+
## Background
13+
14+
[rust-lang/rust] runs a small set of test (and build) jobs on PR CI (faster, less expensive/exhaustive), and runs a much larger set of test (and build) jobs on Full CI. PR CI usually takes around an hour, while Full CI usually takes around 3 hours. Having test jobs that:
15+
16+
- may spuriously fail; or
17+
- may genuinely fail but it's not clear who should be consulted about the failure or who is responsible for fixing the failure; or
18+
- otherwise do not have well documented test job maintainers and failure protocol;
19+
20+
can introduce a lot of friction and frustration for other contributors who now will have to deal with the failure or understand why the test job failed in the first place, which may now be blocking their PR. Everyone utilizing the [rust-lang/rust] CI is expected to use it responsibly.
21+
22+
To help with this, please follow the process described below if you'd like to propose adding a custom test job/component to the [rust-lang/rust] CI, and copy and fill out the Custom Test Job/Component Policy.
23+
24+
## Process for adding a custom test job to rust-lang/rust CI
25+
26+
![Flowchart of the process for adding a custom test job/component to rust-lang/rust CI](./custom-test-jobs/test-job-flow.png)
27+
28+
## Custom Test Job/Component Template
29+
30+
*Please copy and fill out this template as part of the MCP.*
31+
32+
The proposed custom test job or custom test component for the [rust-lang/rust] CI must:
33+
34+
- Be approved by the compiler team through a proposed Major Change Proposal (MCP), where the MCP is seconded by a compiler team member, and the MCP being accepted with no blocking concerns.
35+
- Have no blocking concerns from the library team by creating an issue on [rust-lang/rust] proposing to add the custom test job/component to [rust-lang/rust] CI linking to the MCP, and nominating the issue for review by the library team via `@rustbot label +I-libs-nominated`.
36+
- Have the implementation PR be reviewed and approved by the infrastructure team, linking to the MCP and issue.
37+
- Be properly documented on [rustc-dev-guide] (preferably as part of the implementation PR), linking to the MCP and issue.
38+
39+
### Test job/component rationale
40+
41+
- What does this custom test job/component do?
42+
- What [rust-lang/rust] changes can potentially break the custom test job/component? E.g. changes to rustc, standard library, bootstrap or tools (like clippy/rustfmt/cargo).
43+
- Why does this custom test job/component need to be part of the [rust-lang/rust] PR and/or Full Merge CI?
44+
- If the custom test job/component will block on failure, why does it need to block?
45+
- If the custom test job/component will not block on failure initially but is intended to eventually become blocking, why so? And when will it become blocking?
46+
47+
### Test job/component maintainers
48+
49+
The proposed custom test job/component for [rust-lang/rust] CI must have at least one dedicated maintainer. The test job/component maintainers understand that they will be pinged or otherwise contacted about the custom test job/component, particularly for (but not limited to) its failures. Please list who will be maintaining this test job/component here.
50+
51+
**We, the custom test job/component maintainers, acknowledge and consent that we will be pinged about the custom test job/component failures or be consulted about it in general.**
52+
53+
### Failure protocol: what to do if the job/component breaks/fails?
54+
55+
- How can the test job/component maintainers be contacted in case of failure?
56+
- If the addition of a custom test job is being proposed:
57+
- How can the test job be run in CI? If so, is there a try job (`try-job: ...`) invocation? What's the job name?
58+
- Can the test job be run locally? If so, how?
59+
- If the addition of a custom test component is being proposed:
60+
- Which existing CI jobs will be building and testing this custom test component? Will they be built and ran as part of a try job? If so, what are the job names and the try job (`try-job: ...`) invocation?
61+
- Can the test component be built and run locally? If so, how?
62+
- How can the custom test job/component be disabled in the event of spurious failures that are blocking PR and/or Full Merge CI?
63+
- Will the `rust-log-analyzer` failure message include a link to the custom test job/component page in [rustc-dev-guide]?
64+
65+
For both custom test jobs/components:
66+
67+
- Is there a ping group or zulip channel/topic that can be used to notify the test job/component maintainers about a test job/component failure?
68+
- If a PR breaks the test job/component:
69+
- If the breakage seems **spurious** and retrying does not resolve the spurious breakage, the test job will be **temporarily disabled** (see below).
70+
- If the breakage is **intentional**, how will this be resolved?
71+
- If the breakage is **unintentional**, is the PR author expected to fix the breakage?
72+
73+
**We, the test job/component maintainers, acknowledge and understand that the custom test job/component may be temporarily disabled to unblock [rust-lang/rust] PR CI or Full Merge CI without receiving prior approval from the test job/component maintainers, but the test job/component maintainers will be pinged or otherwise notified about the test job/component being disabled.**
74+
75+
### Dependencies, build/test environments and reliability
76+
77+
- Does the test job involve any custom build systems that are not used in the regular [rust-lang/rust] CI jobs?
78+
- Does the test job depend on external resources (e.g. external servers) that may be subject to network connectivity?
79+
- If so, does the infrastructure team need to help maintain a mirror of the required assets?
80+
- Are there any other unusual requirements (build environment, dependencies, etc.)?
81+
82+
### CI infrastructure considerations
83+
84+
- Does the custom test job/component require substantial CI resources (storage and/or CI time)?
85+
86+
87+
[rust-lang/rust]: https://github.com/rust-lang/rust
88+
[rustc-dev-guide]: https://github.com/rust-lang/rustc-dev-guide
Loading

0 commit comments

Comments
 (0)