Refactor parameter-heavy safe-update and package resolution APIs - #52982
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Ponytail Reviewer completed successfully! Reviewed PR #52982 with ponytail-review lens: mechanical options-struct extraction to fix parameter-count lint violations (EnforceSafeUpdate, resolveRepositoryPackageExtensionFiles). Each new struct has 5-8 genuinely-used fields, single call site pattern is standard for reducing parameter count, no speculative/unused flexibility introduced. Lean already. Ship.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ PR Code Quality Reviewer completed the code quality review. Completed PR review analysis for #52982; no GitHub write performed because I found no actionable review comments to submit.
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
Pull request overview
Refactors the two parameter-heavy APIs identified in #52813 while preserving existing safe-update and package-resolution behavior.
Changes:
- Introduces options structs for safe-update enforcement and package extension resolution.
- Updates compiler and test call sites to use the new APIs.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/safe_update_enforcement.go |
Adds SafeUpdateOptions and refactors enforcement. |
pkg/workflow/safe_update_enforcement_test.go |
Updates safe-update tests. |
pkg/workflow/compiler.go |
Passes compiler inputs through the options struct. |
pkg/workflow/compiler_threat_detection_formal_test.go |
Updates formal conformance tests. |
pkg/cli/add_package_manifest.go |
Adds package-extension resolution options. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
There was a problem hiding this comment.
Clean refactor converting positional parameters to options structs for EnforceSafeUpdate and resolveRepositoryPackageExtensionFiles. All call sites and tests updated consistently. No logic changes detected. LGTM.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 14.7 AIC · ⌖ 7.01 AIC · ⊞ 5.6K
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design — this is a clean, well-executed refactor. Approving with a few minor observations.
📋 Key Themes & Highlights
Key Themes
- Struct consistency:
SafeUpdateOptionsis exported;repositoryPackageExtensionFilesOptionsis unexported — intentional asymmetry but worth documenting. - Zero-value semantics: both option structs rely on Go zero values for omitted fields, which works correctly here, but the nil-vs-zero distinction for
Manifestis load-bearing and slightly subtle.
Positive Highlights
- ✅ Mechanical, behavior-preserving refactor with no logic changes
- ✅ All call sites and test suites updated consistently
- ✅ Named struct fields make call sites self-documenting
- ✅ Security-critical tests (
compiler_threat_detection_formal_test.go) all preserved and updated
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 22.8 AIC · ⌖ 8.87 AIC · ⊞ 7.7K
Comment /matt to run again
Adds a draft Architecture Decision Record documenting the decision to consolidate parameter-heavy function signatures into options structs (SafeUpdateOptions and repositoryPackageExtensionFilesOptions). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (110 new lines in 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. ❓ Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
|
@copilot Quick triage for maintainer-ready follow-up: Please refresh the branch if GitHub allows it and run the Outstanding maintainer-facing follow-up (newest first):
Failed checks from the compact candidate set:
Branch update was requested automatically for this run when GitHub allows it.
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Done — ADR-52982 is finalized (status: Accepted) and linked in the PR body so the Design Decision Gate can re-evaluate. Ran Maintainer-facing summary: this refactor remains fully behavior-preserving — Note: no |
|
🎉 This pull request is included in a new release. Release: |
Two custom-linter findings exceeded the configured parameter-count limit in safe-update enforcement and repository package extension resolution.
Safe-update enforcement
SafeUpdateOptionsto group manifest, references, redirect, transition, and memory-validation inputs.Package extension resolution
repositoryPackageExtensionFilesOptionsfor repository, manifest, and inclusion inputs.run: https://github.com/github/gh-aw/actions/runs/31914929251> Generated by 👨🍳 PR Sous Chef · gpt54 · 7.2 AIC · ⌖ 6.93 AIC · ⊞ 8.7K · ◷