Repository navigation
feat(#2264): derive Jira work-item identity in fullsend run - #8922
Conversation
For Jira-sourced dispatches, fullsend run exported ISSUE_NUMBER from the status number. After Jira status routing that value is the numeric suffix of the Jira key (123 for PROJ-123). Pre/post scripts and harness env expansion then saw a Jira-derived number as a GitHub/GitLab issue number. FULLSEND_WORK_ITEM_SOURCE was documented but never exported. A payload claiming a Jira source whose normalized event failed validation fell back to forge routing silently. fullsend run is the common sink of the GitHub Actions harness-run job and the GitLab agent job, so the identity contract is enforced there: - Jira events: export FULLSEND_WORK_ITEM_SOURCE=jira, the textual key as FULLSEND_WORK_ITEM_KEY, and the browse URL as FULLSEND_WORK_ITEM_URL from the normalized event, overriding inherited values. Clear ISSUE_NUMBER. - Fail closed when the Jira key is not PROJ-123 shaped, the URL is not https, or a Jira-claimed payload fails normalized-event validation. - Forge events: only fill FULLSEND_WORK_ITEM_SOURCE when unset (event source.system, else the detected forge). Key, URL and ISSUE_NUMBER behavior is unchanged. Helpers live in internal/cli/run_workitem.go, and dispatch payload reading is shared with extractNormalizedEventFromDispatch. The jira-poll adapter spec and the bring-your-own-agent env table are updated. Partial: reusable-dispatch.yml still passes the numeric Jira ID as status-number (fullsend run and reconcile-status replace it with the Jira key for status routing). Jira dispatch on the GitLab pipeline path is tracked in #8919. Tracker writeback is tracked in #8918. Note: pre-commit could not fetch hook repos (sandbox TLS); hooks matching the changed files (whitespace, EOF, gofmt, go vet, symlinks, docs links, lychee, gitleaks) were run directly and passed. TestStartFetchService_* fail in the sandbox on a clean tree too (local socket blocked). Related to #2264 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 12:00 AM UTC · Completed 12:11 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.93 |
Site previewPreview: https://31eb4f7f-site.fullsend-ai.workers.dev Commit: |
|
<!-- fullsend:risk-assessment --> DetailsModerate risk: elevated change size and high git churn on run.go are balanced by no protected paths, zero dependency or workflow changes, bot authorship, substantial test coverage, and scoped alignment with linked issue #2264. Previous run<!-- fullsend:risk-assessment --> DetailsModerate risk: moderate change size and high git churn on run.go are balanced by no protected paths, bot authorship, strong test coverage, and alignment with linked issue #2264. Previous run (2)<!-- fullsend:risk-assessment --> DetailsModerate risk: moderate change size and high git churn on run.go are balanced by no protected paths, bot authorship, strong test coverage, and alignment with linked issue #2264. |
ReviewFindingsLow
Earlier findings
Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2NsaS9ydW4uZ28iLCJpZCI6ImZfMWQyYmZmNTExNmY0ZDJkZSIsImxpbmUiOjkwOCwiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiaW5jb3JyZWN0LWRvYyIsImZpbGUiOiJkb2NzL2d1aWRlcy91c2VyL2ppcmEtaW50ZWdyYXRpb24ubWQiLCJpZCI6ImZfN2QyZThiMTcxY2Y3ODM3ZCIsImxpbmUiOjc2LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJiYWNrd2FyZC1pbmNvbXBhdGlibGUiLCJmaWxlIjoiaW50ZXJuYWwvY2xpL3J1bi5nbyIsImlkIjoiZl83ZDJhZjBiOWZkM2M2MDA0IiwibGluZSI6NjQwLCJhY3Rpb25hYmxlIjpmYWxzZX0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYnJlYWtpbmctY29uZmlnIiwiZmlsZSI6ImludGVybmFsL2NsaS9ydW4uZ28iLCJpZCI6ImZfYTY2MjdmMzgyMDU0MTcyNSIsImxpbmUiOjkwNSwiYWN0aW9uYWJsZSI6ZmFsc2V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NlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJicmVha2luZy1jb25maWciLCJmaWxlIjoiaW50ZXJuYWwvY2xpL3J1bi5nbyIsImlkIjoiZl9hNjYyN2YzODIwNTQxNzI1IiwibGluZSI6OTA1LCJhY3Rpb25hYmxlIjpmYWxzZX1dfQ== --> ReviewFindingsMedium
Low
Labels: PR changes the fullsend run dispatch/work-item identity handling in Go Next steps:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Finished Fix · ✅ Success · Started 12:12 AM UTC · Completed 12:19 AM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.38 |
Run the Jira dispatch-payload guard whenever no --event-file was given and the tracker source is not already jira, so a valid forge event from GITHUB_EVENT_PATH cannot bypass an invalid Jira dispatch file. Add a regression test and document the exact Jira key pattern. Addresses review feedback on PR #8922. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (bot-triggered)Fixed the medium finding by making the Jira fail-closed guard apply even when another dispatch channel supplied a valid forge event, and added a regression test. Documented the exact Jira key pattern for the low finding. Recorded the other low finding (ISSUE_NUMBER change) as out of scope. Targeted tests pass. Pre-commit could not run because the sandbox has no network access. Six unrelated tests in internal/cli fail both with and without this change. Fixed (2):
Disagreed (1):
Tests: passed CI inspections (4):
Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 12:21 AM UTC · Completed 12:34 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.83 |
|
🤖 Finished Fix · ✅ Success · Started 12:36 AM UTC · Completed 12:44 AM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.38 |
…docs resolveWorkItemID now reads FULLSEND_WORK_ITEM_KEY/URL when the source is jira, so Jira runs (which clear ISSUE_NUMBER) no longer record 'unknown'. Adds regression cases and updates the Jira integration guide to describe the FULLSEND_WORK_ITEM_* exports, ISSUE_NUMBER clearing, and fail-closed identity checks. Note: pre-commit could not fetch hook repos (certificate failure); gofmt and go vet were run directly. Six tests in internal/cli (TestStartFetchService_*, TestPostScriptEnv_NoSchema*) fail identically without this change. Addresses #8922 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 2 (bot-triggered)Fixed the two actionable findings: telemetry work-item ID now resolves from the Jira FULLSEND_WORK_ITEM_* variables (with tests), and the Jira guide was updated. The three low-severity/optional findings need no code change and are recorded as disagreements. Six tests in internal/cli fail identically with and without this change (sandbox environment); pre-commit could not fetch hooks, so gofmt and go vet were run directly. Fixed (2):
Disagreed (3):
Tests: passed CI inspections (5):
Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 12:46 AM UTC · Completed 12:55 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.34 |
Superseded by updated review
|
Post-merge validation for #2264:
The full local |
Summary
Makes
fullsend runenforce the Jira work-item identity contract. Both CI paths end infullsend run: the GitHub Actionsharness-runjob and the GitLab agent job.fullsend runexportsFULLSEND_WORK_ITEM_SOURCE=jira,FULLSEND_WORK_ITEM_KEY(the textual key, e.g.PROJ-123) andFULLSEND_WORK_ITEM_URL(the browse URL) from the embedded normalized event, replacing any inherited values. It also clearsISSUE_NUMBER.PROJ-123, if the URL is missing or nothttps, or if the payload declaressource.system: jirabut its normalized event fails validation.FULLSEND_WORK_ITEM_SOURCEis filled in, and only when the caller left it unset. The value comes fromsource.system, or the detected forge when there is no normalized event. Key, URL andISSUE_NUMBERbehave exactly as before.Bug fixed along the way
For Jira runs,
fullsend runused to setISSUE_NUMBERfrom--status-number. After Jira status routing, that value is the numeric suffix of the Jira key (123fromPROJ-123). So even thoughreusable-dispatch.ymlleftISSUE_NUMBERempty, pre/post scripts and harness env expansion saw a Jira-derived number as a forge issue number. A Jira payload whose normalized event failed validation also fell back to forge routing without any error.Related Issue
Partial implementation. Not covered here:
reusable-dispatch.ymlstill passes the numeric Jira entity ID asstatus-number. It only gates status notifications:fullsend runandreconcile-statusreplace it with the Jira key for status routing. Removing it would disable Jira run-status updates, so changing that contract (and the protected workflow file) is left to a follow-up._normalized_event, this runner logic applies there unchanged.fullsend-ai/agentsalready have Jira overlays that mapISSUE_URLfromFULLSEND_WORK_ITEM_URL; the code overlay also clearsISSUE_NUMBER. They can now also rely onFULLSEND_WORK_ITEM_KEYandFULLSEND_WORK_ITEM_SOURCE.Changes
internal/cli/run_workitem.go(new):resolveWorkItemIdentitybuilds the work-item variables and validates Jira identity.issueNumberFlagEnvdecides theISSUE_NUMBERvalue.dispatchEventPayloadsis the shared reader for the dispatch file andGITHUB_EVENT_PATH.dispatchPayloadClaimsJiradetects a Jira-claimed payload whose normalized event failed validation.internal/cli/run.go: calls the helpers after tracker-source extraction (fail closed early) and exports the variables with the other flag-derived env, before env expansion and the pre-script.extractNormalizedEventFromDispatchnow uses the shared payload reader; its behavior is unchanged.FULLSEND_WORK_ITEM_SOURCErow,ISSUE_NUMBERnote).Testing
New unit tests cover:
ISSUE_NUMBERselectionrunAgentintegration tests:Coverage of the new helpers is about 100%.
go test ./internal/cli/passes exceptTestStartFetchService_*, which fail on a clean tree in the sandbox because the local socket is blocked.TestPostScriptEnv_NoSchema*fail only whenFULLSEND_OUTPUT_SCHEMAis set in the environment; they pass with it unset.pre-commitcould not fetch hook repos in the sandbox (TLS). The hooks that match the changed files were run directly and passed: whitespace/EOF, gofmt, go vet, broken symlinks, docs links, lychee, and gitleaks viascan-secrets.make lintpasses (stage changes first, then run). Hooks were run directly instead; see above.Tests added/updated for new or modified logic
Checklist
!for breaking changes)🤖 Generated with Claude Code
Related to #2264
Post-script verification
agent/2264-jira-work-item-identity)dfe2addf04bd08fffa2c2cdddd16146945e611f3..HEAD)