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

Accept T2 by B1 mention check #10

Merged
merged 3 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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