Skip to content

Add make merge-main target and align merge guidance docs#35191

Merged
pelikhan merged 4 commits into
mainfrom
copilot/add-merge-main-target
May 27, 2026
Merged

Add make merge-main target and align merge guidance docs#35191
pelikhan merged 4 commits into
mainfrom
copilot/add-merge-main-target

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

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

    • Added merge-main to Makefile to execute:
      1. make fmt
      2. git fetch origin main
      3. git merge origin/main
      4. make build
      5. make recompile
      6. make fmt
  • Conflict-handling guidance

    • On merge conflict, the target now exits with explicit next steps for resolving/staging conflicts and completing the expected post-merge regeneration sequence.
  • Developer discoverability

    • Added merge-main to make help output.
  • Agent workflow documentation

    • Updated AGENTS.md merge instructions to use make merge-main as the default path, with documented follow-up steps when conflicts must be resolved manually.
.PHONY: merge-main
merge-main:
	@$(MAKE) fmt
	@git fetch 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)
	@$(MAKE) build
	@$(MAKE) recompile
	@$(MAKE) fmt

Copilot AI and others added 2 commits May 27, 2026 11:10
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 make merge-main target to automate mainline merge/recompile flow May 27, 2026
Copilot AI requested a review from pelikhan May 27, 2026 11:20
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot

  • try new command merge-main
  • update AGENTS.md instructions

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 27, 2026

@copilot

  • try new command merge-main
  • update AGENTS.md instructions

Implemented in cfbbb7e.

  • Verified make merge-main by running it on a temporary branch; it completed successfully.
  • Updated AGENTS.md merge instructions to use make merge-main as the default path and documented conflict follow-up steps.

Copilot AI changed the title Add make merge-main target to automate mainline merge/recompile flow Add make merge-main target and align merge guidance docs May 27, 2026
@pelikhan pelikhan marked this pull request as ready for review May 27, 2026 11:39
Copilot AI review requested due to automatic review settings May 27, 2026 11:39
@pelikhan pelikhan merged commit 0694e33 into main May 27, 2026
18 checks passed
@pelikhan pelikhan deleted the copilot/add-merge-main-target branch May 27, 2026 11:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-main Make target that automates fetch/merge plus post-merge build + workflow recompilation + formatting.
  • Adds merge-main to make help output for discoverability.
  • Updates AGENTS.md merge instructions to use make 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 thread Makefile
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 thread Makefile
Comment on lines +781 to +782
@echo "Building after merge..."
@$(MAKE) build
Comment thread Makefile
@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 thread AGENTS.md
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`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants