Skip to content

fix: omit redundant apply instructions from apply comments#2618

Open
m-agahi wants to merge 1 commit intodiggerhq:developfrom
m-agahi:fix/remove-redundant-apply-instructions
Open

fix: omit redundant apply instructions from apply comments#2618
m-agahi wants to merge 1 commit intodiggerhq:developfrom
m-agahi:fix/remove-redundant-apply-instructions

Conversation

@m-agahi
Copy link
Copy Markdown

@m-agahi m-agahi commented Mar 19, 2026

🧠 Ai UsageDetails (if applicable):

This PR was written primarily by Claude Code, reviewed and verified by the contributor.


Summary

Fixes #2120

The PR comment "Instructions" section always showed "To apply these changes, run digger apply" even after an apply had already completed — which doesn't make sense.

This change makes formatExampleCommands() command-type-aware: when the batch/job type is apply, the apply instructions are omitted. The unlock instructions are always shown since they remain useful regardless of command type.

Changes

  • libs/comment_utils/summary/updater.goformatExampleCommands now accepts a DiggerCommand parameter and skips apply instructions when command is apply
  • backend/utils/comment_utils.go — same change for the backend's copy of formatExampleCommands
  • libs/comment_utils/summary/updater_test.go (new) — tests using a mock PullRequestService to verify the full UpdateComment flow for both plan and apply, plus unit tests for the formatter

Test plan

  • go test -v ./libs/comment_utils/summary/ — all 4 tests pass
  • go build ./backend/utils/ — backend compiles cleanly
  • Verify in a demo repo that plan comments still show apply instructions
  • Verify in a demo repo that apply comments no longer show apply instructions

…2120)

The PR comment "Instructions" section always showed "To apply these
changes, run digger apply" even after an apply had already completed.
Skip the apply instructions when the command type is already "apply",
keeping only the unlock instructions.
@m-agahi
Copy link
Copy Markdown
Author

m-agahi commented Mar 28, 2026

no review?

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.

Instructions give more instructions than necessary

1 participant