~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix(release): skip queued release runs for superseded main pushes (#7814)
LearningCircuit1878f3405f0f
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 04e20e7729..837c5e1d87 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -3,10 +3,20 @@ name: Create Releaseon:push:branches:- - main # Automatically create release when merging to main+ - main # Automatically create release when a version bump merges to main+ # Only pushes that change the version trigger a release. Other merges+ # would otherwise each run the full gates while the bumped version is+ # unreleased. GitHub does not evaluate path filters for tag pushes.+ paths:+ - src/local_deep_research/__version__.pytags:- 'v*.*.*' # Also support manual version tags- workflow_dispatch: # Manual trigger for re-runs (no inputs needed)+ workflow_dispatch: # Manual trigger for releases, retries and rehearsals+ inputs:+ dry_run:+ description: Rehearsal - run every release gate but build and publish nothing+ type: boolean+ default: falsepermissions: {} # Minimal permissions at workflow level for OSSF Scorecard@@ -24,7 +34,10 @@ permissions: {} # Minimal permissions at workflow level for OSSF Scorecard# push burst can therefore delay a real release run and the workflow_dispatch# retry behind stale-SHA runs. This is accepted so a release tag run is not# replaced by a later push; it can still be cancelled once 100 runs are-# already pending (see above).+# already pending (see above). To bound the cost, main pushes only trigger+# this workflow when they change __version__.py (see the paths filter), and+# version-check skips a main push run whose SHA is no longer main's tip, so+# stale runs only hold the group for that one lightweight job.concurrency:group: ${{ github.workflow }}cancel-in-progress: false@@ -74,7 +87,18 @@ jobs:exit 0fi- # For main branch pushes: check if version has an existing release+ # For main branch pushes: skip superseded runs. queue: max keeps+ # every push waiting, so without this each queued stale SHA would+ # run the full gates. Only the run for main's current tip proceeds;+ # if the lookup fails, fall through and run the gates as before.+ MAIN_SHA=$(gh api "repos/${GH_REPO}/git/ref/heads/main" --jq .object.sha 2>/dev/null || true)+ if [[ -n "$MAIN_SHA" && "$MAIN_SHA" != "$GITHUB_SHA" ]]; then+ echo "should_release=false" >> "$GITHUB_OUTPUT"+ echo "Superseded: $GITHUB_SHA is no longer main's tip ($MAIN_SHA) — skipping"+ exit 0+ fi++ # Check if version has an existing releaseVERSION=$(grep -oP '(?<=__version__ = ")[^"]*' src/local_deep_research/__version__.py)if [[ -z "$VERSION" ]]; thenecho "ERROR: Could not extract version from __version__.py" >&2@@ -261,7 +285,8 @@ jobs:needs: [version-check, release-gate, ci-gate, test-gate, e2e-test-gate, notes-test-gate, notes-concurrency-gate, responsive-test-gate, compat-test-gate, compose-integration-gate, vulture-gate]# test-gate (Playwright WebKit), responsive-test-gate, and vulture-gate are advisory# release-gate, ci-gate, e2e-test-gate, notes-test-gate, notes-concurrency-gate, compat-test-gate, and compose-integration-gate are required- if: ${{ !cancelled() && needs.release-gate.result == 'success' && needs.ci-gate.result == 'success' && needs.e2e-test-gate.result == 'success' && needs.notes-test-gate.result == 'success' && needs.notes-concurrency-gate.result == 'success' && needs.compat-test-gate.result == 'success' && needs.compose-integration-gate.result == 'success' }}+ # A dry_run rehearsal stops here; every publishing job depends on build.+ if: ${{ !cancelled() && !inputs.dry_run && needs.release-gate.result == 'success' && needs.ci-gate.result == 'success' && needs.e2e-test-gate.result == 'success' && needs.notes-test-gate.result == 'success' && needs.notes-concurrency-gate.result == 'success' && needs.compat-test-gate.result == 'success' && needs.compose-integration-gate.result == 'success' }}runs-on: ubuntu-latestoutputs:version: ${{ steps.version.outputs.version }}diff --git a/changelog.d/+release-skip-superseded-main-runs.bugfix.md b/changelog.d/+release-skip-superseded-main-runs.bugfix.mdnew file mode 100644index 0000000000..c3e4c8d4dd--- /dev/null+++ b/changelog.d/+release-skip-superseded-main-runs.bugfix.md@@ -0,0 +1 @@+Skip queued release runs for main pushes whose commit is no longer main's tip. With `queue: max`, every push to main waited its turn and then ran the full release gates while the version was unreleased, so a burst of merges queued dozens of full gate runs on stale SHAs. `version-check` now compares the run's SHA with main's current tip and skips the gates when it has been superseded, restoring the old "only the latest commit is tested" behavior. Tag pushes and `workflow_dispatch` still always proceed, and a failed tip lookup falls back to running the gates.diff --git a/changelog.d/+release-version-bump-trigger-and-rehearsal.feature.md b/changelog.d/+release-version-bump-trigger-and-rehearsal.feature.mdnew file mode 100644index 0000000000..f02ef6a63c--- /dev/null+++ b/changelog.d/+release-version-bump-trigger-and-rehearsal.feature.md@@ -0,0 +1 @@+Pushes to `main` now start the release workflow only when they change `src/local_deep_research/__version__.py`, so ordinary merges no longer run the full release gates while a bumped version is unreleased. Merging a version bump still releases automatically, and tag pushes are unaffected. Manual runs of **Create Release** gain a `dry_run` option: a rehearsal that runs every release gate once on the chosen ref and skips build and every publishing job. After a failed release, run a rehearsal or a manual release; merging a fix no longer retries the release on its own.diff --git a/docs/RELEASE_GUIDE.md b/docs/RELEASE_GUIDE.mdindex 038ffde1d4..5aa475cab7 100644--- a/docs/RELEASE_GUIDE.md+++ b/docs/RELEASE_GUIDE.md@@ -9,18 +9,20 @@ required — the workflow detects the new version, runs all gates, cutsthe GitHub release, and (after one approval click) publishes to PyPIand Docker Hub.-PRs that don't touch `__version__.py` merge normally but skip the-release pipeline (the version-check job sees the tag already exists-and short-circuits everything downstream).+PRs that don't touch `__version__.py` merge normally and do not start+the release pipeline at all (a `paths` filter on the `push` trigger).+If a release run fails, fixes merged afterwards do not retry it: once+`main` is ready, run a rehearsal or start the release manually (see+[Manual Release Options](#-manual-release-options)).## 📋 How Releases Work### 1. **Automatic Release Creation**-- **Trigger**: Push to `main` whose `__version__.py` resolves to a tag+- **Trigger**: Push to `main` that changes `__version__.py` to a versionthat does not yet exist as a GitHub release. In practice this means- "merge a PR that bumps `__version__.py`". Tag pushes (`v*.*.*`) and- manual `workflow_dispatch` runs also trigger the pipeline and bypass- the version-exists check.+ "merge a PR that bumps `__version__.py`"; other pushes to `main` do not+ start the workflow. Tag pushes (`v*.*.*`) and manual `workflow_dispatch`+ runs also trigger the pipeline and bypass the version-exists check.- **Version**: Read from `src/local_deep_research/__version__.py` bythe `version-check` job; the tag is `v<version>`.- **Release body**: Composed by `.github/workflows/release.yml` from three sources:@@ -112,8 +114,12 @@ If any of `prerelease-docker`, `publish-docker`, or `monitor-pypi` fails,mostly waiting for a runner. After a push burst, a real release run or the`workflow_dispatch` retry recommended after a failed release can waitbehind stale-SHA runs, and when 100 are pending GitHub cancels the newest- arrivals rather than the stale ones. The release gate's own group is- unaffected, since its standalone triggers are rare.+ arrivals rather than the stale ones. To bound this, only pushes that+ change `__version__.py` start the workflow, and `version-check` skips a+ main-push run whose SHA is no longer main's tip, so only the newest+ commit runs the gates; tag pushes and `workflow_dispatch` are never+ skipped. The release gate's own group is unaffected, since its standalone+ triggers are rare.- Missing digests, failed registry inspections and unexpected HTTPresponses for a tag, including unreadable platform images, keep that tagand fail cleanup only after every other tag has been handled, with or@@ -332,9 +338,22 @@ with auto-notes plus AI summary only).## 🔧 Manual Release Options+### Rehearsal (dry run)+- Go to Actions → "Create Release" → "Run workflow" and tick **dry_run**.+- Runs every release gate (security, CI, E2E, compatibility, …) once on+ the selected ref, then stops: `build` and every publishing job are+ skipped, so nothing is tagged, built, signed or published. A green run+ means the gates pass on that commit.+- Use it before merging a version bump, while a major release is being+ prepared, or after fixing a failed release, so that one run validates+ `main` instead of re-running the full gates on every merge.+- Any branch can be rehearsed; only a real release is limited to `main`+ or a version tag.+### Option A: Manual Trigger-- Go to Actions → "Create Release" → "Run workflow"-- No inputs are required: the workflow reads the version from+- Go to Actions → "Create Release" → "Run workflow" (leave **dry_run**+ unticked)+- No other inputs are required: the workflow reads the version from`src/local_deep_research/__version__.py` at HEAD. To release anolder or different version, use Option B (push a version tag).- Dispatch from `main`, or from the `v<version>` tag that matches@@ -377,7 +396,9 @@ Recovery, in order of preference:- Any other failure: re-run the failed job via the Actions UI ifit's still re-runnable (typically within 30 days).2. **Re-trigger the full pipeline** via `workflow_dispatch` if- re-running individual jobs isn't possible. Safe for digest-keyed+ re-running individual jobs isn't possible. Merging a fix does not+ restart the release on its own, because only version bumps trigger it;+ a dry-run rehearsal first confirms the gates pass. Safe for digest-keyedcosign verification — old digests remain valid because their cosignartifacts persist; the new run produces a new digest with its ownsignatures.diff --git a/tests/ci/test_release_queue_contract.py b/tests/ci/test_release_queue_contract.pyindex c8771efb5e..ac0154da66 100644--- a/tests/ci/test_release_queue_contract.py+++ b/tests/ci/test_release_queue_contract.py@@ -59,3 +59,53 @@ def test_checkov_scans_workflows_with_queue_after_blanking_it() -> None:assert stripped.count("\n") == source.count("\n")parsed = yaml.safe_load(stripped)assert set(parsed["concurrency"]) == {"group", "cancel-in-progress"}+++def test_version_check_skips_superseded_main_pushes() -> None:+ """queue: max keeps every main push waiting; without this skip each stale+ SHA would run the full release gates in its own serial turn."""+ release = yaml.safe_load((WORKFLOWS / "release.yml").read_text())+ steps = release["jobs"]["version-check"]["steps"]+ script = next(s["run"] for s in steps if s.get("id") == "check")+ bypass = script.index("workflow_dispatch")+ superseded = script.index("git/ref/heads/main")+ version = script.index("__version__.py")+ assert bypass < superseded < version+ assert '"$MAIN_SHA" != "$GITHUB_SHA"' in script+++def test_main_pushes_trigger_release_only_on_version_change() -> None:+ """Ordinary merges must not each run the full gates while a bumped+ version is unreleased; tags and manual runs stay unfiltered."""+ release = yaml.safe_load((WORKFLOWS / "release.yml").read_text())+ # PyYAML parses the bare `on` key as True.+ push = release[True]["push"]+ assert push["branches"] == ["main"]+ assert push["paths"] == ["src/local_deep_research/__version__.py"]+ assert push["tags"] == ["v*.*.*"]+++def test_dry_run_rehearsal_skips_build_and_everything_downstream() -> None:+ release = yaml.safe_load((WORKFLOWS / "release.yml").read_text())+ dry_run = release[True]["workflow_dispatch"]["inputs"]["dry_run"]+ assert dry_run["type"] == "boolean"+ assert dry_run["default"] is False++ jobs = release["jobs"]+ assert "!inputs.dry_run" in jobs["build"]["if"]++ # Every job that builds or publishes must transitively depend on build,+ # so skipping build is enough to keep a rehearsal side-effect free.+ gates = {"version-check"} | {+ name+ for name, job in jobs.items()+ if job.get("needs") == ["version-check"]+ }++ def depends_on_build(name: str) -> bool:+ needs = jobs[name].get("needs", [])+ needs = [needs] if isinstance(needs, str) else needs+ return "build" in needs or any(depends_on_build(n) for n in needs)++ for name in set(jobs) - gates - {"build"}:+ assert depends_on_build(name), name