Skip to content

refactor(parser): extract extractEngineMCPSettings to bring extractEngineConfig under 60-line limit - #47009

Merged
pelikhan merged 3 commits into
mainfrom
copilot/lint-monster-refactor-parser-extractor
Jul 21, 2026
Merged

refactor(parser): extract extractEngineMCPSettings to bring extractEngineConfig under 60-line limit#47009
pelikhan merged 3 commits into
mainfrom
copilot/lint-monster-refactor-parser-extractor

Conversation

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

extractEngineConfig in pkg/parser/import_field_extractor.go was 67 lines, exceeding the 60-line custom linter threshold.

Changes

  • pkg/parser/import_field_extractor.go — pulled the engine MCP timeout extraction block out of extractEngineConfig into a new private helper extractEngineMCPSettings(mcpVal any, fullPath string), reducing extractEngineConfig from 67 → 52 lines with no logic change
// Before: 18-line inline block inside extractEngineConfig
if mcpVal, hasMCP := v["mcp"]; hasMCP {
    if mcpMap, ok := mcpVal.(map[string]any); ok {
        // ... tool-timeout and session-timeout extraction (16 lines) ...
    }
}

// After: delegated to helper
if mcpVal, hasMCP := v["mcp"]; hasMCP {
    acc.extractEngineMCPSettings(mcpVal, fullPath)
}

The new helper encapsulates the first-wins extraction of engine.mcp.tool-timeout and engine.mcp.session-timeout, matching the pattern used by other focused extractors in this file.


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

Warning

Firewall blocked 1 domain

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

  • pi.dev

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

network:
  allowed:
    - defaults
    - "pi.dev"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · 11 AIC · ⌖ 5.19 AIC · ⊞ 7K ·
Comment /souschef to run again


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

Warning

Firewall blocked 1 domain

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

  • pi.dev

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

network:
  allowed:
    - defaults
    - "pi.dev"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · 12.4 AIC · ⌖ 6.12 AIC · ⊞ 5.5K ·
Comment /souschef to run again

…gineConfig length

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor extractEngineConfig to meet linter limits refactor(parser): extract extractEngineMCPSettings to bring extractEngineConfig under 60-line limit Jul 21, 2026
Copilot AI requested a review from pelikhan July 21, 2026 07:21
@pelikhan
pelikhan marked this pull request as ready for review July 21, 2026 07:36
Copilot AI review requested due to automatic review settings July 21, 2026 07:36

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

Refactors parser engine configuration extraction to satisfy the 60-line linter limit without changing behavior.

Changes:

  • Extracts MCP timeout handling into extractEngineMCPSettings.
  • Preserves first-wins semantics for tool and session timeouts.
Show a summary per file
File Description
pkg/parser/import_field_extractor.go Delegates engine MCP timeout extraction to a focused helper.

Review details

Tip

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

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

@github-actions

github-actions Bot commented Jul 21, 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 analysis not required. PR refactors pkg/parser/import_field_extractor.go (22 additions, 16 deletions) to extract extractEngineMCPSettings function—a production-only change.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

No ADR enforcement needed: PR #47009 does not have the 'implementation' label and has only 22 new lines of code in business logic directories (threshold: 100).

@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.

Clean extract-method refactor. The new extractEngineMCPSettings helper is a faithful extraction of the original inline block — identical logic, same first-wins semantics, proper early return on type mismatch. No issues found.

🔎 Code quality review by PR Code Quality Reviewer · 9.61 AIC · ⌖ 4.33 AIC · ⊞ 5.6K
Comment /review to run again

@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 — this is a clean, focused extraction with no logic change.

  • ✅ Helper is correctly scoped as a method on importAccumulator, consistent with adjacent extractors
  • ✅ Early-return guard for the type assertion replaces the nested if ok — slightly cleaner
  • extractEngineConfig now sits comfortably under the 60-line limit

Nothing actionable to flag. LGTM.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 12.2 AIC · ⌖ 4.37 AIC · ⊞ 6.7K
Comment /matt to run again

@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.

LGTM. Clean, behavior-preserving extraction of extractEngineMCPSettings. Logic, first-wins semantics, and logging are all faithfully preserved.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 10.7 AIC · ⌖ 4.32 AIC · ⊞ 5K

@github-actions github-actions Bot mentioned this pull request Jul 21, 2026
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, confirm the branch is current after the branch update, address any remaining unresolved review feedback, and summarize the exact next maintainer action to merge this PR.

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

Warning

Firewall blocked 1 domain

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

  • pi.dev

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

network:
  allowed:
    - defaults
    - "pi.dev"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · 11 AIC · ⌖ 5.19 AIC · ⊞ 7K ·
Comment /souschef to run again

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, confirm the branch is current after the branch update, address any remaining unresolved review feedback, and summarize the exact next maintainer action to ...

Done. I ran the PR-finisher flow and copilot-review checks.

  • Branch current after update: confirmed main commit 8070dbd is in this branch (HEAD d40a8a6, merge commit includes 8070dbd as parent).
  • Remaining unresolved review feedback: none (no unresolved review threads; only informational bot comments).
  • Local validation: make fmt, make lint, make test-unit, make test, and make recompile all passed.

Exact next maintainer action to merge: re-trigger CI on the current PR HEAD (close/reopen PR, workflow_dispatch, or a maintainer push), then merge once required checks are green.

Copilot AI requested a review from gh-aw-bot July 21, 2026 08:31
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, update the branch, rerun CI, and verify this refactor is ready for maintainer review.

Warning

Firewall blocked 1 domain

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

  • pi.dev

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

network:
  allowed:
    - defaults
    - "pi.dev"

See Network Configuration for more information.

Generated by 👨‍🍳 PR Sous Chef · 12.4 AIC · ⌖ 6.12 AIC · ⊞ 5.5K ·
Comment /souschef to run again

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, update the branch, rerun CI, and verify this refactor is ready for maintainer review.

...

Completed another pr-finisher pass at d40a8a6 (no code changes were needed).

  • Branch update/currentness: confirmed up to date with origin/main (8070dbd is an ancestor of HEAD d40a8a6).
  • Review feedback: no unresolved review threads and no actionable in-scope review comments remain.
  • Validation: make fmt, make lint, make test-unit, make test, and make recompile all pass locally.

I cannot directly rerun required repository CI from this agent environment. Next maintainer action: re-trigger CI on the current PR HEAD (close/reopen PR, workflow_dispatch, or maintainer push). If required checks pass, this refactor is ready for maintainer review/merge.

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, update the branch, rerun CI, and verify this refactor is ready for maintainer review.

...

Branch is already current with main (HEAD d40a8a6, and origin/main is an ancestor; behind count is 0), so no branch-update commit was needed.

I reran the PR-finisher checks for this HEAD:

  • no unresolved review threads/comments to address
  • local validation passed: make fmt, make lint, make test-unit, make test, make recompile
  • prior action_required CI entries had no failed jobs/logged failures; current check snapshot shows 2 copilot runs successful and 1 still in progress

This refactor is ready for maintainer review. If a fresh required-check run is still needed on this exact HEAD, the maintainer can re-trigger CI (close/reopen PR, workflow_dispatch, or maintainer push) and merge once required checks are green.

@pelikhan
pelikhan merged commit 4a77d0d into main Jul 21, 2026
26 checks passed
@pelikhan
pelikhan deleted the copilot/lint-monster-refactor-parser-extractor branch July 21, 2026 09:49
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.83.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.

[lint-monster] [Code Quality] Refactor parser extractor long function (1 finding)

4 participants