-
Notifications
You must be signed in to change notification settings - Fork 0
Add automated workflow to rebase opensoft-prod onto upstream production #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: brettheap <1513478+brettheap@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds automated rebase workflow to keep the opensoft-prod branch synchronized with the upstream sst/opencode:production branch.
Changes:
- Adds a GitHub Actions workflow that runs weekly (Sunday 23:00 UTC) or manually to rebase
opensoft-prodonto upstream production - Implements conflict detection and automated issue creation with idempotent conflict tracking
- Provides comprehensive documentation for manual conflict resolution
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
.github/workflows/rebase-upstream-prod.yml |
Automated rebase workflow with scheduled and manual triggers, conflict handling, and GitHub issue creation |
.github/rebase-upstream-prod-conflict.md |
Step-by-step manual conflict resolution guide referenced in auto-generated issues |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const issueBody = `## Automated Rebase Failed | ||
|
|
||
| The automated rebase of \`opensoft-prod\` onto | ||
| \`upstream/production\` has encountered conflicts that require | ||
| manual resolution. | ||
|
|
||
| **Workflow Run:** [#${context.runNumber}](${ | ||
| context.payload.repository.html_url | ||
| }/actions/runs/${context.runId}) | ||
|
|
||
| ## What Happened | ||
|
|
||
| The GitHub Actions workflow attempted to: | ||
| 1. Fetch the latest \`production\` branch from upstream | ||
| (sst/opencode) | ||
| 2. Rebase \`opensoft-prod\` onto \`upstream/production\` | ||
| 3. The rebase encountered merge conflicts and was aborted | ||
|
|
||
| ## Next Steps | ||
|
|
||
| A maintainer needs to manually resolve the conflicts and | ||
| push the rebased branch. Please follow the instructions | ||
| below: | ||
|
|
||
| --- | ||
|
|
||
| ${instructions} | ||
|
|
||
| --- | ||
|
|
||
| ## After Resolution | ||
|
|
||
| Once you've manually resolved and pushed the changes: | ||
| - [ ] Verify \`opensoft-prod\` is up to date with | ||
| \`upstream/production\` | ||
| - [ ] Close this issue | ||
| - [ ] The next automated run should succeed | ||
|
|
||
| ## Labels | ||
|
|
||
| - \`automated\`: Created by automated workflow | ||
| - \`maintenance\`: Repository maintenance task | ||
| `; |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue body template string has significant whitespace indentation that will appear in the generated GitHub issue. The leading spaces before each line (lines 91-130) will be preserved in the issue body, causing unwanted indentation. Consider using template literal dedenting or removing the leading whitespace from these lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit 0adcd98. Added .trim() to the template literal to remove leading indentation while maintaining YAML validity. The issue body will now render without unwanted whitespace.
| ## Labels | ||
|
|
||
| - \`automated\`: Created by automated workflow | ||
| - \`maintenance\`: Repository maintenance task |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Labels" section in the issue body (lines 127-130) appears to be documentation about the labels rather than actual label application. This will be confusing in the generated issue since the labels are already applied via the labels array in the API call. Consider removing this section or clarifying that these are the applied labels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed in commit 0adcd98. The "Labels" section has been removed from the issue body.
| - name: Rebase onto upstream/production | ||
| id: rebase | ||
| continue-on-error: true | ||
| run: | | ||
| echo "Attempting rebase of opensoft-prod onto upstream/production..." | ||
| if git rebase upstream/production; then | ||
| echo "result=success" >> $GITHUB_OUTPUT | ||
| echo "Rebase successful" | ||
| else | ||
| echo "result=conflict" >> $GITHUB_OUTPUT | ||
| echo "Rebase failed with conflicts" | ||
| git rebase --abort | ||
| exit 1 | ||
| fi |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rebase step uses 'continue-on-error: true' which means the step will always report success to GitHub Actions even when it fails. This could lead to the workflow showing as successful when it actually encountered conflicts. Consider removing 'continue-on-error' and handling the failure through conditional steps, or ensure monitoring relies on the outputs rather than the overall workflow status.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed in commit 0adcd98. Removed continue-on-error: true and updated the condition to failure() && steps.rebase.outputs.result == 'conflict' so the workflow properly reports its status.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…move Labels section Co-authored-by: brettheap <1513478+brettheap@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.