Many fixes on code quality and CI #129

Merged
metal3d merged 21 commits from develop into master 2025-07-06 13:37:08 +00:00
Owner

This pull request introduces multiple updates across the codebase, including workflow enhancements, dependency updates, and refactoring for consistency and maintainability. The changes primarily focus on improving CI/CD workflows, updating Go and SonarQube configurations, and standardizing naming conventions in the labelstructs package.

Workflow Enhancements

  • Updated .github/workflows/go-test.yaml to include additional pull request event types (opened, synchronize, reopened) and expanded branch support for main and releases/**.
  • Upgraded the Go version from 1.23 to 1.24 and replaced the SonarCloud action with SonarQube (sonarqube-scan-action@v5.2.0) while adding permissions for contents and pull-requests. [1] [2]

Code Refactoring

  • Renamed all occurrences of labelStructs to labelstructs across multiple files for consistency in naming conventions. [1] [2] [3] [4] [5] [6] [7]

Dependency and Permission Updates

  • Replaced hardcoded directory permissions (0o755) with utils.DirectoryPermission for better maintainability. [1] [2]
  • Updated the SONAR_HOST_URL environment variable to use vars.SONAR_HOST_URL for better configuration management.

Bug Fixes and Improvements

  • Enhanced validation in cmd/katenary/main.go by trimming whitespace from givenAppVersion before checking its length.
  • Fixed string concatenation in generator/converter.go by replacing append([]byte(fmt.Sprintf(...))) with fmt.Appendf(nil, ...) for improved performance.

Documentation Updates

  • Added a package description to doc/docs/packages/generator/labels.md to clarify the purpose of the labels package.
This pull request introduces multiple updates across the codebase, including workflow enhancements, dependency updates, and refactoring for consistency and maintainability. The changes primarily focus on improving CI/CD workflows, updating Go and SonarQube configurations, and standardizing naming conventions in the `labelstructs` package. ### Workflow Enhancements * Updated `.github/workflows/go-test.yaml` to include additional pull request event types (`opened`, `synchronize`, `reopened`) and expanded branch support for `main` and `releases/**`. * Upgraded the Go version from `1.23` to `1.24` and replaced the SonarCloud action with SonarQube (`sonarqube-scan-action@v5.2.0`) while adding permissions for `contents` and `pull-requests`. [[1]](diffhunk://#diff-459772e2288eadce428ea0649a84579e92ebb7ac501a4b06b99415d3bc892314L19-R22) [[2]](diffhunk://#diff-459772e2288eadce428ea0649a84579e92ebb7ac501a4b06b99415d3bc892314R34-R48) ### Code Refactoring * Renamed all occurrences of `labelStructs` to `labelstructs` across multiple files for consistency in naming conventions. [[1]](diffhunk://#diff-eba92d4872680b46c7e6b3518bef21be0f724d0e0fb9c3f4eb4b1db5d87ba8ccL6-R6) [[2]](diffhunk://#diff-7cd5232ec31ebcaa9fef033fd1f6ab9902cf755fa6d8434fc92aa18601399948L6-R6) [[3]](diffhunk://#diff-91559675883b78b34d9d8c54f1f568d454265a8ba0882f4fa8e25255335438e0L10-R10) [[4]](diffhunk://#diff-76e18537ba2c68d807f1c710adee38e059407e51bc3801b64d33c1b04de105cdL5-R5) [[5]](diffhunk://#diff-d980d24f8bd990a1d2918af6dd78c2fff5bf931de30e8a81d1c5f800e78e1402L6-R6) [[6]](diffhunk://#diff-ebe0c9061541da82c4de858d4996649ee6d33bf4036cb96200cc3f3ae891a536L7-R7) [[7]](diffhunk://#diff-4634fcaa859b8d870e92a66e611b03cc02edf156bd0ae71f1da9e51cfd787722L5-R5) ### Dependency and Permission Updates * Replaced hardcoded directory permissions (`0o755`) with `utils.DirectoryPermission` for better maintainability. [[1]](diffhunk://#diff-eba92d4872680b46c7e6b3518bef21be0f724d0e0fb9c3f4eb4b1db5d87ba8ccL98-R106) [[2]](diffhunk://#diff-91559675883b78b34d9d8c54f1f568d454265a8ba0882f4fa8e25255335438e0L176-R177) * Updated the `SONAR_HOST_URL` environment variable to use `vars.SONAR_HOST_URL` for better configuration management. ### Bug Fixes and Improvements * Enhanced validation in `cmd/katenary/main.go` by trimming whitespace from `givenAppVersion` before checking its length. * Fixed string concatenation in `generator/converter.go` by replacing `append([]byte(fmt.Sprintf(...)))` with `fmt.Appendf(nil, ...)` for improved performance. ### Documentation Updates * Added a package description to `doc/docs/packages/generator/labels.md` to clarify the purpose of the `labels` package.
Sign in to join this conversation.
No description provided.