Skip to content
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

migrate pallet-node-authorization to use umbrella crate #7040

Conversation

UtkarshBhardwaj007
Copy link
Contributor

Description

Migrate pallet-node-authorization to use umbrella crate. Part of #6504

Review Notes

  • This PR migrates pallet-node-authorization to use the umbrella crate.
  • Some imports like below have not been added to any prelude as they have very limited usage across the various pallets.
use sp_core::OpaquePeerId as PeerId;
  • Added a commonly used runtime trait for testing in the testing_prelude in substrate/frame/src/lib.rs:
pub use sp_runtime::traits::BadOrigin;
  • weights.rs uses the weights_prelude like:
use frame::weights_prelude::*;
  • tests.rs and mock.rs use the testing_prelude:
use frame::testing_prelude::*;
  • lib.rs uses the main prelude like:
use frame::prelude::*;
  • For testing: Checked that local build works and tests run successfully.

@UtkarshBhardwaj007 UtkarshBhardwaj007 added R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet. labels Jan 3, 2025
@UtkarshBhardwaj007 UtkarshBhardwaj007 requested a review from a team as a code owner January 3, 2025 15:54

doc:
- audience: Runtime Dev
description: This PR migrates the pallet-node-authorization to use the frame umbrella crate. This
Copy link
Contributor

Choose a reason for hiding this comment

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

The whole issue is marked as R0-silent, as well as this PR, so we don't need a PRdoc unless you do something more than just the migration.

Copy link
Contributor

Choose a reason for hiding this comment

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

To be pedantic, we are only adding new types to frame, and adding things is still worthy of PRDoc and minor upgrade based on semver rules.

If we have merged some PRs already in this direction without PRDoc, it is okay since this crate is quite fresh, but going forward they should have PRDoc.

pallet-node-authorization should not be minor afaik, and since nothing is changing, it is a patch.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ggwpez can you please double check I am not wrong?

Copy link
Contributor Author

@UtkarshBhardwaj007 UtkarshBhardwaj007 Jan 6, 2025

Choose a reason for hiding this comment

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

I have been creating prdocs for the 2 PRs I have raised for this issue. My reasoning was that even though the changes in pallets could be argued to be none but adding new re-exports in the umbrella pallet must be a minor change.

pallet-node-authorization should not be minor afaik, and since nothing is changing, it is a patch.

I thought about this. I checked the SemVer documnetation and it seems like the recommedation for patch is specifically for bug fixes. Any changes to internal private functions could thus be categorised as minor. Since we are basically just changing imports and internal dependencies, I thought minor to be most accurate here. Curious to hear your thoughts @kianenigma @re-gius @ggwpez .

Copy link
Contributor

Choose a reason for hiding this comment

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

Your description sounds more educated than mine, and I trust it more here :) so minor for both sounds good to me.

@UtkarshBhardwaj007 UtkarshBhardwaj007 added this pull request to the merge queue Jan 7, 2025
Merged via the queue into paritytech:master with commit d2c157a Jan 7, 2025
202 of 207 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the migrate-pallet-node-authorization branch January 7, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants