Repository navigation
feat(#9132): read Jira authorization lists from the environment - #9262
Conversation
E2E tests are runningAuthorization passed for this commit. See the E2E Tests workflow for results. |
PR Summary by QodoRead Jira authorization lists from environment variables
AI Description
Diagram
High-Level Assessment
Files changed (24)
|
Code Review by Qodo
1.
|
Site previewPreview: https://a8b2559a-site.fullsend-ai.workers.dev Commit: |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
waynesun09
left a comment
There was a problem hiding this comment.
Two review findings below, both MEDIUM.
71c9aa0 to
3da5167
Compare
3da5167 to
ed07311
Compare
The fix for
The catalog still lists this finding as active, so it should close on the next review. I have not dismissed it, since you didn't ask me to.
|
waynesun09
left a comment
There was a problem hiding this comment.
Two review findings below, both MEDIUM.
ed07311 to
5bcc93c
Compare
waynesun09
left a comment
There was a problem hiding this comment.
Two review findings below, both MEDIUM.
…cenario zero (to be deleted)
…cenario actor (to be deleted)
…cenario zero (to be deleted)
…cenario actor (to be deleted)
5bcc93c to
e49176a
Compare
waynesun09
left a comment
There was a problem hiding this comment.
One review finding below, MEDIUM.
e49176a to
f8a5e6e
Compare
waynesun09
left a comment
There was a problem hiding this comment.
Two review findings below, both MEDIUM.
196aa41 to
f7888a5
Compare
a989d8c to
22e1681
Compare
|
I rebased and fixed conflicts. @waynesun09 |
waynesun09
left a comment
There was a problem hiding this comment.
Two MEDIUM findings from a review-only pass, posted inline.
…nment The jira authorization entry's write and triage lists can now name an environment variable with groups_from and accounts_from, so group and account IDs stay out of a public repository's config.yaml. Config and poller: - The poller reads the variable on every poll. The value is a list separated by commas or newlines. An unset or empty variable grants no one, and the poller logs a warning that names the variable. - Config loading rejects a role that sets both forms of one field, and an empty or invalid variable name. - The poller never logs the values. - The docs and the config test use a placeholder account ID. Managed GitHub poll workflow: - The managed caller forwards FULLSEND_JIRA_WRITE_GROUPS, FULLSEND_JIRA_WRITE_ACCOUNTS, FULLSEND_JIRA_TRIAGE_GROUPS and FULLSEND_JIRA_TRIAGE_ACCOUNTS to the poll step when config.yaml reads them. reusable-poll-jira.yml declares them as optional. - A new job with no secrets sets the dispatch matrix output. GitHub drops a job output that contains a value of a secret the job has, and the matrix holds the acting account's ID, which can equal a list secret. The poll job saves the dispatch file as an artifact, after checking it for Jira credentials, including ones that JSON escaped. Each call names its artifact with a random suffix, so two calls in one run do not share it. repos install: - It fails before any write when config.yaml uses groups_from or accounts_from and the repository's jobs run a release that predates them, on any forge. Every job runs the CLI at the scaffold's ref, and an older CLI cannot load the config. repos status reports the same error. Without an upstream GitHub client, a stamped scaffold's ref is not checked. A vendored install runs its own binary, so it is checked only when the managed GitHub poll caller passes a list secret: that caller calls the upstream workflow at the pinned ref. A user-owned GitHub poll caller that pins a reusable-poll-jira.yml older than the keys fails too, unless the install is vendored: that workflow installs the CLI at its own ref. - It warns about a variable name other than the four above, for the managed caller and for a user-owned caller of reusable-poll-jira.yml, because that workflow accepts only those four. It also warns about a user-owned caller that does not pass one of the four that the config names. It never writes or deletes these secrets. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Gwenneg Lepage <10584698+gwenneg@users.noreply.github.com>
22e1681 to
8639cdd
Compare
|
/fs-review |
|
/ok-to-test 8639cdd |
|
E2E authorized for |
|
@gwenneg Keep the schema at 3, as the PR has it. A bump would make older CLIs refuse every repository pinned to the new release, and would refuse vendored installs that work, while |
|
🤖 Finished Review · ✅ Success · Started 1:48 PM UTC · Completed 2:00 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $3.47 |
|
Risk Assessment: elevated (3/5) DetailsLarge change touching a protected CI workflow and Jira authorization logic with high recent churn in touched files, mitigated by opt-in configuration and thorough acceptance criteria coverage. |
ReviewFindingsMedium
Low
Labels: PR changes repos install/status checks, a reusable CI workflow, and Jira integration docs. Next steps:
|
waynesun09
left a comment
There was a problem hiding this comment.
Approving. All earlier MEDIUM findings are fixed and verified at this head; the two remaining LOWs are answered, and the schema follow-up is #9837.
f1d1364
Summary
The
jiraauthorization lists in.fullsend/config.yamlcan now come from an environment variable, so account and group IDs stay out of a public repository:Related Issue
Closes #9132
Changes
Config and poller
write:andtriage:acceptgroups_fromandaccounts_from. The value is a list separated by commas or newlines.Managed GitHub poll workflow
FULLSEND_JIRA_WRITE_GROUPS,FULLSEND_JIRA_WRITE_ACCOUNTS,FULLSEND_JIRA_TRIAGE_GROUPSandFULLSEND_JIRA_TRIAGE_ACCOUNTSto the poll step. It passes only the ones the config names, so existing callers don't change.reusable-poll-jira.ymlnow sets the dispatch matrix from a second job that has no secrets.repos installDocs
FULLSEND_prefix, becauserepos statusreports an unmanagedFULLSEND_variable as an orphan.Why the matrix is set by a second job
GitHub drops a job output that contains the value of a secret the job has. The matrix contains the ID of the account that acted. So if
FULLSEND_JIRA_WRITE_ACCOUNTSholds one account ID, the matrix is dropped every time that person triggers an agent. The poller has already advanced its Jira checkpoints by then, so those dispatches are lost and the run still shows green.Fix: the poll job saves
dispatches.jsonas an artifact (kept 1 day) and outputs only a count and a random artifact suffix. A newmatrixjob, which has no secrets, reads the file and sets the output. The caller and the workflow'smatrixoutput are unchanged.Each call names its artifact with its own suffix, so two calls in one run don't share it.
Trade-offs
dispatches.jsoncontainsFULLSEND_JIRA_TOKEN,FULLSEND_JIRA_EMAIL,FULLSEND_JIRA_CLIENT_IDorFULLSEND_JIRA_CLIENT_SECRET. It trims the values first, as the CLI does. It searches the decoded strings of each record and itsevent_payload, so it also finds a credential that JSON escaped.Alternatives I ruled out
Install checks
Error: the release must support the new keys. Every job runs the CLI at the repository's
fullsend_ref, andfullsend_refdoesn't follow CLI upgrades. v0.54.0 rejectsgroups_fromas an unknown field, so without this check install would commit a config that no job can load.reusable-poll-jira.ymlat the pinned ref and looks forFULLSEND_JIRA_WRITE_GROUPS, which lands in the same commit as the CLI support.fullsend_refwhen install runs from a build with no release ref. Install then leaves the scaffold at its stamped ref, so the check reads that ref.reusable-poll-jira.ymlat the pinned ref, and GitHub rejects it when the workflow there doesn't declare the secret (run against v0.55.0).reusable-poll-jira.ymlthat a poll caller you maintain pins, and fails if one predates the keys: that workflow installs the CLI at its own ref. A vendored install is skipped, because the old workflow runs the vendored binary there.repos statusreports the same errors, for an installed repository and for one that is not installed yet.internal/config/managed-config-schema, 3 onmainsince feat(#8143)!: let agents entries carry a harness: block (ADR 0162) #9422), although older releases reject the new keys. This check refuses them for an older ref instead. A comment in that file says so.Warning: a list variable won't reach the poller. On GitHub, with polling enabled:
reusable-poll-jira.yml. That workflow accepts only those four, and GitHub rejects a caller that passes it another secret (run);reusable-poll-jira.ymlwithout passing one of the four that the config names.It's a warning, not an error, because a self-hosted runner can still set the variable. Without it the list grants no one, which fails closed.
Not in this PR
FULLSEND_JIRA_*variables as orphans, andrepos statusthen exits with an error. This already happens onmainfor the Jira credentials that install writes since repos install: manage Jira polling for GitLab #9108. It will also happen for list variables with aFULLSEND_name. One fix covers both.Testing
make lintpasses (stage changes first, then run)Details:
uses:lines reuse pins the repo already has, andpinactpasses.TestJiraPollCallerPollAlignmentchecks that the job holding the secrets outputs only a count and a random suffix, and that thematrixjob references no secrets.TestJiraPollWorkflowCheckDispatchesruns the check step once per Jira secret, including a token that contains"and<.TestJiraPollWorkflowSecretThreadingchecks that the step receives all four and no list secret.reusable-poll-jira.ymlate49176a8e(an earlier head of this PR) throughworkflow_call, with the real CLI and a mock Jira:matrixjob is skipped, the caller gets{"include":[]}, anddispatchis skipped.secrets:mapping, and all 4 dispatches reach thedispatchjob.fromjson, since fix(jirapoll)!: unmarshal EventPayload as structured JSON in DispatchRecord #7518 madeevent_payloadan object, and two more secrets checked), and tests. The changed check step is covered byTestJiraPollWorkflowCheckDispatches, not by a runner.uses:points to the commit on the fork, the trigger is a push,dispatchcalls a stub that prints the matrix, ashowjob is added, and the CLI is a vendored build of the same commit behind a wrapper that starts the mock.join_tr__*). No ID is printed.matrixjob were copied unchanged.accounts_fromandgroups_fromfrom secrets. The listed account and the listed group's member were dispatched, and a stranger was not.matrixjob downloaded the artifact withpermissions: {}.Skip output 'matrix' since it may contain secret);Checklist
!for breaking changes)🤖 Generated with Claude Code