Skip to content

Refactor engine import defaults parameters - #51295

Merged
pelikhan merged 4 commits into
mainfrom
copilot/lint-monster-apply-engine-import-defaults
Aug 8, 2026
Merged

Refactor engine import defaults parameters#51295
pelikhan merged 4 commits into
mainfrom
copilot/lint-monster-apply-engine-import-defaults

Conversation

CopilotAI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

applyEngineImportDefaults exceeded the custom linter’s parameter-count limit. This refactor keeps the behavior local and unchanged while reducing the helper signature below the threshold.

  • Options struct

    • Added a narrow engineImportDefaultsOptions struct for the values already passed together.
    • Kept the struct local to compiler_orchestrator_engine.go.
  • Call-site clarity

    • Replaced the long positional argument list with named fields:
engineConfig, model=c.applyEngineImportDefaults(engineImportDefaultsOptions{
engineConfig: engineConfig,
model: model,
engineSetting: engineSetting,
importsResult: importsResult,
importedEngineDefinitions: importedEngineDefinitions,
preservedMaxTurns: preservedMaxTurns,
preservedMaxAICredits: preservedMaxAICredits,
preservedMaxRuns: preservedMaxRuns,
preservedMaxTurnCacheMisses: preservedMaxTurnCacheMisses,
})

@copilot Quick triage nudge for this PR.
Please refresh the branch if GitHub can update it cleanly, address the remaining items below, and run the skill before handing back to maintainers.

Open review threads (newest first):

Run: https://github.com/github/gh-aw/actions/runs/31241108329> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 7.06 AIC · ⌖ 6.39 AIC · ⊞ 8.5K ·

Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 17.1 AIC · ⌖ 6.55 AIC · ⊞ 6.1K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
CopilotAI changed the title [WIP] Refactor applyEngineImportDefaults to use options structRefactor engine import defaults parametersAug 8, 2026
CopilotAI requested a review from pelikhanAugust 8, 2026 03:52
@pelikhan
pelikhan marked this pull request as ready for review August 8, 2026 04:52
CopilotAI balanced review requested due to automatic review settings August 8, 2026 04:52
@github-actions

github-actionsBot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actionsBot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (52 additions detected, threshold is 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actionsBot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • api.individual.githubcopilot.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
allowed:
- defaults
- "api.individual.githubcopilot.com"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actionsBot commented Aug 8, 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

CopilotAI 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

Refactors engine import default handling to satisfy the parameter-count linter without changing behavior.

Changes:

  • Introduces a local options struct.
  • Replaces positional arguments with named fields.
Show a summary per file
FileDescription
pkg/workflow/compiler_orchestrator_engine.goRefactors helper signature and call site.

Review details

Tip

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

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

preservedMaxRuns int,
preservedMaxTurnCacheMisses int,
) (*EngineConfig, string) {
type engineImportDefaultsOptions struct {

@github-actionsgithub-actionsBot 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.

Clean refactor: converting a 9-parameter function to an options struct. Logic is identical, call site is correctly updated, and struct field names match original parameter names. No issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 15.7 AIC · ⌖ 7.09 AIC · ⊞ 5.5K

@github-actionsgithub-actionsBot 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 — clean mechanical refactor; approving.

📋 Highlights
  • engineImportDefaultsOptions is package-private (lowercase), correctly scoped to this file
  • ✅ Only engineConfig and model (the returned/mutated values) are unpacked to locals; all other fields accessed via opts.* — idiomatic Go
  • ✅ Behaviour is identical to the previous positional-parameter signature
  • ✅ Single focused file change; linter parameter-count threshold satisfied

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 18 AIC · ⌖ 7.36 AIC · ⊞ 7.1K
Comment /matt to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.
Please refresh the branch if GitHub can update it cleanly, address the remaining items below, and run the skill before handing back to maintainers.

Open review threads (newest first):

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

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 7.06 AIC · ⌖ 6.39 AIC · ⊞ 8.5K ·
Comment /souschef to run again

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

CopilotAI commented Aug 8, 2026

Copy link
Copy Markdown
ContributorAuthor

@copilot Quick triage nudge for this PR.
Please refresh the branch if GitHub can update it cleanly, address the remaining items below, and run the skill before handing back to maintainers.
...

Moved the applyEngineImportDefaults doc comment to sit directly above the function declaration (below the options struct) so Go's doc tooling associates it with the right symbol. Fixed in the latest commit.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.

Please refresh the branch if GitHub can update it cleanly, confirm the remaining review thread you already replied to is now fully resolved, and run the pr-finisher skill before handing back to maintainers.

Open items (newest first):

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

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 17.1 AIC · ⌖ 6.55 AIC · ⊞ 6.1K ·
Comment /souschef to run again

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Category: refactor | Risk: low | Score: 58 (impact 20, urgency 15, quality 23)

Recommended action:fast_track

Small internal refactor (parameter struct extraction, no behavior change), 1 file. AI reviewer approved (2x github-actions APPROVED). CI (CGO/CWI) currently in_progress after latest push; prior runs alternated pass/action_required. Good candidate for expedited human review once CI is green.

Generated by 🔧 PR Triage Agent · auto · 40.7 AIC · ⌖ 2.51 AIC · ⊞ 8K ·

@pelikhan
pelikhan merged commit ef11208 into mainAug 8, 2026
28 checks passed
@pelikhan
pelikhan deleted the copilot/lint-monster-apply-engine-import-defaults branch August 8, 2026 06:36
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.2

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[lint-monster] lint-monster: apply options-struct refactor for applyEngineImportDefaults

4 participants

@gh-aw-bot@pelikhan