Skip to content

fix: partition shard items with comprehensions for the SonarCloud gate - #1406

Merged
Brad-Edwards merged 1 commit into
devfrom
fix-dev-sonar-shard-plugin
Oct 1, 2026
Merged

Brad-Edwards merged 1 commit into
devfrom
fix-dev-sonar-shard-plugin

Conversation

@Brad-Edwards

Copy link
Copy Markdown
Collaborator

Summary

dev fails the required sonar check at 2a5b0f46. The SonarCloud quality gate has one new violation (new_violations = 1): python:S9409 in tools/pytest_shard_plugin.py:71, an append() inside a for-loop. The same gate blocks the dev → main PR #1402. This PR partitions shard items with comprehensions, which fixes the finding without changing behavior.

Requirement UIDs

  • None. This is a code-quality fix to test tooling with no requirement scope.

Related Issues

No issue: remediates the SonarCloud gate failure on dev.

ADR Impact

  • None.

Changes

  • tools/pytest_shard_plugin.py: each item's shard assignment is computed once, then split into owned and deselected lists with comprehensions instead of a loop that appends to one list or the other. Ordering and the deselection hook are unchanged.

Test Plan

  • Unit tests pass
  • Integration tests pass if applicable
  • Full completion suite required in CI before merge
  • No coverage regression

tests/test_pytest_shard.py and tests/test_nox_shard_wiring.py pass (46). nox -s verify-fast-feedback --base-rev origin/dev and tools/check_tooling_artifact_policy.py pass.

Ground Control Checks

  • SonarCloud finding addressed in code, not suppressed

Traceability

  • SonarCloud dev quality gate: new_violations 1 (python:S9409, tools/pytest_shard_plugin.py:71); CI run 36804584166, job sonar

Checklist

  • No security or quality gate weakened
  • Behavior-preserving change verified by the shard tests

@Brad-Edwards
Brad-Edwards merged commit f51a2d1 into dev Oct 1, 2026
33 checks passed
@Brad-Edwards
Brad-Edwards deleted the fix-dev-sonar-shard-plugin branch October 1, 2026 03:01
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.

1 participant