CI doesn't run on PRs into feature branches, so fixes are only tested after they merge

Open Beginner friendly
#461 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, python
Domain
ci-cd

Research direction

Read .github/workflows/ci.yml and check its existing push, pull_request, and concurrency settings. Update the pull request trigger so CI runs for every base branch while pushes remain limited to master; keep azure-deploy.yml unchanged. Done means this PR's checks show the four Python version jobs, as described in the issue.

Written by the indexing model from the issue text.

Description

bug

Problem

.github/workflows/ci.yml (lint plus pytest on Python 3.11–3.14) triggers only on:

on:
  push:
    branches: ["master"]
  pull_request:
    branches: ["master"]

Release work happens on a feature branch (feat/pi-version-1-8-0), and fix PRs target that branch: 41 PRs have merged into it so far. Because those PRs don't target master, CI never runs on them. #456, #458 and #460, for example, show no checks at all, only CodeQL.

CI does check the feature branch indirectly, through the open release PR #433 (feat/pi-version-1-8-0 → master). Each merge into the feature branch updates #433, which starts a pull_request run. So each fix gets tested only after it has merged:

  • A fix PR that breaks lint, breaks a test, or fails on a Python version the developer didn't test locally is merged anyway. The failure first shows up on #433, which is then red for every later fix until someone pushes a fix.
  • Reviewers of a fix PR have no CI result to go on.
  • A change to ci.yml itself, such as #460 adding scripts to the lint step, can't be tested on its own PR.

Local pre-commit (ruff plus pytest on one Python version) is the only check before a merge, and it's opt-in per machine. It doesn't cover the 3.11–3.14 matrix.

Expected

Every PR runs CI before it merges, whatever its base branch.

Suggested fix

Run CI on pull requests to any branch, and keep pushes limited to master:

on:
  push:
    branches: ["master"]
  pull_request:

Leaving out branches: under pull_request covers every base branch. Alternatively, list the patterns: branches: ["master", "feat/**", "fix/**", "release/**"].

Things to check:

  • Concurrency: the group ${{ github.workflow }}-${{ github.ref }} is per PR ref (refs/pull/N/merge), so fix PRs don't cancel each other or #433's runs.
  • Cost: each fix PR adds one 4-version matrix run, about 30 s of tests per job. Pushes to feature branches still don't trigger a run, so this doesn't double up with #433.
  • azure-deploy.yml: it triggers on push to master and workflow_dispatch only, and should stay that way.
  • Verifying: the PR that makes this change targets feat/pi-version-1-8-0 and is the first fix PR to run CI under the new trigger. Its checks list should show the four Python 3.x jobs.

Optional, separate decision

The repository ruleset (default) targets only the default branch and has no required status check. So even on master, a red CI run doesn't block a merge (CodeQL is enforced through the code_scanning rule). Making the Python 3.x jobs required, on master and on release feature branches if the ruleset is extended to them, would make CI a gate rather than a signal. That needs repo admin settings, not a code change.

Out of scope

  • Changing the Python matrix or the test command.
  • Adding ruff format --check to CI. Pre-commit runs it, CI doesn't.
Dominant language
Python
Stars
7
Forks
2
Avg merge
3h 41m
Merged PRs (30d)
59

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pendingintent/soa-workbench

All issues in pendingintent/soa-workbench

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.