Skip to content

ci: fix cirrus and reduce rebuilds #2460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2025
Merged

Conversation

henryiii
Copy link
Contributor

Reducing rebuilds when unrelated files change.

Trying to fix Cirrus CI GraalPy.

@henryiii henryiii force-pushed the henryiii/ci/flimit branch 5 times, most recently from e7fdb15 to a5be50f Compare June 10, 2025 20:48
henryiii added 2 commits June 10, 2025 16:49
Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii force-pushed the henryiii/ci/flimit branch from a5be50f to c481bf5 Compare June 10, 2025 20:49
@henryiii
Copy link
Contributor Author

The last build before "Monthly commute limit exceeded" did pass on Windows! Just in time.

@henryiii
Copy link
Contributor Author

@joerick, what about turning off builds on main for some CIs like Cirrus? They use a lot of credits (every PR merge), and aren't really very helpful.

@henryiii henryiii marked this pull request as ready for review June 10, 2025 20:51
@henryiii henryiii requested a review from Copilot June 10, 2025 21:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to reduce unnecessary rebuilds and fix Cirrus CI GraalPy by updating CI configuration files and adding additional checks.

  • Added a warm-up socket connection in test_ssl.py to mitigate connection delays during SSL tests.
  • Updated certificate installation commands in Windows tasks and refined file exclusion patterns across CI configurations.
  • Modified the 'only_if' condition in .cirrus.yml to better control rebuild triggers.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/test_ssl.py Added socket warm-up command to improve SSL test reliability.
examples/cirrus-ci-minimal.yml Introduced certificate generation commands in Windows tasks.
azure-pipelines.yml Expanded file exclusion list to prevent redundant pipeline runs.
.github/workflows/test.yml Added extra files to paths-ignore for more efficient CI triggering.
.cirrus.yml Updated the only_if logic and certificate commands for better clarity.

Comment on lines +1 to 2
only_if: changesInclude('.cirrus.yml') || ($CIRRUS_BRANCH == "main" && !changesIncludeOnly('.github/*', 'bin/*', 'docs/*', '.circleci/*', '.travis.yml', '.pre-commit-config.yaml', '.readthedocs.yml', 'azure-pipelines.yml', 'README.md', 'mkdocs.yml', 'noxfile.py')) || $CIRRUS_BRANCH =~ 'cirrus.*'

Copy link
Preview

Copilot AI Jun 10, 2025

Choose a reason for hiding this comment

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

[nitpick] The current 'only_if' condition is complex and may be difficult to maintain. Consider refactoring the logic or extracting the file patterns into a variable to improve readability and ease of future modifications.

Suggested change
only_if: changesInclude('.cirrus.yml') || ($CIRRUS_BRANCH == "main" && !changesIncludeOnly('.github/*', 'bin/*', 'docs/*', '.circleci/*', '.travis.yml', '.pre-commit-config.yaml', '.readthedocs.yml', 'azure-pipelines.yml', 'README.md', 'mkdocs.yml', 'noxfile.py')) || $CIRRUS_BRANCH =~ 'cirrus.*'
IGNORED_FILE_PATTERNS: &IGNORED_FILE_PATTERNS
- .github/*
- bin/*
- docs/*
- .circleci/*
- .travis.yml
- .pre-commit-config.yaml
- .readthedocs.yml
- azure-pipelines.yml
- README.md
- mkdocs.yml
- noxfile.py
only_if: changesInclude('.cirrus.yml') || ($CIRRUS_BRANCH == "main" && !changesIncludeOnly(*IGNORED_FILE_PATTERNS)) || $CIRRUS_BRANCH =~ 'cirrus.*'

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't check to see if this works, so fine to skip for now, though it does look better. Hopefully someone remembers to try it next month.

Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@henryiii henryiii merged commit 3fa7bd1 into pypa:main Jun 10, 2025
24 of 32 checks passed
@henryiii henryiii deleted the henryiii/ci/flimit branch June 10, 2025 21:57
@joerick
Copy link
Contributor

joerick commented Jun 10, 2025

@joerick, what about turning off builds on main for some CIs like Cirrus? They use a lot of credits (every PR merge), and aren't really very helpful.

Cirrus currently only builds on main, to reduce usage. I figure that's fewer builds than all the PRs, and still lets us catch stuff. (I gotta say though, it's a bit of a hassle keeping all these CIs around that don't run in PRs!)

@henryiii
Copy link
Contributor Author

What about having it only rebuild on the dependency update PRs? That's 1-2 per week.

@joerick
Copy link
Contributor

joerick commented Jun 11, 2025 via email

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