Repository navigation
Closed
Labels
area/ci-cdGitHub workflows, merge queue, gh-aw integrations, release pipeline.area/cliCLI command surface, flags, help text (cross-cutting).code-qualityCode quality, linting, and complexity guardrailsgood first issueMaintainer-supported newcomer task; check human scope approval, review contact and existing claims.priority/lowHuman-set low priority; does not imply acceptance, implementation approval or a release target.refactorLegacy classification name; prefer type/refactor. Retained for history.status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.status/triagedAutomated advice completed; deduplication only. Not human approval; silence is not approval.type/refactorInternal restructure, no behavior change.
Description
Strangler Stage 1: tame the worst outliers
Labels: good first issue, code-quality, refactor
Stage 1 -- tame the worst outliers
Tighten Ruff thresholds from baseline to Stage 1 targets. This stage focuses on the small number of extreme outliers that gate every metric.
Threshold changes
| Metric | Current | Stage 1 | Violations | Files |
|---|---|---|---|---|
| max-statements | 275 | 200 | 1 | 1 |
| max-branches | 115 | 60 | 1 | 1 |
| max-complexity | 100 | 50 | 2 | 2 |
| max-args | 18 | 15 | 5 | 4 |
| max-returns | 18 | 12 | 4 | 4 |
| file-length | 2400 | 1400 | 3 | 3 |
Key files to refactor
mcp_integrator.py::install (owns 3 metrics simultaneously):
- 269 statements (target: 200)
- 108 branches (target: 60)
- 97 complexity (target: 50)
- Extract phases into private helpers (
_validate,_resolve,_deploy,_hooks)
install/validation.py (complexity 65, target 50)
commands/install.py (18 args on two functions, target 15):
- Reduce via parameter objects or context dataclasses
marketplace/publisher.py (16 returns, target 12):
- Early-return consolidation
File length (3 files > 1400 lines):
github_downloader.py(2316),commands/install.py(1680),skill_integrator.py(1365)
How to verify
# Update thresholds in pyproject.toml, then:
uv run ruff check src/ tests/
# Update MAX_LINES in .github/workflows/ci.yml, then check:
find src/ -name '*.py' | xargs wc -l | awk '$1 > 1400'References
Metadata
Metadata
Assignees
Labels
area/ci-cdGitHub workflows, merge queue, gh-aw integrations, release pipeline.area/cliCLI command surface, flags, help text (cross-cutting).code-qualityCode quality, linting, and complexity guardrailsgood first issueMaintainer-supported newcomer task; check human scope approval, review contact and existing claims.priority/lowHuman-set low priority; does not imply acceptance, implementation approval or a release target.refactorLegacy classification name; prefer type/refactor. Retained for history.status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.status/triagedAutomated advice completed; deduplication only. Not human approval; silence is not approval.type/refactorInternal restructure, no behavior change.
Type
Projects
- StatusShow more project fieldsDone
Activity
zeel2104 commentedon Apr 30, 2026
Open for contribution?
sergio-sisternes-epam commentedon May 1, 2026
Absolutely Zeel Desai (@zeel2104), go for it!
github-actions commentedon May 1, 2026
Triage decision
acceptProposed labels
Milestone
null-- no open milestones found in the repository at triage time.Suggested next action
Pick one file from the key-files list (start with
marketplace/publisher.pyearly-return consolidation orinstall/validation.pycomplexity reduction), open a focused PR against parent #1076, and verify withuv run ruff check src/ tests/before pushing.Suggested issue comment
Per-lens notes (collapsed)
DevX UX Expert -- User-Need Reviewer
Pure internal code quality refactor with no user-facing surface change. The decomposition of
mcp_integrator.py::installinto phase helpers improves long-term maintainability and will make error paths easier to follow, which indirectly benefits UX. Issue is well-scoped with concrete verification steps (uv run ruff check+find ... wc -l). No discoverability, familiarity, or composability concerns flagged.Supply Chain Security Expert -- Risk-Surface Reviewer
No direct P/G/S risk surface implication. The refactoring of
mcp_integrator.py::installis the only security-adjacent touch -- it is the critical install-path function. The implementer must ensure that helper extraction preserves the semantic ordering (validate/resolve before deploy/hooks) and that all file operations continue to route throughpath_security.validate_path_segments/ensure_path_within. No lockfile schema change, no registry interaction change, no auth flow change. Implementation-time reminder only; not a reason to withhold acceptance.OSS Growth Hacker -- Contributor-Tone Reviewer
Not activated -- author is a project COLLABORATOR (sergio-sisternes-epam), not a new or low-interaction contributor; tone tuning for first-time contributors is not warranted.
Python Architect -- Architecture Reviewer
The refactoring scope is well-specified and feasible. Phase-extraction from
install()(_validate/_resolve/_deploy/_hooks) aligns with APM's existing lifecycle patterns (CommandLogger, BaseIntegrator). Parameter reduction via frozen dataclass is consistent with APM's dataclass guidance. Ruff threshold changes are mechanical CI config edits. Parent issue #1076 confirms this is part of a coordinated strangler fig plan, not an isolated change. No cross-cutting design decision (new interface, data model, migration boundary, or primitive) is required before code can land --status/acceptedis correct andstatus/needs-designis not warranted.Doc Writer -- Documentation Reviewer
Not activated -- this is a pure internal code quality refactor with no user-facing CLI surface change, no new commands, no new flags, and no new authoring concepts. No documentation updates to
docs/src/content/docs/or the README are implied by this issue.APM CEO -- Triage Arbiter
Straightforward accept. This is a planned, well-scoped code quality refactor under the strangler fig strategy (#1076). No product surface is touched, no theme mega-label is required (pure area/cli + area/ci-cd scope with no P/G/S implication). The good-first-issue label is warranted and preserved -- the issue names exactly which files and metrics to target, which gives a contributor a clear entry point. No open milestones exist at triage time; this rolls into whichever patch cycle the maintainer targets. All specialists agreed; no arbitration dispute.
{ "decision": "accept", "decision_detail": "", "theme": null, "areas": ["area/cli", "area/ci-cd"], "type": "type/refactor", "status": "status/accepted", "priority": "priority/low", "preserved_labels": ["good first issue"], "milestone": null, "next_action": "Pick one file from the key-files list (start with marketplace/publisher.py or install/validation.py), open a focused PR against parent #1076, and verify with uv run ruff check src/ tests/ before pushing.", "comment_markdown": "Thanks for the structured breakdown -- the metric table and per-file targets make this straightforward to pick up incrementally.\n\nThe panel accepts this as written. A few notes for the implementer:\n\n- When extracting _validate, _resolve, _deploy, _hooks from mcp_integrator.py::install, preserve the operation ordering: identity/integrity checks (validate/resolve) must complete before any file writes (deploy). All path joins must continue flowing through path_security.validate_path_segments / ensure_path_within.\n- For commands/install.py arg reduction, a frozen dataclass is the idiomatic APM pattern (see DiagnosticCollector and the BaseIntegrator family). Name the dataclass after the phase it represents (e.g. InstallContext) and keep it in the same file until a second call site warrants moving it to core/.\n- The Ruff threshold edits in pyproject.toml and the MAX_LINES guard in .github/workflows/ci.yml should land in the same commit as the refactor they gate -- not ahead of it.\n\nTwo existing labels (refactor, code-quality) are not in the APM label taxonomy. The panel has proposed type/refactor (canonical) in their place; a maintainer can remove the non-taxonomy labels if they choose.\n\nGood first issue: the marketplace/publisher.py early-return consolidation (16 -> 12 returns) or install/validation.py complexity reduction (65 -> 50) are the lowest-risk entry points. Either can land as a standalone PR referencing this issue." }fix: address Copilot + APM panel review feedback (#1077)
refactor: Strangler Stage 1 -- tame worst complexity outliers (#1464)