This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 371
Replace the label checks using bash script by ruled-labels
#1576
Merged
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
06f9c27
Add rules and specs
chevdor 1b9bd11
add labels
alvicsam ca08d7e
Add new checks
chevdor 485bab8
Fix criticality check
chevdor 0d395c1
Use the new rule filter introduced in ruled-labels v0.3.0 to better t…
chevdor 2b76ad3
Add workflow to tests label rules
chevdor 22fa2f3
Fix trigger
chevdor 3fd9f9b
Add new GH Workflow
chevdor e06eb58
Don't swallow failures but allow them
chevdor 93432e2
Fix new script
chevdor aeb4d43
Simplify check
chevdor d8025e0
Fix Workflow
chevdor 40b009d
Remove dup var
chevdor b627874
Fix vars
chevdor b650e2c
Move pull image to separate step
chevdor 2f603e2
Remove continue on error
chevdor 7272cba
Show input list of labels
chevdor 7c21220
Merge remote-tracking branch 'origin/master' into wk-220829-ruled_labels
78cdc3c
Fix check-labels workflow
chevdor 068a6aa
Remove Docker -it flags
chevdor fbeb7fc
Prevent shell from splitting on spaces
chevdor 36fea89
Fix rules path
chevdor 2747a66
Comment out rules related to labels not present in the repo
chevdor a8a5802
Fix tests
chevdor f5eaa51
Fix labels specs and tests
480ff65
fix test
the-right-joyce bef76f9
new label description and rules
the-right-joyce 790010b
fix tests
the-right-joyce f4a1c60
use ruled_labels as crate
alvicsam 03445db
fix toolchain
alvicsam fcc1be9
fix component
alvicsam 768e5d7
move from docker to crate
alvicsam fa42ebb
fix test
alvicsam d5c0018
fail without labels
alvicsam 7dc0a98
add cache
alvicsam 04397d0
fix check no labels
alvicsam aa8be5b
add D-labels check
alvicsam efac3a0
fix emtpy label check
alvicsam 66f7475
try docker
alvicsam 86401c9
fix specs
alvicsam d27a373
test D label
alvicsam f4b6e7e
revert Cargo.toml
alvicsam b1fb7aa
use tags for ruled_labels
alvicsam 4be1954
fix rules
alvicsam 295acf5
test D label
alvicsam 4522dd4
fix tags
alvicsam ee5ae94
remove changes
alvicsam 79cb53a
add PR tag to single criticality rule
the-right-joyce da9b635
Merge branch 'wk-220829-ruled_labels' of https://github.com/paritytec…
the-right-joyce 71131c0
remove old line
alvicsam a55a31e
Merge branch 'master' into wk-220829-ruled_labels
alvicsam 5865d0d
test ruled_labels test
alvicsam c62ec4a
disable Check label Rules
alvicsam 713cd33
fix GHA name
alvicsam 75fc005
fix tests
alvicsam dee90ab
rename files, upd ruled_labels 0.3.2
alvicsam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: Check D labels | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [labeled, opened, synchronize, unlabeled] | ||
| paths: | ||
| - primitives/** | ||
|
|
||
| jobs: | ||
| check-labels: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
|
|
||
| - name: Pull image | ||
| env: | ||
| IMAGE: paritytech/ruled_labels:0.3.2 | ||
| run: docker pull $IMAGE | ||
|
|
||
| - name: Check labels | ||
| env: | ||
| IMAGE: paritytech/ruled_labels:0.3.2 | ||
| MOUNT: /work | ||
| GITHUB_PR: ${{ github.event.pull_request.number }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| API_BASE: https://api.github.com/repos | ||
| REPO: ${{ github.repository }} | ||
| RULES_PATH: scripts/ci/ruled_labels | ||
| CHECK_SPECS: specs.yaml | ||
| run: | | ||
| echo "REPO: ${REPO}" | ||
| echo "GITHUB_PR: ${GITHUB_PR}" | ||
|
|
||
| # Fetch the labels for the PR under test | ||
| labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",") | ||
|
|
||
| if [ -z "${labels}" ]; then | ||
| echo "No labels found. Please add labels D labels" | ||
| exit 1 | ||
| fi | ||
|
|
||
| labels_args=${labels: :-1} | ||
| printf "Checking labels: %s\n" "${labels_args}" | ||
|
|
||
| # Prevent the shell from splitting labels with spaces | ||
| IFS="," | ||
|
|
||
| # --dev is more useful to debug mode to debug | ||
| docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE check $MOUNT/$CHECK_SPECS --labels ${labels_args} --dev --tags audit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: Check label Rules | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - scripts/ci/ruled_labels/** | ||
|
|
||
| jobs: | ||
| check-label-rules: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
|
|
||
| - name: Pull image | ||
| env: | ||
| IMAGE: paritytech/ruled_labels:0.3.2 | ||
| run: docker pull $IMAGE | ||
|
|
||
| - name: Check label Rules | ||
| env: | ||
| IMAGE: paritytech/ruled_labels:0.3.2 | ||
| MOUNT: /work | ||
| RULES_PATH: scripts/ci/ruled_labels | ||
| run: | | ||
| docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE test ${MOUNT}/tests.yaml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # disabled in favor of ruled_labels tool | ||
| # name: Check labels | ||
|
|
||
| # on: | ||
| # pull_request: | ||
| # types: [labeled, opened, synchronize, unlabeled] | ||
|
|
||
|
|
||
| # jobs: | ||
| # check-labels: | ||
| # runs-on: ubuntu-latest | ||
| # steps: | ||
| # - name: Checkout sources | ||
| # uses: actions/checkout@v3 | ||
| # with: | ||
| # fetch-depth: 0 | ||
| # ref: ${{ github.event.pull_request.head.ref }} | ||
| # repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
| # - name: Check labels | ||
| # run: bash ${{ github.workspace }}/scripts/ci/github/check_labels.sh | ||
| # env: | ||
| # GITHUB_PR: ${{ github.event.pull_request.number }} | ||
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
| # BASE_SHA: ${{ github.event.pull_request.base.sha }} | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.