Add make merge-main target and align merge guidance docs#35191
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Add merge-main Makefile target for merge workflow
Add May 27, 2026
make merge-main target to automate mainline merge/recompile flow
Copilot created this pull request from a session on behalf of
pelikhan
May 27, 2026 11:20
View session
Collaborator
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Implemented in
|
Copilot
AI
changed the title
Add
Add May 27, 2026
make merge-main target to automate mainline merge/recompile flowmake merge-main target and align merge guidance docs
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new make merge-main workflow to standardize the routine “merge from main” sequence (format → fetch/merge → rebuild/regenerate artifacts → format) and updates agent guidance to prefer this command.
Changes:
- Introduces a
merge-mainMake target that automates fetch/merge plus post-merge build + workflow recompilation + formatting. - Adds
merge-maintomake helpoutput for discoverability. - Updates
AGENTS.mdmerge instructions to usemake merge-main, with follow-up steps when conflicts occur.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Adds merge-main target and advertises it in help. |
| AGENTS.md | Updates merge-from-main guidance to use make merge-main and documents conflict follow-up steps. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 4
Comment on lines
+773
to
+780
| .PHONY: merge-main | ||
| merge-main: | ||
| @echo "Formatting before merge..." | ||
| @$(MAKE) fmt | ||
| @echo "Fetching latest main..." | ||
| @git fetch origin main | ||
| @echo "Merging origin/main..." | ||
| @git merge origin/main || (echo "Merge conflicts detected. Resolve conflicts in .go and .cjs files, stage with git add, then run: make build && make recompile && git commit && make fmt" && exit 1) |
Comment on lines
+781
to
+782
| @echo "Building after merge..." | ||
| @$(MAKE) build |
| @echo "Fetching latest main..." | ||
| @git fetch origin main | ||
| @echo "Merging origin/main..." | ||
| @git merge origin/main || (echo "Merge conflicts detected. Resolve conflicts in .go and .cjs files, stage with git add, then run: make build && make recompile && git commit && make fmt" && exit 1) |
Comment on lines
+216
to
218
| 2. **If merge conflicts occur in .go or .cjs files:** | ||
| - Manually resolve conflicts in Go files (`.go`) | ||
| - Manually resolve conflicts in CommonJS files (`.cjs`) |
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.
This introduces a single Make target to run the routine merge-from-main sequence mechanically: format, merge latest
main, rebuild/recompile generated workflow artifacts, then format again. It reduces repetitive manual merge steps and catches most routine merge drift in one command.New merge orchestration target
merge-maintoMakefileto execute:make fmtgit fetch origin maingit merge origin/mainmake buildmake recompilemake fmtConflict-handling guidance
Developer discoverability
merge-maintomake helpoutput.Agent workflow documentation
AGENTS.mdmerge instructions to usemake merge-mainas the default path, with documented follow-up steps when conflicts must be resolved manually.