Skip to content

feat(events): add mergify events, a timeline over the activity log - #1760

Open
jd wants to merge 1 commit into
mainfrom
devs/jd/jd/mrgfy-8363-make-the-activity-log-answerable-from-the-cli-a-shared-logs/add-mergify-events-timeline-over-activity-log--3dd37c3d
Open

feat(events): add mergify events, a timeline over the activity log#1760
jd wants to merge 1 commit into
mainfrom
devs/jd/jd/mrgfy-8363-make-the-activity-log-answerable-from-the-cli-a-shared-logs/add-mergify-events-timeline-over-activity-log--3dd37c3d

Conversation

@jd

@jd jd commented Aug 5, 2026

Copy link
Copy Markdown
Member

The activity log carries ~45 event types — the action.queue.* family,
the workflow actions, ci_insights., command., queue pauses,
scheduled freezes — and almost none of it was reachable from the CLI,
so agents hand-rolled curl against a contract they did not know.

Add events as a new top-level noun over the shared client:

mergify events                       # whole repo, last 24h
mergify events --pr 1740 --since 7d
mergify events --type action.queue.leave --type command.queue
mergify events --pr 1740 --json      # raw events, newest first
mergify events --limit 20            # newest 20, and the header says so

One command over a filter covers every type; there is deliberately no
command per event type. Two details carry the lesson #1747 taught:

  • The header always states the window (PR #1740 · 6 events · 2026-07-29 21:00 → 2026-07-30 21:00 UTC), so an empty result reads
    as "nothing in the last 24h" and never as "nothing ever" — that
    ambiguity is the bug this removes. The empty case names the range
    and the retention: No events for PR #1740 between <from> and <to> UTC. / Retention is 90 days; try --since 90d. (the hint is
    omitted when the query already covered the full retention).
  • --since cannot express a window the API would reject: the
    duration parser enforces the 93-day cap as a usage error carrying
    the fix, and the 24h default is applied by the CLI and stated, not
    inherited silently from the API.

The human timeline reads oldest-first with a dim date row wherever
the calendar date changes, and a best-effort summary per line
(queue name, draft PR number, abort/dequeue codes, merged, command
author) that degrades to nothing on types this CLI has never seen.
--json emits one document echoing the query (repository,
pull_request, received_from, received_to) plus size and the
raw events newest-first, unknown fields intact.

Verified against the live API on Mergifyio/mergify-cli: the full
queue lifecycle of #1747 (enter → checks_start → checks_end → leave
merged), a 30-day repo-wide query paginating to completion (806
events over 9 pages, newest-first), the --type filter, and the empty
case naming its window.

Docs: README command list, a new mergify-events agent skill, the
mergify-merge-queue skill now routes "whole lifecycle" questions to
mergify events instead of curl, and AGENTS.md maps the new group.

Fixes MRGFY-8363.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

Depends-On: #1759

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 5, 2026 07:43 Failure
@jd

jd commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 refactor(queue): port queue show's dequeue diagnosis onto mergify-events #1759
2 feat(events): add mergify events, a timeline over the activity log #1760 👈

@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 7 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 👀 Review Requirements 👀 reviews
🔴 🔎 Reviews 👀 reviews
🟢 ⛓️ Depends-On Requirements
🟢 🤖 Continuous Integration
🟢 Enforce conventional commit
🟢 📕 PR description
🟢 🚦 Auto-queue

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

Show 5 satisfied protections

🟢 ⛓️ Depends-On Requirements

Requirement based on the presence of Depends-On in the body of the pull request

🟢 🤖 Continuous Integration

  • all of:
    • check-success=ci-gate

🟢 Enforce conventional commit

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

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

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team August 5, 2026 07:49
@jd
jd marked this pull request as ready for review August 5, 2026 09:35
@jd
jd force-pushed the devs/jd/jd/mrgfy-8363-make-the-activity-log-answerable-from-the-cli-a-shared-logs/port-queue-show-s-dequeue-diagnosis-onto-mergify--e13a945a branch from 2538e85 to c4884b2 Compare August 5, 2026 12:18
@jd
jd force-pushed the devs/jd/jd/mrgfy-8363-make-the-activity-log-answerable-from-the-cli-a-shared-logs/add-mergify-events-timeline-over-activity-log--3dd37c3d branch from b8c7237 to 263ea5e Compare August 5, 2026 12:18
@jd
jd temporarily deployed to func-tests-live August 5, 2026 12:18 — with GitHub Actions Inactive
@jd

jd commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial b8c7237 2026-08-05 12:18 UTC
2 rebase b8c7237 → 263ea5e (rebase only) 2026-08-05 12:18 UTC
3 rebase 263ea5e → fdda9fe (rebase only) 2026-08-06 08:58 UTC

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 5, 2026 12:18 Failure
@mergify
mergify Bot force-pushed the devs/jd/jd/mrgfy-8363-make-the-activity-log-answerable-from-the-cli-a-shared-logs/port-queue-show-s-dequeue-diagnosis-onto-mergify--e13a945a branch from c4884b2 to 6bacff8 Compare August 6, 2026 08:45
@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

A predecessor in this stack was just merged, but I couldn't auto-rebase this PR: there's a conflict that needs manual resolution.

Conflict in: Cargo.lock, crates/mergify-events/Cargo.toml, crates/mergify-events/src/lib.rs (replayed onto 6bacff82).

Resolve with mergify stack sync && mergify stack push.

@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@jd this pull request is now in conflict 😩

@mergify mergify Bot added the conflict label Aug 6, 2026
The activity log carries ~45 event types — the action.queue.* family,
the workflow actions, ci_insights.*, command.*, queue pauses,
scheduled freezes — and almost none of it was reachable from the CLI,
so agents hand-rolled curl against a contract they did not know.

Add `events` as a new top-level noun over the shared client:

    mergify events                       # whole repo, last 24h
    mergify events --pr 1740 --since 7d
    mergify events --type action.queue.leave --type command.queue
    mergify events --pr 1740 --json      # raw events, newest first
    mergify events --limit 20            # newest 20, and the header says so

One command over a filter covers every type; there is deliberately no
command per event type. Two details carry the lesson #1747 taught:

- **The header always states the window** (`PR #1740 · 6 events ·
  2026-07-29 21:00 → 2026-07-30 21:00 UTC`), so an empty result reads
  as "nothing in the last 24h" and never as "nothing ever" — that
  ambiguity is the bug this removes. The empty case names the range
  and the retention: `No events for PR #1740 between <from> and <to>
  UTC.` / `Retention is 90 days; try --since 90d.` (the hint is
  omitted when the query already covered the full retention).
- **`--since` cannot express a window the API would reject**: the
  duration parser enforces the 93-day cap as a usage error carrying
  the fix, and the 24h default is applied by the CLI and stated, not
  inherited silently from the API.

The human timeline reads oldest-first with a dim date row wherever
the calendar date changes, and a best-effort summary per line
(queue name, draft PR number, abort/dequeue codes, merged, command
author) that degrades to nothing on types this CLI has never seen.
`--json` emits one document echoing the query (`repository`,
`pull_request`, `received_from`, `received_to`) plus `size` and the
raw events newest-first, unknown fields intact.

Verified against the live API on Mergifyio/mergify-cli: the full
queue lifecycle of #1747 (enter → checks_start → checks_end → leave
merged), a 30-day repo-wide query paginating to completion (806
events over 9 pages, newest-first), the --type filter, and the empty
case naming its window.

Docs: README command list, a new `mergify-events` agent skill, the
`mergify-merge-queue` skill now routes "whole lifecycle" questions to
`mergify events` instead of curl, and AGENTS.md maps the new group.

Fixes MRGFY-8363.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Change-Id: I3dd37c3d0539d8208755e12d7deb4d2030753dd5
@jd
jd force-pushed the devs/jd/jd/mrgfy-8363-make-the-activity-log-answerable-from-the-cli-a-shared-logs/add-mergify-events-timeline-over-activity-log--3dd37c3d branch from 263ea5e to fdda9fe Compare August 6, 2026 08:58
@jd
jd force-pushed the devs/jd/jd/mrgfy-8363-make-the-activity-log-answerable-from-the-cli-a-shared-logs/port-queue-show-s-dequeue-diagnosis-onto-mergify--e13a945a branch from 6bacff8 to b2faf78 Compare August 6, 2026 08:58
@jd
jd temporarily deployed to func-tests-live August 6, 2026 08:58 — with GitHub Actions Inactive
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 6, 2026 08:58 Failure
@jd

jd commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main — no content change.

The base of this stack, #1758, merged this morning as 8bb025c, which left this PR CONFLICTING. The stack is restacked on the new trunk and the conflict is gone.

263ea5e → fdda9fecompare

cargo test --workspace, cargo fmt --check and cargo clippy --workspace --all-targets are clean on the rebased tip, and the commit below (#1759) was re-verified standalone — each commit is its own PR with its own CI.

@mergify mergify Bot removed the conflict label Aug 6, 2026
Base automatically changed from devs/jd/jd/mrgfy-8363-make-the-activity-log-answerable-from-the-cli-a-shared-logs/port-queue-show-s-dequeue-diagnosis-onto-mergify--e13a945a to main August 6, 2026 10:13
@mergify
mergify Bot force-pushed the devs/jd/jd/mrgfy-8363-make-the-activity-log-answerable-from-the-cli-a-shared-logs/add-mergify-events-timeline-over-activity-log--3dd37c3d branch from fdda9fe to 9a87987 Compare August 6, 2026 10:13
@mergify
mergify Bot deployed to func-tests-live August 6, 2026 10:13 Active
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 6, 2026 10:13 Failure
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.

1 participant