Skip to content

Stabilize Black/Isort CI format validation [AARD-2117]#1303

Merged
BrandonPacewic merged 2 commits intodevfrom
branp/2117/exporter-black-isort-ci-fix
Apr 3, 2026
Merged

Stabilize Black/Isort CI format validation [AARD-2117]#1303
BrandonPacewic merged 2 commits intodevfrom
branp/2117/exporter-black-isort-ci-fix

Conversation

@BrandonPacewic
Copy link
Copy Markdown
Member

Task

AARD-2117

Symptom

The BlackFormat.yml CI job fails intermittently on PRs with no Python changes. Two causes:

  1. The Black validation step used psf/black@stable, which always resolves to the latest black release. Any new version with updated formatting rules immediately breaks CI against
    previously passing code.
  2. verifyIsortFormatting.py validated formatting by actually modifying files on disk and diffing the result. Because it was invoked from the repo root, the pyproject.toml skip patterns
    for src/Proto and proto/proto_out did not resolve reliably, causing isort to reformat auto-generated proto files and produce false positive failures.

Additionally, black and isort were unpinned in requirements-dev.txt, meaning developer environments and CI could silently diverge.

Solution

  • Replaced the psf/black@stable action with a direct python3 -m black --check invocation with an explicit --config flag, ensuring config discovery is deterministic regardless of
    working directory.
  • Replaced the file-mutating isort validation script with isort --check-only --diff --settings-path, delegating comparison logic to isort itself and eliminating the disk-write side effect.
  • Pinned black==24.10.0 and isort==5.13.2 in requirements-dev.txt.
  • Updated CI to install from requirements-dev.txt directly, making it the single source of truth for formatter versions.

Verification

  • Ran python3 -m black --check --config ./exporter/SynthesisFusionAddin/pyproject.toml ./exporter/SynthesisFusionAddin/ locally, all 40 files pass unchanged.
  • Ran the updated verifyIsortFormatting.py locally, all tracked Python files pass; src/Proto files are correctly skipped.

Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

@BrandonPacewic BrandonPacewic self-assigned this Apr 3, 2026
@BrandonPacewic BrandonPacewic requested review from a team as code owners April 3, 2026 19:33
@BrandonPacewic BrandonPacewic merged commit ce8c601 into dev Apr 3, 2026
16 checks passed
@BrandonPacewic BrandonPacewic deleted the branp/2117/exporter-black-isort-ci-fix branch April 3, 2026 19:42
@BrandonPacewic BrandonPacewic removed the request for review from PepperLola April 3, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant