Skip to content

MPT-22108 fix phase-step ruff:ignore suppression (broken main build) - #59

Merged
jentyk merged 1 commit into
mainfrom
bugfix/MPT-22108/phase-step-ruff-ignore
Jul 20, 2026
Merged

MPT-22108 fix phase-step ruff:ignore suppression (broken main build)#59
jentyk merged 1 commit into
mainfrom
bugfix/MPT-22108/phase-step-ruff-ignore

Conversation

@jentyk

@jentyk jentyk commented Jul 20, 2026

Copy link
Copy Markdown
Member

🤖 AI-generated PR — Please review carefully.

What

Fixes the broken PR build and merge on main after #53. The packages (phase-step) job fails because ruff 0.15.22 (now pinned on main) enforces the noqa-comments rule: a ruff code must be suppressed with # ruff:ignore[...], not # noqa:.

One-line change on the _normalize_phases import in phase_gate.py:

  • before: _normalize_phases, # noqa: PLC2701 # same-package internal helper
  • after: _normalize_phases, # ruff:ignore[import-private-name] # same-package internal helper

Why it happened

#53 was validated against ruff 0.15.21, which did not enforce this rule. main has since bumped ruff to 0.15.22, so the merged suppression started failing post-merge.

Testing

Reproduced the failure locally (ruff 0.15.22 = main's pin), then ran the same flow as the failing packages (phase-step) job:

  • scripts/check_repository.py, ruff format --check, ruff check, flake8, mypy, uv lock --check — all pass
  • pytest phase-step — 25 passed, 100% coverage

Fixes the failure in https://github.com/softwareone-platform/mpt-extension-python-contrib/actions/runs/29755869740

  • Updated the Ruff suppression syntax for the internal _normalize_phases import to support Ruff 0.15.22.
  • Preserved the same-package internal import and existing behavior.
  • Validation passes, including 25 tests with 100% coverage.

Ruff 0.15.22 (now pinned on main) enforces the `noqa-comments` rule:
suppressing a ruff code with `# noqa:` is rejected in favour of
`# ruff:ignore[...]`. The `# noqa: PLC2701` on the `_normalize_phases`
import that merged in #53 therefore breaks the post-merge build on main
(job `packages (phase-step)`).

Switch the suppression to `# ruff:ignore[import-private-name]`, which
ruff accepts, keeping the same-package internal import unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jentyk
jentyk requested a review from a team as a code owner July 20, 2026 16:07
@jentyk
jentyk requested review from albertsola and d3rky July 20, 2026 16:07
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

✅ Found Jira issue key in the title: MPT-22108

Generated by 🚫 dangerJS against 1571d6b

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 255e2cae-e1ac-41c7-a062-aeb2672701b4

📥 Commits

Reviewing files that changed from the base of the PR and between ab6a5a7 and 1571d6b.

📒 Files selected for processing (1)
  • phase-step/mpt_extension_contrib/phase_step/phase_gate.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • softwareone-platform/mpt-extension-skills (manual)
📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: packages (phase-step)
  • GitHub Check: sonar
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Keep Python packages independently releasable and expose them through the shared mpt_extension_contrib namespace without introducing a namespace-level initializer.

Files:

  • phase-step/mpt_extension_contrib/phase_step/phase_gate.py
**/*

⚙️ CodeRabbit configuration file

**/*: For each subsequent commit in this PR, explicitly verify if previous review comments have been resolved

Files:

  • phase-step/mpt_extension_contrib/phase_step/phase_gate.py
🧠 Learnings (1)
📚 Learning: 2026-07-03T13:40:50.305Z
Learnt from: jentyk
Repo: softwareone-platform/mpt-extension-python-contrib PR: 50
File: order-status/mpt_extension_contrib/order_status/templates.py:29-56
Timestamp: 2026-07-03T13:40:50.305Z
Learning: When using `TemplateService.get_template(product_id, status, name=template_name)` from the `mpt-extension-sdk` dependency, assume it already implements “named template or default fallback” in a single call (fetches the named template for that status, and if it doesn’t exist, returns the default). Therefore, callers should not issue an extra, separate query for the default template when the named one is missing—just call `get_template(..., name=...)` and use the returned template. This is consistent with the SDK source/tests (e.g., `tests/services/mpt_api_service/test_template.py`) and the method docstring stating it falls back to default.

Applied to files:

  • phase-step/mpt_extension_contrib/phase_step/phase_gate.py
🔇 Additional comments (1)
phase-step/mpt_extension_contrib/phase_step/phase_gate.py (1)

5-5: LGTM!


📝 Walkthrough

Walkthrough

Changes

Lint suppression

Layer / File(s) Summary
Update private import suppression
phase-step/mpt_extension_contrib/phase_step/phase_gate.py
Replaces the PLC2701 suppression on _normalize_phases with Ruff’s import-private-name ignore directive.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Documentation Up To Date ✅ Passed Only a Ruff suppression comment changed in a single internal file; no behavior, API, or workflow docs needed.

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@jentyk
jentyk merged commit e93d1ab into main Jul 20, 2026
10 checks passed
@jentyk
jentyk deleted the bugfix/MPT-22108/phase-step-ruff-ignore branch July 20, 2026 16:10
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.

2 participants