Pull Requests
Review and merge code changes through collaborative pull requests with diff visualization and approval workflows.
Overview
Pull requests (PRs) provide a structured code review process before merging changes into the main branch. They enable:
- Peer review of workflow logic, prompt changes, and configurations
- Discussion via inline comments on specific changes
- Approval gates requiring sign-off before merge
- Integration testing to validate changes before deployment
- Audit trail of who approved what and when
M3 Forge’s PR workflow integrates directly with Gitea, providing a web-based review interface.
Creating a Pull Request
Make Changes in a Branch
First, create a feature branch and commit your changes:
- Create branch from
main - Edit files in the repository browser
- Commit changes with descriptive messages
- Push branch to remote repository
Open Pull Request
Navigate to Manage → Repositories → [Your Repository] → Pull Requests and click New Pull Request.
Configure PR
Provide the following details:
- Source branch — Branch containing your changes
- Target branch — Branch to merge into (usually
main) - Title — Concise summary of changes
- Description — Detailed explanation including:
- What changed
- Why the change was needed
- How to test the changes
- Links to related issues or tickets
Assign Reviewers
Select one or more team members to review the PR. Reviewers receive notifications and can:
- View the diff
- Leave comments
- Approve or request changes
- Merge when satisfied
Submit
Click Create Pull Request. The PR is now open and reviewers are notified.
PR descriptions support Markdown formatting for better readability. Use code blocks, lists, and links.
Reviewing a Pull Request
When assigned as a reviewer, you can inspect changes and provide feedback.
View Changed Files
The Files Changed tab shows all modified files with line-by-line diffs:
- Green lines — Additions
- Red lines — Deletions
- Gray lines — Context (unchanged)
For workflow JSON files, the diff shows structural changes to nodes, edges, and configurations.

Leave Comments
Click any line number to add an inline comment:
- Type your comment
- Optionally select Start a review to batch multiple comments
- Click Add comment or Add to review
Comments can:
- Ask questions about implementation
- Suggest alternative approaches
- Point out potential issues
- Acknowledge good work
Example comment:
This prompt looks good, but consider adding an example
for the LLM to improve output consistency. See the
"few-shot prompting" pattern in our prompt guide.Request Changes
If the PR needs work before merging:
- Leave comments explaining what needs to change
- Click Review changes
- Select Request changes
- Submit review
The PR author receives notification and can address feedback.
Approve
If the changes look good:
- Click Review changes
- Select Approve
- Optionally add a summary comment
- Submit review
Approved PRs can be merged (subject to repository settings requiring approvals).
Diff Visualization
M3 Forge provides specialized diff views for different file types.
JSON Diffs (Workflows)
Workflow JSON diffs show structural changes:
{
"nodes": [
{
"id": "llm-node-1",
"type": "llm",
- "config": { "model": "gpt-4" }
+ "config": { "model": "gpt-4o" }
}
]
}YAML Diffs (Prompts)
Prompt YAML diffs highlight content and metadata changes:
---
name: "Extract Invoice"
-model: "gpt-4"
+model: "claude-3-5-sonnet-20241022"
temperature: 0.0
---
Extract invoice data from:
{{ invoice_text }}Side-by-Side vs Unified
Switch between diff formats:
- Side-by-side — Old and new versions displayed in parallel columns
- Unified — Single column with +/- indicators
Use side-by-side for large changes; unified for small tweaks.
PR Lifecycle
Pull requests progress through several states:
| State | Description | Actions Available |
|---|---|---|
| Open | Under review | Comment, approve, request changes, close |
| Approved | Reviewers signed off | Merge, continue discussion |
| Changes Requested | Needs updates | Push new commits, discuss |
| Merged | Changes integrated | View history, delete branch |
| Closed | Abandoned without merge | Reopen if needed |
Adding Commits to Open PR
If reviewers request changes:
- Make updates in the same branch
- Commit and push to remote
- New commits appear automatically in the PR
Reviewers are notified of updates and can re-review.
Merging
When approved, merge the PR:
- Click Merge pull request
- Choose merge strategy:
- Merge commit — Preserves full commit history
- Squash and merge — Combines all commits into one
- Rebase and merge — Replays commits on top of target branch
- Confirm merge
The PR closes and changes are now in the target branch.
Most teams use squash and merge for feature branches to keep main branch history clean.
Deleting Branch After Merge
After merging, delete the feature branch to keep the repository tidy:
- Click Delete branch button in merged PR
- Confirm deletion
The commits remain in history even though the branch is deleted.
Approval Workflows
Repository administrators can configure approval requirements:
Require Approvals
Set minimum number of approving reviews before merge (e.g., 2 approvals required).
Dismiss Stale Reviews
Automatically dismiss previous approvals when new commits are pushed. Ensures reviewers see the latest changes.
Require Code Owner Review
For repositories with a CODEOWNERS file, require approval from designated code owners for specific paths.
Block Self-Approval
Prevent PR authors from approving their own PRs, enforcing independent review.
Integration with Release Pipeline
Pull requests are tightly integrated with the Release Pipeline:
- Feature branch contains workflow/prompt changes
- Open PR for review
- Approve and merge to main
- Create change set grouping related merged PRs
- Create version from change set
- Deploy version to staging/production
This ensures all production changes go through peer review.
PR Templates
Standardize PR descriptions with templates:
Create Template
In repository, add .github/pull_request_template.md:
## Summary
Brief description of changes.
## Motivation
Why is this change needed?
## Testing
How did you test this? What should reviewers test?
## Screenshots (if applicable)
Workflow canvas screenshots, execution logs, etc.
## Checklist
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] Reviewed own changes
- [ ] Passed local testingUse Template
When creating a new PR, the template auto-populates the description field. Fill in each section.
Best Practices
Small, Focused PRs
Keep PRs small for faster review:
- Single feature per PR
- Under 400 lines changed when possible
- Clear scope with no unrelated changes
Large PRs take longer to review and have higher risk of defects slipping through.
Descriptive Titles
PR titles should be concise but informative:
Poor:
Fix workflowGood:
Add timeout handling to external API calls in fraud workflowDetailed Descriptions
Include context reviewers need:
- What changed (summary)
- Why the change was made (motivation)
- How to verify it works (testing steps)
- Screenshots for visual changes
Review Your Own PR
Before requesting review, review your own changes:
- Read through the entire diff
- Check for debug code, console.logs, commented-out sections
- Verify commit messages are clear
- Ensure tests are included
Catch obvious issues before reviewers see them.
Respond to Feedback
When reviewers leave comments:
- Acknowledge each comment
- Explain your reasoning if you disagree
- Make changes or start a discussion
- Resolve comment threads after addressing
Reviewers appreciate responsiveness and constructive discussion.
Use Draft PRs
For work-in-progress, open a Draft Pull Request:
- Signals not ready for full review
- Enables early feedback on approach
- Prevents accidental merge
Mark as ready when complete.
Common Workflows
Hotfix PR
For urgent production fixes:
- Create branch from
main(e.g.,hotfix/critical-timeout-bug) - Make minimal fix
- Open PR with high priority label
- Get expedited review
- Merge and deploy immediately
Experimental PR
For trying new approaches:
- Create branch with
experiment/prefix - Implement prototype
- Open draft PR for feedback
- Iterate based on discussion
- Convert to regular PR if approved, or close if experiment fails
Documentation PR
For doc-only changes:
- Create branch (e.g.,
docs/update-prompt-guide) - Edit markdown files
- Open PR with reviewers from relevant teams
- Merge after approval
Troubleshooting
Merge Conflicts
Cause: Target branch changed since PR was opened.
Solution:
Update Branch
Merge latest main into your feature branch:
git checkout feature-branch
git merge mainResolve Conflicts
Edit conflicting files to resolve differences. Git marks conflicts with:
<<<<<<< HEAD
Your changes
=======
Main branch changes
>>>>>>> mainCommit Resolution
After resolving, commit the merge and push.
CI Checks Failing
Cause: Automated tests or linters failed on your changes.
Solution: Review CI logs, fix issues, push new commits. PR updates automatically.
Cannot Merge
Cause: Missing required approvals or failing checks.
Solution: Address reviewer feedback and ensure CI passes before merge button becomes available.
Next Steps
- Learn about change sets
- Set up repository approval workflows
- Integrate PRs with Release Pipeline
- Configure webhooks for CI/CD