Skip to content

feat(#9132): read Jira authorization lists from the environment - #9262

Open
gwenneg wants to merge 1 commit into
fullsend-ai:mainfrom
gwenneg:feat/9132-jira-auth-from-env
Open

gwenneg wants to merge 1 commit into
fullsend-ai:mainfrom
gwenneg:feat/9132-jira-auth-from-env

Conversation

@gwenneg

@gwenneg gwenneg commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The jira authorization lists in .fullsend/config.yaml can now come from an environment variable, so account and group IDs stay out of a public repository:

authorization:
  - provider: jira
    write:
      groups_from: FULLSEND_JIRA_WRITE_GROUPS   # value: "<group-id-1>,<group-id-2>"

Related Issue

Closes #9132

Changes

Config and poller

  • write: and triage: accept groups_from and accounts_from. The value is a list separated by commas or newlines.
  • An unset or empty variable grants no one. The poller logs a warning that names the variable, never its value.
  • Config loading rejects a role that sets both forms of one field, and an empty or invalid variable name.

Managed GitHub poll workflow

  • The managed caller passes FULLSEND_JIRA_WRITE_GROUPS, FULLSEND_JIRA_WRITE_ACCOUNTS, FULLSEND_JIRA_TRIAGE_GROUPS and FULLSEND_JIRA_TRIAGE_ACCOUNTS to the poll step. It passes only the ones the config names, so existing callers don't change.
  • reusable-poll-jira.yml now sets the dispatch matrix from a second job that has no secrets.

repos install

  • It fails before any write when the repository's jobs run a release that predates the new keys.
  • It warns when a list variable won't reach the poller.

Docs

  • The Jira guide covers GitHub secrets, Vault or another secret store, and GitLab CI/CD variables.
  • For a store with no GitHub Action, the guide gives three numbered steps. Step 1 joins the value into one line, so masking covers a list stored one entry per line.
  • The GitLab section says to use a name without the FULLSEND_ prefix, because repos status reports an unmanaged FULLSEND_ variable as an orphan.
  • The guide says the acting account's ID is still in the dispatch record, in the artifact and in agent job logs.
  • The GitLab section gives the GitLab versions for masking a comma list (15.9) and for Masked and hidden (17.4). It says GitLab refuses to save a value it can't mask, and not to save the list unmasked.
  • Examples use a placeholder account ID.

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_ACCOUNTS holds 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.json as an artifact (kept 1 day) and outputs only a count and a random artifact suffix. A new matrix job, which has no secrets, reads the file and sets the output. The caller and the workflow's matrix output are unchanged.

Each call names its artifact with its own suffix, so two calls in one run don't share it.

Trade-offs

  • A failed upload or download would lose that cycle's dispatches, because the checkpoints are already advanced. Each is tried twice.
  • GitHub's check also used to block any of the four Jira secrets in the matrix. The poll job now checks for that itself: it fails if dispatches.json contains FULLSEND_JIRA_TOKEN, FULLSEND_JIRA_EMAIL, FULLSEND_JIRA_CLIENT_ID or FULLSEND_JIRA_CLIENT_SECRET. It trims the values first, as the CLI does. It searches the decoded strings of each record and its event_payload, so it also finds a credential that JSON escaped.
  • The artifact holds the same records that harness jobs already print in their logs.

Alternatives I ruled out

  • Escaping list values in the poller's output: it works around a GitHub safety check and breaks if any step rewrites the matrix.
  • Passing only the group secrets: it drops account-ID privacy, which is the point of the issue.
  • Having the poller start agent runs itself, as on GitLab: it's the cleanest fix but a redesign. See "Not in this PR".

Install checks

Error: the release must support the new keys. Every job runs the CLI at the repository's fullsend_ref, and fullsend_ref doesn't follow CLI upgrades. v0.54.0 rejects groups_from as an unknown field, so without this check install would commit a config that no job can load.

  • It runs on GitHub and GitLab, with polling on or off.
  • It reads reusable-poll-jira.yml at the pinned ref and looks for FULLSEND_JIRA_WRITE_GROUPS, which lands in the same commit as the CLI support.
  • It also covers a repository with no fullsend_ref when install runs from a build with no release ref. Install then leaves the scaffold at its stamped ref, so the check reads that ref.
  • It's skipped when the repository is unpinned or pinned to the running release.
  • A vendored install runs its own binary and workflows, so it's skipped too, with one exception: the managed GitHub poll caller passes a list secret. That caller always calls upstream reusable-poll-jira.yml at the pinned ref, and GitHub rejects it when the workflow there doesn't declare the secret (run against v0.55.0).
  • On GitHub with polling enabled, it also reads each reusable-poll-jira.yml that 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 status reports the same errors, for an installed repository and for one that is not installed yet.
  • This PR does not increment the config schema version (internal/config/managed-config-schema, 3 on main since 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:

  • the config names a variable other than the four above, and the managed caller, or a caller you maintain, calls reusable-poll-jira.yml. That workflow accepts only those four, and GitHub rejects a caller that passes it another secret (run);
  • a caller you maintain calls reusable-poll-jira.yml without 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

  • GitLab reports FULLSEND_JIRA_* variables as orphans, and repos status then exits with an error. This already happens on main for the Jira credentials that install writes since repos install: manage Jira polling for GitLab #9108. It will also happen for list variables with a FULLSEND_ name. One fix covers both.
  • The poller starts agent runs itself on GitHub. That would remove the artifact hand-off and the checkpoint ordering problem.

Testing

  • make lint passes (stage changes first, then run)
  • Tests added/updated for new or modified logic

Details:

  • The two new uses: lines reuse pins the repo already has, and pinact passes.
  • Unit tests cover the new keys, the conversion to the poller's lists, the unset-variable warning, the caller rendering, the install check and both install warnings.
  • TestJiraPollCallerPollAlignment checks that the job holding the secrets outputs only a count and a random suffix, and that the matrix job references no secrets.
  • TestJiraPollWorkflowCheckDispatches runs the check step once per Jira secret, including a token that contains " and <. TestJiraPollWorkflowSecretThreading checks that the step receives all four and no list secret.
  • I ran the managed caller on a fork, calling reusable-poll-jira.yml at e49176a8e (an earlier head of this PR) through workflow_call, with the real CLI and a mock Jira:
    • 0-dispatch cycle: the matrix job is skipped, the caller gets {"include":[]}, and dispatch is skipped.
    • List secret equal to the actor ID: the list secrets arrive through the caller's secrets: mapping, and all 4 dispatches reach the dispatch job.
    • These runs predate later pushes, which changed only the install warning, the install check for vendored installs, the GitLab text in the guide, the check step (no fromjson, since fix(jirapoll)!: unmarshal EventPayload as structured JSON in DispatchRecord #7518 made event_payload an object, and two more secrets checked), and tests. The changed check step is covered by TestJiraPollWorkflowCheckDispatches, not by a runner.
    • Differences from a real install: uses: points to the commit on the fork, the trigger is a push, dispatch calls a stub that prints the matrix, a show job is added, and the CLI is a vendored build of the same commit behind a wrapper that starts the mock.
  • Two calls in one run: both got the second poll's dispatches before the suffix (run), and each gets its own with it (run). "Re-run failed jobs" still reads the same artifact (run).
  • The secret-store recipe ran on a GitHub runner with fake IDs on 8 input shapes (run, jobs join_tr__*). No ID is printed.
  • Earlier, I ran the real poller inside copies of the workflow's steps on GitHub (run). The CLI was built from this commit and polled a mock Jira, with fake secrets. The poll, check, save and read steps and the whole matrix job were copied unchanged.
    • The poller read accounts_from and groups_from from secrets. The listed account and the listed group's member were dispatched, and a stranger was not.
    • The matrix arrived although one list secret equals an actor ID in it, and the matrix job downloaded the artifact with permissions: {}.
    • With the first upload and the first download made to fail, the second tries ran and the matrix was still built.
  • An earlier run with a fixed dispatch file covers the rest (run):
    • a control job in the old single-job shape lost its output (Skip output 'matrix' since it may contain secret);
    • the credential check caught a leaked token, including one stored with a trailing space, and didn't fail on a token ending with a newline.
  • I ran the built CLI in a Linux container against the same mock for four cases: a comma list, one entry per line, both variables unset (no dispatch, one warning per variable), and one variable empty.
  • Not tested: a real Jira site, and the GitLab variable settings in the guide. They follow GitLab's documentation and its source at the release tags; I did not run them on a GitLab instance.

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO) — human and human-directed agent sessions only
  • I wrote this contribution myself and can explain all changes in it

🤖 Generated with Claude Code

@gwenneg
gwenneg requested a review from a team as a code owner November 10, 2026 09:21
@github-actions

Copy link
Copy Markdown

E2E tests did not run

E2E tests run automatically for pull requests authored by users with write access or higher.

For other contributors, someone with write access must add the ok-to-test label after the latest push.

Reason: unauthorized

See E2E testing guide for details.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Read Jira authorization lists from environment variables

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Allow Jira write and triage lists to come from environment variables instead of public
 configuration.
• Forward only configured GitHub secrets and build dispatch matrices in a secret-free job.
• Add fail-closed validation, install warnings, tests, and setup guidance.
Diagram

graph TD
  CFG["Jira config"] --> INSTALL["Repo install"] --> CALLER["Managed caller"] --> POLL["Jira poll"] --> FILE[("Dispatch artifact")] --> MATRIX["Matrix job"] --> DISPATCH["Agent dispatch"]
  CFG --> POLL
Loading
High-Level Assessment

Keep the environment-backed lists and secret-free matrix job. Inline lists would retain the public-repository exposure, while emitting the matrix from the secret-bearing poll job would risk GitHub dropping its output. The artifact boundary preserves the existing dispatch interface.

Files changed (24) +1059 / -117

Enhancement (10) +455 / -62
reusable-poll-jira.ymlIsolate matrix output from Jira secrets +106/-15

Isolate matrix output from Jira secrets

• Declares optional authorization-list secrets for the poll step. Checks dispatch records for Jira credentials, transfers nonempty records by artifact with retries, and builds the matrix in a second job without secrets.

.github/workflows/reusable-poll-jira.yml

poll.goResolve Jira authorization lists for polling +30/-12

Resolve Jira authorization lists for polling

• Passes environment access into Jira poll options so list variables are resolved for each poll. Empty resolved lists deny access and produce warnings naming variables, without logging their values.

internal/cli/poll.go

poll_jira_gitlab.goEnable environment-backed lists in GitLab polling +1/-1

Enable environment-backed lists in GitLab polling

• Passes environment access to the shared Jira poll options builder for GitLab.

internal/cli/poll_jira_gitlab.go

config.goAdd validated environment-backed Jira actor lists +99/-5

Add validated environment-backed Jira actor lists

• Adds 'groups_from' and 'accounts_from', list resolution for comma- or newline-separated values, and collection of referenced variable names. Rejects invalid or empty names and fields specified in both inline and environment forms.

internal/config/config.go

managed.goPreserve environment names when cloning Jira lists +4/-4

Preserve environment names when cloning Jira lists

• Copies the full Jira actor list before independently cloning its inline slices, retaining the new '*_from' fields.

internal/config/managed.go

converge.goCheck Jira list support before install writes +6/-3

Check Jira list support before install writes

• Collects the expanded effective Jira poll state during discovery and invokes the compatibility check before reconciliation writes.

internal/repos/converge.go

github_jira_poll.goForward configured secrets and warn about omissions +78/-8

Forward configured secrets and warn about omissions

• Selects supported authorization secrets for the managed caller. Warns when a managed caller cannot forward a configured name or a user-owned reusable-workflow caller omits one.

internal/repos/github_jira_poll.go

jira_poll.goTrack list names and gate unsupported refs +93/-11

Track list names and gate unsupported refs

• Collects Jira authorization variable names from effective configuration even when polling is disabled. Checks pinned or retained scaffold refs for feature support before writes and passes names and warnings to reconciliation.

internal/repos/jira_poll.go

jira-poll-per-repo.yamlAdd poll-only list secret slots to caller template +7/-1

Add poll-only list secret slots to caller template

• Adds the four authorization-list secret mappings to the poll job, leaving the dispatch job without them.

internal/scaffold/fullsend-repo/templates/jira-poll-per-repo.yaml

jira_poll.goRender only requested Jira list secrets +31/-2

Render only requested Jira list secrets

• Defines the four supported managed-caller names and removes unused secret mappings during rendering, preserving callers whose configuration names no list secrets.

internal/scaffold/jira_poll.go

Tests (8) +408 / -46
poll_test.goTest poll authorization resolution and warnings +39/-8

Test poll authorization resolution and warnings

• Covers equivalent inline and environment-backed authorization, empty-variable denial and warnings, and unchanged behavior without a Jira provider.

internal/cli/poll_test.go

config_test.goTest Jira list parsing and validation +98/-2

Test Jira list parsing and validation

• Covers mixed list forms, splitting and trimming, blank values, variable-name collection, and rejection of conflicting or invalid configuration. Replaces the example account ID.

internal/config/config_test.go

effective_test.goVerify effective configuration retains list sources +5/-1

Verify effective configuration retains list sources

• Checks that effective YAML includes 'groups_from' and cloning retains environment-variable names.

internal/config/effective_test.go

github_jira_poll_test.goTest caller forwarding and install warnings +115/-7

Test caller forwarding and install warnings

• Verifies selective secret forwarding, rejection of an older pin before writes, and warnings for managed and user-owned callers.

internal/repos/github_jira_poll_test.go

jira_poll_test.goTest effective state and release compatibility +87/-11

Test effective state and release compatibility

• Covers supported, unsupported, unavailable, and retained refs, plus collection of list variables when Jira is not the selected tracker.

internal/repos/jira_poll_test.go

workflow_test_helper_test.goAdd a feature-capable workflow fixture +12/-1

Add a feature-capable workflow fixture

• Introduces a reusable-workflow fixture declaring the new list secrets and uses it for the current-release test pin.

internal/repos/workflow_test_helper_test.go

jira_poll_test.goVerify caller secret scope and workflow contract +43/-11

Verify caller secret scope and workflow contract

• Tests selective poll-job forwarding, absence of list secrets in agent dispatch, and alignment with the reusable workflow's new matrix job.

internal/scaffold/jira_poll_test.go

workflow_call_alignment_test.goAssert reusable poll workflow secret wiring +9/-5

Assert reusable poll workflow secret wiring

• Checks that all four list secrets are optional in the reusable workflow, reach its poll step, and appear in the caller template.

internal/scaffold/workflow_call_alignment_test.go

Documentation (6) +196 / -9
repos.mdDocument install behavior for environment-backed lists +14/-1

Document install behavior for environment-backed lists

• Explains supported managed-caller secret names, warnings for unsupported or unforwarded names, secret ownership, and the pre-write check for older pinned releases.

docs/cli/repos.md

operations.mdList optional Jira authorization secrets +1/-0

List optional Jira authorization secrets

• Adds the four optional repository secrets to the operations inventory and clarifies that users manage them rather than install or uninstall.

docs/guides/getting-started/operations.md

infrastructure-reference.mdIdentify user-managed Jira list secrets +5/-0

Identify user-managed Jira list secrets

• Adds the optional group and account list secrets to the infrastructure reference.

docs/guides/infrastructure/infrastructure-reference.md

custom-poller-example.mdWarn custom pollers about secret-masked matrix outputs +8/-0

Warn custom pollers about secret-masked matrix outputs

• Advises workflows receiving Jira list secrets to produce the matrix in a separate job without those secrets.

docs/guides/user/custom-poller-example.md

jira-integration.mdExplain private Jira list setup across forges +149/-4

Explain private Jira list setup across forges

• Documents environment-backed lists, fail-closed behavior, managed GitHub secrets, external secret stores, and GitLab variables. Updates the workflow explanation, troubleshooting guidance, and example account ID.

docs/guides/user/jira-integration.md

config-reference.mdSpecify Jira environment-list configuration +19/-4

Specify Jira environment-list configuration

• Adds the four '*_from' fields and describes parsing, validation, missing-variable behavior, and managed GitHub secret-name limits. Replaces the example account ID.

docs/reference/config-reference.md

@qodo-code-review

qodo-code-review Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Private Jira account IDs reach artifacts ✗ Dismissed
Description
The Check dispatches step scans only Jira credentials before Save dispatches uploads the
complete file, even though an actor ID in that file can equal a forwarded authorization-list secret.
When a listed account triggers a dispatch, repository readers can download that account ID from the
workflow artifact, including when the repository is public.


Remediation recommended

2. Escaped credentials pass the dispatch check ✓ Resolved

Resolving commit: ed07311

Resolution reason
The check now decodes the dispatch JSON with jq, including the nested event_payload JSON strings,
and searches the decoded strings for each trimmed FULLSEND_JIRA_TOKEN / FULLSEND_JIRA_CLIENT_SECRET
value, without printing the value. A regression test uses a credential containing a JSON-escaped
character.
Description
Check dispatches searches the JSON file for literal credential bytes, but JSON marshaling escapes
characters such as backslashes, quotes and angle brackets. If a Jira comment contains a credential
with one of those characters, the scan misses its encoded representation and the dispatch file
proceeds to the artifact and matrix output.

3. Secret store steps are hard to follow ✓ Resolved

Resolving commit: ed07311

Resolution reason
The prose paragraph was replaced with a three-step numbered list (fetch value in script step, mask
with ::add-mask:: before printing, append NAME=value to $GITHUB_ENV), each with its command in a
code block, so the masking step is explicit and ordered.
Description
The Vault-or-other-store subsection gives the procedure for a store with no GitHub Action as one
prose paragraph: fetch the value in a script step, mask it with ::add-mask::, and append
NAME=value to $GITHUB_ENV, followed by a version constraint. A reader setting this up has to
pull three ordered actions out of a sentence, and the masking step is the one that keeps the value
out of logs, so it is easy to skip. The same subsection also describes the poll-job setup for
maintained workflows in prose and bullets, not numbered steps.

Grey Divider

Context sources
✅ Compliance rules (platform): 103 rules
✅ Skills: 5 invoked
  writing-user-docs
  writing-adrs
  check-patch-coverage
  cutting-releases
  adr-corner
✅ Web pages:
  +2 more
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/experiments (sha: d4292120) — View relationship
  Explored: repo: fullsend-ai/.fullsend (sha: 5e159214) — View relationship
  Explored: repo: fullsend-ai/agents (sha: 82226d2a) — View relationship
✅ REVIEW.md
Review mode: Auto: 🧠 Deep: Dense security-sensitive change: authorization lists, secrets, workflow artifact handoff, install gating across 87 hunks.

Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread docs/guides/user/jira-integration.md Resolved
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://a8b2559a-site.fullsend-ai.workers.dev

Commit: 8639cdd41715a89c26407cd6601f0f13e9d69a5f

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two review findings below, both MEDIUM.

return cr
}
}
if err := checkJiraAuthorizationEnvSupport(ctx, d, cfg, refResolver); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: repos status does not run the new groups_from/accounts_from support check that install fails on

checkJiraAuthorizationEnvSupport is called only from convergeRepo (here). The repo's convention is that status reports any configuration error install would fail on. status.go:421-427 already does this for checkEstablishedServiceAccountSupport, with the comment "Report the configuration error install would fail on". So when the jira entry uses groups_from/accounts_from with a fullsend_ref or stamped scaffold ref that predates them, repos status reports the repo as clean and repos install then rejects it.

Suggestion: call checkJiraAuthorizationEnvSupport in the status path next to checkEstablishedServiceAccountSupport (status.go:424) and set status.Error. If that is not wanted, say in docs/cli/repos.md that only install runs this check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3da5167. repos status now runs checkJiraAuthorizationEnvSupport next to checkEstablishedServiceAccountSupport and sets status.Error.

One case is not covered: a repo that is not installed yet still shows "not installed" with no error, because status returns before that line. Tell me if you want that covered too.

return nil
}
names := strings.Join(d.jira.authEnv, ", ")
if refResolver == nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: support check fails hard with no GitHub client, unlike the sibling GitLab checks

Take a GitLab-only converge on a source or dev build: there is no fullsend_ref, cfg.UpstreamRef is empty, and the scaffold is stamped. establishedScaffoldRef then returns the stamped ref. With refResolver nil, this branch returns "... cannot be checked for support without an upstream GitHub client" and install stops. checkGitLabJiraOAuthSupport (gitlab_jira_poll.go) returns nil when the resolver is nil. The pinned-and-differing case is already rejected earlier, at converge.go:1501. So this branch only adds a new hard failure for unpinned dev-build GitLab installs. No test covers it, and neither a comment nor the docs explain why it differs from the sibling checks.

Suggestion: decide whether this branch should fail closed. If yes, add a test and a line in the docs and the code comment explaining why it differs from checkGitLabJiraOAuthSupport. If no, return nil when refResolver is nil and the ref came from establishedScaffoldRef.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3da5167, with your second option. The check now returns nil when there is no GitHub client and the ref comes from establishedScaffoldRef. A pinned ref keeps its error.

I also added a test for the stamped scaffold with no client.

@qodo-code-review

Copy link
Copy Markdown

Fixed in ed07311. The check now parses the records and their event_payload, and searches the decoded strings. TestJiraPollWorkflowCheckDispatches runs the step with a credential that contains `` and <. --comment_id=4548996815

The fix for finding 2 (Escaped credentials pass the dispatch check) is in the checked-out code. I read .github/workflows/reusable-poll-jira.yml at lines 138-169.

  • The step now writes jq -r '.., (.[].event_payload | fromjson | ..) | strings' dispatches.json to dispatch-strings.txt. It decodes each record's event_payload and checks the decoded strings, not the raw JSON bytes.
  • Each trimmed FULLSEND_JIRA_TOKEN and FULLSEND_JIRA_CLIENT_SECRET is still matched with grep -qF, and the step still fails with ::error:: on a match.
  • The test TestJiraPollWorkflowCheckDispatches is in internal/scaffold/jira_poll_test.go. I read it in the diff but did not run it.

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.

finding 1 (Private Jira account IDs reach artifacts) is a separate issue and is not addressed by this change. The step still checks only the token and client secret, and the full dispatches.json is still uploaded as an artifact. If you want that one closed, tell me to dismiss it, or push a change for it.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two review findings below, both MEDIUM.

2. Mask it before anything else prints it:

```bash
echo "::add-mask::$VALUE"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: the recipe for a store with no GitHub Action breaks on a one-ID-per-line list and can print IDs to the log

Line 965 says a list stored one entry per line also works. This recipe then runs echo "::add-mask::$VALUE" and echo "FULLSEND_JIRA_WRITE_GROUPS=$VALUE" >> "$GITHUB_ENV". When $VALUE has more than one line:

  • Only the first line is a workflow command, so only that line is masked. The other lines go to the job log as plain text. That leaks the IDs this feature is meant to hide, and on a public repo anyone can read them.
  • The NAME=value form in $GITHUB_ENV can't hold newlines. The runner either rejects the file or reads it wrong.

The earlier thread on this recipe was about readability. This is a separate problem.

Suggestion: turn the value into one line before masking, e.g. VALUE="$(printf '%s' "$VALUE" | tr '\n' ',')". Or mask each line in a loop and write $GITHUB_ENV with the NAME<<EOF_<random> delimiter form. Then run the recipe once and paste its real output.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5bcc93c. Step 1 now joins the value into one line: VALUE="$(<command> | tr -s '\r\n' ',')".

I added \r to your first suggestion. With tr '\n' ',' alone, a list with Windows line endings still printed entries 2 and 3.

I ran it on a GitHub runner with fake IDs, on 8 input shapes: run, jobs join_tr__*. No ID is printed, and a later step sees the variable as *** with the right entries.

continue-on-error: true
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: fullsend-jira-dispatches

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: a fixed artifact name with overwrite: true mixes up dispatches when a run calls the reusable workflow twice

Both uploads (lines 168 and 178) and both downloads (lines 207 and 213) use the fixed name fullsend-jira-dispatches, and the uploads set overwrite: true. Artifact names are unique per workflow run.

Say a user's own caller calls reusable-poll-jira.yml twice in one run, with a strategy matrix or two poll jobs:

  1. The second upload replaces the first.
  2. Both matrix jobs build from the same file.
  3. One poll's dispatches are lost after its Jira checkpoints have already moved. The other poll's dispatches run twice.
  4. Both runs still show green.

Before this PR the matrix went through a job output, so those callers worked. The managed caller calls the workflow only once, so only custom callers are affected.

Suggestion: give each call its own name. For example, have the poll job output a random suffix (e.g. from openssl rand -hex 8) next to dispatch_count, and use fullsend-jira-dispatches-${{ needs.poll.outputs.artifact_suffix }} in both the upload and the download. Or document that a run may call this workflow only once.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5bcc93c, with your first suggestion. The poll job outputs a random artifact_suffix, and both uploads and both downloads use it.

Tested on GitHub runners with a copy of the workflow and a fake poll step:

  • Before: two poll jobs in one run both got the second poll's dispatches (run).
  • After: each call gets its own (run).
  • "Re-run failed jobs" still reads the same artifact (run).

A strategy matrix still returns one leg's matrix to the caller. It does the same on main (run), because GitHub keeps one leg's output.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two review findings below, both MEDIUM.


#### GitLab: CI/CD variables

The Jira poll job receives the project's CI/CD variables, so any variable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: the GitLab recipe with the example FULLSEND_JIRA_* names makes repos status fail on orphan variables, and the guide doesn't say so

This subsection says "any variable name works", but every example in the guide uses FULLSEND_JIRA_WRITE_GROUPS and the other FULLSEND_ names. CheckOrphanVars (internal/repos/drift.go, lines 181-220) flags every repository variable that starts with FULLSEND_ and is not in the managed set. So a GitLab user who copies the example names gets orphan drift, and repos status exits with an error. The PR body lists this under "Not in this PR" (#9108), but a reader of the guide gets no warning.

Suggestion: add a sentence here that names #9108 and says these variables show up as orphan drift until it is fixed. Or, since GitLab accepts any name, tell readers to pick a name without the FULLSEND_ prefix (for example JIRA_WRITE_GROUPS) so no drift appears.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e49176a, with your second option. The GitLab section now says to use a name without the FULLSEND_ prefix, for example JIRA_WRITE_GROUPS, and why.

I didn't name #9108: it is the closed feature issue, and no open issue tracks the orphan report yet.

matrix:
description: Dispatch matrix accepted by reusable-dispatch.yml.
value: ${{ jobs.poll.outputs.matrix }}
value: ${{ jobs.matrix.outputs.matrix || '{"include":[]}' }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: the two-job hand-off was tested only as copied steps, never through workflow_call from a real caller

The PR body says "The caller and the workflow's matrix output are unchanged." The real run behind that (gwenneg/fullsend run 42791612406) copied the poll, check, save and matrix steps into a top-level push workflow and passed the secrets in directly. Three things have not run at the PR head:

  1. This workflow_call output fallback, jobs.matrix.outputs.matrix || '{"include":[]}', when the matrix job is skipped on a 0-dispatch cycle, and how the dispatch job's if: in the managed caller handles it (jira-poll-per-repo.yaml, line 53).
  2. List secrets arriving through the caller's secrets: mapping or secrets: inherit.
  3. The matrix output still arriving through workflow_call when a list secret equals the acting account ID.

The code looks right: a skipped job's output is empty, so the fallback applies. The gap is in the validation, not a known bug.

Suggestion: before merge, run the rendered managed caller once on a fork, calling reusable-poll-jira.yml at the PR head. Cover one 0-dispatch cycle (dispatch is skipped cleanly) and one cycle where a list secret equals the actor ID (the matrix arrives), and link the runs. Or reword the PR body to say only the copied steps were tested.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I ran the rendered managed caller on my fork, calling reusable-poll-jira.yml at e49176a, with the real CLI and a mock Jira.

  • 0-dispatch cycle: the matrix job is skipped, the caller gets {"include":[]}, and dispatch is skipped.
  • List secret equal to the actor ID: the list secrets arrive through the caller's secrets: mapping, and all 4 dispatches reach the dispatch job.

Differences from a real install:

  • uses: points to the commit on my fork. GitHub can't resolve it through fullsend-ai/fullsend before merge.
  • The trigger is a push.
  • dispatch calls a stub that prints the matrix, so no agent starts. Its needs, if: and matrix are the rendered ones.
  • A show job prints what the caller received.
  • The CLI is a vendored build of the same commit, behind a wrapper that starts the mock.

The PR description lists these runs.

gwenneg added a commit to gwenneg/fullsend that referenced this pull request Nov 12, 2026
gwenneg added a commit to gwenneg/fullsend that referenced this pull request Nov 12, 2026
gwenneg added a commit to gwenneg/fullsend that referenced this pull request Nov 12, 2026
gwenneg added a commit to gwenneg/fullsend that referenced this pull request Nov 12, 2026
@gwenneg
gwenneg force-pushed the feat/9132-jira-auth-from-env branch from 5bcc93c to e49176a Compare November 12, 2026 15:45

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One review finding below, MEDIUM.

Comment thread internal/repos/github_jira_poll.go Outdated
}
if exists && !scaffold.IsManagedJiraPollCaller(have) {
// A reusable workflow gets only the secrets its caller passes.
if missing := userJiraCallerUnforwarded(have, req.AuthorizationEnv); len(missing) > 0 && req.Warn != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: the user-owned caller warning gives advice that cannot work for non-standard names, and says nothing under secrets: inherit

For a user-owned caller, Ensure passes every *_from variable name to userJiraCallerUnforwarded(have, req.AuthorizationEnv), then tells the user to "add it to that job's secrets". But reusable-poll-jira.yml declares only the four FULLSEND_JIRA_{WRITE,TRIAGE}_{GROUPS,ACCOUNTS} list secrets (lines 51-57). Its poll step maps only those four into the poller env (lines 124-127).

  • Advice that cannot work. A name outside scaffold.JiraAuthorizationSecrets, such as MY_WRITE_GROUPS, cannot reach the poller through any secrets mapping. Adding it to the job's secrets does nothing.
  • No warning under inherit. jiraJobUnforwarded returns nil for secrets: inherit (lines 226-227). Inherit still reaches the poller only through those four env mappings. So a non-standard name under inherit gets no warning, and that list grants no one without saying so.

The managed-caller branch (lines 306-309) already gives the right advice: "rename it to one of ...". This fails closed (deny), so the impact is a misleading or missing warning, not a security hole.

Suggestion

  1. Split the names first with splitJiraAuthorizationEnv.
  2. For the forwardable names, keep the "add it to that job's secrets" advice, and treat secrets: inherit as forwarding exactly those names.
  3. For a non-forwardable name, always warn, whatever the secrets node says. Use the managed branch's advice: rename it to one of the four, or run the poller in your own job.
  4. Update TestConverge_GitHubJiraPoll_WarnsAboutListVariableItCannotForward so that inherit + MY_WRITE_GROUPS expects a warning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f8a5e6e, following your four steps.

  • The "add it to that job's secrets" warning now covers only the four standard names. secrets: inherit counts as passing them.
  • Any other name gets the rename advice, with a mapping or with inherit.
  • The test covers both names with both forms of secrets:.

One addition: the rename warning shows only when the caller has a job that calls reusable-poll-jira.yml. A caller that runs the poller itself gets no warning.

I also ran it on a fork. Passing MY_WRITE_GROUPS in the mapping makes GitHub reject the workflow at startup (run): "Invalid secret, MY_WRITE_GROUPS is not defined in the referenced workflow."

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two review findings below, both MEDIUM.

return fmt.Errorf("%s/%s: config.yaml reads %s with groups_from/accounts_from, and %s %q cannot be checked for support without an upstream GitHub client",
resolved.Owner, resolved.Repo, names, source, ref)
}
content, err := refResolver.client.GetFileContentAtRef(ctx, shimOwner, shimRepo, reusableJiraPollWorkflowPath, ref)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: the Jira list support check ignores vendor: true, unlike its sibling checks

checkJiraAuthorizationEnvSupport reads reusable-poll-jira.yml from upstream at the pinned fullsend_ref. If that file lacks FULLSEND_JIRA_WRITE_GROUPS, it rejects the repo. It never looks at resolved.Vendor.

The sibling checks do handle vendored installs:

  • checkPinnedServiceAccountSupport (gitlab_existing_wif.go:166) returns nil when resolved.Vendor is set.
  • checkOpenAIWIFContract (openai_wif.go:897-899) reads the vendored workflows through cfg.ReadVendoredWorkflow.
  • converge.go:1736-1739 skips the remote scaffold fetch for vendored installs, because what gets committed comes from the running binary's embedded templates and the vendored binary.

Failure case: a GitHub repo with vendor: true, a fullsend_ref pinned before #9132, and groups_from or accounts_from in config. Run it with a newer binary (the running one, or one passed with --fullsend-binary). Install and status refuse it with does not support; set fullsend_ref..., even though the vendored binary and workflows support the keys.

Suggestion: handle vendored installs the way the siblings do. Either check the vendored reusable-poll-jira.yml through cfg.ReadVendoredWorkflow when resolved.Vendor && cfg.ReadVendoredWorkflow != nil, or skip the check for vendored installs. Add a test for a vendored install with an old pin.

@gwenneg gwenneg Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f7888a5, but not with either option. Both would let a broken caller through.

  • The managed poll caller always calls upstream reusable-poll-jira.yml at the pinned ref, even with vendor: true. The vendored copy is never called.
  • So with a pin at v0.55.0 and groups_from: FULLSEND_JIRA_WRITE_GROUPS, the caller passes a secret that workflow does not declare. GitHub then rejects the caller at startup (run).

The check now skips a vendored install, except in that one case: GitHub, polling on, and the config reads one of the four FULLSEND_JIRA_* names.

Tests cover a vendored install with an old pin: polling off, another name, and a standard name.

Comment thread docs/guides/user/jira-integration.md Outdated
GitLab gives the variable to every job in pipelines on protected branches or
tags, not only the Jira poll job: agent jobs and the project's own jobs get it
too. The poller never prints the value, and if another job does, the log
shows `[MASKED]`. Some older self-managed GitLab versions refuse to mask a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: the guide misstates what happens when an older GitLab can't mask a comma-separated list

This says: "Some older self-managed GitLab versions refuse to mask a value that contains a comma. There, the value stays visible to any job that prints it."

GitLab checks the masking rules when the variable is saved. A value that fails them can't be saved as Masked at all, so it is not stored unmasked without the reader knowing. It ends up visible only if the reader then chooses to save it unmasked, and the text reads as if that is fine.

The sentence names no GitLab version. Neither does the rule "GitLab masks a value that contains a comma only when expansion is off" (line 1095), nor the Masked and hidden option (line 1093). The PR's Testing section also says the GitLab variable steps were not run on a GitLab instance.

Suggestion: rewrite the last sentence along these lines: "If GitLab refuses to save the value as Masked (versions that allow only a fixed character set), save one group ID per variable, or upgrade to a version that allows any character when expansion is off. Do not save the list unmasked." Name the GitLab version, or link the GitLab docs section, for the comma-masking rule and for Masked and hidden. Then either test the steps on a GitLab instance or mark them as not tested.

@gwenneg gwenneg Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f7888a5.

  • The guide now says GitLab refuses to save a value it cannot mask, and not to save the list unmasked.
  • It gives the versions: 15.9 for a comma with expansion off, 17.4 for Masked and hidden. It links GitLab's masking docs.
  • I left out "one group ID per variable". Each groups_from reads one variable, so the guide says only a one-entry list can be masked before 15.9.

I did not run the steps on a GitLab instance. The PR description says so.

@gwenneg
gwenneg force-pushed the feat/9132-jira-auth-from-env branch 2 times, most recently from 196aa41 to f7888a5 Compare November 12, 2026 22:29
@gwenneg

gwenneg commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

I rebased and fixed merge conflicts.

jq -e 'type == "array"' dispatches.json > /dev/null
# JSON escapes characters such as quotes, and event_payload is JSON
# inside a string, so search the decoded strings, not the file.
jq -r '.., (.[].event_payload | fromjson | ..) | strings' dispatches.json > dispatch-strings.txt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #7518 (merging soon), the event_payload is being changed from a JSON string to an object. The fromjson here should be dropped after a rebase on main (after #7518 merges).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 6c944a0. I rebased on main and dropped fromjson.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two review findings below, both MEDIUM.

Comment thread docs/reference/config-reference.md Outdated
accounts: ["712020:00000000-0000-0000-0000-000000000000"] # Jira account IDs
triage: # Fullsend role triage
groups: [example-team]
groups_from: FULLSEND_JIRA_TRIAGE_GROUPS # Or read a list from an environment variable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: the config reference example uses a FULLSEND_ list name, which the Jira guide tells GitLab users to avoid

The main config example uses groups_from: FULLSEND_JIRA_TRIAGE_GROUPS. The GitLab section of the Jira guide (docs/guides/user/jira-integration.md, near lines 1370-1378, added in e49176a) says GitLab users should not use the FULLSEND_ prefix. repos status reports unmanaged FULLSEND_ variables as orphan drift and exits with an error. This page gives no forge caveat, so a GitLab reader who copies the example hits that error. The earlier thread fixed the guide but not this page.

Suggestion: add a short comment next to the example:

  • On GitHub, the managed workflow forwards only the four FULLSEND_JIRA_* names.
  • On GitLab, use a name without the FULLSEND_ prefix, for example JIRA_TRIAGE_GROUPS.
  • Link the guide's GitLab section.

@gwenneg gwenneg Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ba11620. The example comment now says GitLab needs a name without the FULLSEND_ prefix. The "Lists from the environment" paragraph says the same, gives JIRA_TRIAGE_GROUPS as an example and links the guide's GitLab section. That paragraph already had the GitHub rule.

Comment thread docs/guides/user/jira-integration.md Outdated
repository.

List groups by group ID, not by name, and use groups rather than `accounts`.
A group ID does not resolve to a name or to members for someone who is not

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: the claim that a group ID reveals nothing to signed-out users has no source, and the security advice depends on it

This line says: "A group ID does not resolve to a name or to members for someone who is not signed in to your site." The guide uses that claim to recommend inline group IDs in a public config.yaml. Other outside claims in this section link a source or a run, such as GitHub masking and the GitLab masking versions. This one has no Atlassian reference and no test in the PR or in #9132. Whether a signed-out caller can resolve a group depends on the Jira Cloud "Browse users and groups" permission and the site's anonymous access settings.

Suggestion: do one of these:

  • Cite the Atlassian REST doc for /rest/api/3/group/member?groupId= and the permission it needs.
  • Test a signed-out request against a site.
  • Or soften the sentence ("on a site without anonymous access") and present groups_from as the way to keep IDs private.

@gwenneg gwenneg Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ba11620. I softened the sentence and added sources:

  • It now says Jira returns a group's name or members only to a caller with the Browse users and groups permission, and links the REST doc for group/member.
  • It says a site does not grant that permission to signed-out people unless an admin chose to, and links Atlassian's "Prevent or remove public access" page.
  • It presents groups_from as the way to keep the IDs private whatever the site's settings.

I also sent signed-out requests to ecosystem.atlassian.net, a public Jira Cloud site: group/member, group/bulk, group and user/groups returned 401, and groups/picker returned an empty list. I could not test a site that grants the permission to Anyone.

@gwenneg
gwenneg force-pushed the feat/9132-jira-auth-from-env branch 2 times, most recently from 27195c5 to ba11620 Compare November 13, 2026 23:09
@gwenneg

gwenneg commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

I rebased and fixed merge conflicts.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Four review findings below, all MEDIUM.

- **Visibility:** Masked and hidden (GitLab 17.4 or later), or Masked.
- **Flags:** select **Protect variable** and clear **Expand variable
reference**. GitLab masks a value that contains a comma only when
expansion is off, and only in GitLab 15.9 or later. See

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: wrong GitLab version for masking a comma list. The guide says 15.9, GitLab's docs say 16.6

Lines 1433-1436 say GitLab masks a value with a comma "only when expansion is off, and only in GitLab 15.9 or later". Lines 1446-1449 say "Before GitLab 15.9 a masked value can't contain a comma ... upgrade GitLab".

I checked GitLab's versioned doc/ci/variables/index.md, section "Mask a CI/CD variable":

  • At v15.9.0-ee and v16.5.0-ee, a masked value must be "8 characters or longer, consisting only of: Characters from the Base64 alphabet (RFC4648). The @, :, ., or ~ characters". So no comma is allowed.
  • The looser rule first appears at v16.6.0-ee: "Be 8 characters or longer". The character limit applies only "if variable expansion is enabled".

A user on GitLab 15.9 to 16.5 who follows the guide can't save the masked list, and the upgrade advice names the wrong version. The 15.9 figure came in with f7888a5, in reply to the earlier thread that asked for a version. That thread didn't check the number itself.

Suggestion: change both mentions from 15.9 to 16.6, and change the "Before GitLab 15.9" paragraph to match. Optionally, also say that Masked and hidden is GA in 17.6 and sits behind the ci_hidden_variables feature flag in 17.4 and 17.5.

@gwenneg gwenneg Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept 15.9, and tested it. I ran GitLab CE 15.8.6, 15.9.8 and 16.5.10 locally and saved a masked variable holding two group IDs separated by a comma, with expansion off, through the API: 15.8.6 refuses it (400), 15.9.8 and 16.5.10 save it (201). The change shipped in 15.9 (!109008 and !110773). The 16.6 docs wording comes from a docs-only change (!136405). Masked and hidden is on by default from 17.4 (docs), so I kept that too.

--output dispatches.json \
--fullsend-dir .fullsend

# The matrix job has no secrets, so GitHub no longer blocks a Jira

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: Check dispatches no longer covers FULLSEND_JIRA_EMAIL or FULLSEND_JIRA_CLIENT_ID

The matrix used to be an output of the poll job, which held all four Jira credentials, and GitHub dropped that output if it held any secret value. Now the matrix is built in a job with no secrets. The replacement "Check dispatches" step (lines 137-160) checks only FULLSEND_JIRA_TOKEN and FULLSEND_JIRA_CLIENT_SECRET. FULLSEND_JIRA_EMAIL and FULLSEND_JIRA_CLIENT_ID are declared as secrets and passed to the Poll Jira step, but the check skips them.

Example: a dispatch record contains the poller account's email because someone quoted it in a Jira comment. That value now goes into the uploaded artifact, the downstream matrix and event_payload without masking. Before this change, GitHub would have dropped the output.

Suggestion: add FULLSEND_JIRA_EMAIL and FULLSEND_JIRA_CLIENT_ID to the step's env and to the for name in ... loop. Extend TestJiraPollWorkflowCheckDispatches to cover them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 804e2da. The check step now also covers FULLSEND_JIRA_EMAIL and FULLSEND_JIRA_CLIENT_ID. The test has one case per secret, and TestJiraPollWorkflowSecretThreading checks that the step receives all four.

Comment thread internal/config/config.go
@@ -354,7 +423,7 @@ var jiraProviderKeys = map[string]bool{"provider": true, "write": true, "triage"

// jiraActorListKeys are the keys allowed in a jira provider write:/triage:
// mapping.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: groups_from/accounts_from change the config shape, but managed-config-schema stays at 2

This PR adds groups_from and accounts_from to jiraActorListKeys. Older releases check these keys strictly in AuthorizationProvider.UnmarshalYAML (checkMappingKeys), so v0.55.0 rejects a config that uses them.

internal/config/managed-config-schema (from #9292) says: "Increment it, and config.ManagedConfigSchemaVersion with a renderer for the previous version, whenever a per-repo configuration change is not readable by older releases." This PR leaves the declaration and ManagedConfigSchemaVersion at 2. ManagedConfigSchemaDependent and CheckManagedConfigSchemaCompat also don't know the new keys.

So a release that reads *_from and one that doesn't both declare schema 2, and the schema-compat path calls such a config compatible. Only the separate checkJiraAuthorizationEnvSupport check, which looks for a marker in reusable-poll-jira.yml, catches it. Install is still guarded, so this breaks the documented convention rather than causing silent breakage.

Suggestion: pick one.

  • Bump the schema to 3, with a version-2 renderer or compat check that rejects *_from and names the setting. Keep checkJiraAuthorizationEnvSupport only for cases the schema mechanism can't cover.
  • Or say in the PR, and in a code comment next to the declaration, why this change deliberately doesn't bump the schema.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the schema at 2 and said why in the PR description and in a comment in managed-config-schema. I tried the bump to 3 first:

  • v0.56.0-rc.1 then refuses every pinned repository whose config sets tracker ("declares schema version 3 … upgrade fullsend"), though the tracker shape did not change.
  • The schema path refuses a vendored install pinned to a schema-2 ref, which is the case fixed earlier in this PR.
  • It can't replace checkJiraAuthorizationEnvSupport: it runs only for a pinned ref, so both would stay, with two different errors for one problem.

You were right that status could call such a config compatible: it did for a repository that is not installed yet. Fixed in 117223a: status now runs the check there too.

Happy to bump if you still prefer it.

// load the config. The ref checked is the pinned fullsend_ref, or the ref the
// installed scaffold is stamped with when install will not refresh it (see
// establishedScaffoldRef). Any other repository runs the current release.
func checkJiraAuthorizationEnvSupport(ctx context.Context, d convergeDiscovery, cfg ConvergeConfig, refResolver *RefResolver) error {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: the support check skips a user-owned caller that pins an older reusable-poll-jira.yml

Anchored here because the related lines in internal/repos/github_jira_poll.go (52-56) are outside the diff.

For a user-owned caller with token (non-OAuth) credentials, checkGitHubJiraPollWorkflow returns nil at github_jira_poll.go:52-56 and never reads the caller's uses refs. This function reads reusable-poll-jira.yml only at the pinned fullsend_ref or the stamped scaffold ref. Its comment assumes "Every job runs the CLI at the scaffold's ref".

A user-owned caller that pins reusable-poll-jira.yml@v0.55.0 breaks that assumption. The reusable workflow installs the CLI at its own workflow_sha. That old CLI rejects groups_from in config.yaml, or GitHub rejects the caller at startup if it forwards FULLSEND_JIRA_WRITE_GROUPS. Install and status still pass, and every scheduled poll fails.

The OAuth path already handles this case by checking each pinned ref (requireUserJiraCallerWorkflowsOAuth). The earlier user-owned caller thread (fixed in f8a5e6e) changed which names the warning covers, not which ref the caller pins.

Suggestion: when d.jira.authEnv is not empty and the caller is user-owned, collect the caller's reusable-poll-jira.yml uses refs, as userJiraCallerOAuthUses does. Read each ref for jiraAuthorizationEnvMarker, and fail or warn when the marker is missing. Add a test with a user-owned caller pinned to an old ref.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a989d8c. When the config uses the new keys and the poll caller is user-owned, install and status now read each reusable-poll-jira.yml the caller pins and fail if it predates them. A vendored install is skipped: the old workflow runs the vendored binary there. The test table has cases for both.

@gwenneg
gwenneg force-pushed the feat/9132-jira-auth-from-env branch from ba11620 to 804e2da Compare November 14, 2026 01:31
@gwenneg
gwenneg force-pushed the feat/9132-jira-auth-from-env branch from 804e2da to 117223a Compare November 14, 2026 02:00
@gwenneg
gwenneg force-pushed the feat/9132-jira-auth-from-env branch from 117223a to a989d8c Compare November 14, 2026 02:15
@gwenneg
gwenneg requested a review from waynesun09 November 17, 2026 13:15
@gwenneg
gwenneg force-pushed the feat/9132-jira-auth-from-env branch from a989d8c to 22e1681 Compare November 18, 2026 22:19
gwenneg added a commit to gwenneg/fullsend that referenced this pull request Nov 18, 2026
gwenneg added a commit to gwenneg/fullsend that referenced this pull request Nov 18, 2026
gwenneg added a commit to gwenneg/fullsend that referenced this pull request Nov 18, 2026
gwenneg added a commit to gwenneg/fullsend that referenced this pull request Nov 18, 2026
@gwenneg

gwenneg commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

I rebased and fixed conflicts.

@waynesun09 main is now at schema 3 (#9422). Do you want this PR to bump it to 4? It would undo an earlier fix in this PR: install would reject a vendored repository pinned to an older release when its config uses the new keys. Without the bump, the existing check still refuses the new keys for an older ref. I tested both cases locally with the repo's install test harness.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two MEDIUM findings from a review-only pass, posted inline.

job, and set the output from a second job that reads it.
`reusable-poll-jira.yml` does it this way.

#### GitLab: CI/CD variables

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: GitLab: a pipeline or schedule variable can override the authorization list, and the guide does not say so

On GitLab, groups_from/accounts_from read an ordinary CI/CD variable from the poll job's environment. Pipeline and schedule variables take precedence over project CI/CD variables. Someone who can run a pipeline or set a schedule variable on the protected ref the poll job runs on can define JIRA_WRITE_GROUPS and give their own Jira group write access, with no review of .fullsend/config.yaml.

The scaffold already treats this variable class as attacker-reachable: run-poll-job.sh:145 says "A pipeline/schedule variable of either name could ..." and pins those names. ci_pipeline_variables_minimum_override_role = no_one_allowed is only required for the trigger fast path. Per docs/cli/repos.md, a polling-only install that fails that check is deferred while polling continues. This section (lines 1539-1567) covers only the Protect, Mask and Expand settings and says nothing about this precedence.

I did not reproduce the exploit: this is a threat-model gap in the docs and a missing guard.

Suggestion: In this section, say that pipeline and schedule variables outrank project variables, and recommend ci_pipeline_variables_minimum_override_role: no_one_allowed for any repo that uses *_from. Better: have repos install/repos status warn when a GitLab repo uses *_from and the live override role is weaker than no_one_allowed, or have the GitLab poll script refuse a list name that is also set as a pipeline or schedule variable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note to the GitLab section. Install already requires no_one_allowed: it fails under a weaker role, creates the Jira poll schedule only under that role (gitlab_jira_poll.go:280), and replaces a schedule that has variables. Tested on GitLab 19.5.6 and 18.11.14: under no_one_allowed adding a schedule variable is refused, but one added earlier still applies until install replaces the schedule. I did not add a guard in the poll script: a Developer token cannot read the role or another user's schedule variables. I did not add a repos status check in this PR.

Comment thread internal/repos/jira_poll.go Outdated
resolved := d.resolved
// A vendored install runs its own binary and workflows. Only the managed
// GitHub poll caller still calls upstream at that ref, and the workflow
// there must declare each list secret the caller passes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: Vendored exemption still runs the upstream pinned-ref check for a user-owned poll caller

A vendored install returns early here only when it is not GitHub, polling is off, or no standard FULLSEND_JIRA_* name is forwarded. Otherwise it falls through to the upstream reusable-poll-jira.yml check at the pinned fullsend_ref, without checking whether the poll caller is managed. The stated reason ("Only the managed GitHub poll caller still calls upstream at that ref", and the reply on f7888a5) holds only for the managed caller.

checkUserJiraCallerAuthorizationEnv skips vendored installs on purpose ("A vendored install runs its own binary there, so it is not checked"). So for a vendored GitHub repo with a user-owned poll caller (for example one using secrets: inherit, or one calling a local vendored copy) and an older fullsend_ref, install and status still reject the config, even though the vendored binary supports the keys. The two checks give opposite answers for the same case.

Suggestion: Apply the vendored fall-through only when the existing poll caller is managed (scaffold.IsManagedJiraPollCaller). For a user-owned caller, return nil as checkUserJiraCallerAuthorizationEnv does. Add a test-table case: vendored, user-owned caller, old pin, standard name.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as suggested: a vendored install with a user-owned poll caller is no longer checked against fullsend_ref. Added your table case, one for a vendored install whose managed caller is already committed (still rejected), and one for a caller that cannot be read.

…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>

This branch was successfully deployed

1 active deployment
site-preview — 8639cdd4 Deployed Nov 21, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jira authorization: read write/triage lists from the environment (groups_from, accounts_from)

3 participants