Skip to content

post-code: report no-op runs to the Jira issue #2160

Closed as not planned
Closed as not planned

Description

@waynesun09

Problem

When a Jira-sourced code run ends without a PR (the agent finds the work already done, makes no branch, or changes no files), nothing is written to the Jira issue. The person who started the run gets no PR, no comment and no status change. The only trace is a ::notice line in the workflow log.

GitHub and GitLab issues get a "No PR created" comment in the same situation, with the reason, the agent's explanation and the run link.

Cause

In scripts/post-code.src.sh, post_noop_comment returns early for external work items:

if [ "${EXTERNAL_WORK_ITEM}" = "true" ]; then
  gha_echo notice "No PR created for ${WORK_ITEM_KEY}: ${reason}"
  return 0
fi

The only Jira writer, post_jira_stage_update, runs on the PR path and requires a PR/MR URL. So no path reports a no-op to Jira.

The post script already has what it needs: the Jira overlay in harness/code.yaml passes the Jira credentials and FULLSEND_DIR to the runner, and the credential-isolation block at the top of post-code.src.sh stashes them before the no-op exits run.

Scope

Files: scripts/post-code.src.sh, the regenerated scripts/post-code.sh (make script-build), and scripts/post-code-test.sh. Nothing under .github/, and no change to harness/code.yaml.

  1. In post_noop_comment, when the tracker is Jira (WORK_ITEM_TRACKER is jira), post a comment to the Jira issue instead of returning. Keep the ::notice line.
  2. Reuse the existing Jira write path: the same identity checks, credential selection (jira_auth_select, jira_auth_fullsend), fullsend issues post-comment --tracker jira call and <!-- fullsend:code-agent --> marker as _post_jira_stage_update_inner. Factor the shared part into a helper rather than copying it. Because the marker is shared, a later run that opens a PR replaces the no-op comment.
  3. Comment body, plain text that renders in Jira:
    • No PR created for <KEY>: the code agent determined no changes are needed.
    • Reason: <reason>
    • The agent's context from pr_body in the result file, after the same sanitize_failure_detail and gitleaks scan_public_text checks the GitHub comment uses. Omit it if the scan fails.
    • Workflow run: <run URL>
  4. Best-effort: if the Jira write fails, log a warning and keep exit 0. Do not run maybe_transition_jira_pr_ready on this path.
  5. Non-Jira external trackers keep today's behaviour (notice only).
  6. Tests in scripts/post-code-test.sh, using a stub fullsend binary on PATH that records its arguments and stdin:
    • Jira no-op posts one comment with the marker, the reason and the run URL.
    • A failing stub CLI still yields exit 0 and a warning.
    • The GitHub no-op comment is unchanged.

Acceptance

  • A Jira-sourced run that ends with no PR leaves a "No PR created" comment on the Jira issue with the reason and run link.
  • A Jira write failure on this path does not fail the run.
  • make script-build leaves no diff, and scripts/post-code-test.sh passes.

Activity

  1. added
    bug
    on Nov 23, 2026
  2. waynesun09 commented on Nov 23, 2026

    @waynesun09
    MemberAuthor

    /fs-code
    Do not sign off. No git commit -s, no Signed-off-by trailer.

  3. fullsend-ai-triage commented on Nov 23, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 4:18 PM UTC · Completed 4:20 PM UTC

    Commit: a4d3b9f · View workflow run →

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

  4. fullsend-ai-coder commented on Nov 23, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Code · ❌ Terminated · Started 4:18 PM UTC · Ended 4:27 PM UTC

    Commit: a4d3b9f · View workflow run →

  5. added and removed
    bug
    on Nov 23, 2026
  6. fullsend-ai-triage commented on Nov 23, 2026

    @fullsend-ai-triage

    This is actionable as written. The cited code on main matches: post_noop_comment returns early for external work items, and _post_jira_stage_update_inner already holds the Jira identity checks, credential selection and marker you want to reuse. No open PR addresses this.

    Related work: #1953 is open and overlaps with this issue. It covers the same no-op case plus a post-script failure case. If both are implemented, coordinate the shared-helper refactor of the Jira write path so they don't conflict.

    Notes for implementation

    • The "No PR created" Jira comment never existed, so this is new behavior rather than a regression, even though the issue is labelled as a bug.
    • The scope touches only scripts/, so it does not require workflow-file changes.
    • A maintainer already requested /fs-code, and the sign-off exclusion for pipeline agents applies.

    Proposed test case

    Stub `fullsend` on PATH recording args + stdin; EXTERNAL_WORK_ITEM=true, WORK_ITEM_TRACKER=jira:
    1. post_noop_comment -> exactly one `issues post-comment --tracker jira` call;
       stdin has the fullsend:code-agent marker, the reason and the run URL;
       no maybe_transition_jira_pr_ready call.
    2. Stub exits non-zero -> post_noop_comment returns 0 and logs a warning.
    3. Result-file pr_body fails the secret scan -> context omitted, comment still posted.
    4. GitHub work item -> existing "No PR created" comment unchanged.
    5. Non-Jira external tracker -> notice only, no CLI call.
    

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  7. fullsend-ai-coder commented on Nov 23, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 4:18 PM UTC · Completed 4:27 PM UTC

    Commit: a4d3b9f · View workflow run →

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

  8. waynesun09 commented on Nov 23, 2026

    @waynesun09
    MemberAuthor

    Duplicate of #1953. PR #2010 implements it, including the no-op case described here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions