Skip to content

feat(stack): push notes and surface reasons in revision history#1268

Merged
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-git-notes/push-notes-surface-reasons-revision-history--59af5360
Apr 21, 2026
Merged

feat(stack): push notes and surface reasons in revision history#1268
mergify[bot] merged 1 commit intomainfrom
devs/jd/worktree-git-notes/push-notes-surface-reasons-revision-history--59af5360

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented Apr 20, 2026

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

@jd
Copy link
Copy Markdown
Member Author

jd commented Apr 20, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(stack): push notes and surface reasons in revision history #1268 👈

@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 20, 2026 14:24 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 20, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@jd jd force-pushed the devs/jd/worktree-git-notes/push-notes-surface-reasons-revision-history--59af5360 branch from baaa2b2 to 6ab0e33 Compare April 20, 2026 15:09
@jd
Copy link
Copy Markdown
Member Author

jd commented Apr 20, 2026

Revision history

# Type Changes Reason Date
1 initial baaa2b2 2026-04-20 15:09 UTC
2 rebase baaa2b2 → 6ab0e33 2026-04-20 15:09 UTC
3 content 6ab0e33 → 59812b1 2026-04-21 09:01 UTC
4 content 59812b1 → 73ce4a9 2026-04-21 10:14 UTC

@jd jd force-pushed the devs/jd/worktree-git-notes/add-mergify-stack-note-cmd--33cc921f branch from 6932dd2 to b188fe3 Compare April 20, 2026 15:09
@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 20, 2026 15:10 Failure
@mergify mergify Bot requested a review from a team April 20, 2026 15:15
@jd jd marked this pull request as ready for review April 20, 2026 16:32
Base automatically changed from devs/jd/worktree-git-notes/add-mergify-stack-note-cmd--33cc921f to main April 21, 2026 07:42
JulianMaurin
JulianMaurin previously approved these changes Apr 21, 2026
@mergify mergify Bot requested a review from a team April 21, 2026 07:48
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 21, 2026

@jd this pull request is now in conflict 😩

@mergify mergify Bot added the conflict label Apr 21, 2026
Copilot AI review requested due to automatic review settings April 21, 2026 09:01
@jd jd force-pushed the devs/jd/worktree-git-notes/push-notes-surface-reasons-revision-history--59af5360 branch from 6ab0e33 to 59812b1 Compare April 21, 2026 09:01
@mergify mergify Bot dismissed JulianMaurin’s stale review April 21, 2026 09:03

Pull request has been modified.

@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 21, 2026 09:03 Failure
@mergify mergify Bot removed the conflict label Apr 21, 2026
Copy link
Copy Markdown

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

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/stack before planning, read per-commit notes into LocalChange.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.

Comment thread mergify_cli/stack/push.py Outdated
Comment thread mergify_cli/stack/push.py
Comment thread mergify_cli/stack/push.py Outdated
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
@jd jd force-pushed the devs/jd/worktree-git-notes/push-notes-surface-reasons-revision-history--59af5360 branch from 59812b1 to 73ce4a9 Compare April 21, 2026 10:14
@mergify mergify Bot deployed to Mergify Merge Protections April 21, 2026 10:14 Active
@mergify mergify Bot requested a review from a team April 21, 2026 12:22
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 21, 2026

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

mergify Bot added a commit that referenced this pull request Apr 21, 2026
@mergify mergify Bot added the queued label Apr 21, 2026
@mergify mergify Bot merged commit 559739d into main Apr 21, 2026
19 checks passed
@mergify mergify Bot deleted the devs/jd/worktree-git-notes/push-notes-surface-reasons-revision-history--59af5360 branch April 21, 2026 13:24
@mergify mergify Bot removed the queued label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants