feat: Add --definitions flag and artifact - #6858
Conversation
--definitions flag and artifact--definitions flag and artifact
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6858 +/- ##
=========================================
- Coverage 82.6% 82.6% -0.0%
=========================================
Files 1010 1010
Lines 79566 79568 +2
Branches 7540 7532 -8
=========================================
Hits 65704 65704
- Misses 13862 13864 +2
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new way to export XRPL server definitions without running a node, and wires CI to publish those definitions as an artifact for downstream SDK consumers.
Changes:
- Add
--definitionsCLI flag to output server definitions JSON and exit. - Refactor
server_definitionshandler to reuse a shared static definitions instance and exposegetStaticServerDefinitions(). - Update CI workflow to generate and upload
server_definitions.jsonas an artifact on a specific public release build.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/xrpld/rpc/handlers/server_info/ServerDefinitions.h |
Declares getStaticServerDefinitions() for non-RPC consumers. |
src/xrpld/rpc/handlers/server_info/ServerDefinitions.cpp |
Centralizes the static definitions instance and implements getStaticServerDefinitions(). |
src/xrpld/app/main/Main.cpp |
Adds --definitions option to emit definitions JSON and exit. |
src/test/rpc/ServerDefinitions_test.cpp |
Adds unit test coverage for getStaticServerDefinitions() and hash consistency with the RPC handler. |
.github/workflows/reusable-build-test-config.yml |
Exports and uploads server_definitions.json artifact in CI for a designated build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…/rippled into add-definitions-artifact
|
@pdp2121 is this PR good to go now? |
|
@mvadari Yes it should be. Could you help with merging it? Thank you! |
I added the "Ready to merge" label, which means that next time our authors will be taking a look at what to merge will likely add it to a merge queue. |
|
There seems to be a flaky test not related to this PR |
I agree, but it's a bit suspicious it failed 3 times in a row. I restarted the workflow, let's see if it fails again |
|
It passed now. My worry is that it will fail in merge queue since it's flaky. |
|
@mathbunnyru it's failing on one of my other PRs as well |
@mvadari @mathbunnyru I think one of the PRs that was merged today might be to blame. Any thoughts? |
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
High Level Overview of Change
Adds a
--definitionsCLI flag to xrpld that outputs server definitions as JSON and exits, without starting the server.CI is updated to export and upload
server_definitions.jsonas 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
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)Before / After
Before: Generating definitions.json for downstream SDKs required either running a live
server_definitionsRPC call against a running node, or maintaining a custom regex-based script to extract definitions from source.After: SDK maintainers can build and use
--definitionsflag to generate the json file, or simply download theserver-definitionsartifact directly from any CI run.Test Plan
CI passes and artifact generated.