Skip to content

BUILD-11942 Add Dev Agent GitHub Action#322

Closed
jayadeep-km-sonarsource wants to merge 1 commit into
masterfrom
feat/jkinavoormadam/BUILD-11942-devAgent
Closed

BUILD-11942 Add Dev Agent GitHub Action#322
jayadeep-km-sonarsource wants to merge 1 commit into
masterfrom
feat/jkinavoormadam/BUILD-11942-devAgent

Conversation

@jayadeep-km-sonarsource

Copy link
Copy Markdown
Contributor

BUILD-11942 Implement the reusable Dev Agent composite Action for the Jira-to-draft-PR POV.

Adds Vault-backed Jira and Slack reporting, a pinned Codex Action invocation, deterministic per-ticket draft-PR branches, and a documented caller contract.

Validation:

  • yamllint
  • ShellCheck
  • Bash syntax and prompt-assembly checks

The focused ShellSpec test is included but was not run locally because shellspec is unavailable.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jul 14, 2026

Copy link
Copy Markdown

BUILD-11942

Comment thread dev-agent/publish.sh Outdated
Comment thread dev-agent/prepare.sh Outdated
Comment thread dev-agent/publish.sh
@jayadeep-km-sonarsource jayadeep-km-sonarsource force-pushed the feat/jkinavoormadam/BUILD-11942-devAgent branch from 61ffdad to 5f83bec Compare July 14, 2026 14:05
@jayadeep-km-sonarsource

Copy link
Copy Markdown
Contributor Author

[from codex]: Fixed the untracked-file detection, rendered Jira description handling, ticket-title fallback, executable script modes, and Markdown lint issues in 5f83bec.

@jayadeep-km-sonarsource jayadeep-km-sonarsource force-pushed the feat/jkinavoormadam/BUILD-11942-devAgent branch 5 times, most recently from aa01139 to e3623d5 Compare July 14, 2026 15:06
Comment thread dev-agent/README.md
with:
jira-key: ${{ inputs.jira-key }}
instructions-file: .github/dev-agent-instructions.md
slack-channel: test_jd

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: README example uses test placeholder slack-channel 'test_jd'

The documented example replaces the real channel squad-eng-xp-github with test_jd, which looks like a leftover testing value rather than caller guidance. Restore a representative channel name (or a clearly-marked placeholder like <your-slack-channel>) so copy-pasting the example doesn't send notifications to a stray test channel.

Was this helpful? React with 👍 / 👎

@jayadeep-km-sonarsource jayadeep-km-sonarsource force-pushed the feat/jkinavoormadam/BUILD-11942-devAgent branch from e3623d5 to 080e58e Compare July 14, 2026 15:18
Add the reusable Jira-to-draft-PR orchestration Action and its dogfood-ready contract.
@jayadeep-km-sonarsource jayadeep-km-sonarsource force-pushed the feat/jkinavoormadam/BUILD-11942-devAgent branch from 080e58e to f34ed87 Compare July 14, 2026 15:25
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
10.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@gitar-bot

gitar-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 4 resolved / 5 findings

Implements a reusable Dev Agent composite action with secure Jira and Slack reporting, resolving issues with file publishing, Jira description formatting, and symlink handling. Update the README example to use a production-ready Slack channel instead of the placeholder 'test_jd'.

💡 Quality: README example uses test placeholder slack-channel 'test_jd'

📄 dev-agent/README.md:12

The documented example replaces the real channel squad-eng-xp-github with test_jd, which looks like a leftover testing value rather than caller guidance. Restore a representative channel name (or a clearly-marked placeholder like <your-slack-channel>) so copy-pasting the example doesn't send notifications to a stray test channel.

✅ 4 resolved
Bug: publish.sh misses untracked files, reports no_changes

📄 dev-agent/publish.sh:16-30
The change-detection if git diff --quiet && git diff --cached --quiet only inspects tracked, modified files; it does not see untracked files. When Codex satisfies a ticket by creating new files (a very common outcome), both diffs are empty, so the script takes the no_changes branch, never runs git add -A/commit/push, and reports no_changes even though real work was produced. Detect all changes including untracked files, e.g. if [[ -z "$(git status --porcelain)" ]]; then for the no-changes branch.

Bug: Jira v3 description is ADF JSON, not plain text

📄 dev-agent/prepare.sh:30-37
The Jira Cloud REST API v3 (/rest/api/3/issue/...) returns fields.description as an Atlassian Document Format (ADF) object, not a string. jq -r '.fields.description // ""' therefore emits the serialized JSON of the ADF document into the prompt instead of readable ticket text, degrading the context handed to Codex. Either request the rendered/plain text (e.g. ?expand=renderedFields and read renderedFields.description, or use the v2 API which returns plain text) or convert the ADF content to text with jq.

Edge Case: publish.sh uses TICKET_TITLE without asserting it is set

📄 dev-agent/publish.sh:5-9 📄 dev-agent/publish.sh:34
publish.sh references $TICKET_TITLE in the gh pr create --title argument but, unlike the other inputs, it is not asserted via a : "${TICKET_TITLE:?...}" guard, and set -u will abort with an unclear error if it is ever unset. Since it is optional/derived, guard with a default (e.g. : "${TICKET_TITLE:=$JIRA_KEY}") so an empty ticket summary yields a sensible PR title rather than KEY: .

Bug: .actions/config-npm symlink gets committed into the draft PR

📄 dev-agent/action.yml:35-48 📄 dev-agent/action.yml:90-100 📄 dev-agent/action.yml:122-126 📄 dev-agent/publish.sh:17-29
The .actions/config-npm symlink is created before the config-npm step but only removed in the final always() cleanup step (lines 122-126), which runs after publish.sh. Since the symlink is untracked and lives in the workspace, git status --porcelain in publish.sh is always non-empty, so even when Codex makes no changes the run reports success with a spurious commit instead of no_changes, and git add -A stages the symlink and pushes it into the draft PR. Move the symlink cleanup to before the publish step, or create the symlink outside the workspace / add .actions/ to .git/info/exclude so publish never sees it.

🤖 Prompt for agents
Code Review: Implements a reusable Dev Agent composite action with secure Jira and Slack reporting, resolving issues with file publishing, Jira description formatting, and symlink handling. Update the README example to use a production-ready Slack channel instead of the placeholder 'test_jd'.

1. 💡 Quality: README example uses test placeholder slack-channel 'test_jd'
   Files: dev-agent/README.md:12

   The documented example replaces the real channel `squad-eng-xp-github` with `test_jd`, which looks like a leftover testing value rather than caller guidance. Restore a representative channel name (or a clearly-marked placeholder like `<your-slack-channel>`) so copy-pasting the example doesn't send notifications to a stray test channel.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant