Skip to content

Conversation

danceratopz
Copy link
Member

@danceratopz danceratopz commented Jun 27, 2025

πŸ—’οΈ Description

This PR tries to eliminate the most obvious inefficiency in our current CI: Duplicated tox_verify runs, e.g.
image

It won't make individual jobs quicker, but it will stop jobs getting queued up and delaying CI for a PR.

It eliminates redundant CI executions by:

  • Limiting 'push' triggers to only the 'main' branch for post-merge verification.
  • Using 'pull_request' for PR validation to run exactly once per commit.
  • Adding concurrency control to cancel in-progress runs when new commits are pushed.

Before the change:

  • Push to any branch β†’ CI runs.
  • Open/update PR β†’ CI runs.
  • Push to PR branch β†’ CI runs twice (push + pull_request events).

After the change:

  • Push to main only β†’ CI runs
  • Push to any other branch without PR β†’ No CI runs
  • Open/update PR β†’ CI runs once (pull_request event only)

Key differences:

  1. βœ… Push to main: Still triggers CI (for post-merge verification)
  2. ❌ Push to feature branch without PR: No longer triggers CI
  3. βœ… PR commits: Triggers CI exactly once instead of twice
  4. βœ… Merging branch into branch: Still works (via pull_request event)

πŸ”— Related Issues or PRs

N/A.

βœ… Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md. skipped
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).

This change eliminates redundant CI executions by:
- Limiting 'push' triggers to only the 'main' branch for post-merge verification
- Using 'pull_request' for PR validation to run exactly once per commit
- Adding concurrency control to cancel in-progress runs when new commits are pushed

Before: Each PR commit triggered CI twice (push + pull_request events)
After: Each PR commit triggers CI exactly once (pull_request event only)

The workflow still runs on push to main and supports all merge scenarios
while preventing resource waste from duplicate executions.
@danceratopz danceratopz added type:bug Something isn't working scope:ci Scope: Continuous Integration labels Jun 27, 2025
@danceratopz danceratopz marked this pull request as ready for review June 27, 2025 10:27
Copy link
Contributor

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

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

Quick approve from me!

@spencer-tb
Copy link
Contributor

Should we remove the 3.10 python runs in this PR? Maybe better to have a seperate PR that removes 3.10 from everywhere (not just CI).

@danceratopz
Copy link
Member Author

Should we remove the 3.10 python runs in this PR? Maybe better to have a seperate PR that removes 3.10 from everywhere (not just CI).

Always haz been cf #1808

@spencer-tb
Copy link
Contributor

Should we remove the 3.10 python runs in this PR? Maybe better to have a seperate PR that removes 3.10 from everywhere (not just CI).

Always haz been cf #1808

Y'all are fast!

Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Great idea, thanks!

@marioevz marioevz merged commit ead99d1 into main Jun 27, 2025
13 checks passed
@marioevz marioevz deleted the chore/streamline-ci branch June 27, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:ci Scope: Continuous Integration type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants