Skip to content

Consolidate RunSummary and DownloadResult analysis fields - #52957

Merged
pelikhan merged 4 commits into
mainfrom
copilot/deep-report-consolidate-duplicated-fields
Aug 15, 2026
Merged

Consolidate RunSummary and DownloadResult analysis fields#52957
pelikhan merged 4 commits into
mainfrom
copilot/deep-report-consolidate-duplicated-fields

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

RunSummary and DownloadResult carried the same run-analysis field set independently, creating drift risk whenever artifact/log analysis metadata changed. This refactor moves the shared surface into one embedded type while preserving promoted field access and flat RunSummary JSON.

  • Shared data model
    • Added RunAnalysis for the common run metadata, metrics, analysis reports, usage summaries, and job details.
    • Embedded RunAnalysis in both RunSummary and DownloadResult.
    • Kept PolicyAnalysis and ArtifactsList on RunSummary, where they remain summary-specific.
type RunAnalysis struct {
    Run                  WorkflowRun       `json:"run"`
    Metrics              LogMetrics        `json:"metrics"`
    AccessAnalysis       *DomainAnalysis   `json:"access_analysis"`
    FirewallAnalysis     *FirewallAnalysis `json:"firewall_analysis"`
    // ...
}

type RunSummary struct {
    CLIVersion  string    `json:"cli_version"`
    RunID       int64     `json:"run_id"`
    ProcessedAt time.Time `json:"processed_at"`
    RunAnalysis
    PolicyAnalysis *PolicyAnalysis `json:"policy_analysis,omitempty"`
    ArtifactsList  []string        `json:"artifacts_list"`
}

type DownloadResult struct {
    RunAnalysis
    Error    error
    Skipped  bool
    Cached   bool
    LogsPath string
}
  • Construction sites

    • Updated summary/result literals to initialize RunAnalysis.
    • Reused cached summary.RunAnalysis directly when converting a cached summary into a DownloadResult.
  • Regression coverage

    • Added reflection-based coverage to ensure both carrier structs embed RunAnalysis, do not redeclare shared fields, and continue promoting those fields.
    • Verified RunSummary marshals embedded analysis fields as flat JSON keys rather than nesting under RunAnalysis.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 20.9 AIC · ⌖ 7.31 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Consolidate duplicated fields between RunSummary and DownloadResult Consolidate RunSummary and DownloadResult analysis fields Aug 15, 2026
Copilot AI requested a review from pelikhan August 15, 2026 20:11
@pelikhan
pelikhan marked this pull request as ready for review August 15, 2026 20:37
Copilot AI balanced review requested due to automatic review settings August 15, 2026 20:37

Copilot AI left a comment

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.

Pull request overview

Consolidates duplicated run-analysis fields into an embedded RunAnalysis model while preserving flat summary JSON.

Changes:

  • Embeds RunAnalysis in RunSummary and DownloadResult.
  • Updates construction and cache-conversion paths.
  • Adds embedding, promotion, serialization, and regression coverage.
Show a summary per file
File Description
pkg/cli/logs_models.go Defines and embeds RunAnalysis.
pkg/cli/logs_run_processor.go Updates result and summary construction.
pkg/cli/audit.go Builds audit summaries with shared analysis.
pkg/cli/audit_diff.go Updates partial diff summaries.
pkg/cli/logs_summary_test.go Tests embedding and flat JSON.
pkg/cli/logs_summary_integration_test.go Updates cache integration fixtures.
pkg/cli/logs_usage_activity_test.go Updates usage fixtures.
pkg/cli/logs_run_processor_test.go Updates processor fixtures.
pkg/cli/logs_parallel_test.go Updates result fixtures.
pkg/cli/logs_orchestrator_filters_test.go Updates filter fixtures.
pkg/cli/logs_cache_test.go Updates cache fixtures.
pkg/cli/forecast_compliance_fixtures_formal_test.go Updates formal round-trip fixture.
pkg/cli/audit_test.go Updates audit fixtures.
pkg/cli/audit_evals_fallback_test.go Updates eval fallback fixture.
pkg/cli/audit_diff_test.go Updates audit-diff fixtures.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 15/15 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread pkg/cli/logs_models.go
CLIVersion string `json:"cli_version"` // CLI version used to process this run
RunID int64 `json:"run_id"` // Workflow run database ID
ProcessedAt time.Time `json:"processed_at"` // When this summary was created
type RunAnalysis struct {
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage for maintainer-ready follow-up:

Please refresh the branch if GitHub allows it and run the pr-finisher skill before handing this PR back to maintainers.

Current signal:

  • no failed checks were listed in the compact candidate set
  • no PR comments are present yet, so please leave a concise maintainer-facing status update after your next change set
  • if any review thread or requested follow-up exists outside the visible compact context, close the loop in-thread on the latest head before handing back

Run context: https://github.com/github/gh-aw/actions/runs/31907553336

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 20.9 AIC · ⌖ 7.31 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Quick triage for maintainer-ready follow-up:

Please refresh the branch if GitHub allows it and run the pr-finisher skill before handing this PR back to maintainers....

Ran the pr-finisher pass:

  • ✅ Reviews — the one review thread (doc comment attached to the new RunAnalysis instead of RunSummary) is addressed: the cache-summary doc block is back on RunSummary and RunAnalysis now has its own short doc comment.
  • ✅ Checks (local) — make agent-report-progress (fmt, lint of changed files, impacted unit tests, workflow lock sync) passes.
  • ❓ Checks (CI) — agent pushes don't trigger workflows, so CI on the current head is unverified; no prior failed checks were present.
  • ✅ Mergeable — branch is up to date with main (already merged), no conflicts.

Latest change is doc-comment only, no behavior change. CI needs a maintainer re-trigger before merge.

Copilot AI requested a review from gh-aw-bot August 15, 2026 20:59
@pelikhan
pelikhan merged commit 5de82df into main Aug 15, 2026
27 checks passed
@pelikhan
pelikhan deleted the copilot/deep-report-consolidate-duplicated-fields branch August 15, 2026 21:58
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.0

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.

[deep-report] Consolidate 14 duplicated fields between RunSummary and DownloadResult in pkg/cli/logs_models.go

4 participants