Base candidate branches on main at publication time - #143
Open
p-linnane wants to merge 1 commit into
Open
Conversation
The matcher sweep runs for over an hour, so a branch built on the checkout SHA reverts whatever landed on main meanwhile; when that includes .github/workflows, the push is rejected. Publication now three-way merges the snapshot onto current main, carrying concurrent advisory edits through and failing with the conflicting paths on a real overlap. Shards already landed on main are skipped rather than failing on an empty commit. Signed-off-by: Patrick Linnane <patrick@linnane.io>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the ingest workflow so matched-advisory candidate branches are created from main as it exists at publication time (rather than the original checkout SHA), while preserving mid-run main changes via a three-way merge of the snapshot onto that publish-time base.
Changes:
- Rename the snapshot output from
base/BASE_SHAtodiff_base/DIFF_BASE_SHAand update diffing logic accordingly. - In the publish step, fetch
origin/main, computePUBLISH_BASE_SHA, and derive a merged snapshot tree viagit merge-treeto apply onto publish-timemain. - Skip publishing shards that are already present on
main, while still counting them as “published” for reconciliation logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
spec/workflows_spec.rb |
Extends workflow assertions to cover the new DIFF_BASE_SHA plumbing, publish-time main fetch/base selection, merge-tree usage, and the “already on main” guard. |
.github/workflows/ingest.yml |
Implements publish-time main basing and merge-tree snapshot application; updates env/output naming from BASE_SHA to DIFF_BASE_SHA; adds no-op publish guard for shards already on main. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each candidate branch is now based on main as of publication time instead of the checkout SHA, with the snapshot three-way merged onto it so advisory edits landing mid-sweep survive and genuine overlaps fail with the conflicting paths listed. Details in the commit message.
This clears the push rejection that hits whenever a workflow file lands on main during the hour-plus matcher run.