ci: add weekly scheduled merge from starbase repository
Metadata
Current evaluation
PR #190 was closed unmerged with 14 unresolved review comments and months of inactivity; originating issue #189 remains open.
Resolution: closed stale
Reason: The PR was abandoned after review feedback, with 14 unresolved comments and no activity for more than 287 days. It was not merged, no weekly merge workflow is present, and #189 remains open.
Evaluated by: mr-cal-bot
No scores available.
Issue body
## Plan: Create Scheduled Workflow to Merge Starbase Changes
- [x] Create a GitHub Actions workflow that:
- [x] Runs on a weekly schedule (every Monday at 9:00 AM UTC)
- [x] Can also be triggered manually via workflow_dispatch
- [x] Triggers on PRs that modify the workflow file for testing (posts comment with detailed conflict information instead of creating PR)
- [x] Fetches latest changes from starbase repository
- [x] Handles merge conflicts with intelligent resolution:
- [x] Always uses starbase version for infrastructure files (common.mk)
- [x] Detects and analyzes project-specific changes (e.g., "starcraft" → "craft-platforms")
- [x] Provides structured guidance for resolving remaining conflicts
- [x] Regenerates uv.lock file after merging to reflect dependency changes
- [x] Creates a PR with the merged changes (without labels)
- [x] Includes guidance in PR description about using GitHub Copilot to review changes
- [x] Marks PRs as draft and assigns to @lengau when conflicts are detected
- [x] Asks GitHub Copilot for suggestions on resolving conflicts
- [x] Shows detailed conflict information (file list and diff hunks) in PR test comments
- [x] Gracefully handles the case when already up-to-date with starbase
- [x] Handles unrelated git histories between repositories
- [x] Includes workflow files from starbase in the merge (with actions:write permission)
- [x] Validate YAML syntax
- [x] Add documentation explaining the starbase integration
- [x] Request code review (no issues found)
- [x] Run security scan (no vulnerabilities found)
- [x] Address all PR feedback
## Summary
Workflow now properly handles all scenarios with intelligent conflict resolution:
1. **Weekly schedule** (Monday 9:00 AM UTC)
2. **Manual workflow_dispatch**
3. **Pull requests** that modify the workflow file - posts a detailed comment showing:
- List of conflicted files
- Actual conflict details (diff hunks with conflict markers) in an expandable section
- Conflict resolution strategy applied
- Guidance to use GitHub Copilot for resolution
4. **Already up-to-date**: Exits successfully when no changes are needed
5. **Clean merge**: Creates PR with merged changes (no labels applied)
6. **Conflicts with intelligent resolution**:
- **Strategy 1 - Starbase-only files**: Files like `common.mk` always use starbase version (maintained in starbase)
- **Strategy 2 - Project-specific detection**: Analyzes conflicts to detect project-specific customizations (e.g., project name changes from "starcraft" to "craft-platforms")
- **Structured guidance**: Provides clear guidance on which conflicts should keep local changes vs accept starbase changes
- Marks PR as draft and assigns to @lengau
- Detailed resolution strategy logged in step summary
7. **Dependency management**: Automatically regenerates `uv.lock` using `uv lock` command after merging to keep dependencies in sync
8. **Unrelated histories**: Uses `--allow-unrelated-histories` flag
9. **Workflow files**: Included in merge with `actions: write` permission
All code is properly formatted with prettier.
- Fixes canonical/craft-platforms#189
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Merge Starbase every week</issue_title>
> <issue_description>Create a scheduled workflow (which can also be run manually) that merges the latest changes from starbase (https://github.com/canonical/starbase) and uses Copilot to determine which changes from starbase to pull vs. which changes from craft-platforms.</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
- Fixes canonical/craft-platforms#189
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed stale | PR #190 was closed unmerged with 14 unresolved review comments and months of inactivity; originating issue #189 remains open. | |
| qwen/qwen3.6-35b-a3b | — | closed stale | PR closed without being merged; 14 review comments unresolved and no activity for 287+ days. Issue #189 remains open. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Related To:
canonical/craft-platforms#189
(confidence 100%)
Original request for a weekly, manually dispatchable Starbase merge workflow; it remains open.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #14 chore: merge the latest starbase in | craft-grammar | closed | PR #14 was closed unmerged after review remained pending, with no approval or CI checks; its proposed Starbase merge was not delivered. | |
| #405 [WIP] [WIP] Address feedback from review on updating starbase PR | imagecraft | closed | WIP stacked PR #405 (merging into test PR #402) was closed unmerged after 51 days of inactivity, with its review comment on the starbase merge left unresolved; the real starbase update later landed via #449 (aa3de58). | |
| #284 chore: merge in starbase | craft-store | closed | Closed unmerged after 513 days without review or comments, abandoning the CRAFT-4537 Starbase merge; later syncs landed in #337 and #377. | |
| #237 chore(merge): update starbase (2026-07-14) | craft-archives | closed | PR #237 was closed unmerged after failing CI checks and leaving 29 review comments unresolved; no resolving commit was identified. | |
| #422 Integrate with Starbase | rockcraft | closed | Closed unmerged after prolonged inactivity, with 46 review comments unresolved; a maintainer later asked whether it could be closed. | |
| #353 Starbase merge | craft-providers | closed | Starbase merge PR #353 (merge commit 435181e) was closed unmerged by author mr-cal, since merge commits rebase poorly ahead of a starbase freeze; the work was redone later. | |
| #191 chore: merge latest changes from starbase | craft-platforms | closed | Automated starbase update #191 was closed unmerged after 333 days without review or activity; no resolving commit was found in craft-platforms history. | |
| #1578 chore: merge the latest starbase | craft-parts | open | Superseded by the merged 2026-10-01 Starbase update (#1728); this older 26-file merge remains unreviewed with 10 failing CI jobs. | |
| #432 chore(merge): update starbase (2026-10-08) | craft-store | closed | Starbase sync PR closed without merging due to unresolved review comments and failing copilot-setup-steps CI check. | |
| #39 meta: update starbase | craft-application | closed | Starbase tooling update was abandoned unmerged after 134 days of inactivity, with review pending and no CI results or comments. |