Skip to content

Conversation

@kuan121
Copy link
Collaborator

@kuan121 kuan121 commented Nov 6, 2025

High Level Overview of Change

  1. Remove XRPLF/rippled@63a0856
    • NonFungibleTokensV1
    • NonFungibleTokensV1_1
    • fixNonFungibleTokensV1_2
    • fixNFTokenRemint
  2. Remove XRPLF/rippled@2ae65d2
    • PermissionDelegation

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Did you update HISTORY.md?

  • Yes
  • No, this change does not impact library users

Test Plan

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

This PR disables several amendments in the rippled test configuration and introduces runtime amendment availability checks in integration tests, allowing tests to conditionally skip when required amendments are not enabled on the server.

Changes

Cohort / File(s) Summary
Configuration amendment removal
.ci-config/rippled.cfg
Removed five amendment identifiers from the features list: NonFungibleTokensV1, NonFungibleTokensV1_1, NonFungibleTokensV1_2, fixNFTokenRemint, and PermissionDelegation
Test utility function
packages/xrpl/test/integration/utils.ts
Added new exported async function isAmendmentEnabled(client, amendmentName) that queries the XRPL server for feature data and returns whether a named amendment is enabled
Test gate implementation
packages/xrpl/test/integration/transactions/delegateSet.test.ts
Added import of isAmendmentEnabled utility and introduced a runtime check at the start of the 'base' test that conditionally skips the test if PermissionDelegation amendment is not enabled

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Straightforward configuration removal with no logic impact
  • New utility function is a simple async wrapper around server feature queries
  • Test gate addition follows a standard conditional skip pattern
  • Minimal scope across three files with consistent intent

Possibly related PRs

Suggested reviewers

  • mvadari
  • khancode
  • ckeshava

Poem

🐰 Amendments leap, then pause mid-stride,
We gate our tests with checks inside,
When features hide, we skip with grace,
No broken runs—just time and space! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning The PR description is incomplete with missing context, no specific test plan, and no confirmation of HISTORY.md updates despite significant amendment removals affecting library functionality. Add detailed context explaining why amendments are being removed, describe the specific tests executed to verify the changes, confirm HISTORY.md status, and clarify the breaking nature of removing supported amendments.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing integration tests caused by amendment removals from the config file.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-failed-integ-tests-due-to-removal-of-ammendaments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/xrpl/test/integration/transactions/delegateSet.test.ts (1)

44-54: Consider using Mocha's test skipping mechanism for better test reporting.

The early return pattern works functionally but causes the test to report as "passing" rather than "skipped" in test runners and CI/CD systems, which can hide that the test wasn't actually executed.

Consider refactoring to use Mocha's built-in skip functionality:

Option 1: Convert to regular function to use this.skip()

  it(
    'base',
-   async () => {
+   async function () {
      const isEnabled = await isAmendmentEnabled(
        testContext.client,
        'PermissionDelegation',
      )
      if (!isEnabled) {
-       // eslint-disable-next-line no-console -- Informing user about skipped test
-       console.warn(
-         'Skipping DelegateSet test: PermissionDelegation amendment is not enabled on the server',
-       )
-       return
+       this.skip()
      }

Option 2: Conditionally define the test

Alternatively, check the amendment status in beforeEach and use conditional test registration, though this is more complex and may not fit the current test structure.

packages/xrpl/test/integration/utils.ts (1)

96-126: LGTM! Implementation is sound.

The isAmendmentEnabled function correctly queries the server's feature set and safely handles errors by defaulting to false. The logic is clear and the documentation is helpful.

Optional: Consider adding type safety for feature objects.

While the current implementation works, you could improve type safety by defining an interface for the feature structure:

interface Feature {
  name: string
  enabled: boolean
  // other properties as needed
}

Then type the iteration more explicitly:

const features = featureResponse.result.features as Record<string, Feature>
for (const feature of Object.values(features)) {
  // TypeScript now knows feature.name and feature.enabled are available
  if (feature.name === amendmentName) {
    return feature.enabled
  }
}

This would provide better IDE support and catch potential issues at compile time, though the current implementation is functional.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd883bd and 9909a1b.

📒 Files selected for processing (3)
  • .ci-config/rippled.cfg (0 hunks)
  • packages/xrpl/test/integration/transactions/delegateSet.test.ts (2 hunks)
  • packages/xrpl/test/integration/utils.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • .ci-config/rippled.cfg
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: shawnxie999
Repo: XRPLF/xrpl.js PR: 2661
File: packages/xrpl/test/integration/transactions/clawback.test.ts:165-178
Timestamp: 2024-12-06T19:27:11.147Z
Learning: In the integration tests for `clawback.test.ts`, it's acceptable to use `ts-expect-error` to bypass type checking when verifying ledger entries, and no additional type safety improvements are needed.
Learnt from: shawnxie999
Repo: XRPLF/xrpl.js PR: 2661
File: packages/xrpl/test/integration/transactions/mptokenAuthorize.test.ts:29-118
Timestamp: 2024-12-06T19:25:15.376Z
Learning: In the XRPLF/xrpl.js TypeScript client library, when writing tests (e.g., in `packages/xrpl/test/integration/transactions/`), we generally do not need to test rippled server behaviors, because those behaviors are covered by rippled's own integration and unit tests.
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2873
File: packages/xrpl/test/integration/transactions/trustSet.test.ts:0-0
Timestamp: 2025-01-31T17:46:25.375Z
Learning: For the XRPL implementation, extensive test cases for deep freeze behavior (high/low side interactions, clearing flags, etc.) are maintained in the C++ implementation and don't need to be duplicated in the JavaScript implementation.
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2874
File: packages/xrpl/test/integration/transactions/permissionedDomain.test.ts:25-80
Timestamp: 2025-01-08T02:12:28.489Z
Learning: The rippled C++ implementation (PR #5161) includes comprehensive test coverage for PermissionedDomain (XLS-80d) error cases. The JS SDK tests focus on the happy path since the error cases are already validated at the rippled level, following the principle of not duplicating complex validation testing across SDK implementations.
📚 Learning: 2024-12-06T19:25:15.376Z
Learnt from: shawnxie999
Repo: XRPLF/xrpl.js PR: 2661
File: packages/xrpl/test/integration/transactions/mptokenAuthorize.test.ts:29-118
Timestamp: 2024-12-06T19:25:15.376Z
Learning: In the XRPLF/xrpl.js TypeScript client library, when writing tests (e.g., in `packages/xrpl/test/integration/transactions/`), we generally do not need to test rippled server behaviors, because those behaviors are covered by rippled's own integration and unit tests.

Applied to files:

  • packages/xrpl/test/integration/transactions/delegateSet.test.ts
  • packages/xrpl/test/integration/utils.ts
📚 Learning: 2024-12-06T19:27:11.147Z
Learnt from: shawnxie999
Repo: XRPLF/xrpl.js PR: 2661
File: packages/xrpl/test/integration/transactions/clawback.test.ts:165-178
Timestamp: 2024-12-06T19:27:11.147Z
Learning: In the integration tests for `clawback.test.ts`, it's acceptable to use `ts-expect-error` to bypass type checking when verifying ledger entries, and no additional type safety improvements are needed.

Applied to files:

  • packages/xrpl/test/integration/transactions/delegateSet.test.ts
📚 Learning: 2024-12-06T18:44:55.095Z
Learnt from: shawnxie999
Repo: XRPLF/xrpl.js PR: 2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.

Applied to files:

  • packages/xrpl/test/integration/transactions/delegateSet.test.ts
📚 Learning: 2025-01-31T17:46:25.375Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2873
File: packages/xrpl/test/integration/transactions/trustSet.test.ts:0-0
Timestamp: 2025-01-31T17:46:25.375Z
Learning: For the XRPL implementation, extensive test cases for deep freeze behavior (high/low side interactions, clearing flags, etc.) are maintained in the C++ implementation and don't need to be duplicated in the JavaScript implementation.

Applied to files:

  • packages/xrpl/test/integration/transactions/delegateSet.test.ts
🧬 Code graph analysis (2)
packages/xrpl/test/integration/transactions/delegateSet.test.ts (1)
packages/xrpl/test/integration/utils.ts (1)
  • isAmendmentEnabled (103-126)
packages/xrpl/test/integration/utils.ts (1)
.ci-config/getNewAmendments.js (1)
  • client (15-15)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: browser (24.x)
  • GitHub Check: unit (24.x)
  • GitHub Check: unit (20.x)
  • GitHub Check: integration (24.x)
  • GitHub Check: integration (22.x)
  • GitHub Check: integration (20.x)
  • GitHub Check: unit (22.x)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: build-and-lint (24.x)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/xrpl/test/integration/transactions/delegateSet.test.ts (1)

18-22: LGTM!

The import of isAmendmentEnabled is correctly added and will enable runtime amendment checks.

@kuan121 kuan121 merged commit 3f128b7 into main Nov 6, 2025
12 checks passed
@kuan121 kuan121 deleted the fix-failed-integ-tests-due-to-removal-of-ammendaments branch November 6, 2025 20:44
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.

4 participants