Repository navigation
feat(jirapoll): make the backfill window's length a setting #9978
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
Draft
guyoron1
wants to merge
203
commits into
fullsend-ai:main
Choose a base branch
from
guyoron1:feat/jirapoll-backfill-window-hours
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,072
−908
Draft
Changes from all commits
Commits
Show all changes
203 commits
Select commit
Hold shift + click to select a range
527843f
fix(jirapoll): treat an unparseable lastCheck as unset
guyoron1 e0d3663
feat(jirapoll)!: remove the per-issue lock and check write access first
guyoron1 c060643
refactor(jirapoll): return an issue's records with its checkpoint as …
guyoron1 f2c408c
feat(jirapoll): limit reading to 5 minutes per cycle and 2 per issue
guyoron1 a8cfc1c
feat(jirapoll): take each candidate's lastCheck from the search results
guyoron1 95d4ad7
feat(jirapoll)!: search the whole backfill window, oldest change first
guyoron1 c999cae
test(jirapoll): cover both bad lastCheck forms and the all-failed guard
guyoron1 71112a5
test(jirapoll): pin the write check, the retry and the poll queue
guyoron1 5d27b04
docs(jira-poll): leave architecture.md alone and describe the write c…
guyoron1 6635f32
Merge branch 'feat/jirapoll-remove-lock' into refactor/jirapoll-issue…
guyoron1 ea42aab
Merge branch 'refactor/jirapoll-issue-records-unit' into feat/jirapol…
guyoron1 a85a142
fix(jirapoll): report a cancelled poll cycle as cancelled, not as tim…
guyoron1 34f1a18
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 fa9fcb0
fix(jiramock): serve a search whose body cannot be read, as before
guyoron1 094cc3b
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 afeda2c
docs(jira-poll): say what the window search no longer reports after a…
guyoron1 048b710
feat(jirapoll): limit one issue to 250 records and 768 KB per cycle
guyoron1 00f8edb
test(jirapoll): pin that a record over 768 KB on its own is dropped
guyoron1 2d83300
Merge branch 'fix/jirapoll-unparseable-lastcheck' into feat/jirapoll-…
guyoron1 a772539
Merge branch 'feat/jirapoll-remove-lock' into refactor/jirapoll-issue…
guyoron1 01d47ae
Merge branch 'refactor/jirapoll-issue-records-unit' into feat/jirapol…
guyoron1 ede31d1
fix(jirapoll): exit normally at the cycle time limit, as ADR 0085 says
guyoron1 0d65b81
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 5847e8c
refactor(jirapoll): parseLastCheck cannot fail, so it returns no error
guyoron1 870f3e7
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 c17b58a
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 60dbfaa
refactor(jirapoll): keep an issue's records in order when the limits …
guyoron1 07a34db
docs(jira-poll): put the default-query sentence back with the query p…
guyoron1 73eac9c
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 f84ccd8
feat(jirapoll)!: serve issues oldest first up to a per-cycle limit
guyoron1 ce247e9
docs(jira-poll): drop two leftovers of the pick and the filter's prop…
guyoron1 2fa4335
Merge branch 'chore/jirapoll-skip-idle-merge-main' into restack/unpar…
guyoron1 5814593
Merge branch 'restack/unparseable-lastcheck' into restack/remove-lock
guyoron1 d94f734
Merge branch 'restack/remove-lock' into restack/issue-records-unit
guyoron1 bf9f4b2
Merge branch 'restack/issue-records-unit' into restack/time-limits
guyoron1 abd309f
Merge branch 'restack/time-limits' into restack/search-checkpoint
guyoron1 ca2a217
Merge branch 'restack/search-checkpoint' into restack/window-oldest-f…
guyoron1 f32dd09
docs(jirapoll): drop the lock from two comments that came with the ma…
guyoron1 3607b26
Merge branch 'restack/remove-lock' into restack/issue-records-unit
guyoron1 c5bc2b0
Merge branch 'restack/issue-records-unit' into restack/time-limits
guyoron1 ff8b695
Merge branch 'restack/time-limits' into restack/search-checkpoint
guyoron1 ed3327b
Merge branch 'restack/search-checkpoint' into restack/window-oldest-f…
guyoron1 d073774
refactor(jirapoll): use config's ORDER BY splitter instead of a jql p…
guyoron1 16452f2
Merge branch 'restack/window-oldest-first' into restack/issue-record-…
guyoron1 331b388
Merge branch 'restack/issue-record-limits' into restack/cycle-ceiling
guyoron1 6d55115
ci(jira-poll): add a full-size batch check for the GitHub hand-off
guyoron1 acbb149
fix(jirapoll): count the matrix output the way GitHub enforces its limit
guyoron1 10aa206
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 4efe05c
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 f762837
ci(jira-poll): size the batch check by what GitHub counts
guyoron1 28eb759
fix(jirapoll): count the matrix output the way GitHub enforces its limit
guyoron1 62758e2
Merge branch 'restack/issue-record-limits' into restack/cycle-ceiling
guyoron1 dfaec9d
ci(jira-poll): add a full-size batch check for the GitHub hand-off
guyoron1 1d5efef
ci(jira-poll): size the batch check by what GitHub counts
guyoron1 e531a50
ci(jira-poll): follow the poll workflow's matrix job in the batch check
guyoron1 1c62fe1
docs(jira-poll): say what changes when an adopter upgrades the poller
guyoron1 f9b935c
docs(jira-poll): say what changes when an adopter upgrades the poller
guyoron1 f96a418
docs(jira-poll): say the driver keeps a cycle to at most 250 records
guyoron1 11a5701
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 fbcf082
docs(jira-poll): say the driver keeps a cycle to at most 250 records
guyoron1 500a18b
Merge branch 'restack/batch-check' into restack/upgrade-notice
guyoron1 0a619f0
fix(jirapoll): hold the issue time limit when it passes inside the ma…
guyoron1 cd9d329
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 c696b96
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 04b0aad
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 dc645d8
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 d6c90b6
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 bfd514e
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 6d040b0
ci(jira-poll): give the batch check's matrix job no token permissions
guyoron1 c6b252a
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 abef7cc
Merge branch 'feat/jirapoll-time-limits' into restack/time-limits
guyoron1 cfd8196
Merge branch 'restack/time-limits' into restack/search-checkpoint
guyoron1 875ac79
Merge branch 'feat/jirapoll-search-checkpoint' into restack/search-ch…
guyoron1 423d60c
Merge branch 'restack/search-checkpoint' into restack/window-oldest-f…
guyoron1 9905ace
Merge branch 'feat/jirapoll-window-oldest-first' into restack/window-…
guyoron1 577e263
Merge branch 'restack/window-oldest-first' into restack/issue-record-…
guyoron1 b6933a0
Merge branch 'feat/jirapoll-issue-record-limits' into restack/issue-r…
guyoron1 d4b4fc2
Merge branch 'restack/issue-record-limits' into restack/cycle-ceiling
guyoron1 b2d6362
Merge branch 'feat/jirapoll-cycle-ceiling' into restack/cycle-ceiling
guyoron1 473a3b3
Merge branch 'restack/cycle-ceiling' into restack/batch-check
guyoron1 bf616ac
Merge branch 'ci/jira-poll-batch-check' into restack/batch-check
guyoron1 408d177
Merge branch 'restack/batch-check' into restack/upgrade-notice
guyoron1 5177b6f
Merge branch 'docs/jira-poll-upgrade-notice' into restack/upgrade-notice
guyoron1 7b311fa
docs(jira-poll): describe the poller of ADR 0085 as built
guyoron1 1216ae9
Merge branch 'chore/jirapoll-skip-idle-merge-main' into restack/unpar…
guyoron1 bf8aafc
Merge branch 'restack/unparseable-lastcheck' into restack/remove-lock
guyoron1 191c0d7
Merge branch 'restack/remove-lock' into restack/issue-records-unit
guyoron1 ee0693e
Merge branch 'restack/issue-records-unit' into restack/time-limits
guyoron1 a81de2a
Merge branch 'restack/time-limits' into restack/search-checkpoint
guyoron1 b56a622
Merge branch 'restack/search-checkpoint' into restack/window-oldest-f…
guyoron1 3dbd497
Merge branch 'restack/window-oldest-first' into restack/issue-record-…
guyoron1 e08d9c0
Merge branch 'restack/issue-record-limits' into restack/cycle-ceiling
guyoron1 f0b27ce
Merge branch 'restack/cycle-ceiling' into restack/batch-check
guyoron1 7727f0f
Merge branch 'restack/batch-check' into restack/upgrade-notice
guyoron1 632838e
fix(jirapoll): read the per-cycle limit when the config has no tracke…
guyoron1 01a6293
Merge branch 'restack/cycle-ceiling' into restack/batch-check
guyoron1 e37973b
Merge branch 'restack/batch-check' into restack/upgrade-notice
guyoron1 b3b6024
Merge branch 'feat/jirapoll-skip-idle' into fix/jirapoll-unparseable-…
guyoron1 194ca1f
Merge branch 'fix/jirapoll-unparseable-lastcheck' into feat/jirapoll-…
guyoron1 94672e4
Merge branch 'feat/jirapoll-remove-lock' into refactor/jirapoll-issue…
guyoron1 29f4acc
Merge branch 'refactor/jirapoll-issue-records-unit' into feat/jirapol…
guyoron1 1fb717e
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 2340925
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 df8e164
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 10d59c7
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 4950714
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 437fec4
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 c0d2d4c
fix(jirapoll): validate tracker.jira when an explicit source replaces…
guyoron1 e52b104
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 015755c
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 d226986
docs(jira-poll): add troubleshooting rows for overlapping cycles and …
guyoron1 f9a7ed2
Merge branch 'feat/jirapoll-remove-lock' into refactor/jirapoll-issue…
guyoron1 9f04b42
Merge branch 'refactor/jirapoll-issue-records-unit' into feat/jirapol…
guyoron1 b5e4b01
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 22151d0
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 6aaaab7
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 dc4240d
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 c9e1aa3
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 c9c4df3
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 820d2b8
docs(jira-poll): count a slow issue as failed in the write-check trou…
guyoron1 61aa0df
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 277a2c8
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 92c5078
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 3fbbdfc
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 ae9e9de
docs(jira-poll): quote the all-failed error as it now reads in the tr…
guyoron1 1569617
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 5b699fd
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 8827fae
docs(jira-poll): name the token scope the write check needs
guyoron1 48c7b23
Merge branch 'feat/jirapoll-remove-lock' into refactor/jirapoll-issue…
guyoron1 4f0e8d7
Merge branch 'refactor/jirapoll-issue-records-unit' into feat/jirapol…
guyoron1 57ef4f1
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 c177c77
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 dae1b92
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 3252a73
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 09ca7f9
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 6da70d4
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 83ab462
docs(jira-poll): link ADR 0085 from the upgrade notice
guyoron1 9cdc8a4
feat(jirapoll): make the backfill window's length a setting
guyoron1 acd5228
docs(jira-poll): describe the backfill window setting
guyoron1 df6db02
fix(jirapoll): check only the per-cycle limit when an explicit source…
guyoron1 f30318d
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 7db2b2a
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 79bbb22
Merge branch 'docs/jira-poll-upgrade-notice' into feat/jirapoll-backf…
guyoron1 07582e1
docs(jirapoll): drop the lock from the entity execution table and a t…
guyoron1 8ff4790
fix(jirapoll): leave a discarded issue out of the cycle's event counts
guyoron1 dff9273
Merge branch 'feat/jirapoll-remove-lock' into refactor/jirapoll-issue…
guyoron1 50cdf0a
Merge branch 'refactor/jirapoll-issue-records-unit' into feat/jirapol…
guyoron1 d80f8ba
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 2030ac4
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 299e2f0
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 eebfb8c
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 9c8477a
refactor(jirapoll): drop the count snapshot that per-issue counts rep…
guyoron1 ad87462
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 46adaeb
test(jira-poll): report a missing dispatch condition in the contract …
guyoron1 3022814
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 550d95c
Merge branch 'docs/jira-poll-upgrade-notice' into feat/jirapoll-backf…
guyoron1 9c87e7e
Merge branch 'feat/jirapoll-skip-idle' into feat/jirapoll-remove-lock
guyoron1 96699c2
Merge branch 'feat/jirapoll-remove-lock' into refactor/jirapoll-issue…
guyoron1 473e176
Merge branch 'refactor/jirapoll-issue-records-unit' into feat/jirapol…
guyoron1 eb0498f
fix(jirapoll): keep a timed-out issue out of the no-match warning
guyoron1 59289b6
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 352b540
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 c389854
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 9a79d9a
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 42af816
test(config): expect the default poll query without an ordering
guyoron1 5b3e07e
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 5c39ad6
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 08f5134
refactor(jirapoll): drop the loader's own check of the per-cycle limit
guyoron1 d77c60f
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 f2eab48
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 4a47668
Merge branch 'docs/jira-poll-upgrade-notice' into feat/jirapoll-backf…
guyoron1 b66e01c
docs(jira-poll): wrap the time-limit paragraphs at 80 columns
guyoron1 6df1f09
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 5140bb0
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 96805f5
docs(jira-poll): wrap the backfill-window paragraph at 80 columns
guyoron1 aca40b6
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 3d9df68
docs(jira-poll): wrap the per-issue limits paragraph at 80 columns
guyoron1 6023b1a
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 bf69ebd
docs(jira-poll): wrap the per-cycle limit paragraph at 80 columns
guyoron1 955fd10
Merge remote-tracking branch 'origin/main' into feat/jirapoll-cycle-c…
guyoron1 8d4ed37
docs(jira-poll): say which limit a declared connections.jira polls with
guyoron1 a10ec16
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 8b970d4
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 088a029
Merge branch 'docs/jira-poll-upgrade-notice' into feat/jirapoll-backf…
guyoron1 72782c5
docs(jira-poll): wrap the backfill window setting's paragraph at 80 c…
guyoron1 27584c9
docs(jira-poll): say which window a declared connections.jira polls with
guyoron1 2ec3341
Merge remote-tracking branch 'origin/main' into fix/jirapoll-unparsea…
guyoron1 1c73a81
Merge branch 'fix/jirapoll-unparseable-lastcheck' into feat/jirapoll-…
guyoron1 50a8999
Merge branch 'feat/jirapoll-remove-lock' into refactor/jirapoll-issue…
guyoron1 20982f4
test(jirapoll): pin that an unparseable lastCheck is unset, not floored
guyoron1 42a15a0
Merge branch 'fix/jirapoll-unparseable-lastcheck' into feat/jirapoll-…
guyoron1 e1bf398
refactor(jirapoll): drop the unused delete from the poller's Jira client
guyoron1 5ffdb8e
test(scaffold): pin the GitLab poll job's resource group
guyoron1 f821b61
docs(jira-poll): say the lock is gone in two places that still expect it
guyoron1 c964f48
Merge branch 'feat/jirapoll-remove-lock' into refactor/jirapoll-issue…
guyoron1 e247b90
Merge branch 'refactor/jirapoll-issue-records-unit' into feat/jirapol…
guyoron1 ead3b82
Merge branch 'feat/jirapoll-time-limits' into feat/jirapoll-search-ch…
guyoron1 77b2215
Merge branch 'feat/jirapoll-search-checkpoint' into feat/jirapoll-win…
guyoron1 bbac702
Merge branch 'feat/jirapoll-window-oldest-first' into feat/jirapoll-i…
guyoron1 4263bda
Merge branch 'feat/jirapoll-issue-record-limits' into feat/jirapoll-c…
guyoron1 73f09ab
Merge branch 'feat/jirapoll-cycle-ceiling' into ci/jira-poll-batch-check
guyoron1 e7c794f
Merge branch 'ci/jira-poll-batch-check' into docs/jira-poll-upgrade-n…
guyoron1 851f019
Merge branch 'docs/jira-poll-upgrade-notice' into feat/jirapoll-backf…
guyoron1 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,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}" ]] || | ||
| 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" |
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,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}' |
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,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 | ||
| echo "::error::record ${INDEX} (${digest}) is not a record of the batch" | ||
| exit 1 | ||
| fi | ||
| echo "Record ${INDEX} arrived unchanged (${digest})." |
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,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}" |
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,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." |
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
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.
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.
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.
[medium] incorrect-doc
ADR 0160 has status Accepted on main and main's copy has no Amendments section. The diff appends a '## Amendments' section (2026-11-25, #9766) that changes the behavior Decision item 1 records (an unparseable checkpoint is now treated as unset instead of going to the per-issue error path). docs/contributing/adrs.md allows only minor annotations on Accepted ADRs, asks that behavior changes go in a new superseding ADR, and requires edits to accepted ADRs to be called out in the PR description; this PR's description does not mention it. The edit arrives via a stacked commit (Fixes #9766), not this PR's own backfill-window commits, so it is borderline and advisory.
Suggested fix: Either move the decision change into a new ADR that refines or supersedes ADR 0160 Decision item 1 and keep only a short cross-reference note in ADR 0160, or call out the accepted-ADR edit in the PR description (ideally in the stacked PR that introduces it).