Skip to content

refactor(cli): embed DomainBuckets in WorkflowDomainsDetail - #67642

Merged
pelikhan merged 2 commits into
mainfrom
pelikhan-shared-domain-bucket-embedding
Oct 11, 2026
Merged

pelikhan merged 2 commits into
mainfrom
pelikhan-shared-domain-bucket-embedding

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Summary

  • Embed shared DomainBuckets in WorkflowDomainsDetail and update construction sites.
  • Preserve the existing flat JSON schema, including null and empty-array domain values, with a detail-specific marshaler; other reporting types retain their existing omitempty behavior.
  • Add populated/empty/nil JSON round-trip regression coverage and assertions for actual workflow-domain command output.

Fixes #67201

Validation

  • make build passed; Go formatting completed.
  • Focused domain-reporting tests passed.
  • golangci-lint run --allow-parallel-runners ./pkg/cli passed with zero issues.
  • make agent-report-progress passed schema freshness and impacted Go tests, but the overall gate is blocked by two existing custom-linter diagnostics on untouched domains_command.go statements (args[0] and a discarded type-assertion ok value). The initial regular lint job also collided with sibling sessions; the standalone parallel-safe rerun passed.
  • Repository-wide make fmt completed Go formatting but its unrelated JavaScript formatting stage lacked locally installed Prettier. Formatter-only changes outside this issue were reverted.

Publication used local Git because this runtime does not expose report_progress.

Preserve workflow domain JSON keys for populated, empty, and nil lists and cover command output and JSON round trips.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 11, 2026 05:41
Copilot AI balanced review requested due to automatic review settings October 11, 2026 05:41
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR #67642 lacks the implementation label and has 98 new lines in business logic directories (<=100 threshold, default config).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #67642

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

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.

🟢 Approval recommended

The focused refactor preserves existing behavior and has appropriate regression coverage.

0 open findings

What changed in this PR

Refactors workflow-domain reporting to reuse DomainBuckets while preserving its established flat JSON contract.

Changes:

  • Embeds DomainBuckets in WorkflowDomainsDetail.
  • Adds detail-specific JSON marshaling for empty and nil lists.
  • Expands round-trip and command-output regression tests.
File Description
pkg/​cli/​domains_command.go Embeds shared buckets and preserves JSON output.
pkg/​cli/​domains_command_test.go Tests command output and JSON edge cases.
pkg/​cli/​domain_buckets.go Generalizes the embedding documentation.

🧠 Review effort: Balanced


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

@github-actions github-actions Bot 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.

There are no blocking issues in the changed lines. The embedding refactor preserves the flat JSON output contract and adds regression coverage for nil, empty, and populated domain lists.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 38.9 AIC · ⌖ 5.41 AIC · ⊞ 21.2K
Comment /review to run again

@github-actions github-actions Bot mentioned this pull request Oct 11, 2026

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /codebase-design — approving with one minor maintainability note.

📋 Key Themes & Highlights

Key Themes

  • Embedding pattern is consistent: WorkflowDomainsDetail now embeds DomainBuckets the same way AnalysisBase already does in domain_buckets.go, reducing duplication without introducing a new abstraction.
  • Schema preservation via custom MarshalJSON: a small shadow struct is used to keep the flat, non-omitempty JSON shape for allowed_domains/blocked_domains while the shared DomainBuckets keeps omitempty for other embedders (AnalysisBase). This duplicates field declarations, so a future field added to WorkflowDomainsDetail could silently be dropped from JSON output — flagged inline with a low-cost suggestion (test or comment guardrail).
  • Test coverage is thorough: the rewritten TestWorkflowDomainsDetail_JSONMarshaling now table-tests populated/empty/nil/partial domain lists plus marshal+unmarshal round-trips, and TestRunWorkflowDomains_JSONOutput asserts actual command output end-to-end via a stdout pipe (consistent with existing patterns elsewhere in the package).

Positive Highlights

  • ✅ Comment update in domain_buckets.go correctly generalizes "embedded by DomainAnalysis/FirewallAnalysis" to "CLI reporting types embed it", since WorkflowDomainsDetail is now a third embedder.
  • ✅ No behavioral change to the public JSON schema — verified build and targeted tests pass locally (TestWorkflowDomainsDetail_JSONMarshaling, TestRunWorkflowDomains_JSONOutput, TestRunWorkflowDomains_TextOutput).
  • ✅ Good choice to keep RunWorkflowDomains's JSON-output construction site minimal by using the embedded struct literal.

Verification: ran go build ./pkg/cli/... and go test ./pkg/cli/ -run 'TestWorkflowDomainsDetail_JSONMarshaling|TestRunWorkflowDomains' — all pass.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 44.3 AIC · ⌖ 14.6 AIC · ⊞ 10.3K
Comment /matt to run again

Comment thread pkg/cli/domains_command.go
Address review feedback by explicitly noting that the JSON shadow struct and assignments must stay synchronized with WorkflowDomainsDetail.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan merged commit 1913833 into main Oct 11, 2026
41 checks passed
@pelikhan
pelikhan deleted the pelikhan-shared-domain-bucket-embedding branch October 11, 2026 07:26
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] Embed DomainBuckets in WorkflowDomainsDetail

2 participants