Skip to content

Commit b6512be

Browse files
gui1117alvicsam
andauthored
Make all prdoc valid and add CI job to check prdoc with prdoc check (#7543)
Some prdoc are invalid, `prdoc check` is failing for them. This also broke usage of parity-publish. This PR fixes the invalid prdoc, and add a ci job to check the prdoc are valid. I don't think the check is unstable considering it is a simple yaml check, so I put the job as required. --------- Co-authored-by: Alexander Samusev <[email protected]>
1 parent 43ea306 commit b6512be

File tree

6 files changed

+16
-281
lines changed

6 files changed

+16
-281
lines changed

.github/workflows/check-prdoc.yml

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,49 +22,33 @@ jobs:
2222
check-prdoc:
2323
runs-on: ubuntu-latest
2424
timeout-minutes: 10
25-
if: github.event.pull_request.number != ''
2625
steps:
2726
- name: Checkout repo
2827
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc #v4.1.7
29-
# we cannot show the version in this step (ie before checking out the repo)
30-
# due to https://github.com/paritytech/prdoc/issues/15
31-
- name: Check if PRdoc is required
32-
id: get-labels
28+
- name: Check prdoc format
3329
run: |
3430
echo "Pulling $IMAGE"
3531
$ENGINE pull $IMAGE
3632
37-
# Fetch the labels for the PR under test
38-
echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
39-
labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",")
40-
echo "Labels: ${labels}"
41-
echo "labels=${labels}" >> "$GITHUB_OUTPUT"
42-
4333
echo "Checking PRdoc version"
4434
$ENGINE run --rm -v $PWD:/repo $IMAGE --version
4535
46-
- name: Early exit if PR is silent
47-
if: ${{ contains(steps.get-labels.outputs.labels, 'R0') }}
48-
run: |
49-
hits=$(find prdoc -name "pr_$GITHUB_PR*.prdoc" | wc -l)
50-
if (( hits > 0 )); then
51-
echo "PR detected as silent, but a PRDoc was found, checking it as information"
52-
$ENGINE run --rm -v $PWD:/repo $IMAGE check -n ${GITHUB_PR} || echo "Ignoring failure"
53-
else
54-
echo "PR detected as silent, no PRDoc found, exiting..."
55-
fi
56-
echo "If you want to add a PRDoc, please refer to $PRDOC_DOC"
57-
exit 0
36+
echo "Check prdoc format"
37+
echo "For PRDoc format, please refer to $PRDOC_DOC"
38+
$ENGINE run --rm -v $PWD:/repo -e RUST_LOG=info $IMAGE check
5839
59-
- name: PRdoc check for PR#${{ github.event.pull_request.number }}
60-
if: ${{ !contains(steps.get-labels.outputs.labels, 'R0') }}
40+
- name: Check if PRdoc is required
41+
if: github.event.pull_request.number != ''
42+
id: get-labels
6143
run: |
62-
echo "Checking for PR#${GITHUB_PR}"
63-
echo "You can find more information about PRDoc at $PRDOC_DOC"
64-
$ENGINE run --rm -v $PWD:/repo -e RUST_LOG=info $IMAGE check -n ${GITHUB_PR}
44+
# Fetch the labels for the PR under test
45+
echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
46+
labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",")
47+
echo "Labels: ${labels}"
48+
echo "labels=${labels}" >> "$GITHUB_OUTPUT"
6549
6650
- name: Validate prdoc for PR#${{ github.event.pull_request.number }}
67-
if: ${{ !contains(steps.get-labels.outputs.labels, 'R0') }}
51+
if: ${{ github.event.pull_request.number != '' && !contains(steps.get-labels.outputs.labels, 'R0') }}
6852
run: |
6953
echo "Validating PR#${GITHUB_PR}"
7054
python3 --version

prdoc/pr_6440.prdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ doc:
66
crates:
77
- name: polkadot-node-core-pvf
88
validate: false
9+
bump: none

prdoc/pr_6455.prdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ doc:
66
crates:
77
- name: sc-network
88
validate: false
9+
bump: none

prdoc/pr_6549.prdoc

Lines changed: 0 additions & 247 deletions
This file was deleted.

prdoc/pr_6636.prdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ doc:
77
crates:
88
- name: sc-network
99
validate: false
10+
bump: none

prdoc/pr_6988.prdoc

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)