-
Notifications
You must be signed in to change notification settings - Fork 48
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
chore: add restricted module check #420
Conversation
WalkthroughThe pull request introduces two main changes in the testing files. First, in Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
e2e/module_check_test.go (1)
12-19
: Consider adding test documentationPlease add a comment block explaining:
- Why these specific modules are restricted
- The security implications of these restrictions
- The relationship to Noble's architecture
+// TestRestrictedModules verifies that specific modules are restricted from access +// in the Noble blockchain context. These modules are restricted because: +// - circuit: [explain why] +// - gov: [explain why] +// - group: [explain why] func TestRestrictedModules(t *testing.T) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
e2e/conformance_test.go
(0 hunks)e2e/module_check_test.go
(1 hunks)
💤 Files with no reviewable changes (1)
- e2e/conformance_test.go
🔇 Additional comments (2)
e2e/module_check_test.go (2)
1-10
: LGTM: Clean and minimal imports
The package declaration and imports are well-organized, containing only the necessary dependencies for the test implementation.
20-24
: 🛠️ Refactor suggestion
Improve test robustness and error reporting
Consider these improvements:
- Use
t.Run
for each module to report failures independently - Enhance error messages with more context
- Verify the complete list of restricted modules
- restrictedModules := []string{"circuit", "gov", "group"}
-
- for _, module := range restrictedModules {
- require.False(t, noble.HasCommand(ctx, "query", module), fmt.Sprintf("%s is a restricted module", module))
- }
+ restrictedModules := []string{"circuit", "gov", "group"}
+
+ for _, module := range restrictedModules {
+ t.Run(fmt.Sprintf("module_%s", module), func(t *testing.T) {
+ hasCommand := noble.HasCommand(ctx, "query", module)
+ require.False(t, hasCommand,
+ fmt.Sprintf("Module '%s' should be restricted but is accessible via 'query' command", module))
+ })
+ }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CI test ensures that certain Go modules are not included in Noble.