Repository navigation
docs(jira-poll): say what changes when an adopter upgrades the poller #9918
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
base: main
Are you sure you want to change the base?
Changes from all commits
527843f
e0d3663
c060643
f2c408c
a8cfc1c
95d4ad7
c999cae
71112a5
5d27b04
6635f32
ea42aab
a85a142
34f1a18
fa9fcb0
094cc3b
afeda2c
048b710
00f8edb
2d83300
a772539
01d47ae
ede31d1
0d65b81
5847e8c
870f3e7
c17b58a
60dbfaa
07a34db
73eac9c
f84ccd8
ce247e9
2fa4335
5814593
d94f734
bf9f4b2
abd309f
ca2a217
f32dd09
3607b26
c5bc2b0
ff8b695
ed3327b
d073774
16452f2
331b388
6d55115
acbb149
10aa206
4efe05c
f762837
28eb759
62758e2
dfaec9d
1d5efef
e531a50
1c62fe1
f9b935c
f96a418
11a5701
fbcf082
500a18b
0a619f0
cd9d329
c696b96
04b0aad
dc645d8
d6c90b6
bfd514e
6d040b0
c6b252a
abef7cc
cfd8196
875ac79
423d60c
9905ace
577e263
b6933a0
d4b4fc2
b2d6362
473a3b3
bf616ac
408d177
5177b6f
7b311fa
1216ae9
bf8aafc
191c0d7
ee0693e
a81de2a
b56a622
3dbd497
e08d9c0
f0b27ce
7727f0f
632838e
01a6293
e37973b
b3b6024
194ca1f
94672e4
29f4acc
1fb717e
2340925
df8e164
10d59c7
4950714
437fec4
c0d2d4c
e52b104
015755c
d226986
f9a7ed2
9f04b42
b5e4b01
22151d0
6aaaab7
dc4240d
c9e1aa3
c9c4df3
820d2b8
61aa0df
277a2c8
92c5078
3fbbdfc
ae9e9de
1569617
5b699fd
8827fae
48c7b23
4f0e8d7
57ef4f1
c177c77
dae1b92
3252a73
09ca7f9
6da70d4
83ab462
df6db02
f30318d
7db2b2a
07582e1
8ff4790
dff9273
50cdf0a
d80f8ba
2030ac4
299e2f0
eebfb8c
9c8477a
ad87462
46adaeb
3022814
9c87e7e
96699c2
473e176
eb0498f
59289b6
352b540
c389854
9a79d9a
42af816
5b3e07e
5c39ad6
08f5134
d77c60f
f2eab48
b66e01c
6df1f09
5140bb0
96805f5
aca40b6
3d9df68
6023b1a
bf69ebd
955fd10
8d4ed37
a10ec16
8b970d4
2ec3341
1c73a81
50a8999
20982f4
42a15a0
e1bf398
5ffdb8e
f821b61
c964f48
e247b90
ead3b82
77b2215
bbac702
4263bda
73f09ab
e7c794f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| #!/usr/bin/env bash | ||
| # jira-poll-record-digest-test.sh — digest and workflow-contract tests for the | ||
| # Jira poll batch check. | ||
| # | ||
| # The batch check is only evidence while its stand-in workflows hand the | ||
| # batch over the way the real ones do. The contract cases below fail when the | ||
| # real hand-off changes and the stand-ins do not follow. | ||
| # | ||
| # Run from the repo root: | ||
| # bash .github/scripts/jira-poll-record-digest-test.sh | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| SCRIPT="${SCRIPT_DIR}/jira-poll-record-digest.sh" | ||
| WORKFLOWS="${SCRIPT_DIR}/../workflows" | ||
| TEMPLATE="${SCRIPT_DIR}/../../internal/scaffold/fullsend-repo/templates/jira-poll-per-repo.yaml" | ||
|
|
||
| fail() { echo "FAIL: $*" >&2; exit 1; } | ||
| contains() { grep -Fq -- "$2" "$1" || fail "${1} does not contain ${2}"; } | ||
| digest() { printf '%s' "$1" | "${SCRIPT}"; } | ||
|
|
||
| # The digest is of the content, not of how the JSON is written. | ||
| want="$(digest '{"agent":"triage","event_payload":{"body":"a<b 語","n":7}}')" | ||
| [[ "${want}" =~ ^[0-9a-f]{64}$ ]] || fail "digest is not a SHA-256: ${want}" | ||
|
|
||
| reordered="$(digest '{ | ||
| "event_payload": { | ||
| "n": 7, | ||
| "body": "a<b 語" | ||
| }, | ||
| "agent": "triage" | ||
| }')" | ||
| [[ "${reordered}" == "${want}" ]] || fail "key order and whitespace changed the digest" | ||
|
|
||
| escaped="$(digest '{"agent":"triage","event_payload":{"body":"a<b 語","n":7}}')" | ||
| [[ "${escaped}" == "${want}" ]] || fail "escaping a character changed the digest" | ||
|
|
||
| changed="$(digest '{"agent":"triage","event_payload":{"body":"a<b 語","n":8}}')" | ||
| [[ "${changed}" != "${want}" ]] || fail "a changed value kept the digest" | ||
|
|
||
| truncated="$(digest '{"agent":"triage","event_payload":{"body":"a<b ","n":7}}')" | ||
| [[ "${truncated}" != "${want}" ]] || fail "a shortened string kept the digest" | ||
|
|
||
| if digest '{"agent":' >/dev/null 2>&1; then | ||
| fail "input that is not JSON produced a digest" | ||
| fi | ||
|
|
||
| # The poll stand-in builds the matrix output in the real workflow's matrix | ||
| # job, which differs only in taking its runner and timeout from inputs. | ||
| matrix_job() { awk '/^ matrix:$/ { on = 1 } on && !/^ (runs-on|timeout-minutes): /' "$1"; } | ||
| real_job="$(matrix_job "${WORKFLOWS}/reusable-poll-jira.yml")" | ||
| [[ -n "${real_job}" ]] || fail "reusable-poll-jira.yml has no matrix job" | ||
| [[ "$(matrix_job "${WORKFLOWS}/jira-poll-batch-check-poll.yml")" == "${real_job}" ]] || | ||
| fail "the matrix job of jira-poll-batch-check-poll.yml differs from reusable-poll-jira.yml" | ||
|
|
||
| # Both return that job's output, and feed the job from the poll job's | ||
| # artifact under the same name. | ||
| for workflow in reusable-poll-jira.yml jira-poll-batch-check-poll.yml; do | ||
| contains "${WORKFLOWS}/${workflow}" "value: \${{ jobs.matrix.outputs.matrix || '{\"include\":[]}' }}" | ||
| contains "${WORKFLOWS}/${workflow}" 'dispatch_count: ${{ steps.check.outputs.count }}' | ||
| contains "${WORKFLOWS}/${workflow}" 'name: fullsend-jira-dispatches-${{ steps.check.outputs.artifact_suffix }}' | ||
| done | ||
|
|
||
| # The caller hands the matrix on under the managed caller's condition. | ||
| # A file without the line gives an empty condition, so the checks below | ||
| # report it; under pipefail a bare grep miss would end the script first. | ||
| condition() { grep -F 'fromJSON(needs.poll.outputs.matrix)' "$1" | sed 's/^[[:space:]]*//' || true; } | ||
| real_condition="$(condition "${TEMPLATE}")" | ||
| [[ -n "${real_condition}" ]] || fail "jira-poll-per-repo.yaml has no dispatch condition" | ||
| [[ "$(condition "${WORKFLOWS}/jira-poll-batch-check.yml")" == "${real_condition}" ]] || | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [medium] pattern-inconsistency Previously reported finding remains open: medium pattern-inconsistency in .github/scripts/jira-poll-record-digest-test.sh:69. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) A later review found this finding fixed at commit 3022814; the newer thread explains why. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [medium] pattern-inconsistency Previously reported finding remains open: medium pattern-inconsistency in .github/scripts/jira-poll-record-digest-test.sh:69. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: a later review found this finding fixed at commit 3022814. Why: A missing dispatch condition now reaches the explicit fail check instead of ending the script early. Evidence: jira-poll-record-digest-test.sh line 68 adds Resolving this thread. Unresolve it if you disagree. |
||
| fail "the dispatch condition of jira-poll-batch-check.yml differs from jira-poll-per-repo.yaml" | ||
| for caller in "${TEMPLATE}" "${WORKFLOWS}/jira-poll-batch-check.yml"; do | ||
| contains "${caller}" 'matrix: ${{ needs.poll.outputs.matrix }}' | ||
| done | ||
|
|
||
| # The real dispatch workflow still takes the matrix as a string input and | ||
| # makes one job of each record, which the dispatch stand-in copies. | ||
| contains "${WORKFLOWS}/reusable-dispatch.yml" 'matrix: ${{ fromJSON(inputs.matrix != '"''"' && inputs.matrix || ' | ||
| contains "${WORKFLOWS}/reusable-dispatch.yml" 'EVENT_PAYLOAD: ${{ toJSON(matrix.event_payload) }}' | ||
| contains "${WORKFLOWS}/jira-poll-batch-check-dispatch.yml" 'matrix: ${{ fromJSON(inputs.matrix) }}' | ||
| contains "${WORKFLOWS}/jira-poll-batch-check-dispatch.yml" 'RECORD: ${{ toJSON(matrix) }}' | ||
|
|
||
| echo "jira poll record digest and workflow-contract tests passed" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env bash | ||
| # jira-poll-record-digest.sh — Print the SHA-256 of one dispatch record | ||
| # | ||
| # Reads a JSON value on stdin and hashes its canonical form: keys sorted, no | ||
| # insignificant whitespace, strings written the way jq writes them. The Jira | ||
| # poll batch check (.github/workflows/jira-poll-batch-check.yml) hashes each | ||
| # record when it builds the batch and again in the matrix job that receives | ||
| # it. GitHub parses and re-serializes the record on the way, so the bytes | ||
| # differ, and the two digests agree only when the content is the same. | ||
| # | ||
| # Usage: jira-poll-record-digest.sh < record.json | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| jq -cSj . | sha256sum | awk '{print $1}' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Dispatch side of the Jira poll batch check (jira-poll-batch-check.yml). | ||
| # | ||
| # Stands in for the harness-run job of reusable-dispatch.yml. It takes the | ||
| # matrix as a string input and turns it into one job per record with | ||
| # fromJSON(inputs.matrix), as that job does. Each job hashes the record it | ||
| # received and looks the digest up among the digests of the batch, where the | ||
| # real job would run an agent. | ||
| name: Jira poll batch check (dispatch) | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| matrix: | ||
| description: Dispatch matrix, as reusable-dispatch.yml takes it. | ||
| type: string | ||
| required: true | ||
| digests: | ||
| description: JSON array with the digest of every record of the batch. | ||
| type: string | ||
| required: true | ||
|
|
||
| jobs: | ||
| record: | ||
| name: Record ${{ strategy.job-index }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJSON(inputs.matrix) }} | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 5 | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout the digest script | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| sparse-checkout: | | ||
| .github/scripts/jira-poll-record-digest.sh | ||
| sparse-checkout-cone-mode: false | ||
|
|
||
| - name: Compare the record with the batch | ||
| env: | ||
| RECORD: ${{ toJSON(matrix) }} | ||
| DIGESTS: ${{ inputs.digests }} | ||
| INDEX: ${{ strategy.job-index }} | ||
| run: | | ||
| set -euo pipefail | ||
| digest=$(printf '%s' "${RECORD}" | .github/scripts/jira-poll-record-digest.sh) | ||
| if ! jq -e --arg digest "${digest}" 'index($digest) != null' <<<"${DIGESTS}" > /dev/null; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] test-inadequate The whole-batch check only tests that each received digest is somewhere in the original batch; a batch with one record replaced by a duplicate of another passes both this check and the job-count check. Suggested fix: Compare each digest with the expected digest at strategy.job-index, or compare the full multiset with the original batch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] test-inadequate The check proves only that each received record belongs somewhere in the original batch (index($digest) != null). Together with the caller's job-count check it still accepts a batch where one record is missing and another duplicated, so it does not establish that the batch arrived whole. Suggested fix: Compare each received digest with the expected digest at its matrix index, or compare the multisets of digests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] test-inadequate Each receiving job only checks that its digest occurs somewhere in the expected batch; the final verification counts successful jobs, not which expected records arrived. A duplicated record still passes. Suggested fix: Compare the received digest with the expected digest at strategy.job-index, or compare the multiset of received digests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] test-inadequate The digest check proves only that each received record belongs somewhere in the original batch, not that every original record arrived. Each matrix job runs Suggested fix: Verify each received digest against the expected digest at strategy.job-index, or collect received digests and compare their complete multiset with the original batch's digests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] test-inadequate The digest check proves only that each received record belongs somewhere in the original batch. A duplicated record paired with a lost one passes every matrix job and the job-count check. Suggested fix: Compare each received digest with the expected digest at There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] test-inadequate The digest check only tests membership in the whole digest array. If one record is replaced by a duplicate of another valid record, every dispatch job still passes and the caller's successful-job count still matches, so the workflow reports success despite losing a record. Suggested fix: Compare each received digest with the expected digest at strategy.job-index, or compare the multiset of received digests with the expected batch, preserving duplicate counts. |
||
| echo "::error::record ${INDEX} (${digest}) is not a record of the batch" | ||
| exit 1 | ||
| fi | ||
| echo "Record ${INDEX} arrived unchanged (${digest})." | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| # Poll side of the Jira poll batch check (jira-poll-batch-check.yml). | ||
| # | ||
| # Stands in for reusable-poll-jira.yml. The matrix job is that workflow's | ||
| # matrix job word for word, and the matrix is returned the same way: a step | ||
| # output, then that job's only output, then this workflow's output. What | ||
| # differs is the poll job, which builds dispatches.json with the real driver | ||
| # reading a fake Jira (hack/prove-jira-poll-batch) and saves it under the | ||
| # artifact name the real poll job uses. | ||
| # | ||
| # The record count, the digests and the size are outputs of the poll job, not | ||
| # of the matrix job, so they still arrive when GitHub rejects the matrix. | ||
| name: Jira poll batch check (poll) | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| case: | ||
| description: Batch to build (a case of hack/prove-jira-poll-batch). | ||
| type: string | ||
| required: true | ||
| outputs: | ||
| matrix: | ||
| description: Dispatch matrix, returned as reusable-poll-jira.yml returns it. | ||
| value: ${{ jobs.matrix.outputs.matrix || '{"include":[]}' }} | ||
| count: | ||
| description: Number of records in the batch. | ||
| value: ${{ jobs.poll.outputs.dispatch_count }} | ||
| digests: | ||
| description: JSON array with the digest of every record (jira-poll-record-digest.sh). | ||
| value: ${{ jobs.poll.outputs.digests }} | ||
| bytes: | ||
| description: Size of the matrix in bytes of UTF-8. GitHub counts each one as two. | ||
| value: ${{ jobs.poll.outputs.bytes }} | ||
|
|
||
| jobs: | ||
| poll: | ||
| name: Poll a fake Jira | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 15 | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| dispatch_count: ${{ steps.check.outputs.count }} | ||
| artifact_suffix: ${{ steps.check.outputs.artifact_suffix }} | ||
| digests: ${{ steps.check.outputs.digests }} | ||
| bytes: ${{ steps.check.outputs.bytes }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Run one poll cycle against a fake Jira | ||
| env: | ||
| CASE: ${{ inputs.case }} | ||
| TARGET_REPO: ${{ github.repository }} | ||
| run: go run ./hack/prove-jira-poll-batch -case "${CASE}" -target-repo "${TARGET_REPO}" -out dispatches.json | ||
|
|
||
| - name: Check dispatches | ||
| id: check | ||
| run: | | ||
| set -euo pipefail | ||
| matrix=$(jq -c '{include: .}' dispatches.json) | ||
| digests=$(jq -c '.[]' dispatches.json | while IFS= read -r record; do | ||
| printf '%s' "${record}" | .github/scripts/jira-poll-record-digest.sh | ||
| done | jq -Rcs 'split("\n") | map(select(. != ""))') | ||
| { | ||
| echo "artifact_suffix=$(openssl rand -hex 8)" | ||
| echo "count=$(jq length dispatches.json)" | ||
| echo "digests=${digests}" | ||
| echo "bytes=$(printf '%s' "${matrix}" | wc -c)" | ||
| } >> "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: Save dispatches | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | ||
| with: | ||
| name: fullsend-jira-dispatches-${{ steps.check.outputs.artifact_suffix }} | ||
| path: dispatches.json | ||
| if-no-files-found: error | ||
| retention-days: 1 | ||
|
|
||
| matrix: | ||
| name: Build dispatch matrix | ||
| needs: poll | ||
| # "!= '0'", not "> 0": an empty (dropped) count still runs this job. | ||
| if: ${{ needs.poll.outputs.dispatch_count != '0' }} | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 15 | ||
| permissions: {} | ||
| outputs: | ||
| matrix: ${{ steps.matrix.outputs.matrix }} | ||
| steps: | ||
| # If both tries fail, "Re-run failed jobs" reads the artifact again | ||
| # while it is kept (1 day). "Re-run all jobs" would poll again and find | ||
| # nothing. | ||
| - name: Read dispatches | ||
| id: read | ||
| continue-on-error: true | ||
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | ||
| with: | ||
| name: fullsend-jira-dispatches-${{ needs.poll.outputs.artifact_suffix }} | ||
|
|
||
| - name: Read dispatches (second try) | ||
| if: ${{ steps.read.outcome == 'failure' }} | ||
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | ||
| with: | ||
| name: fullsend-jira-dispatches-${{ needs.poll.outputs.artifact_suffix }} | ||
|
|
||
| - name: Build dispatch matrix | ||
| id: matrix | ||
| run: | | ||
| set -euo pipefail | ||
| jq -e 'type == "array" and length > 0' dispatches.json > /dev/null | ||
| MATRIX=$(jq -c '{include: .}' dispatches.json) | ||
| DELIM="MATRIX_$(openssl rand -hex 8)" | ||
| { | ||
| echo "matrix<<${DELIM}" | ||
| printf '%s\n' "${MATRIX}" | ||
| echo "${DELIM}" | ||
| } >> "${GITHUB_OUTPUT}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Full-size batch check for the Jira poll hand-off on GitHub (ADR 0085). | ||
| # | ||
| # The managed poll workflow passes a cycle's whole batch from the poll job to | ||
| # the dispatch job as one job output, and runs each record as one job of a | ||
| # matrix. GitHub limits a job's outputs to 1 MB and a matrix to 256 jobs, and | ||
| # a batch over either limit is lost whole. The jira-poll driver therefore | ||
| # keeps a cycle to at most 250 records and 768 KB. This workflow shows, on | ||
| # GitHub, that a batch at those limits arrives whole. | ||
| # | ||
| # It has the shape of the managed caller | ||
| # (internal/scaffold/fullsend-repo/templates/jira-poll-per-repo.yaml): a poll | ||
| # job that returns a matrix through a reusable workflow's output, and a | ||
| # dispatch job, under the same condition, that hands the matrix to a second | ||
| # reusable workflow as an input. Two things differ. The batch comes from the | ||
| # real driver reading a fake Jira (hack/prove-jira-poll-batch) instead of | ||
| # from a Jira site, and each record's job compares the record it received | ||
| # with the one the batch held instead of running an agent. | ||
| # | ||
| # Run it once per case when a change touches the limits, the record format or | ||
| # the hand-off. See "Jira poll batch check" in | ||
| # docs/guides/dev/testing-workflows.md. | ||
| name: Jira poll batch check | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| case: | ||
| description: Batch to send through the hand-off | ||
| type: choice | ||
| required: true | ||
| options: | ||
| - records | ||
| - size | ||
| - wide | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| poll: | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/jira-poll-batch-check-poll.yml | ||
| with: | ||
| case: ${{ inputs.case }} | ||
|
|
||
| dispatch: | ||
| needs: poll | ||
| if: ${{ needs.poll.outputs.matrix != '' && fromJSON(needs.poll.outputs.matrix).include[0] != null }} | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/jira-poll-batch-check-dispatch.yml | ||
| with: | ||
| matrix: ${{ needs.poll.outputs.matrix }} | ||
| digests: ${{ needs.poll.outputs.digests }} | ||
|
|
||
| verify: | ||
| name: Verify the batch arrived whole | ||
| needs: [poll, dispatch] | ||
| if: ${{ always() }} | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 5 | ||
| permissions: | ||
| actions: read | ||
| steps: | ||
| - name: Count the records that reached their own job | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| CASE: ${{ inputs.case }} | ||
| EXPECTED: ${{ needs.poll.outputs.count }} | ||
| BYTES: ${{ needs.poll.outputs.bytes }} | ||
| DISPATCH_RESULT: ${{ needs.dispatch.result }} | ||
| run: | | ||
| set -euo pipefail | ||
| echo "Case ${CASE}: ${EXPECTED} records in ${BYTES} bytes of UTF-8, which GitHub counts as $((2 * BYTES)) of the 1048576 a job's outputs may hold." | ||
| if [[ -z "${EXPECTED}" || "${EXPECTED}" -eq 0 ]]; then | ||
| echo "::error::the batch holds no records" | ||
| exit 1 | ||
| fi | ||
| if [[ "${DISPATCH_RESULT}" != "success" ]]; then | ||
| echo "::error::the dispatch job ended as '${DISPATCH_RESULT}': the batch did not arrive whole" | ||
| exit 1 | ||
| fi | ||
| arrived=$(gh api --paginate "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/jobs?per_page=100" \ | ||
| --jq '.jobs[] | select(.name | contains("/ Record ")) | select(.conclusion == "success") | .name' | wc -l) | ||
| if [[ "${arrived}" -ne "${EXPECTED}" ]]; then | ||
| echo "::error::${arrived} records reached their own job unchanged, want ${EXPECTED}" | ||
| exit 1 | ||
| fi | ||
| echo "All ${EXPECTED} records reached their own job unchanged." |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,3 +284,20 @@ their own discovery and are unaffected. Forgejo has no Jira poll target. | |
| - Starvation beyond the top M stays documented and unmitigated: the filter | ||
| neither widens nor narrows the window, and the clearance bound above | ||
| applies only to candidates inside it. | ||
|
|
||
| ## Amendments | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] architectural-conflict The diff appends a '## Amendments' section to ADR 0160, which is Accepted on main. The section records a behavior change to Decision item 1 (an unparseable lastCheck is treated as unset). docs/contributing/adrs.md forbids substantially rewriting Context, Decision or Consequences, not minor annotations; the original Decision text is untouched and ADR 0038 and ADR 0070 use the same pattern. Still, recording the change in ADR 0085 (the superseding ADR) would follow the rule more closely, and adrs.md requires the PR description to call out edits to Accepted ADRs. Suggested fix: Make sure the PR description (or the owning stacked PR) calls out the ADR 0160 edit; consider recording the change in ADR 0085 instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] architectural-conflict The '## Amendments' section changes Decision item 1 of an ADR whose status is Accepted. docs/contributing/adrs.md treats Accepted ADRs as point-in-time records; a changed decision goes in a superseding ADR. Suggested fix: Record the changed handling in a new ADR that supersedes the affected part of ADR 0160 (or, if the ADR is not yet on main, edit the Decision directly). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] architectural-conflict The Amendments section changes Decision item 1 of ADR 0160 in place rather than through ADR 0085 or a superseding ADR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] architectural-conflict ADR 0160 has status Accepted. The PR appends an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] architectural-conflict An earlier finding remains open. The PR still appends an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by the review agent: this is an older copy of a finding that a newer review thread also carries: #9918 (comment) The finding is still open. Follow up in the newer thread. Resolving this duplicate. Unresolve it if you disagree. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [low] architectural-conflict The PR appends an Amendments section to Accepted ADR 0160. docs/contributing/adrs.md treats an Accepted ADR as an immutable point-in-time record and expects a new or superseding ADR for rule changes. Issue #9751 itself describes the change as an amendment to ADR 0160, and ADRs 0038 and 0070 already carry amendment sections, so this is a policy question for a human rather than a defect. Suggested fix: Confirm the amendment approach with the ADR owners, or record the change in a new or superseding ADR. |
||
|
|
||
| ### 2026-11-25: A checkpoint that is not a timestamp is treated as unset (#9766) | ||
|
|
||
| Decision item 1 sends a checkpoint that cannot be parsed to processing, | ||
| where "the existing per-issue error path reports it as today". That path | ||
| fails the issue on every pick and never saves a new checkpoint, so the | ||
| issue is never processed again, and when it is the only active candidate | ||
| every quiet cycle ends in the all-failed error. The driver now treats a | ||
| stored value that is not a timestamp as unset, as it already treats one | ||
| dated in the future: the issue stays active, gets one first-poll look | ||
| bounded by the backfill window, and that look saves a valid checkpoint. | ||
| Processing logs a WARNING naming the issue without the stored value, and | ||
| the filter's one line per cycle names such candidates. A failed read is | ||
| still an error. Replay stays bounded by one backfill window, the same as | ||
| deleting or forward-dating the checkpoint today. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[low] pattern-inconsistency
The dispatch-condition check extracts its line with grep -F and sed while job-body checks use awk; both feed the same compare-and-fail pattern, so this is a minor style difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved by the review agent: a later review found this finding fixed at commit 3022814.
Why: A missing dispatch condition now reaches the explicit fail check.
Evidence: jira-poll-record-digest-test.sh line 68 adds
|| true, so line 70 reports the missing condition.Resolving this thread. Unresolve it if you disagree.