Skip to content

add backend instructions #2090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions backend/utils/comment_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ func GenerateRealtimeCommentMessage(jobs []models.DiggerJob, batchType orchestra
resourcesDeleted)
}

// Add instruction helpers (same as CLI)
message += "\n" + formatExampleCommands()

// Handle comment length limits
const GithubCommentMaxLength = 65536
if len(message) > GithubCommentMaxLength {
Expand All @@ -190,6 +193,27 @@ func GenerateRealtimeCommentMessage(jobs []models.DiggerJob, batchType orchestra
return message, nil
}

// formatExampleCommands creates a collapsible markdown section with example commands
// This matches the exact format used by the CLI's BasicCommentUpdater
func formatExampleCommands() string {
return `
<details>
<summary>Instructions</summary>

⏩ To apply these changes, run the following command:

` + "```" + `bash
digger apply
` + "```" + `

🚮 To unlock the projects in this PR run the following command:
` + "```" + `bash
digger unlock
` + "```" + `
</details>
`
}

// UpdateOrCreateSummaryComment updates or creates the summary comment for the batch
func UpdateOrCreateSummaryComment(prService ci.PullRequestService, batch *models.DiggerBatch, message string) (*int64, error) {
if batch.CommentId != nil {
Expand Down
Loading