Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 06f9c27

Browse files
committed
Add rules and specs
1 parent 05abc1a commit 06f9c27

File tree

4 files changed

+269
-0
lines changed

4 files changed

+269
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
DIR=$(dirname -- "$0")
4+
5+
# This is the new version using `ruled-labels`
6+
repo="$GITHUB_REPOSITORY"
7+
pr="$GITHUB_PR"
8+
9+
pushd "$DIR/../ruled_labels" > /dev/null
10+
11+
# TODO: Fetch the labels for the PR under test
12+
labels=("B0-Silent" "X1-Runtime" "P1" "D1-audited 👍")
13+
14+
ruled-labels --version
15+
ruled-labels check --labels "${labels[@]}"

scripts/ci/ruled_labels/specs.yaml

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
---
2+
name: paritytech/cumulus
3+
description: Import from paritytech/cumulus
4+
version: 0.0.1
5+
labels:
6+
- name: A0-please_review
7+
description: Pull request needs code review.
8+
color: "666666"
9+
- name: A1-needs_burnin
10+
description: Pull request needs to be tested on a live validator node before merge. DevOps is notified via matrix
11+
color: c7def8
12+
- name: A2-insubstantial
13+
description: "Pull request requires no code review (e.g., a sub-repository hash update)."
14+
color: C6C7F8
15+
- name: A3-in_progress
16+
description: Pull request is in progress. No review needed at this stage.
17+
color: DBC6F8
18+
- name: A4-companion
19+
description: A PR that should be considered alongside another (usually more comprehensive and detailed) PR.
20+
color: F8C5E7
21+
- name: A5-stale
22+
description: Pull request did not receive any updates in a long time. No review needed at this stage. Close it.
23+
color: F2C5F8
24+
- name: A6-backport
25+
description: Pull request is already reviewed well in another branch.
26+
color: F8C5E7
27+
- name: B0-silent
28+
description: Changes should not be mentioned in any release notes
29+
color: F8C4D0
30+
- name: B1-note_worthy
31+
description: Changes should be noted in the release notes
32+
color: f9d0c4
33+
- name: C1-low
34+
description: "Elevates a release containing this PR to \"low priority\"."
35+
color: fcdfc3
36+
- name: C3-medium
37+
description: "Elevates a release containing this PR to \"medium priority\"."
38+
color: FFE9C0
39+
- name: C5-high
40+
description: "Elevates a release containing this PR to \"high priority\"."
41+
color: fef2c0
42+
- name: C7-critical
43+
description: "Elevates a release containing this PR to \"critical priority\"."
44+
color: fef2c0
45+
- name: D1-audited 👍
46+
description: PR contains changes to fund-managing logic that has been properly reviewed and externally audited.
47+
color: C0E7CC
48+
- name: D2-notlive 💤
49+
description: PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
50+
color: C209B4
51+
- name: D3-trivial 🧸
52+
description: PR contains trivial changes in a runtime directory that do not require an audit
53+
color: 5EDFEE
54+
- name: D5-nicetohaveaudit ⚠️
55+
description: PR contains trivial changes to logic that should be properly reviewed.
56+
color: c5def5
57+
- name: D9-needsaudit 👮
58+
description: PR contains changes to fund-managing logic that should be properly reviewed and externally audited
59+
color: C3EDC0
60+
- name: E0-runtime_migration
61+
description: PR introduces code that might require downstream chains to run a runtime upgrade.
62+
color: c2e0c6
63+
- name: E1-database_migration
64+
description: PR introduces code that does a one-way migration of the database.
65+
color: f4f5f9
66+
- name: E2-dependencies
67+
description: Pull requests that update a dependency file.
68+
color: f2f9f2
69+
- name: E3-host_functions
70+
description: PR adds new host functions which requires a node release before a runtime upgrade.
71+
color: f9f2f2
72+
- name: E4-node_first_update
73+
description: This is a runtime change that will require all nodes to be update BEFORE the runtime upgrade.
74+
color: e8d7d7
75+
- name: F0-breaks_everything
76+
description: "This change breaks the underlying networking, sync or related and thus will cause a fork."
77+
color: bdadad
78+
- name: F1-breaks_authoring
79+
description: This change breaks authorities or authoring code.
80+
color: e99695
81+
- name: F2-breaks_consensus
82+
description: This change breaks consensus or consensus code.
83+
color: "5319e7"
84+
- name: F3-breaks_API
85+
description: This PR changes public API; next release should be major.
86+
color: cdadad
87+
- name: I0-consensus
88+
description: Issue can lead to a consensus failure.
89+
color: f6d9e9
90+
- name: I1-panic
91+
description: The node panics and exits without proper error handling.
92+
color: 17b25d
93+
- name: I10-enhancement
94+
description: An additional feature request.
95+
color: c2e0c6
96+
- name: I11-meta
97+
description: A specific issue for grouping tasks or bugs of a specific category.
98+
color: a2eeef
99+
- name: I12-unconfirmed
100+
description: "Issue might be valid, but it's not yet known."
101+
color: "000000"
102+
- name: I13-intended
103+
description: Issue describes a behavior which turns out to work as intended. Closer should explain why.
104+
color: b10d11
105+
- name: I14-duplicate
106+
description: Issue is a duplicate. Closer should comment with a link to the duplicate.
107+
color: D62209
108+
- name: I15-wont_fix
109+
description: "Issue is in principle valid, but this project will not address it. Closer should explain why."
110+
color: FB3701
111+
- name: I16-invalid
112+
description: Issue is invalid. Closer should comment why.
113+
color: F76E02
114+
- name: I2-security
115+
description: "The node fails to follow expected, security-sensitive, behaviour."
116+
color: d93f0b
117+
- name: I3-bug
118+
description: The node fails to follow expected behavior.
119+
color: "249899"
120+
- name: I4-annoyance
121+
description: "The node behaves within expectations, however this “expected behaviour” itself is at issue."
122+
color: D6075D
123+
- name: I5-tests
124+
description: "Tests need fixing, improving or augmenting."
125+
color: 6C9C98
126+
- name: I6-documentation
127+
description: "Documentation needs fixing, improving or augmenting."
128+
color: f48a75
129+
- name: I7-refactor
130+
description: Code needs refactoring.
131+
color: 0075ca
132+
- name: I8-footprint
133+
description: "An enhancement to provide a smaller (system load, memory, network or disk) footprint."
134+
color: "000000"
135+
- name: I9-optimisation
136+
description: An enhancement to provide better overall performance in terms of time-to-completion for a task.
137+
color: c5def5
138+
- name: S0-design
139+
description: Issue is in the design stage.
140+
color: f3a603
141+
- name: S1-implement
142+
description: Issue is in the implementation stage.
143+
color: fbca04
144+
- name: S2-test/monitor
145+
description: Issue is in the testing stage.
146+
color: dbea04
147+
- name: S3-deploy
148+
description: Issue is in the deployment stage
149+
color: 34C302
150+
- name: S4-blocked
151+
description: "Issue is blocked, see comments for further information."
152+
color: "122381"
153+
- name: T0-polkadot
154+
description: This PR/Issue is related to Polkadot.
155+
color: ffeeee
156+
- name: T1-smart_contracts
157+
description: This PR/Issue is related to smart contracts.
158+
color: 0C7BAD
159+
- name: T2-parachains
160+
description: This PR/Issue is related to Parachains.
161+
color: 0052cc
162+
- name: T3-release
163+
description: This PR/Issue is related to topics touching the release notes.
164+
color: 0052cc
165+
- name: T4-statemint
166+
description: This PR/Issue is related to Statemint
167+
color: 86e62a
168+
- name: T5-CGP
169+
description: This PR/Issue is related to Common Good Parachains.
170+
color: BFDADC
171+
- name: T6-XCM
172+
description: This PR/Issue is related to XCM.
173+
color: d4c5f9
174+
- name: T7-substrate
175+
description: This is an issue that needs to be implemented upstream in Substrate.
176+
color: 1d76db
177+
- name: U0-drop_everything
178+
description: Everyone should address the issue now.
179+
color: "5319e7"
180+
- name: U1-asap
181+
description: "No need to stop dead in your tracks, however issue should be addressed as soon as possible."
182+
color: fff4ed
183+
- name: U2-some_time_soon
184+
description: Issue is worth doing soon.
185+
color: b60205
186+
- name: U3-nice_to_have
187+
description: Issue is worth doing eventually.
188+
color: FFF7ED
189+
- name: U4-some_day_maybe
190+
description: Issue might be worth doing eventually.
191+
color: fffbed
192+
- name: X0-node
193+
description: This PR/Issue is related to the topic “node”.
194+
color: fbffe0
195+
- name: X1-runtime
196+
description: This PR/Issue is related to the topic “runtime”.
197+
color: F5FCE6
198+
- name: X2-API
199+
description: This PR/Issue is related to APIs.
200+
color: 009B40
201+
202+
rules:
203+
- name: Require a release label (B)
204+
spec:
205+
require: !one_of [ B* ]
206+
207+
- name: Runtimes require an audit Label
208+
when: !one_of [ X1 ]
209+
spec:
210+
require: !one_of [ D* ]
211+
212+
- name: Release need priorities
213+
when: !one_of [ B1 ]
214+
spec:
215+
require: !one_of [ P* ]
216+
217+
- name: Release require some topics
218+
when: !one_of [ B1 ]
219+
spec:
220+
require: !some_of [ X* ]

scripts/ci/ruled_labels/test.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
DIR=$(dirname -- "$0")
4+
unset RUST_LOG
5+
6+
pushd "$DIR" > /dev/null
7+
8+
ruled-labels --version
9+
ruled-labels test
10+
11+
popd > /dev/null

scripts/ci/ruled_labels/tests.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Cumulus ruled-labels test cases
2+
spec_file: specs.yaml
3+
4+
specs:
5+
- name: Pass - Pass all
6+
labels: [ B1, P1, D1, X1 ]
7+
expected: true
8+
9+
- name: Fail - Require release label
10+
labels: [ A1 ]
11+
expected: false
12+
13+
- name: Fail - Runtimes require an audit Label
14+
labels: [ X1, B1, P1 ]
15+
expected: false
16+
17+
- name: Fail - Release need priorities
18+
labels: [ B1, X1, D1 ]
19+
expected: false
20+
21+
- name: Fail - Release require some topics
22+
labels: [ B1, P1, D1 ]
23+
expected: false

0 commit comments

Comments
 (0)