Skip to content

Refactor Jira poller internals to accept multiple projects #9883

Done

Description

@ifireball

Parent

#9677 — Let a Jira poll cover more than one project

What to build

Refactor the Jira poller internals to process an explicit set of project keys without changing the current configuration shape. The existing single-project configuration continues to call the poller with a one-item set. This creates the internal capability that the entity-source configuration work under #8418 can later feed with several projects.

Acceptance criteria

  • The poller accepts a non-empty set of Jira project keys; the existing single-project path supplies its configured project as a one-item set and retains current behavior.
  • Every search is constrained to exactly the supplied project set, independently of the configured JQL predicate. A predicate cannot widen that scope, and a trailing ORDER BY remains in its correct position.
  • Each returned issue resolves its role roster using that issue's project. A roster failure retains the current fail-closed behavior.
  • Poll limits and pagination budgets apply across the whole set. Duplicate canonical issues returned through overlapping project selections are handled once per cycle, and checkpoint/dispatch behavior remains compatible.
  • An empty or malformed project set fails before making a Jira request.
  • This issue does not add or change a user-facing configuration field.

Activity

  1. added
    ready-for-agent
    on Nov 26, 2026
  2. fullsend-ai-triage commented on Nov 26, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 10:13 AM UTC · Completed 10:15 AM UTC

    Commit: d9d65b1 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.13

  3. added
    triaged
    on Nov 26, 2026
  4. fullsend-ai-triage commented on Nov 26, 2026

    @fullsend-ai-triage

    This issue is specified well enough to implement; the parent (#9677) supplies the design context.

    Where the single-project assumption lives (verified in the current tree): the JiraProject option in internal/jirapoll/types.go, the one-roster-per-cycle loading in auth.go and poller.go, the project-mismatch-means-external check in convert.go, the default JQL in poller.go, and ScopeJQLToProject in internal/config/issue_targets.go. The role-resolution change is the substantive part, not the JQL wrapping.

    Things to watch

    • A one-item set must produce identical JQL and behavior to today.
    • The scoping clause must be applied outside the user predicate, with a trailing ORDER BY kept last.
    • Roster failures must keep failing the cycle closed, now per issue project.
    • Validation of the project set must happen before any Jira request.

    Proposed test case

    Table tests across jirapoll/config:
    - one-item set => JQL and behavior identical to current
    - two-project set => `project in (...)` scoping; a predicate with its own project/OR clause cannot widen scope; ORDER BY last
    - mixed-project cycle => each issue resolves its role from its own project's roster; roster load failure => cycle fails closed
    - caps/pagination shared across the set; duplicate issues dispatched once
    - empty or malformed set => error, zero Jira requests
    

    No open PR addresses this and no blocking work was found. It is a refactor with no user-facing config change, so it falls outside the bug/documentation/performance auto-promotion categories; it already carries the ready-for-agent label.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  5. csoceanu commented on Nov 26, 2026

    @csoceanu
    Contributor

    /fs-code

    Implement #9883 as internal Jira poller work only.

    The future configuration implementation in #9884 will depend on this capability. Do not add or modify any user-facing configuration fields in this PR.

    Requirements:

    • Start from current main; keep this independently mergeable.
    • Preserve the existing one-project behavior exactly. The current tracker.jira.project path must call the poller with a one-item project set.
    • Refactor the poller internals to accept an explicit, non-empty set of Jira project keys.
    • Scope every Jira search to exactly that project set, independently of the configured predicate. A predicate must not widen the scope, and any trailing ORDER BY must remain last.
    • Resolve each issue’s Jira role roster using that issue’s project. Preserve the existing fail-closed behavior when a roster lookup fails.
    • Apply polling limits and pagination budgets across the entire project set.
    • Deduplicate the same canonical issue returned through overlapping project selections so it is processed once per cycle.
    • Preserve checkpoint, authorization, and dispatch behavior.
    • Reject empty or malformed project sets before making any Jira request.
    • Preserve the one-poller-per-repository decision from ADR-0085.
    • Do not duplicate or stack on the open ADR-0085 PR chain; account for any overlap and document it in the PR.

    Add regression coverage for:

    • One-project behavior and unchanged JQL.
    • Two-project scoping.
    • A predicate containing its own project or OR clause.
    • Mixed-project role resolution.
    • Role-roster failure and fail-closed retry behavior.
    • Shared limits and pagination.
    • Duplicate canonical issues.
    • Empty and malformed project sets with zero Jira requests.
  6. fullsend-ai-coder commented on Nov 26, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 10:27 AM UTC · Completed 10:49 AM UTC

    Commit: d9d65b1 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $4.88

  7. added a commit that references this issue on Nov 26, 2026
  8. added 2 commits that reference this issue on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready-for-agenttriaged

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions