Skip to content

ci: Swap flake and isort for ruff and reorder jobs - #9056

Open
jakub-vavra-cz wants to merge 1 commit into
SSSD:masterfrom
jakub-vavra-cz:ruff
Open

ci: Swap flake and isort for ruff and reorder jobs#9056
jakub-vavra-cz wants to merge 1 commit into
SSSD:masterfrom
jakub-vavra-cz:ruff

Conversation

@jakub-vavra-cz

Copy link
Copy Markdown
Contributor

Ruff provides the same checks but runs a native code that is faster. It could be used also instead of black but current codebase would need to be reformatted first as ruff and black have different opinions on some cases.
Do not run python-system-tests when tests/system were not changed. Run python-system-tests before codeql (which is building sssd) to get its results much faster.

Ruff provides the same checks but runs a native code that is faster.
It could be used also instead of black but current codebase would
need to be reformatted first as ruff and black have different
opinions on some cases.
Do not run python-system-tests when tests/system were not changed.
Run python-system-tests before codeql (which is building sssd)
to get its results much faster.
cancel-in-progress: true
jobs:
codeql:
changes:

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.

files-changed instead?

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
- uses: actions/checkout@v7
- uses: dorny/paths-filter@v3

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.

filters: |
system_tests:
- 'src/tests/system/**'
- '.github/workflows/static-code-analysis.yml'

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.

Why is the github/workflows/static-code-analysis.yml file included here?

@justin-stephenson

Copy link
Copy Markdown
Contributor

Could you please also update https://github.com/SSSD/sssd-test-framework/blob/master/.github/workflows/ci.yml which runs these same python checks?

@justin-stephenson

Copy link
Copy Markdown
Contributor

Claude-Opus also suggests:

7 2. setup.cfg still contains dead [flake8] and [pycodestyle] sectionssrc/tests/system/setup.cfg still defines max-line-length, ignore = E203,W50 3, and exclude for both flake8 and pycodestyle, but neither tool is installed anymore. These dead sections should be removed to avoid confusion. The E203 and
W503 ignores don't need to be ported to ruff (E203 is not enforced when Black-compatible, and W503 doesn't exist in ruff), but leaving the stale config behind is
misleading.

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

Just one question, otherwise it looks good.

- '.github/workflows/static-code-analysis.yml'

python-system-tests:
needs: changes

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.

I like it, because it will reduce resources but shouldn't we be running tests each time there is a build? Not when the tests are modified?

I suppose we will find failures during the scheduled run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants