Skip to content

Comments

Optimize workflow run#8225

Merged
MichaReiser merged 5 commits intoastral-sh:mainfrom
Cjkjvfnby:sa/optimize-workflow-run
Nov 30, 2023
Merged

Optimize workflow run#8225
MichaReiser merged 5 commits intoastral-sh:mainfrom
Cjkjvfnby:sa/optimize-workflow-run

Conversation

@Cjkjvfnby
Copy link
Contributor

@Cjkjvfnby Cjkjvfnby commented Oct 25, 2023

Summary

  • Don't run jobs that are not affected
  • Replace scripts/* with scripts/**

Test Plan

This PR changes ci.yaml, so it will trigger all jobs. there is no good way to test if something is skipped before merging this to the main and creating other PRs.

I am not familiar with the project well, so might miss some configs that are important.

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving our pipeline.

I like the idea of running fewer jobs but I'm unsure if the added complexity is worth it, considering that most jobs include code changes. It's also very easy to forget files.

- Cargo.toml
- Cargo.lock
- clippy.toml
- pyproject.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- pyproject.toml
- pyproject.toml
- rust-toolchain.toml
- fuzz/**

Does the plugin support a way to say: Only run when e.g. all changed files are markdown files? It would reduce that we missed adding an entry. I rather have the job runs too often that miss out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see no, it could not.

But it could be addressed by running them on master, after the merge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not with something like

- **/*
- !**/*.md

I would be surprised if this was not feasible.

@Cjkjvfnby Cjkjvfnby closed this Oct 29, 2023
@Cjkjvfnby Cjkjvfnby reopened this Oct 29, 2023
@Cjkjvfnby
Copy link
Contributor Author

Force pushed changes, after rebasing on top of the main

Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to maintain this list of files. I'd prefer the "negated" style that @MichaReiser requested as well.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@Cjkjvfnby
Copy link
Contributor Author

The first implementation with negation.

code and formatter sections are the same, probably some exclusions should be added to formatted. I don't have expertise in the project to do it.

@MichaReiser MichaReiser added internal An internal refactor or improvement ci Related to internal CI tooling and removed internal An internal refactor or improvement labels Nov 27, 2023
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatter now runs on all linter changes because it doesn't exclude the linter specific crates (or development-only crates).

I'm okay merging this but I would prefer reverting the changes to the linter/formatter filesets to keep the changes isolated.

@Cjkjvfnby
Copy link
Contributor Author

The formatter now runs on all linter changes because it doesn't exclude the linter specific crates (or development-only crates).

I don't know Rust, so could not do it myself.

I'm okay merging this but I would prefer reverting the changes to the linter/formatter filesets to keep the changes isolated.

Done.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 29, 2023

CodSpeed Performance Report

Merging #8225 will improve performances by 11.42%

Comparing Cjkjvfnby:sa/optimize-workflow-run (8ad224b) with main (5d554ed)

Summary

⚡ 5 improvements
✅ 20 untouched benchmarks

🆕 5 new benchmarks

Benchmarks breakdown

Benchmark main Cjkjvfnby:sa/optimize-workflow-run Change
linter/all-rules[unicode/pypinyin.py] 17.2 ms 16.2 ms +6.03%
linter/all-rules[numpy/globals.py] 4.2 ms 3.9 ms +6.42%
linter/all-rules[pydantic/types.py] 80.3 ms 72.2 ms +11.18%
🆕 linter/all-with-preview-rules[unicode/pypinyin.py] N/A 17.2 ms N/A
🆕 linter/all-with-preview-rules[numpy/globals.py] N/A 4.2 ms N/A
🆕 linter/all-with-preview-rules[large/dataset.py] N/A 185.6 ms N/A
🆕 linter/all-with-preview-rules[numpy/ctypeslib.py] N/A 37.1 ms N/A
linter/all-rules[numpy/ctypeslib.py] 36.8 ms 33.9 ms +8.58%
linter/all-rules[large/dataset.py] 186.2 ms 167.1 ms +11.42%
🆕 linter/all-with-preview-rules[pydantic/types.py] N/A 79.9 ms N/A

@MichaReiser MichaReiser merged commit 08f3110 into astral-sh:main Nov 30, 2023
zanieb added a commit that referenced this pull request Dec 7, 2023
These were literals instead of expressions... and were consequently not
evaluated.

Fixes bug from #8225
zanieb added a commit that referenced this pull request Dec 7, 2023
Replaces #9035
Fixes #8225

The issue appears to be that `*/**` was used instead of `**/*` which did
not match _any_ changed file as desired
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to internal CI tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants