Skip to content

chore: deprecate nft for future #24575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 29, 2025
Merged

chore: deprecate nft for future #24575

merged 7 commits into from
Apr 29, 2025

Conversation

aljo242
Copy link
Contributor

@aljo242 aljo242 commented Apr 24, 2025

Summary by CodeRabbit

  • Documentation

    • Added deprecation notices to the x/nft module documentation and related files, indicating the module will be removed in the next major release and moved to a legacy repository.
    • Updated the changelog to include a new "Deprecated" section for the x/nft module.
  • Style

    • Improved formatting and alignment of comments in import statements and code comments across various files.
  • Chores

    • Annotated deprecated imports with comments to suppress static analysis warnings.

Copy link

ironbird-prod bot commented Apr 24, 2025

Ironbird - launch a network To use Ironbird, you can use the following commands:
  • /ironbird start OR /ironbird start --load-test-config= - Launch a testnet with the specified chain and load test configuration.
  • /ironbird chains - List of chain images that ironbird can use to spin-up testnet
  • /ironbird loadtests - List of load test modes that ironbird can run against testnet
Custom Load Test Configuration You can provide a custom load test configuration using the `--load-test-config=` flag:
/ironbird start cosmos --load-test-config={
  "block_gas_limit_target": 0.75,
  "num_of_blocks": 50,
  "msgs": [
    {"weight": 0.3, "type": "MsgSend"},
    {"weight": 0.3, "type": "MsgMultiSend"},
	{"weight": 0.4, "type": "MsgArr", "ContainedType": "MsgSend", "NumMsgs": 3300}
  ]
}

Use /ironbird loadtests to see more examples.

Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

📝 Walkthrough

Walkthrough

The changes introduce widespread deprecation notices and linter suppression comments throughout the codebase, specifically targeting the x/nft module and its related subpackages. Comments indicating deprecation and planned removal are added at the top of key files and in import statements, often using //nolint:staticcheck to suppress warnings about deprecated usage. Documentation files such as README.md and CHANGELOG.md are updated to reflect the deprecation and relocation of the x/nft module to a legacy repository. No changes are made to the functional logic, exported entities, or control flow of the code.

Changes

File(s) Change Summary
CHANGELOG.md, x/nft/README.md Added deprecation notices regarding the x/nft module and its relocation to a legacy repository.
simapp/app.go, simapp/app_config.go Added or adjusted comments for deprecated imports and improved formatting of import statements.
x/nft/keeper/class.go, x/nft/keeper/genesis.go, x/nft/keeper/grpc_query.go, Added //nolint:staticcheck comments to cosmossdk.io/x/nft imports, noting deprecation and removal plans.
x/nft/keeper/grpc_query_test.go, x/nft/keeper/keys.go, x/nft/keeper/msg_server.go, Same as above—suppressed linter warnings for deprecated x/nft imports in keeper/test files.
x/nft/keeper/msg_server_test.go, x/nft/keeper/nft.go, x/nft/keeper/nft_batch.go, Same as above—suppressed linter warnings for deprecated x/nft imports in keeper/test files.
x/nft/keeper/nft_batch_test.go, x/nft/keeper/keeper.go, x/nft/keeper/keeper_test.go, Added deprecation comments and linter suppression for x/nft and related package imports.
x/nft/keys.go, x/nft/module/autocli.go, x/nft/module/module.go Added top-level deprecation comments and/or //nolint:staticcheck to imports for x/nft and subpackages.
x/nft/simulation/decoder.go, x/nft/simulation/decoder_test.go, x/nft/simulation/genesis.go Added deprecation comments and linter suppression to simulation package and imports.
x/nft/simulation/genesis_test.go, x/nft/simulation/msg_factory.go, Same as above—suppressed linter warnings for deprecated x/nft imports in simulation/test files.
x/nft/simulation/operations.go, x/nft/simulation/operations_test.go Same as above—suppressed linter warnings for deprecated x/nft imports in simulation/test files.
x/nft/testutil/app_config.go Added //nolint:staticcheck to deprecated x/nft/module import for app wiring.

Sequence Diagram(s)

No sequence diagram is generated as the changes are limited to documentation, comments, and linter suppression without affecting control flow or introducing new features.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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)
CHANGELOG.md (1)

39-39: Fix heading level for Deprecated section.
The heading "### Deprecated" should only increment one level from the previous H1 ("# Changelog"), so it should be "## Deprecated" to satisfy markdown lint rules.

- ### Deprecated
+ ## Deprecated
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

39-39: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

x/nft/keeper/genesis.go (1)

6-6: Import-level deprecation suppression is correct
The //nolint:staticcheck // deprecated and to be removed directive properly silences deprecation warnings for cosmossdk.io/x/nft.

Consider adding a Go-style deprecation comment at the top of the file to make it explicit in documentation, for example:

+// Deprecated: The x/nft module is deprecated and will be removed in the next major release.
+// Please migrate to github.com/cosmos/cosmos-sdk-legacy/x/nft.
+
 package keeper
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4846e80 and 8d52acd.

📒 Files selected for processing (27)
  • CHANGELOG.md (1 hunks)
  • simapp/app.go (3 hunks)
  • simapp/app_config.go (1 hunks)
  • x/nft/README.md (1 hunks)
  • x/nft/keeper/class.go (1 hunks)
  • x/nft/keeper/genesis.go (1 hunks)
  • x/nft/keeper/grpc_query.go (1 hunks)
  • x/nft/keeper/grpc_query_test.go (1 hunks)
  • x/nft/keeper/keeper.go (1 hunks)
  • x/nft/keeper/keeper_test.go (1 hunks)
  • x/nft/keeper/keys.go (1 hunks)
  • x/nft/keeper/msg_server.go (1 hunks)
  • x/nft/keeper/msg_server_test.go (1 hunks)
  • x/nft/keeper/nft.go (1 hunks)
  • x/nft/keeper/nft_batch.go (1 hunks)
  • x/nft/keeper/nft_batch_test.go (1 hunks)
  • x/nft/keys.go (1 hunks)
  • x/nft/module/autocli.go (1 hunks)
  • x/nft/module/module.go (1 hunks)
  • x/nft/simulation/decoder.go (1 hunks)
  • x/nft/simulation/decoder_test.go (1 hunks)
  • x/nft/simulation/genesis.go (1 hunks)
  • x/nft/simulation/genesis_test.go (1 hunks)
  • x/nft/simulation/msg_factory.go (1 hunks)
  • x/nft/simulation/operations.go (1 hunks)
  • x/nft/simulation/operations_test.go (1 hunks)
  • x/nft/testutil/app_config.go (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
CHANGELOG.md

39-39: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

⏰ Context from checks skipped due to timeout of 90000ms (16)
  • GitHub Check: test-system-legacy
  • GitHub Check: test-system
  • GitHub Check: tests (03)
  • GitHub Check: tests (02)
  • GitHub Check: tests (01)
  • GitHub Check: tests (00)
  • GitHub Check: test-sim-nondeterminism
  • GitHub Check: test-integration
  • GitHub Check: build (arm64)
  • GitHub Check: test-e2e
  • GitHub Check: build (amd64)
  • GitHub Check: Analyze
  • GitHub Check: Check docs build
  • GitHub Check: Gosec
  • GitHub Check: golangci-lint
  • GitHub Check: Summary
🔇 Additional comments (30)
CHANGELOG.md (1)

41-41: Deprecation entry for x/nft module is accurately documented.
The new entry correctly marks the x/nft module as deprecated, includes the PR link, and points to the legacy repo location.

x/nft/simulation/genesis.go (1)

7-7: Deprecation suppression added to nft import.
The //nolint:staticcheck comment on the cosmossdk.io/x/nft import properly suppresses deprecation warnings and aligns with the planned removal of the module.

x/nft/keeper/class.go (1)

8-8: Suppress staticcheck on deprecated nft import.
Adding //nolint:staticcheck to the cosmossdk.io/x/nft import consistently suppresses linter warnings for the deprecated module.

x/nft/keeper/nft_batch.go (1)

7-7: Suppress staticcheck on deprecated nft import.
The import directive for cosmossdk.io/x/nft now includes //nolint:staticcheck, correctly marking the package as deprecated for batch operations as well.

x/nft/keeper/nft.go (1)

8-8: Suppress staticcheck on deprecated nft import.
The //nolint:staticcheck annotation on the cosmossdk.io/x/nft import ensures deprecation warnings are suppressed across core keeper logic.

x/nft/keeper/keys.go (1)

6-6: Deprecation annotation on import is consistent
Using //nolint:staticcheck // deprecated and to be removed correctly suppresses the staticcheck warning for this deprecated import.

Optionally, to improve clarity for future maintainers, you could add a file-level deprecation notice above the package declaration as shown for the other keeper files.

x/nft/keeper/msg_server.go (1)

8-8: Suppressing linter warnings on deprecated import is appropriate
The added //nolint:staticcheck // deprecated and to be removed on the cosmossdk.io/x/nft import correctly silences deprecation alerts without modifying logic.

As with the other files, consider adding a brief file-header comment indicating the module’s deprecated status.

x/nft/simulation/msg_factory.go (1)

6-7: Deprecation suppression on both imports is correct
The dual //nolint:staticcheck // deprecated and to be removed directives on cosmossdk.io/x/nft and its keeper subpackage imports cleanly suppress deprecation warnings.

Optionally, a file-level deprecation prologue could reinforce that this simulation code is tied to a deprecated module.

x/nft/module/module.go (1)

16-18: Import annotations properly suppress staticcheck errors for deprecated modules
Marking cosmossdk.io/x/nft, its keeper, and simulation subpackages with //nolint:staticcheck // deprecated and to be removed is consistent with the deprecation effort.

You may optionally add a top-of-file deprecation notice to adhere to Go’s deprecation conventions, for example:

+// Deprecated: The x/nft module has been moved to github.com/cosmos/cosmos-sdk-legacy.
+// All support for this path will be dropped in the next major release.
+
 package module
x/nft/simulation/operations.go (1)

6-7: Appropriate deprecation annotations added.

The annotations correctly mark the x/nft and x/nft/keeper packages as deprecated with the appropriate //nolint:staticcheck directive, which will properly suppress linter warnings while clearly documenting the deprecation status.

x/nft/keeper/nft_batch_test.go (1)

7-7: Appropriate deprecation annotation added.

The annotation correctly marks the x/nft package as deprecated with the appropriate //nolint:staticcheck directive, which will properly suppress linter warnings while clearly documenting the deprecation status.

x/nft/simulation/operations_test.go (1)

13-15: Appropriate deprecation annotations added.

The annotations correctly mark the x/nft, x/nft/keeper, and x/nft/simulation packages as deprecated with the appropriate //nolint:staticcheck directive, which will properly suppress linter warnings while clearly documenting the deprecation status.

x/nft/keeper/grpc_query.go (1)

7-7: Appropriate deprecation annotation added.

The annotation correctly marks the x/nft package as deprecated with the appropriate //nolint:staticcheck directive, which will properly suppress linter warnings while clearly documenting the deprecation status.

x/nft/keeper/grpc_query_test.go (1)

11-11: Consistent deprecation annotation added.

The addition of the //nolint:staticcheck comment to suppress warnings is appropriate as part of the broader deprecation strategy. This ensures the codebase can compile without linter errors while using the module that will eventually be removed.

x/nft/keys.go (1)

1-1: Clear deprecation notice follows best practices.

The deprecation comment clearly communicates that the package will be removed in the next major release and provides the future location of the code. This follows best practices by giving users advance notice and migration guidance.

x/nft/keeper/msg_server_test.go (1)

6-6: Consistent deprecation annotation added.

The //nolint:staticcheck comment matches the approach used in other files, maintaining consistency throughout the codebase in how deprecated modules are marked.

x/nft/README.md (1)

7-8: Prominent deprecation warning in documentation.

The added warning is appropriately prominent with the warning emoji and clear messaging about the deprecation status. This ensures that developers consulting the documentation are immediately aware of the module's status.

x/nft/simulation/decoder_test.go (1)

9-12: Approve deprecation annotations on NFT imports

The added //nolint:staticcheck // deprecated and to be removed comments correctly suppress static analysis warnings for the deprecated x/nft imports in this test file, aligning with the module deprecation plan.

x/nft/testutil/app_config.go (1)

4-4: Approve blank import deprecation annotation

The //nolint:staticcheck // deprecated and to be removed directive appropriately marks the blank import of x/nft/module for deprecation while preserving it for app wiring.

x/nft/keeper/keeper_test.go (1)

12-14: Approve deprecation suppression on keeper test imports

The //nolint:staticcheck // deprecated and to be removed annotations effectively silence deprecation warnings for the x/nft, x/nft/keeper, and x/nft/module imports in the keeper test suite.

x/nft/simulation/genesis_test.go (1)

11-13: Approve deprecation suppression for simulation genesis test imports

These //nolint:staticcheck // deprecated and to be removed comments correctly flag the x/nft imports as deprecated and suppress staticcheck warnings without affecting test logic.

x/nft/keeper/keeper.go (2)

1-1: Approve deprecation package comment

The file-level deprecation notice clearly communicates the removal timeline and relocation of the x/nft module, which is essential for developers and maintainers.


7-7: Approve staticcheck suppression on NFT import

The //nolint:staticcheck // deprecated and to be removed annotation on the x/nft import is correctly applied to suppress deprecation warnings while the import remains necessary.

simapp/app_config.go (1)

38-40: Ensure consistent deprecation lint suppression for NFT imports

The cosmossdk.io/x/nft import in this file lacks a //nolint:staticcheck directive, unlike other parts of the codebase where deprecated x/nft imports are suppressed. Consider adding //nolint:staticcheck to maintain uniform handling of the deprecated module across all import sites.

x/nft/module/autocli.go (2)

1-1: Deprecation notice format is correct

The package-level // Deprecated: comment properly follows Go conventions and clearly indicates the module's removal plan.


9-9: Suppress staticcheck warnings for deprecated NFT import

Adding //nolint:staticcheck to the cosmossdk.io/x/nft import correctly silences linter warnings for this deprecated package.

simapp/app.go (2)

31-33: Suppress staticcheck warnings for deprecated NFT imports

The x/nft, x/nft/keeper, and x/nft/module imports are now annotated with //nolint:staticcheck, aligning with the deprecation policy across the application wiring.


470-470: Style-only comment adjustment: no action needed

This change converts a block comment to a line comment with adjusted indentation and does not affect functionality.

x/nft/simulation/decoder.go (2)

1-1: Deprecation notice format is correct

The package-level // Deprecated: comment follows Go conventions for deprecation notices and clearly states the removal plan.


8-9: Suppress staticcheck warnings for deprecated simulation imports

The cosmossdk.io/x/nft and cosmossdk.io/x/nft/keeper imports are annotated with //nolint:staticcheck, ensuring deprecated imports do not trigger linter warnings in simulation code.

Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

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

we should update the x/readme.md and move the NFT module from supplementary to deprecated heading

@aljo242 aljo242 enabled auto-merge April 29, 2025 13:40
@aljo242 aljo242 added this pull request to the merge queue Apr 29, 2025
Merged via the queue into main with commit 9168ce4 Apr 29, 2025
46 checks passed
@aljo242 aljo242 deleted the chore/deprecate-nft branch April 29, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants