feat(stack): push notes and surface reasons in revision history#1268
Conversation
|
This pull request is part of a Mergify stack:
|
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
baaa2b2 to
6ab0e33
Compare
Revision history
|
6932dd2 to
b188fe3
Compare
|
@jd this pull request is now in conflict 😩 |
6ab0e33 to
59812b1
Compare
Pull request has been modified.
There was a problem hiding this comment.
Pull request overview
This PR completes the stack-notes workflow by syncing and pushing a git-notes ref used to store “reasons” for changes, and surfaces those reasons in the revision-history PR comment.
Changes:
- Fetch
refs/notes/mergify/stackbefore planning, read per-commit notes intoLocalChange.reason, and push the notes ref atomically with stack branches using--force-with-lease. - Extend revision-history rendering/parsing to support a new “Reason” column (while accepting legacy 4-column bodies).
- Update test harnesses/mocks and add test coverage for notes fetching/pushing and reason formatting/parsing.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
mergify_cli/stack/push.py |
Implements notes fetch/push behavior, reads reasons from notes, and adds a “Reason” column to revision-history comments with escaping/truncation. |
mergify_cli/stack/changes.py |
Adds LocalChange.reason (default empty string). |
mergify_cli/tests/utils.py |
Extends GitMock to simulate command errors and registers default notes-related git mocks. |
mergify_cli/tests/stack/test_push.py |
Adds/updates tests for notes ref fetch/push behavior and revision-history reason rendering/parsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Complete the stack-notes feature: fetch refs/notes/mergify from the remote before planning, read the note attached to each updated commit into LocalChange.reason, and push the ref atomically alongside the stack branches with --force-with-lease. The revision-history PR comment gains a new "Reason" column: | # | Type | Changes | Reason | Date | The parser accepts both the legacy 4-column format and the new 5-column format, preserving legacy rows verbatim so old comments aren't rewritten. Reason cells escape pipes and newlines for markdown-table safety and truncate at 200 characters. Error catches for the notes fetch and the per-commit notes read are narrowed to the specific "ref/note not found" cases so other failures (auth, network, corruption) still surface. Depends-On: the preceding 'stack note' command PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Change-Id: I59af53609d8f0875b000f82cae085368adb5d5ab
59812b1 to
73ce4a9
Compare
Merge Queue Status
This pull request spent 6 minutes 34 seconds in the queue, including 6 minutes 10 seconds running CI. Required conditions to merge
|
Complete the stack-notes feature: fetch refs/notes/mergify from the
remote before planning, read the note attached to each updated commit
into LocalChange.reason, and push the ref atomically alongside the
stack branches with --force-with-lease.
The revision-history PR comment gains a new "Reason" column:
| # | Type | Changes | Reason | Date |
The parser accepts both the legacy 4-column format and the new 5-column
format, preserving legacy rows verbatim so old comments aren't rewritten.
Reason cells escape pipes and newlines for markdown-table safety and
truncate at 200 characters. Error catches for the notes fetch and the
per-commit notes read are narrowed to the specific "ref/note not found"
cases so other failures (auth, network, corruption) still surface.
Depends-On: the preceding 'stack note' command PR.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com