Skip to content

feat(jira): allow repositories to skip Jira actor authorization - #9881

Open
eshulman2 wants to merge 2 commits into
fullsend-ai:mainfrom
eshulman2:codex/jira-actor-authorization-opt-out
Open

eshulman2 wants to merge 2 commits into
fullsend-ai:mainfrom
eshulman2:codex/jira-actor-authorization-opt-out

Conversation

@eshulman2

@eshulman2 eshulman2 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a repo-level check_project_members boolean to the Jira authorization provider. Omitting it or setting it to true preserves the current policy.
  • Setting it to false skips Jira role and group lookups and admits any Jira actor at the dispatch gate on GitHub and GitLab targets. Harness filters still apply, the poller leaves the actor role unresolved, and its existing bot/automation/self-event filter remains active.
  • Reject combinations with write, triage, or labels, so actor restrictions cannot be silently ignored. Check pinned CLI and scaffold refs and remote user-owned GitHub poll workflow refs for parser support before installation writes configuration.
  • Include ADR 0177 and link it from ADRs 0054 and 0151 to record the Jira dispatch exception to actor verification, the human triage floor, and harness role minimums. Reconcile both normative authorization versions; model-bound record admission stays unchanged.
  • Add a contextual annotation to accepted ADR 0151; its original decision text is unchanged.
authorization:
  - provider: jira
    check_project_members: false

Anyone who can produce a matching event in the polled Jira scope can start an agent when the setting is disabled. The polling credential no longer needs Administer Projects to read the role roster in this mode.

Current behavior at the base commit

  • roleSourceFor selects the authorization source for each Jira event.
  • authorizeEvent applies event exceptions and actor thresholds before harness matching.

Verification

  • Added conflict validation, direct-struct validation, and both halves of the provider clone-isolation assertion.

  • Tested the dispatch gate and CEL matcher across comment, opened, label-added, and label-removed events; CEL filters still apply, and GitHub/GitLab authorization stays scoped.

  • Tested customer dispatch and continued filtering of Jira app actors during polling, plus bot and failed-verification actors at the dispatch gate.

  • Tested compatibility preflights for supported/old/missing refs, installed scaffolds, remote user-owned poll callers, missing clients and API failures, including rejection before secret/scaffold writes.

  • go test ./... passed.

  • Focused race tests for the new configuration, matcher, gate, poll-cycle and install-preflight cases passed; go vet for affected packages passed.

  • Staged make lint passed, including security scanning and Markdown links.

  • Approximate changed-line production coverage: 96.4%; the new compatibility preflight function: 96.8%.

  • The broader race-and-coverage run hit Go's default 10-minute suite timeout in internal/cli and internal/repos while running unrelated tests; it did not complete. The timeouts were not increased.

Signed-off-by: eshulman2 <ellashulman1@gmail.com>
@eshulman2
eshulman2 requested a review from a team as a code owner November 26, 2026 08:06
@qodo-code-review

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

Copy link
Copy Markdown

PR Summary by Qodo

Allow repositories to opt out of Jira actor authorization

✨ Enhancement 📝 Documentation 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Add an explicit Jira-only opt-out while preserving actor authorization by default.
• Skip Jira role and group lookups when opted out; harness triggers still control dispatch.
• Document the security trade-off and test configuration, polling, and dispatch behavior.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 2 capabilities

  • 2 affected capabilities span independent functional scopes: Jira-to-agent dispatch authorization, Jira-to-agent integration lifecycle.
  • The provider flag is translated through Jira polling into the shared Jira dispatch gate, allowing one bounded Jira-to-agent behavior to admit matching events.
  • Polling and dispatch are producer and consumer hops of that behavior, not independent capabilities.
  • Forge-native dispatch and model-bound record admission use separate paths.
  • This capability controls whether the same Jira polling integration can be installed or updated with a configuration key understood by its executing CLI and caller workflow.
  • It is a distinct operational outcome from event authorization, but remains within the bounded Jira-to-agent integration scope.
Behavioral complexity 🟡 Medium 🧩 Interacting branches

  • Before, Jira events generally required actor authorization and harness role thresholds.
  • After, one explicit provider state bypasses role verification and role thresholds for Jira while preserving polling filters, harness matching, and non-Jira authorization; false cannot be combined with list-based restrictions.
  • The new correctness condition is that the opt-out must consistently apply only to Jira, admit the intended external human cases, retain bot/self-authored polling filters, and reject contradictory authorization configuration.
  • The added external-actor behavior changes the affected audience but not the bounded end-to-end capability.
Potential damage 🔴 High 🩹 Integrity

  • If enabled for a Jira scope that is not trusted, an external or otherwise unauthorized human participant who creates a matching event can start an agent capable of modifying the target repository.
  • The follow-up confirms the opt-out bypasses the human triage floor and harness role minimums, while bot and self-authored events remain filtered before dispatch.
  • Reverting or disabling the opt-out stops new dispatches, but runs, commits, or other agent-side effects already produced may require audit and repair.
  • Disable the opt-out or restore actor authorization to stop new dispatches.
  • Previously created runs and repository or external effects require review and possible manual repair; no automatic compensation is established.
Assessed commit b8060d6
Diagram

graph TD
  C["Jira provider"] --> CLI["Poll CLI"] --> P["Jira poller"] --> G["Dispatch gate"] --> H["Harness CEL"] --> T["GitHub GitLab"]
  J["Jira API"] --> P
  C --> G
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use Jira account and group allowlists
  • ➕ Retains an explicit actor boundary without requiring project-role roster access.
  • ➖ Requires ongoing list management and does not admit every trusted Jira participant automatically.
2. Keep project-role authorization
  • ➕ Preserves the existing role-based dispatch boundary.
  • ➖ Requires access to Jira’s project-role roster and does not meet the all-participants use case.

Recommendation: Keep the explicit, default-off Jira exception for repositories that trust everyone able to produce matching events in their polled scope. Retain allowlists or project-role authorization where that trust assumption does not hold; harness filters alone are not an actor boundary.

Files changed (17) +226 / -30

Enhancement (6) +53 / -28
poll.goPass the Jira opt-out into polling and dispatch +7/-17

Pass the Jira opt-out into polling and dispatch

• Uses the shared provider-to-dispatch policy conversion and configures the poller to skip actor authorization without resolving configured lists when opted out.

internal/cli/poll.go

config.goAdd a strictly validated Jira-only boolean setting +24/-6

Add a strictly validated Jira-only boolean setting

• Adds 'check_project_members' to the Jira provider, with an explicit-false helper and strict boolean and provider validation. Excludes Jira actor-list environment names when actor authorization is disabled.

internal/config/config.go

managed.goClone the new authorization boolean +4/-0

Clone the new authorization boolean

• Deep-copies the optional boolean when cloning authorization providers, preventing a caller from mutating the stored setting through a shared pointer.

internal/config/managed.go

auth.goAdmit Jira events under the explicit actor-check opt-out +11/-3

Admit Jira events under the explicit actor-check opt-out

• Adds a Jira-specific dispatch option that bypasses actor-role gating for Jira events. Centralizes conversion from the Jira provider to dispatch options while leaving other sources’ authorization unchanged.

internal/harnessdispatch/auth.go

auth.goLeave opted-out Jira actor roles unresolved +3/-0

Leave opted-out Jira actor roles unresolved

• Selects the unresolved role source for opted-out events, avoiding project-role roster and group lookups.

internal/jirapoll/auth.go

types.goExpose the poller’s skip-authorization option +4/-2

Expose the poller’s skip-authorization option

• Adds an authorization option that tells the Jira poller to leave actor roles unresolved for all events.

internal/jirapoll/types.go

Tests (3) +79 / -1
poll_test.goTest opt-out propagation and harness filtering +36/-1

Test opt-out propagation and harness filtering

• Covers omitted, true, and false settings through poller and dispatch options. Confirms that an opted-out Jira event still needs a matching harness and that the exception does not admit a GitHub event.

internal/cli/poll_test.go

config_test.goTest setting validation and configuration isolation +20/-0

Test setting validation and configuration isolation

• Rejects non-boolean values and use on a non-Jira provider. Checks that the opt-out hides actor-list environment names and that retrieved configuration cannot be changed through its returned boolean pointer.

internal/config/config_test.go

auth_test.goTest polling without project-role access +23/-0

Test polling without project-role access

• Runs a poll cycle with a denied project-role lookup and an unlisted slash-command actor. Verifies dispatch, no role or group calls, and an unresolved actor role.

internal/jirapoll/auth_test.go

Documentation (8) +94 / -1
0054-require-authorization-on-all-agent-dispatch-paths.mdLink the Jira exception from the dispatch authorization decision +3/-0

Link the Jira exception from the dispatch authorization decision

• Links ADR 0177 so readers of the existing authorization decision can find the repository-level Jira exception.

docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md

0177-allow-repositories-to-skip-jira-actor-authorization.mdRecord the Jira actor authorization opt-out decision +56/-0

Record the Jira actor authorization opt-out decision

• Defines the opt-in exception, its default policy, GitHub and GitLab scope, and the security consequence of allowing any actor with a matching Jira event to start an agent.

docs/ADRs/0177-allow-repositories-to-skip-jira-actor-authorization.md

architecture.mdDocument the Jira dispatch authorization exception +3/-0

Document the Jira dispatch authorization exception

• Adds the repository-level opt-out to the architecture’s authorization boundary discussion and notes that harness filters remain active.

docs/architecture.md

README.mdMention the Jira opt-out in poll command documentation +1/-1

Mention the Jira opt-out in poll command documentation

• Points users of Jira polling to the new setting and its integration guide.

docs/cli/README.md

jira-integration.mdExplain how and when to enable the Jira opt-out +21/-0

Explain how and when to enable the Jira opt-out

• Provides a YAML example and describes the remaining trigger filters, reduced polling-credential requirements, and risk of agent runs initiated by any actor in the polled scope.

docs/guides/user/jira-integration.md

README.mdSpecify the Jira dispatch-gate exception +5/-0

Specify the Jira dispatch-gate exception

• States that the explicit setting admits Jira events regardless of actor role while preserving harness filters.

docs/normative/authorization/v1/README.md

security-threat-model.mdRecord the opt-out’s security implication +4/-0

Record the opt-out’s security implication

• Notes that Jira participants able to produce matching events can trigger agent runs when a repository disables actor authorization.

docs/problems/security-threat-model.md

config-reference.mdReference the new Jira authorization setting +1/-0

Reference the new Jira authorization setting

• Documents the boolean default and explains that disabling actor checks bypasses Jira authorization lists and label policy, but not harness triggers.

docs/reference/config-reference.md

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. The config test fails on every run ✓ Resolved Bug Correctness

Resolving commit: b8060d6

Resolution reason
The test now asserts the mutated clone no longer skips authorization (assert.False on
provider.SkipsJiraActorAuthorization()) while a fresh cfg.JiraAuthorization() still skips,
correcting the incorrect expectation that caused the failure.
Description
TestJiraCheckProjectMembersValidation changes a returned provider's setting to true but then
expects a fresh provider from cfg.JiraAuthorization() to report that authorization is skipped.
JiraAuthorization() returns a clone each time, so the fresh provider retains the configured
false value and the assertion fails.

Grey Divider

Context sources
✅ Compliance rules (platform): 96 rules
✅ Skills: 5 invoked
  writing-user-docs
  writing-adrs
  check-patch-coverage
  cutting-releases
  adr-corner
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/react-shopping-cart (sha: ae9ac17b) — View relationship
  Explored: repo: fullsend-ai/.fullsend (sha: 85ad2d8a) — View relationship
  Explored: repo: fullsend-ai/agents (sha: 95c86504) — View relationship
✅ Context preparation
  Past issues: summarized; full text retained for this review
Review mode: Auto: ⚖️ Balanced: Security-sensitive authorization bypass spans configuration, polling, and dispatch paths.

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread internal/config/config_test.go Resolved
@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://2cf699da-site.fullsend-ai.workers.dev

Commit: e018304c3996d9027f0d1d86a764e63f6779fa2f

@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/config/config.go 81.81% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@jflowers jflowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Council Review: APPROVE WITH ADVISORIES

7 reviewer runs completed (adversary, architect, curator, fullsend, gaze-testing, guard, testing); all succeeded. 8 findings: 0 CRITICAL, 0 HIGH, 2 MEDIUM, 6 LOW. All are test coverage and clarity hardening; the council found no defects in the authorization logic itself.

What this PR does well: the bypass is scoped to SystemJira events only, harness CEL triggers still apply, the default (omitted or true) preserves the existing policy, config validation is strict (bool scalar only, jira provider only, enforced in both UnmarshalYAML and ValidateAuthorization), the managed-config clone deep-copies the new pointer field, and the trade-off is documented across ADR 0177, the integration guide, architecture, normative authorization, config reference, and the threat model. CI is fully green including codecov/patch.

Advisories (details inline):

  • MEDIUM: the new skip branch in authorizeEvent and AuthOptionsForJiraProvider have no unit cases in internal/harnessdispatch/auth_test.go, the owning package that unit-tests every other gate branch (divisor-testing)
  • MEDIUM: only the slash-command event kind is behaviorally tested of the three the docs promise under the opt-out; label-added, issue-opened, and list/allowlist combinations are untested (divisor-testing)
  • LOW: clone-isolation assertion in TestJiraCheckProjectMembersValidation is half-asserted and undocumented; the qodo bot's "fails on every run" claim is a false positive (divisor-gaze-testing, divisor-testing)
  • LOW: GitHub-event denial asserted outside the production Match path (divisor-gaze-testing)
  • LOW: skip-path return of jiraPollAuthorization asserted field-by-field rather than as the full struct (divisor-testing)
  • LOW: the ValidateAuthorization guard for non-jira providers appears unreachable through the public parse API (divisor-testing)
  • LOW (security, for the record): the opt-out intentionally lets any Jira actor in the polled scope start agents; contained and documented per ADR 0177 (divisor-fullsend)

the contract looks solid overall. a few spots worth double-checking before it lands.

This review was generated by /uf.review-pr (AI-assisted).

Comment thread internal/harnessdispatch/auth.go Resolved
Comment thread internal/cli/poll_test.go Resolved
Comment thread internal/harnessdispatch/auth.go Resolved
Comment thread internal/cli/poll_test.go Resolved
Comment thread internal/cli/poll_test.go Resolved
Comment thread internal/config/config_test.go Resolved
Comment thread internal/config/config.go Resolved

@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.

Review comments below: three inline, and one in this body because its file is not in the diff.

MEDIUM: No version-skew preflight for the new check_project_members key (internal/repos/jira_poll.go, near line 196, not in this diff)

Older CLI releases validate jira provider keys against a fixed jiraProviderKeys set and reject unknown keys. A repository whose jobs run an older pinned fullsend_ref or scaffold ref will fail to load config.yaml in every job once it adds check_project_members. The repo already guards this exact failure class for groups_from/accounts_from with checkJiraAuthorizationEnvSupport, whose comment reads "an older CLI rejects the keys, so no job could load the config". No equivalent guard or documented minimum release exists for the new key.

Suggestion: Add a preflight in repos install similar to checkJiraAuthorizationEnvSupport for check_project_members, or document the minimum CLI release that accepts the key in the guide and config reference.

Verified: read code at head (jira_poll.go checkJiraAuthorizationEnvSupport, config.go jiraProviderKeys) at e018304; raised by: DeepSeek

Comment thread internal/config/config.go Resolved
Comment thread internal/harnessdispatch/auth.go Resolved
Signed-off-by: eshulman2 <ellashulman1@gmail.com>
@eshulman2

Copy link
Copy Markdown
Contributor Author

Addressed the review in b8060d6.

  • Reject check_project_members: false alongside write, triage or labels; document the unrestricted-actor choice explicitly.
  • Addressing the version-skew finding in the review body: added an install preflight for the key itself (including explicit true), checking pinned CLI refs, retained scaffold refs, and remote user-owned GitHub poll workflow refs. Tests cover supported/old/missing refs, API failures, and rejection before secret/scaffold writes. The guide explains vendored and local-workflow responsibilities.
  • Reconcile ADRs 0151/0177 and both normative authorization versions, preserving model-bound admission gates.
  • Add the requested gate, matcher, clone-isolation, direct-validation and poll-cycle coverage. Customer actors dispatch under the opt-out; bot actors are admitted by the dispatch gate but remain filtered by the poller's existing bot/automation/self-event filter.

Validation: go test ./..., focused race tests for all changed authorization paths and preflight cases, affected-package go vet, and staged make lint passed. Approximate changed-line production coverage is 96.4%; the new preflight function has 96.8% coverage.

The broader race-and-coverage suites in internal/cli and internal/repos hit the default 10-minute timeout while running unrelated tests. I kept the suite timeout unchanged and recorded the limitation in the PR description.

@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.

Review comments below: one inline, and one in this body because its file is not in the diff.

MEDIUM: repos status does not run the new check_project_members support check, so status and install disagree (internal/repos/status.go, near line 415, not in this diff)

At converge.go:1623, convergeRepo calls checkJiraProjectMembersSupport before checkJiraAuthorizationEnvSupport. In status.go, the jiraAuthorizationEnvError closure (lines 406-416, used at 436 and 484) wraps only checkJiraAuthorizationEnvSupport. Take a repository that sets check_project_members in config.yaml and whose pinned fullsend_ref or installed scaffold ref predates this PR:

  • repos status reports no configuration error.
  • repos install fails with "does not support check_project_members".
  • Every job at the old ref rejects the config, because the older jiraProviderKeys rejects unknown keys.

docs/cli/repos.md says dry-run, install and status agree.

Suggestion: Also call checkJiraProjectMembersSupport from the status closure, using the same convergeDiscovery and ConvergeConfig, and return the first error. Add a checkRepoStatus test for the old-pin case that mirrors TestConverge_JiraProjectMembers_RejectsOldPinBeforeWrites.

Verified: read code at head (status.go 403-490, converge.go 1623-1627) at b8060d6; raised by: Claude, DeepSeek

if err != nil && !forge.IsNotFound(err) {
return fmt.Errorf("%s/%s: checking %s %q for check_project_members support: %w", resolved.Owner, resolved.Repo, source, ref, err)
}
if err != nil || !bytes.Contains(content, []byte(`yaml:"check_project_members,omitempty"`)) {

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 detection greps a struct-tag substring in config.go, and managed-config-schema does not record the exception

checkJiraProjectMembersSupport fetches internal/config/config.go at the ref and checks bytes.Contains for yaml:"check_project_members,omitempty". A NotFound result is folded into "does not support". Several ordinary later refactors would make every newer ref look unsupported and block installs with a misleading "update the reference" error:

  • moving the struct to another file
  • dropping omitempty
  • reformatting the tag

A comment that contains the literal would falsely pass. The sibling check uses a dedicated marker constant (jiraAuthorizationEnvMarker).

Also, internal/config/managed-config-schema says to bump the schema version whenever a per-repo config change is not readable by older releases. It records groups_from/accounts_from as the one exception. This PR adds a second such key without bumping the version or adding itself to that note.

Suggestion: Use a stable capability marker that exists to be checked, for example a line or constant in managed-config-schema, and check that marker instead of a struct tag. Alternatively, bump the managed schema version and gate the key on it. Either way, list check_project_members next to groups_from/accounts_from in the managed-config-schema exception comment.

Verified: read code at head (jira_poll.go 555-605, managed-config-schema) at b8060d6; raised by: Claude, DeepSeek

This branch was successfully deployed

1 active (outdated) deployment
site-preview — e018304c Deployed Nov 26, 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.

3 participants