Skip to content

ci(protocol-watch): show what changed, not just which files - #155

Merged
Platonenkov merged 2 commits into
devfrom
claude/protocol-watch-lending-v11-8fd79c
Aug 31, 2026
Merged

ci(protocol-watch): show what changed, not just which files#155
Platonenkov merged 2 commits into
devfrom
claude/protocol-watch-lending-v11-8fd79c

Conversation

@Platonenkov

@Platonenkov Platonenkov commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Closes the follow-up from the protocol-watch firing tracked in #46.

Why

The watch tells the operator that a protocol file moved on XRPLF/rippled develop and links to its history. Naming the file still leaves the reading of the change to a human, who has to fetch two revisions and compare them by hand — which is the work the watch exists to save.

The last firing was one line of features.macro flipping LendingProtocolV1_1 from Supported::No to Supported::Yes. Finding that out took several minutes of manual blob fetching.

What changed

Both blob shas are already in hand at the point the comment is built: the baseline stored in the tracking issue holds the old one, the fresh snapshot the new. So the two blobs are fetched by sha and diffed directly, and each changed file gets a unified diff folded into a <details> block under its links.

The comment for the last real firing now renders as:

@@ -19,5 +19,5 @@
 XRPL_FEATURE(Sponsor,                     Supported::Yes, VoteBehavior::DefaultNo)
 XRPL_FEATURE(BatchV1_1,                   Supported::Yes, VoteBehavior::DefaultNo)
-XRPL_FEATURE(LendingProtocolV1_1,         Supported::No,  VoteBehavior::DefaultNo)
+XRPL_FEATURE(LendingProtocolV1_1,         Supported::Yes,  VoteBehavior::DefaultNo)
 XRPL_FEATURE(ConfidentialTransfer,        Supported::Yes, VoteBehavior::DefaultNo)

Rendering a diff is best-effort while the notification is not: a blob fetch that fails leaves the file listed with its links and a note, rather than aborting a run whose only job is to tell somebody that something changed. Long diffs are cut at 80 lines per file with the true total stated.

The second commit is unrelated housekeeping from the same firing: generate-amendments.sh used LendingProtocolV1_1 as its example of an amendment the script has to cope with, and that amendment is no longer an example of one.

Verification

The comment-building logic was run outside Actions against the real shas from #46 (jq is absent locally, so its calls were replaced with the values it would return), covering all three paths:

Path Result
Ordinary diff The comment above, 1291 characters against GitHub's 65536 limit
Truncation (limit lowered to 4) Cut with an honest counter, truncated at 4 of 7 lines
Failed fetch (bad sha) File stays listed with its links plus a note; the run does not fail

actionlint reports the same three pre-existing SC2016 findings before and after — no new ones.

Summary by CodeRabbit

  • Improvements

    • Change notifications now include collapsible, per-file diffs for easier review.
    • Notifications better handle added, removed, and renamed files, while reporting retrieval issues without stopping the notification.
    • Large diffs are automatically shortened to keep notifications readable.
    • Existing links to historical and current versions remain available.
  • Documentation

    • Clarified guidance for configuring additional features and current naming-rule exceptions.

…le of one

protocol-watch fired on issue #46: features.macro changed on rippled develop.
The change is one line - LendingProtocolV1_1 moved from Supported::No to
Supported::Yes in "feat: Enable LendingProtocolV1_1 amendment" (#8125),
2026-08-26.

That line is cited in this script as the example of a name that must not go
into EXTRA_FEATURES, on two grounds: Supported::No on develop, and absent from
the release macro. Both have stopped being true. develop marked it supported,
and the CI stand moved to 3.3.0, which declares it - the comment still said
3.2.0. So the example now argues the opposite of what it was written to show:
by the stated rule, both binaries know the name, which is exactly what makes an
entry admissible.

Rewritten as history rather than replaced, because no amendment fits that shape
today: checked every Supported::No name on develop against 3.3.0 and all of
them are declared there. Saying so is more useful than picking a new example
that does not hold.

No config change, and none is possible: the generator selects Supported::Yes
names, and the nightly pin is 3.4.0~b0+202608111815.26cc683e - built 15 days
before the flip, so its binary still has the amendment as Supported::No.
Regenerating from that ref, which is the only ref allowed to match the pin,
produces what is already committed.

Verified rather than assumed. Regenerating both stands from their own refs -
26cc683e for nightly, 3.3.0 for CI - reproduces the committed files byte for
byte, 47 amendments each. Generating into a throwaway copy from develop yields
48, with LendingProtocolV1_1 in [features] and in [amendments] with its hash:
the entry arrives on its own when the pin moves, which nightly-pin-watch will
propose within the day - the pin is 20 days old against its 21-day allowance.
The watch tells the operator that a protocol file moved and links to its
history. Naming the file still leaves the reading of the change to a human
who must fetch two revisions and compare them by hand - which is the work
the watch exists to save. The last firing was one line of features.macro
flipping LendingProtocolV1_1 from Supported::No to Supported::Yes, and
seeing that took several minutes of manual blob fetching.

Both blob shas are already in hand at that point: the baseline in the
tracking issue holds the old one, the fresh snapshot the new. So fetch the
two blobs by sha and render a unified diff inline, per file, folded into a
<details> block so a wide change does not bury the comment.

Rendering the diff is best-effort while the notification is not. A blob
fetch that fails leaves the file listed with its links and a note rather
than aborting a run whose only job is to tell somebody that something
changed. Long diffs are cut at 80 lines per file with the true total
stated, keeping the comment far below GitHub's 65536-character limit.
@Platonenkov

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3ee69da8-bf6f-4187-b31b-4e8f95507ddd

📥 Commits

Reviewing files that changed from the base of the PR and between 8708b70 and 022f3b7.

📒 Files selected for processing (2)
  • .ci-config/generate-amendments.sh
  • .github/workflows/protocol-watch.yml

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The pull request updates amendment validation comments and extends protocol-watch notifications with per-file unified diffs. The workflow handles added, removed, renamed, and unavailable files, and truncates long diffs.

Changes

Protocol watch updates

Layer / File(s) Summary
Amendment validation documentation
.ci-config/generate-amendments.sh
The comments describe current feature support status and retain the shared-name validation rule.
Per-file diff notifications
.github/workflows/protocol-watch.yml
The workflow fetches blobs, handles file status cases, generates unified diffs, truncates output beyond 80 lines, and renders collapsible Markdown sections.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 022f3

The change adds best-effort unified diffs to protocol-watch notifications and updates an amendment example; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: protocol-watch notifications now show the content of changes instead of only listing changed files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/protocol-watch-lending-v11-8fd79c

Comment @coderabbitai help to get the list of available commands.

@Platonenkov
Platonenkov added this pull request to the merge queue Aug 31, 2026
Merged via the queue into dev with commit 895745b Aug 31, 2026
4 checks passed
@Platonenkov
Platonenkov deleted the claude/protocol-watch-lending-v11-8fd79c branch August 31, 2026 15:15
@Platonenkov Platonenkov mentioned this pull request Sep 1, 2026
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.

1 participant