Repository navigation
fix: resolve Blocker and High SonarCloud findings - #548
Draft
arjun-rajappa wants to merge 1 commit into
Draft
arjun-rajappa wants to merge 1 commit into
arjun-rajappa wants to merge 1 commit into
Conversation
- Pass workflow inputs to the Slack release script via env vars instead of interpolating them in the shell (script injection) - Replace Thread.current with Fiber[] for the Lambda function ARN and with local variables in the gRPC and Sidekiq test boot files - Use ENV.fetch instead of ENV[] for reads without a default - Add explicit else branches to case statements and set Style/EmptyElse to EnforcedStyle: empty in .rubocop.yml - Comment intentionally empty methods - Extract duplicated string literals into constants - Assign APP once in the Sinatra and Rails tests - Move requires to the top of the file in trace.rb, util.rb and grpc_server.rb No behavior change intended. The remaining S7816 findings are lazy or conditional requires and are to be marked as false positives. Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Why
SonarCloud reports 99 open Blocker and High findings on
master(1 Blocker, 98 High). The Blocker is a script-injection risk in the release Slack workflow, so these need clearing.What
release-notification-on-slack.yml: passgithub.event_nameandinputs.github_refthroughenv:instead of interpolating them into the shell script (Blocker, S7630).Thread.current(14): the Lambda function ARN usesFiber[]storage (gem requires Ruby >= 3.2). The gRPC and Sidekiq test boot files use local variables.ENV[]reads useENV.fetch(KEY, nil), same behavior as before.elsetocasestatements..rubocop.ymlsetsStyle/EmptyElsetoEnforcedStyle: emptysoelse nilpasses RuboCop without inline disables.DISABLE_SERVER_TIMING_KEY, gRPC metadata keys,EXECUTE_GRAPHQL).APPonce.trace.rb,util.rbandgrpc_server.rb.The other 44 S7816 findings are not changed. They are lazy or conditional requires (the activators,
begin/rescue LoadError, version-dependent test requires), and moving them would change behavior. They should be marked as false positives in SonarCloud.Testing: RuboCop is clean on the changed files, and
bundle exec rake testpasses (651 tests, 0 failures). The Rails, gRPC, GraphQL and SQS suites were not run locally, so CI should confirm those.