Skip to content

Summary#13

Merged
jenn-if-err merged 12 commits intomasterfrom
summary
Mar 12, 2026
Merged

Summary#13
jenn-if-err merged 12 commits intomasterfrom
summary

Conversation

@jenn-if-err
Copy link
Copy Markdown
Member

  • add nil guards for metadata
  • remove the run summary tracker

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the distributed scenario runner to be more resilient to missing metadata, removes the in-process run summary tracker, and expands the completion payload/notifications with additional fields (failed scenarios + test-analysis flags).

Changes:

  • Add nil-guards for metadata in scenario distribution paths and propagate total_scenarios more consistently.
  • Remove runSummary/runTracker and the per-scenario completion callback previously used to emit a final Slack summary.
  • Extend completion payload handling (and GitHub repository_dispatch payload) with failed_scenarios, missing_tests_in_pr, and should_run_tests, and adjust Slack completion formatting.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scenario.go Adds extra metadata attributes (including nested test_analysis flags) to Pub/Sub report attributes.
main.go Adds metadata nil guards in distributors; removes run summary tracking; updates completion Slack formatting and message struct fields.
github.go Adds new fields to the repository_dispatch client payload and logs them.
go.mod Promotes Secret Manager dependency to a direct requirement (matches secret.go usage).
go.sum Tidies dependency hashes/versions accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

log.Printf("repository_dispatch sent: repo=%s sha=%s run_id=%s overall_status=%s",
msg.Repository, msg.CommitSHA, msg.RunID, msg.OverallStatus)
log.Printf("repository_dispatch sent: repo=%s sha=%s run_id=%s overall_status=%s missing_tests_in_pr=%v should_run_tests=%v",
msg.Repository, msg.CommitSHA, msg.RunID, msg.OverallStatus, msg.MissingTestsInPR, msg.ShouldRunTests)
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The continuation line for this log.Printf call is indented with spaces instead of gofmt's tab indentation. Please run gofmt on the file to keep formatting consistent.

Suggested change
msg.Repository, msg.CommitSHA, msg.RunID, msg.OverallStatus, msg.MissingTestsInPR, msg.ShouldRunTests)
msg.Repository, msg.CommitSHA, msg.RunID, msg.OverallStatus, msg.MissingTestsInPR, msg.ShouldRunTests)

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

@jenn-if-err jenn-if-err left a comment

Choose a reason for hiding this comment

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

}
}

if scenariopubsub != "" && githubtoken != "" && pubsub != "" {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Ynah537 can I remove this? Start_all doesn't have githubtoken, if this is here then the code couldn't proceed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It will still be safe since there is a githubtoken checker in the sendrepositorydispatch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jenn-if-err yes that would be fine

@jenn-if-err jenn-if-err requested a review from Copilot March 12, 2026 05:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

github.go:1

  • Adding missing_tests_in_pr and should_run_tests into a map[string]interface{} will always include these keys (even when false), which differs from the omitempty behavior in ScenarioProgressMessage and can be a breaking change for consumers that treat absence differently from false. If you want to preserve optional semantics, only add these keys when they are meaningful (e.g., conditionally when true or when the upstream analysis exists), or switch client_payload to a typed struct with omitempty.
package main

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +410 to +416
if ta, ok := in.Metadata["test_analysis"].(map[string]interface{}); ok {
for _, key := range []string{"missing_tests_in_pr", "should_run_tests"} {
if v, ok := ta[key].(bool); ok {
attr[key] = fmt.Sprintf("%v", v)
}
}
}
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

Converting booleans via fmt.Sprintf("%v", v) is heavier than needed and can allocate; strconv.FormatBool(v) is the idiomatic and more efficient conversion for booleans.

Copilot uses AI. Check for mistakes.
}

if scenariopubsub != "" && githubtoken != "" && pubsub != "" {
if scenariopubsub != "" && pubsub != "" {
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The progress listener now starts even when githubtoken is empty, and the previous warning about missing token was removed. If GitHub repository_dispatch is still attempted within the listener path, this change can lead to repeated failing calls (401) with reduced operator visibility. Consider restoring a warning when GitHub dispatch is configured but token is missing, or ensuring the dispatch call is explicitly skipped (with a clear log) when githubtoken == "".

Suggested change
if scenariopubsub != "" && pubsub != "" {
if scenariopubsub != "" && pubsub != "" {
if githubtoken == "" {
log.Printf("WARNING: githubtoken is empty; scenario progress listener will run, but any GitHub repository_dispatch operations may fail due to missing credentials")
}

Copilot uses AI. Check for mistakes.
}()
} else if scenariopubsub != "" && githubtoken == "" {
log.Printf("WARNING: --scenario-pubsub set but github token is empty; set --secret-project-id or --github-token to enable GitHub status updates")
}
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

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

The progress listener now starts even when githubtoken is empty, and the previous warning about missing token was removed. If GitHub repository_dispatch is still attempted within the listener path, this change can lead to repeated failing calls (401) with reduced operator visibility. Consider restoring a warning when GitHub dispatch is configured but token is missing, or ensuring the dispatch call is explicitly skipped (with a clear log) when githubtoken == "".

Copilot uses AI. Check for mistakes.
@jenn-if-err jenn-if-err merged commit 8c0b20f into master Mar 12, 2026
1 check passed
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.

3 participants