Skip to content

forge: add a jira provider preset (hybrid tracker — issues from Jira, PR concepts fall through to github, Linear-style) #1740

Closed

Description

@amrmelsayed

Motivation

An upcoming project will track its work in Jira. Codev's forge concept layer (spec 589) has no Jira provider today, so issue-driven protocols (BUGFIX, AIR, PIR spawns keyed to issue ids, porch issue lookups, dashboard/VS Code issue surfaces) cannot run against a Jira-tracked project without hand-rolled per-concept overrides in every repo.

Precedent: Linear, the hybrid-forge template (spec 719)

Jira should follow the Linear shape exactly: a hybrid provider that owns issues while every PR concept falls through to the github default (Linear's preset comment is explicit that even pr-create falls through, so the provider is never in the odd position of merging PRs it cannot open). Linear implements: auth-status, issue-comment, issue-list, issue-search, issue-view, recently-closed, user-identity (packages/codev/scripts/forge/linear/).

Proposed work

  1. Preset scripts at packages/codev/scripts/forge/jira/ mirroring the Linear concept set, wrapping a Jira CLI or the Jira REST API, and emitting the JSON shapes in forge-contracts.ts (note the presets file warns non-GitHub schemas are best-effort; consumers already tolerate null on parse failure, but new scripts should aim for contract conformance).
  2. Register the preset in getProviderPresets() (packages/codev/src/lib/forge.ts), PR concepts falling through to github like Linear.
  3. Auth story: decide the credential source (Jira API token / PAT via env, or the CLI's own auth) and implement auth-status so codev doctor can report it honestly.
  4. Non-numeric issue ids end-to-end: Jira ids are KEY-123, not bare numbers. Validate the full path: afx spawn <id>, branch naming (builder/bugfix-<id>), commit-message conventions, porch state keyed by id, and the VS Code open-issue-by-id command (which already anticipates non-numeric identifiers). The Linear lane is the template for what needed touching.
  5. Docs: provider selection via .codev/config.json forge.provider, concept override examples. Skeleton user-facing docs keep hardcoding gh per the existing convention; the forge abstraction stays internal.

Open questions for scoping

  • Which Jira CLI to wrap, if any, versus direct REST calls with curl + jq (zero-dependency, matches the shell-script preset style).
  • Mapping of concept semantics: Jira "resolved/done" statuses for recently-closed; JQL for issue-search and issue-list; comment body format (Jira wiki markup vs ADF) for issue-comment.
  • Whether auto-close-on-merge conventions (Fix <id> subjects) have a Jira equivalent (smart commits) and whether protocols should use or avoid them.

Interim workaround

Until the preset ships, a project can wire Jira today with per-concept overrides in .codev/config.json (forge section): override the issue concepts with Jira commands and leave PR concepts on the github default. The preset turns that boilerplate into "provider": "jira".

Activity

  1. added
    area/core
    on Sep 27, 2026
  2. amrmelsayed commented on Oct 11, 2026

    @amrmelsayed
    CollaboratorAuthor

    Architect ruling (2026-10-12): protocol + scoping decisions

    Protocol: PIR. The hybrid-provider pattern is settled by spec 719 (Linear), so no spec is needed, but the Jira-specific mapping choices below deserve a reviewed plan before coding.

    Owner decisions (fixed constraints for the plan):

    1. Target: Jira Cloud. Data Center is out of scope for this preset. Document that; a Data Center preset (community jira-cli) is a separate issue if demand appears.
    2. Integration: Atlassian's official CLI, acli. The preset wraps acli jira workitem ... and acli jira auth ... the way the github preset wraps gh. No direct REST calls; no third-party CLI. Each script declares # forge-executable: acli. Verify the installed CLI's exact subcommands and flags with acli jira --help before coding (the official reference is developer.atlassian.com/cloud/acli/reference/commands/); do not code against third-party skill pages.
    3. Auth story. The user runs acli jira auth login once (browser OAuth or API token); the CLI owns the credential. auth-status is a single authenticated call through acli and is what codev doctor reports. Codev never reads, stores, or passes a Jira token. Note the known upstream bug where token login fails for service accounts (CLOUD-12991): document that a standard user account is required.
    4. Shape: hybrid, mirroring the Linear preset exactly. Issue concepts only (auth-status, issue-comment, issue-list, issue-search, issue-view, recently-closed, user-identity); every PR concept falls through to the github default, including pr-create. Register in getProviderPresets() (packages/codev/src/lib/forge.ts) alongside linear. The same forge.<key> config to CODEV_<KEY> env plumbing carries the Jira site and project key.
    5. "Closed" semantics. recently-closed matches on status category Done, never on status names (names are per-tenant).
    6. Search and list. JQL scoped to the configured project key; issue-list defaults to open items in that project.
    7. Comment body. Pass the body through acli as it accepts it; if acli requires Atlassian Document Format rather than plain text, wrap as plain paragraphs and document the markdown-fidelity limitation. No markdown-to-ADF converter in this lane.
    8. No smart commits. Protocols do not rely on Fix KEY-123 auto-transitions; closing an issue on merge stays the architect's job, as everywhere else in Codev.
    9. Non-numeric ids. Jira keys (KEY-123) must flow end to end: afx spawn <id>, branch naming, porch state keyed by id, commit-message conventions, and the VS Code open-issue-by-id command. The Linear lane (spec 719) is the template for what needed touching; re-verify each site rather than assuming it still holds.
    10. Docs. Provider selection via .codev/config.json forge.provider: "jira", prerequisites (acli install + login), and the Cloud-only scope. Skeleton user-facing docs keep hardcoding gh for PR work per the existing convention.

    Verification at the dev gate: exercise the real path against a live Jira Cloud site: codev doctor auth report, afx spawn --protocol bugfix <KEY-N> resolving the issue, issue-comment landing on the work item, recently-closed returning only Done-category items.

  3. amrmelsayed commented on Oct 11, 2026

    @amrmelsayed
    CollaboratorAuthor

    On it! Working on this with the PIR protocol (plan + dev-approval gates before PR).

  4. added 2 commits that reference this issue on Oct 11, 2026
  5. added 10 commits that reference this issue on Oct 21, 2026
  6. 7 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions