Repository navigation
ci: Sync dev with main after each release - #674
Conversation
Reviewer's GuideThe release workflow now exports the final released commit SHA and uses it in an independent sync-dev job to create, fast-forward, or merge main into dev without force-pushing, while keeping Discord announcements unaffected by synchronization failures. Flow diagram for syncing dev with released mainflowchart TD
Start[Released main SHA available] --> Exists{dev exists?}
Exists -->|No| Create[Create dev at release SHA]
Exists -->|Yes| Fetch[Fetch origin/dev]
Fetch --> Contains{dev contains release SHA?}
Contains -->|Yes| Done[No action]
Contains -->|No| Behind{dev is ancestor of release SHA?}
Behind -->|Yes| FF[Fast-forward dev to release SHA]
Behind -->|No| Merge[Merge released main into dev]
Merge --> Conflict{Merge succeeds?}
Conflict -->|No| Fail[Fail; manual resolution required]
Conflict -->|Yes| Push[Plain push merge commit]
Create --> End[Sync complete]
Done --> End
FF --> End
Push --> End
Push -.->|dev moved meanwhile| Reject[Push rejected; no overwrite]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/versioning.yml" line_range="770" />
<code_context>
# ---------------------------------------------------------------------------
# Announce the new release on Discord.
- # Always runs last — only when a release was actually published.
+ # Runs after the release, in parallel with sync-dev — only when a release
+ # was actually published.
# ---------------------------------------------------------------------------
</code_context>
<issue_to_address>
**Existing workflow comment is removed**
When the `notify-discord` header is updated, the original notification-order comment is replaced rather than retained, so the change removes an existing comment contrary to the repository guidance.
Preserve the original comment and add the new parallel-execution explanation without removing it.
</issue_to_address>Sourcery assessment
Needs a human reviewer. If the branch checks or merge logic are wrong, this workflow can create or advance dev and leave a merge commit there; reverting the workflow will not remove those commits. The branch history can be reset or the changes reverted, and the non-force pushes limit the damage if dev moves concurrently.
After each release, the versioning workflow pushes the version bump and the pre-built firmware commits to
main, leavingdevbehindmainuntil it is synced manually. This causes the next release PR to show as behind, and can create conflicts in the files the workflow rewrites (for example a newnextsentinel ondevagainst the version already resolved onmain).This adds a
sync-devjob toversioning.ymlthat runs after the release is published, in parallel with the Discord announcement, so a failure in it never blocks or delays the announcement:devdoes not exist, it is created from the releasedmain.devhas nothing beyond the releasedmain(the normal case), it is fast-forwarded.devreceived commits during the release window,mainis merged into it with a merge commit. A conflict fails the job and is left for manual resolution.devis never force-pushed: if it moves while the job runs, the push is rejected instead of overwriting it.commit-and-releasenow exposes the final released SHA (after the pre-built firmware commit) as an output for this job.Note: pushes made with
GITHUB_TOKENdo not trigger other workflows, so CI does not run on the updateddev. For a fast-forward the content is exactly what was released; in the merge case, the merge commit is validated by the next PR.Summary by Sourcery
Automatically synchronize dev with the final released main branch without delaying release announcements.
New Features:
Bug Fixes:
Enhancements:
CI: