Skip to content

Conversation

@RoyShravani
Copy link
Contributor

@RoyShravani RoyShravani commented Aug 6, 2025

Description

This pull request contains a series of updates and improvements across the infra-server server-ctl-cookbooks, focusing on code modernization, bug fixes, and improvements to code clarity and maintainability. The most significant changes include updating Ruby version requirements, fixing file path and method usage for compatibility and correctness, and cleaning up code to use more idiomatic Ruby patterns.

Build and Dependency Updates

  • Updated Ruby version for cookbook testing workflows from 2.6 to 3.1.7 in .github/workflows/ctl-cookbook-testing.yml.
  • Updated the github/codeql-action/upload-sarif action from v1 to v2 in .github/workflows/brakeman-analysis.yml.

Code Modernization and Cleanup

  • Replaced deprecated or less idiomatic Ruby patterns (e.g., using .first instead of [0], .empty? instead of .zero?, and .one? instead of .count == 1) in multiple library and recipe files for better readability and maintainability.
  • Changed require_relative statements to use a more consistent and modern style (removed leading ./) in several library files for improved compatibility.

Bug Fixes and Correctness

  • Fixed method calls and argument usage to avoid potential bugs (e.g., using .first instead of [0] for arrays, using .to_s for string conversion, and fixing regular expression matches).
  • Corrected file path and file existence checks in recipes/config.rb for more robust configuration handling.

Minor Cleanup

  • Removed unnecessary or misplaced parentheses and improved comment formatting for clarity. [1] [2]

These changes collectively improve code quality, future-proof the cookbooks, and address several minor bugs and inconsistencies.

[Please describe what this change achieves]

Issues Resolved

[List any existing issues this PR resolves, or any Discourse or
StackOverflow discussions that are relevant]

Check List

Signed-off-by: RoyShravani <shravani.roy@progress.com>
Signed-off-by: RoyShravani <shravani.roy@progress.com>
@RoyShravani RoyShravani requested review from a team as code owners August 6, 2025 06:52
@netlify
Copy link

netlify bot commented Aug 6, 2025

👷 Deploy Preview for chef-server processing.

Name Link
🔨 Latest commit 2a24b9e
🔍 Latest deploy log https://app.netlify.com/projects/chef-server/deploys/6892fbca9da591000841dee2

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 6, 2025

@sonarqube-for-infrastructure-prod

Quality Gate failed Quality Gate failed

Failed conditions
1 New issue
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE SonarQube for IDE

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.

2 participants