Repository navigation
fix(#2160): report no-op code runs to the Jira issue - #2162
fullsend-ai-coder[bot] wants to merge 2 commits into
Conversation
A Jira-sourced code run that ended without a PR wrote nothing to Jira: post_noop_comment returned after a ::notice line for every external tracker, and the only Jira writer ran on the PR path. post_noop_comment now posts a plain-text "No PR created" comment to the Jira issue (reason, sanitized and gitleaks-scanned agent context, run URL) when the tracker is jira, keeping the notice line. Other external trackers keep the notice only. The identity checks, credential selection and marked post-comment call move out of _post_jira_stage_update_inner into post_jira_code_comment, shared by both paths, so the shared <!-- fullsend:code-agent --> marker lets a later PR run replace the no-op comment. The no-op write is best-effort: a failure logs a warning and the run still exits 0, and the PR-ready transition never runs on this path. The agent-context sanitize/scan step is shared with the GitHub comment through load_noop_agent_context; the GitHub body is unchanged. The trusted fullsend binary is now resolved before the first no-op exit (the no-feature-branch check), which previously ran before it was set. Tests: Jira no-op on both no-op exits posts one marked comment with the reason, context and run URL and no transition; scan failure omits the context; a failing CLI still exits 0 with a warning; non-Jira external trackers stay notice-only; the GitHub no-op comment body is unchanged. Note: pre-commit could not fetch hook repos (TLS failure in sandbox); shellcheck 0.10.0.1 with the configured args, whitespace/EOF checks, lint-release-cases and scan-secrets were run directly and passed. make lint (skillsaw) not run: uvx unavailable; it does not lint shell. post-code-test.sh: 4 failures also present on main in this sandbox (yq missing, git author env), unrelated to this change. Closes #2160 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 4:29 PM UTC · Completed 4:36 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.51 |
|
Risk Assessment: moderate (2/5) DetailsSmall 3-file change aligned closely with issue scope keeps risk moderate, balanced against protected script modifications and high recent churn in post-code scripts. |
ReviewFindingsMedium
Low
Next steps:
|
| local run_url | ||
| run_url="$(forge_get_workflow_run_url)" | ||
|
|
||
| load_noop_agent_context |
There was a problem hiding this comment.
[low] secret-exposure
The new Jira no-op path calls load_noop_agent_context before xtrace is turned off. If the script runs under bash -x, the loader's agent_context assignment and the sanitize_failure_detail argument print the raw pr_body into runner logs before redaction and before the gitleaks scan. The later set +x protects the Jira credential expansions but not the unscanned agent context. Exposure only happens when tracing is explicitly enabled, and the same unguarded load already runs in the existing GitHub no-op path.
Suggested fix: Turn off xtrace while extracting, sanitizing and scanning agent context in load_noop_agent_context, and restore the original tracing state on every return path. This also covers the GitHub no-op caller. Optionally add a traced test with a secret in pr_body.
|
🤖 Finished Fix · ✅ Success · Started 4:38 PM UTC · Completed 4:43 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.36 |
- Suspend xtrace while load_noop_agent_context reads, sanitizes and scans the agent's pr_body, restoring the tracing state on every return path (covers both the Jira and GitHub no-op callers). Regenerate post-code.sh and add an xtrace regression test. - Update docs/code.md: Jira-sourced no-PR runs now post a no-op comment to the Jira issue; only other external trackers emit a notice alone. Notes: pre-commit could not fetch hook repos (certificate failure), so applicable hooks were checked directly (whitespace, CR, lint-agent-docs); shellcheck and uvx were unavailable. scripts/post-code-test.sh has four failures that also occur without this change. Addresses #2162 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (bot-triggered)Addressed all three findings. Updated docs/code.md for Jira no-op comments, and made load_noop_agent_context suspend xtrace while it handles the raw agent context (with a regression test and regenerated post-code.sh). Recorded the protected-path finding as a human-approval gate with no code change. Four tests in scripts/post-code-test.sh fail both with and without this change. Pre-commit could not fetch hook repos, so applicable checks were run directly. shellcheck and uvx were not available. Fixed (2):
Disagreed (1):
Tests: passed CI inspections (4):
Next steps:
Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 4:45 PM UTC · Completed 4:52 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.65 |
|
Review skipped — this PR is already closed. The Posted by fullsend post-review check |
Summary
When a Jira-sourced code run ends without a PR,
scripts/post-code.src.shnow leaves a "No PR created" comment on the Jira issue. Before this, it only wrote a::noticeline to the workflow log.Changes
post_noop_comment: when the tracker isjira, it calls the newpost_jira_noop_commentafter the existing notice line. Other external trackers still get only the notice.post_jira_noop_comment(new) writes a plain-text comment:No PR created for <KEY>: the code agent determined no changes are needed.Reason: <reason>pr_body, if any.Workflow run: <run URL>It is best-effort: if the Jira write fails, it logs a warning and the run still exits 0. The PR-ready transition never runs on this path. xtrace is turned off around the write, the same way
post_jira_stage_updatedoes it.post_jira_code_comment(new, taken out of_post_jira_stage_update_inner) holds the Jira write that both paths share:jira_auth_selectFULLSEND_DIRand the CLIjira_auth_fullsend ... issues post-comment --tracker jira --marker "<!-- fullsend:code-agent -->"Because both paths use the same marker, a later run that opens a PR replaces the no-op comment. The stage update builds its own body, calls this helper, and then runs
maybe_transition_jira_pr_readyas before. It gets the project and number fromWORK_ITEM_KEY, which the helper has already checked against the URL.load_noop_agent_context(new): thesanitize_failure_detailandscan_public_textsteps now live in one place, used by both the GitHub and Jira comments. The context is left out if the scan fails. The GitHub comment body is unchanged.Trusted
fullsendlookup moved earlier:_jira_fullsend_binis now set before section 1. Before, the first no-op exit ("no feature branch") ran before it was set. The lookup still happens before any repo-controlled code runs.scripts/post-code.shwas regenerated from the source withscripts/bundle-sh.sh.Testing
New tests in
scripts/post-code-test.shuse the Jira test setup's stubfullsend, which records its arguments and stdin:post-commentcall, with the marker, the trusted credentials, the reason, the agent context and the run URL. No transition runs even withCODE_JIRA_PR_READY_TRANSITION=Review, the notice line is still printed, and no GitHub issue comment is made.::warning::Failed to post no-op comment to Jira issue TESTPROJ-42.Results:
SCRIPT_TEST_TARGET=bundled.Caveats
pre-commitcould not fetch its hook repos in the sandbox (TLS failure). I ran the relevant hooks directly instead (shellcheck, whitespace and EOF checks, lint-release-cases, and a secret scan).make lint(skillsaw) was not run becauseuvxis not available. It does not lint shell scripts.post-code-test.shhas 4 failures in this sandbox that also happen on unmodifiedmain, so this change did not cause them:yqis missing, and the git author environment is wrong for the signed-commits tests.🤖 Generated with Claude Code
Closes #2160
Post-script verification
agent/2160-jira-noop-comment)a4d3b9f47a39e4d6a02babb390adb6ec12c327c3..HEAD)