Skip to content

fix: include project name in Plan output and Plan summary comment titles - #2670

Open
kangaechu wants to merge 1 commit into
diggerhq:developfrom
kangaechu:fix/plan-output-project-name
Open

kangaechu wants to merge 1 commit into
diggerhq:developfrom
kangaechu:fix/plan-output-project-name

Conversation

@kangaechu

Copy link
Copy Markdown

Summary

Fixes #2669.

In backendless mode, when multiple projects are impacted by a single PR, all reports are appended to one "Digger run report" comment (via CommentPerRunStrategy). The Plan output and Plan summary section titles were hardcoded without the project name, while the Terraform plan validation check section already included it (Terraform plan validation check (<project>)). This made it impossible to tell which Plan output / Plan summary section belonged to which project when a PR touched more than one project.

This PR makes Plan output and Plan summary include the project name too, consistent with the validation check section:

Plan output (env_dev)
Terraform plan validation check (env_dev)
Plan summary (env_dev)
Instructions
Plan output (env_prd)
Terraform plan validation check (env_prd)
Plan summary (env_prd)
Instructions

Changes

  • reportTerraformPlanOutput now takes the project name and includes it in the Plan output (<project>) title.
  • reportPlanSummary now takes the project name and includes it in the Plan summary (<project>) title.
  • Call sites updated to pass job.ProjectName (previously reportTerraformPlanOutput received projectLock.LockId(), which was unused for the title).

Test plan

  • go build ./... and go vet ./pkg/digger/ pass in cli/
  • go test ./pkg/digger/... passes in cli/
  • Verified end-to-end against a real GitHub PR in backendless mode using a throwaway public repo (kangaechu/digger-test#1) with two null_resource projects (env_dev, env_prd). Confirmed the posted comment shows Plan output (env_dev) / Plan output (env_prd) and Plan summary (env_dev) / Plan summary (env_prd) as expected.

🧠 Ai UsageDetails (if applicable):

Used Claude Code to investigate the root cause, implement the fix, and verify it end-to-end against a live test repository. Diff reviewed and verified manually.

In backendless mode all project reports are appended to a single
"Digger run report" comment, but the "Plan output" and "Plan summary"
section titles were hardcoded without the project name, unlike
"Terraform plan validation check (<project>)". With multiple projects
in one PR it was impossible to tell which plan output belonged to
which project.

Fixes diggerhq#2669
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.

Backendless mode: Plan output comment section title doesn't include the project name, unlike Terraform plan validation check

1 participant