Skip to content

Commit

Permalink
Merge pull request #10 from paritytech/oty-t2
Browse files Browse the repository at this point in the history
Accept `T2` by `B1` mention check
  • Loading branch information
ggwpez authored Jan 27, 2023
2 parents 7eeb238 + 3b76e38 commit 7b92cbf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 15 deletions.
6 changes: 3 additions & 3 deletions ruled_labels/specs_cumulus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ rules:
when: !one_of [B1]
require: !one_of [C*]

- name: Release mentions need a topic "node" or "runtime"
id: require_t0_or_t1_when_b1
- name: Release mentions need a topic "node", "runtime" or "API"
id: require_t_when_b1
tags: [PR]
spec:
when: !one_of [B1]
require: !one_of [T0, T1]
require: !one_of [T0, T1, T2]

- name: Release mentions can have several topics
id: allow_multiple_t_when_b1
Expand Down
6 changes: 3 additions & 3 deletions ruled_labels/specs_polkadot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ rules:
when: !one_of [B1]
require: !one_of [C*]

- name: Release mentions need a topic "node" or "runtime"
id: require_t0_or_t1_when_b1
- name: Release mentions need a topic "node", "runtime" or "API"
id: require_t_when_b1
tags: [PR]
spec:
when: !one_of [B1]
require: !one_of [T0, T1]
require: !one_of [T0, T1, T2]

- name: Release mentions can have several topics
id: allow_multiple_t_when_b1
Expand Down
20 changes: 16 additions & 4 deletions ruled_labels/tests_cumulus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,32 @@ specs:

- name: Fail - Release need a topic.
filter:
id: [ require_t0_or_t1_when_b1 ]
id: [ require_t_when_b1 ]
labels: [ B1, D1 ]
expected: false

- name: Pass - Release has a topic.
- name: Pass - Release has T0 as topic.
filter:
id: [ require_t0_or_t1_when_b1 ]
id: [ require_t_when_b1 ]
labels: [ B1, D1, T0 ]
expected: true

- name: Pass - Release has T1 as topic.
filter:
id: [ require_t_when_b1 ]
labels: [ B1, D1, T1 ]
expected: true

- name: Pass - Release has T2 as topic.
filter:
id: [ require_t_when_b1 ]
labels: [ B1, D1, T2 ]
expected: true

- name: Pass - PR has multiple topics
filter:
id: [ allow_multiple_t_when_b1 ]
labels: [ B1, T0, T7, D1 ]
labels: [ B1, T0, T2, T7, D1 ]
expected: true

- name: Fail - Only one criticality label allowed
Expand Down
22 changes: 17 additions & 5 deletions ruled_labels/tests_polkadot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,32 @@ specs:

- name: Fail - Release need a topic.
filter:
id: [ require_t0_or_t1_when_b1 ]
id: [ require_t_when_b1 ]
labels: [ B1, D1 ]
expected: false

- name: Pass - Release has a topic.
- name: Pass - Release has T0 as topic.
filter:
id: [ require_t0_or_t1_when_b1 ]
id: [ require_t_when_b1 ]
labels: [ B1, D1, T0 ]
expected: true

- name: Pass - Release has T1 as topic.
filter:
id: [ require_t_when_b1 ]
labels: [ B1, D1, T1 ]
expected: true

- name: Pass - Release has T2 as topic.
filter:
id: [ require_t_when_b1 ]
labels: [ B1, D1, T2 ]
expected: true

- name: Pass - PR has multiple topics
filter:
id: [ allow_multiple_t_when_b1 ]
labels: [ B1, T0, T7, D1 ]
labels: [ B1, T0, T2, T7, D1 ]
expected: true

- name: Fail - Only one criticality label allowed
Expand All @@ -66,4 +78,4 @@ specs:
filter:
id: [ single_s ]
labels: [ B1, S1, S3 ]
expected: false
expected: false

0 comments on commit 7b92cbf

Please sign in to comment.