Skip to content

feat(#9288): add optional Jira run-start label - #9342

Merged
waynesun09 merged 4 commits into
fullsend-ai:mainfrom
ederign:feat/9288-jira-tracking-label
Nov 12, 2026
Merged

waynesun09 merged 4 commits into
fullsend-ai:mainfrom
ederign:feat/9288-jira-tracking-label

Conversation

@ederign

@ederign ederign commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds optional tracker.jira.run_label configuration to label the source Jira issue when an agent run starts, before sandbox setup.

tracker:
  jira:
    base_url: https://example.atlassian.net
    project: PROJ
    run_label: fs-code-agent

Related Issue

Closes #9288.

Changes

  • Defaults to disabled, with a skip log when no label is configured.
  • Preserves existing labels and skips the update when the configured label is already present.
  • Runs independently of status comments; Jira API failures produce a warning without failing the run.
  • Validates configuration and documents the setting.

Testing

  • make lint passes (staged files checked).
  • Tests added for configuration, run-start behavior, Jira requests, retries and failures; focused race tests passed.
  • Live integration test called the production run-label helper against real Jira: adding the label, preserving existing labels, retrying without an update, and skipping disabled/non-Jira cases all passed.
  • A complete agent/sandbox run has not been tested. The broad suite had TLS/macOS-path failures reproduced upstream and gateway timing failures that passed in isolation; it was stopped before completion.

Screenshot

The screenshot shows fs-code-agent added successfully alongside fullsend-smoke-preserve, which was added beforehand to verify preservation of existing labels.

Live Jira test showing the configured label and preserved existing label

Checklist

  • PR title follows Conventional Commits.
  • Commits are signed off (DCO).
  • I wrote this contribution myself and can explain all changes in it.

I developed this contribution with AI assistance. I reviewed the implementation, understand the code, and can explain all changes in this PR.

Note

🤖 GPT-6 Astra responding on behalf of Eder

Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>
Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>
@ederign
ederign requested a review from a team as a code owner November 11, 2026 20:24
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add optional Jira run-start label

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Add an opt-in label to Jira issues when agent runs start, enabling JQL-based tracking.
• Preserve existing labels and keep labeling independent of status comments and run success.
• Validate the setting, document its behavior, and test skips, retries, and API failures.
Diagram

sequenceDiagram
    participant Run as Run CLI
    participant Label as Label Helper
    participant Config as Jira Config
    participant Adapter as Tracker Client
    participant Jira as Jira API
    Run->>Label: Run starts
    Label->>Config: Check label settings
    alt Jira label configured
        Config-->>Label: Valid settings
        Label->>Adapter: Add issue label
        Adapter->>Jira: GET issue
        Jira-->>Adapter: Current labels
        opt Label absent
            Adapter->>Jira: PUT additive update
        end
        Adapter-->>Label: Result
        Label-->>Run: Applied or warning
    else Label disabled
        Config-->>Label: No label
        Label-->>Run: Skipped
    end
Loading
High-Level Assessment

Keep labeling separate from status comments and use Jira's additive label operation. This preserves concurrent labels while the preceding read avoids unnecessary updates and changelog entries; placing it in the notifier would incorrectly tie tracking to comment settings.

Files changed (12) +348 / -6

Enhancement (5) +86 / -5
run.goInvoke labeling at run start +3/-0

Invoke labeling at run start

• Calls the Jira label helper before status notifications and sandbox setup, independently of comment configuration.

internal/cli/run.go

run_jira_label.goAdd best-effort Jira labeling helper +42/-0

Add best-effort Jira labeling helper

• Skips non-Jira or unconfigured runs, validates settings and identity, and attempts the label write with a 15-second timeout. Failures produce warnings rather than failing the run.

internal/cli/run_jira_label.go

issue_targets.goAdd and validate Jira run_label configuration +12/-5

Add and validate Jira run_label configuration

• Adds the YAML field to accepted Jira settings and config cloning. Nonempty labels require connection settings, and whitespace or control characters are rejected.

internal/config/issue_targets.go

client.goAdd idempotent Jira label API operation +23/-0

Add idempotent Jira label API operation

• Reads an issue's labels and skips an update when the label is present. Otherwise, it sends Jira an additive label update rather than replacing existing labels.

internal/forge/jira/client.go

jira_client.goExpose labeling through the Jira tracker adapter +6/-0

Expose labeling through the Jira tracker adapter

• Extends the Jira client interface and maps a project and issue number to the Jira key used by the label operation.

internal/tracker/jira_client.go

Tests (5) +222 / -0
run_jira_label_test.goTest run-start labeling decisions +98/-0

Test run-start labeling decisions

• Covers configured and repeated runs, disabled and non-Jira cases, missing prerequisites, write failures, and validation before Jira discovery.

internal/cli/run_jira_label_test.go

jira_run_label_test.goTest run-label configuration handling +32/-0

Test run-label configuration handling

• Checks YAML serialization, cloning, connection requirements, and acceptance or rejection of representative label values.

internal/config/jira_run_label_test.go

label_test.goTest Jira label requests and failures +62/-0

Test Jira label requests and failures

• Verifies the additive PUT payload, the no-write path for an existing label, and read and write error handling.

internal/forge/jira/label_test.go

fake_jira.goSupport additive labels in fake Jira client +13/-0

Support additive labels in fake Jira client

• Implements the label operation for tracker tests, preserving existing labels and avoiding duplicates.

internal/tracker/fake_jira.go

jira_client_test.goTest tracker-level Jira label forwarding +17/-0

Test tracker-level Jira label forwarding

• Checks issue-key mapping, preservation and deduplication of labels, and errors for missing issues.

internal/tracker/jira_client_test.go

Documentation (2) +40 / -1
jira-integration.mdExplain opt-in Jira run tracking +30/-0

Explain opt-in Jira run tracking

• Documents configuration, JQL usage, timing, persistence, permissions, and the best-effort behavior of run-start labels.

docs/guides/user/jira-integration.md

config-reference.mdReference the Jira run_label setting +10/-1

Reference the Jira run_label setting

• Describes its disabled default, validation requirements, labeling behavior, and connection-setting requirements.

docs/reference/config-reference.md

@ederign
ederign requested a review from jwm4 November 11, 2026 20:28
@qodo-code-review

qodo-code-review Bot commented Nov 11, 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


Remediation recommended

1. Matching labels start an extra agent run ✗ Dismissed
Description
addJiraRunLabel writes the configured label without excluding the resulting label-added event from
Jira dispatch. If that label matches an agent trigger, the poller can dispatch a second run even
though it recognizes the change as a bot action; the guide incorrectly says such actions do not
dispatch agents.

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/agents (sha: 94037d2d) — View relationship
✅ REVIEW.md
Review mode: Auto: ⚖️ Balanced: Cross-cutting Jira API, configuration, runtime, and failure-handling behavior.

Grey Divider

Tip of the day
💡 Did you know, you can open the rule or relationship behind a finding in one click

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread internal/cli/run_jira_label.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 findings: 1 MEDIUM inline comment.

Comment thread internal/config/issue_targets.go Resolved
Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:57 PM UTC · Completed 10:08 PM UTC

Commit: 7b7837b · View workflow run →

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

@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://882d192d-site.fullsend-ai.workers.dev

Commit: 7b7837b54d02830802e375931c7df0a922af6c7a

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 11, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Optional, default-disabled Jira run-start label with complete acceptance criteria coverage and healthy test ratio presents moderate risk driven primarily by churn and multi-author contention on central CLI files.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Low

  • [error-handling-idiom] internal/tracker/jira_client.go:540 — JiraClient.AddIssueLabel returns the underlying error directly. Every other mutating method on *JiraClient (UpdateComment, DeleteComment, LinkIssues, and the read methods) wraps it with wrapNotFound, so a missing issue satisfies tracker.IsNotFound across the tracker layer. The only caller today does not check IsNotFound, so there is no functional impact yet.
    Remediation: return wrapNotFound(c.jira.AddIssueLabel(ctx, issueKey(project, number), label)).

  • [injection-vuln] internal/cli/run_jira_label.go:42 — The error text from the Jira label read/write is passed through redactFeedback to StepWarn. redactFeedback removes secrets but keeps newlines and control characters, and parseErrorResponse includes the server's errorMessages verbatim. A raw newline in a Jira error body would start a new CI log line, which GitHub Actions could parse as a workflow command. The configured label cannot add a line break (ValidateRunLabel rejects whitespace and control characters), and the response comes from the configured Jira site. This is a hardening gap rather than an easily exploitable hole.
    Remediation: Neutralize \r, \n and other control characters in the externally derived error text before printing (for example by quoting it with %q), and add a test with an error body that contains a newline.


Labels: PR changes runner start-up behavior for Jira-sourced runs and updates user-facing docs.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the review comment for full details.

Comment thread internal/tracker/jira_client.go Resolved
Comment thread internal/cli/run_jira_label.go Resolved
@fullsend-ai-review fullsend-ai-review Bot added component/runner Agent runner behavior and lifecycle component/docs User-facing documentation labels Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/cli/run_jira_label.go 88.46% 2 Missing and 1 partial ⚠️
internal/forge/jira/client.go 85.71% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@ederign
ederign requested a review from waynesun09 November 11, 2026 22:24

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

LGTM. The current head reviewed clean, and the earlier finding is resolved.

@waynesun09
waynesun09 added this pull request to the merge queue Nov 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 12, 2026
@waynesun09
waynesun09 added this pull request to the merge queue Nov 12, 2026
Merged via the queue into fullsend-ai:main with commit e84abee Nov 12, 2026
123 checks passed

This branch was successfully deployed

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

Labels

component/docs User-facing documentation component/runner Agent runner behavior and lifecycle risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jira-sourced runs: add a configurable tracking label to the Jira issue when a run starts

2 participants