Skip to content

feat: Add --definitions flag and artifact#6858

Open
pdp2121 wants to merge 4 commits intoXRPLF:developfrom
pdp2121:add-definitions-artifact
Open

feat: Add --definitions flag and artifact#6858
pdp2121 wants to merge 4 commits intoXRPLF:developfrom
pdp2121:add-definitions-artifact

Conversation

@pdp2121
Copy link
Copy Markdown

@pdp2121 pdp2121 commented Apr 10, 2026

High Level Overview of Change

Adds a --definitions CLI flag to xrpld that outputs server definitions as JSON and exits, without starting the server.
CI is updated to export and upload server_definitions.json as a build artifact on every run.

Context of Change

This is particularly valuable for SDK maintainers (e.g. xrpl.js, xrpl-py) who need up-to-date definitions early in a feature's development cycle, before a Docker image is available or a branch is merged to develop.

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

Before / After

Before: Generating definitions.json for downstream SDKs required either running a live server_definitions RPC call against a running node, or maintaining a custom regex-based script to extract definitions from source.

After: SDK maintainers can build and use --definitions flag to generate the json file, or simply download the server-definitions artifact directly from any CI run.

Test Plan

CI passes and artifact generated.

@pdp2121 pdp2121 changed the title feat: add --definitions flag and artifact feat: Add --definitions flag and artifact Apr 10, 2026
return RPC::invalid_field_error(jss::hash);
}

static detail::ServerDefinitions const defs{};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should refactor this to use the helper function you just added, so there's only one static variable

@mvadari mvadari requested a review from mathbunnyru April 10, 2026 21:21
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.6%. Comparing base (e2e537b) to head (3d5afc9).

Files with missing lines Patch % Lines
...pld/rpc/handlers/server_info/ServerDefinitions.cpp 0.0% 3 Missing ⚠️
src/xrpld/app/main/Main.cpp 66.7% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #6858     +/-   ##
=========================================
- Coverage     81.6%   81.6%   -0.0%     
=========================================
  Files         1010    1010             
  Lines        75982   75988      +6     
  Branches      7633    7634      +1     
=========================================
+ Hits         61982   61983      +1     
- Misses       14000   14005      +5     
Files with missing lines Coverage Δ
src/xrpld/app/main/Main.cpp 77.2% <66.7%> (-0.7%) ⬇️
...pld/rpc/handlers/server_info/ServerDefinitions.cpp 96.6% <0.0%> (-1.4%) ⬇️

... and 2 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants