Skip to content

chore: Update to go 1.24.0 and CI updates#35

Merged
zacharyblasczyk merged 22 commits intomainfrom
zacharyb/deps-upgrade-and-ci
Feb 25, 2025
Merged

chore: Update to go 1.24.0 and CI updates#35
zacharyblasczyk merged 22 commits intomainfrom
zacharyb/deps-upgrade-and-ci

Conversation

@zacharyblasczyk
Copy link
Contributor

@zacharyblasczyk zacharyblasczyk commented Feb 25, 2025

Summary by CodeRabbit

  • Chores

    • Introduced new automated workflows for environment setup, code quality checks, and dependency management to help ensure consistent releases.
    • Upgraded various tooling and dependency versions to enhance overall project stability.
  • Bug Fixes

    • Improved error reporting in deployment commands for clearer guidance when issues arise.
    • Refined command output behaviors for a smoother user experience.
  • Refactor/Style

    • Applied formatting and whitespace improvements for uniformity across components, including adjustments in code indentation and alignment.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2025

Walkthrough

This pull request introduces a new GitHub Actions workflow (checks.yaml) for automating dependency setup, linting, formatting, and dependency verification on pushes and pull requests to the main branch. The release workflow has been updated with an expanded Go setup configuration. Additionally, the changes update the .gitignore, Makefile, command-line deployment and list functions with improved error handling and spinner usage, and perform extensive dependency upgrades in go.mod. Minor formatting adjustments were also made in several Helm and utility packages.

Changes

Files Summary
.github/workflows/checks.yaml, .github/workflows/release.yaml Introduces a new CI workflow for dependency setup, linting, formatting, and dependency verification; updates release workflow with Go 1.24, caching, and dependency installation.
.gitignore Adds new entries (wsm, test-wsm/) and adjusts formatting for consistency.
Makefile Updates GO_VERSION and GOLANGCI_LINT_VERSION, adds new targets (clean-lint, lint, lint-fix, fmt, safe-update-deps), and includes macOS-specific environment configuration.
cmd/wsm/deploy.go, cmd/wsm/list.go Adds error handling for chart path retrieval, updates import statements, and modifies spinner usage in command execution.
go.mod Upgrades Go version (to 1.24.0) and multiple dependencies (including charmbracelet libraries, Kubernetes packages, and others) to newer versions.
pkg/helm/chart.go, pkg/helm/values/from.go Applies minor formatting adjustments and updates the YAML import to use an explicit alias.
pkg/term/task/task.go Refactors whitespace and formatting in struct definitions and function implementations.
pkg/utils/tar.go Reformats code indentation using spaces without affecting the tarball creation logic.

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant GitHubActions
  participant SetupJob
  participant LintJob
  participant FormatJob
  participant DependencyCheckJob

  Developer->>GitHubActions: Push/PR to main branch
  GitHubActions->>SetupJob: Run Setup Dependencies job
  SetupJob-->>GitHubActions: Environment and dependencies set up
  GitHubActions->>LintJob: Trigger Lint job (after Setup)
  LintJob-->>GitHubActions: Return lint results
  GitHubActions->>FormatJob: Trigger Format job (after Setup)
  FormatJob-->>GitHubActions: Return formatting status
  GitHubActions->>DependencyCheckJob: Trigger Dependency Check job (after Setup)
  DependencyCheckJob-->>GitHubActions: Return dependency verification
Loading
sequenceDiagram
  participant User
  participant DeployCmd
  participant getChartPath
  participant OS

  User->>DeployCmd: Execute deployment command
  DeployCmd->>getChartPath: Retrieve operator chart path
  getChartPath-->>DeployCmd: Return path or error
  alt Error detected
      DeployCmd-->>OS: Print error and exit
  else No error
      DeployCmd->>getChartPath: Retrieve wandb chart path
      getChartPath-->>DeployCmd: Return path or error
      alt Error detected
          DeployCmd-->>OS: Print error and exit
      else
          DeployCmd->>DeployCmd: Continue with deployment flow
      end
  end
Loading

Possibly related PRs

  • fix: Wandb images will use semver #34: Involves similar GitHub Actions workflow updates with Go environment setup and dependency management enhancements, aligning with the changes in this PR.

Suggested reviewers

  • mwhooker
  • danielpanzella
  • theishshah
  • adityachoudhari26
  • j7m4

Poem

Hopping through branches, I code with delight,
In workflows and Makefiles, I dance through the night.
Dependencies updated, errors caught on the run,
My whiskers twitch proudly when the tests are done.
With each neat commit and a well-placed space,
A bunny’s tale of code joins the digital race.
Happy hops and joyous bytes in every place!

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 golangci-lint (1.62.2)

Error: can't load config: the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.24.0)
Failed executing command with error: can't load config: the Go language version (go1.23) used to build golangci-lint is lower than the targeted Go version (1.24.0)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91c37ba and 115c89c.

📒 Files selected for processing (1)
  • cmd/wsm/list.go (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Lint
🔇 Additional comments (9)
cmd/wsm/list.go (9)

6-6: Good update from deprecated io/ioutil to io package

The change from ioutil to io aligns with Go 1.24.0 best practices, as the io/ioutil package is deprecated and its functions have been moved to the io package.


34-40: Well-structured model enhancement

The model struct has been properly expanded to include fields for tracking operator images, W&B images, errors, and application state. This provides better state management and clearer data flow through the application.


42-46: Good addition of message type for structured results

The new fetchCompleteMsg type provides a clean way to encapsulate the results from image fetching operations, making the code more maintainable and easier to understand.


48-53: Improved Init method with concurrent operations

Using tea.Batch to run the spinner tick and image fetching concurrently is an excellent approach that improves user experience by showing feedback while performing operations.


55-76: Well-structured Update method with proper type handling

The Update method now properly handles different message types, including keyboard events for quitting, spinner updates, and fetch completion messages. The switch statement provides a clean and extensible implementation.


78-83: Clean View method with conditional rendering

The View method now checks the quitting state to avoid showing spinner during program exit, which provides a better user experience.


85-140: Well-implemented asynchronous image fetching

The new fetchImagesCmd function encapsulates image fetching logic with proper error handling at each step. It uses the tea.Cmd pattern correctly to run operations asynchronously and returns structured results via fetchCompleteMsg.


151-151: Updated to use io.ReadAll instead of deprecated ioutil.ReadAll

Correctly updated to use io.ReadAll which is the recommended replacement for the deprecated ioutil.ReadAll in Go 1.24.0.


197-233: Improved ListCmd with proper Bubble Tea integration

The ListCmd function has been restructured to follow Bubble Tea best practices:

  1. Proper initialization of spinner and model
  2. Clean program execution with proper error handling
  3. Extraction of results from the final model state
  4. Conditional rendering based on error state

This results in a more maintainable application with better user experience.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@socket-security
Copy link

socket-security bot commented Feb 25, 2025

Report is too large to display inline.
View full report↗︎

Next steps

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore golang/golang.org/x/telemetry@v0.0.0-20240228155512-f48c80bd79b2
  • @SocketSecurity ignore golang/google.golang.org/appengine@v1.6.7
  • @SocketSecurity ignore golang/github.com/opencontainers/image-spec@v1.1.0
  • @SocketSecurity ignore golang/github.com/jmespath/go-jmespath@v0.4.1-0.20220621161143-b0104c826a24
  • @SocketSecurity ignore golang/github.com/aws/aws-sdk-go@v1.55.5
  • @SocketSecurity ignore golang/github.com/Microsoft/hcsshim@v0.12.9
  • @SocketSecurity ignore golang/github.com/google/pprof@v0.0.0-20241210010833-40e02aabc2ad
  • @SocketSecurity ignore golang/k8s.io/kube-openapi@v0.0.0-20241212222426-2c72e554b1e7
  • @SocketSecurity ignore golang/github.com/grpc-ecosystem/grpc-gateway/v2@v2.25.1
  • @SocketSecurity ignore golang/github.com/aws/aws-sdk-go-v2@v1.32.8
  • @SocketSecurity ignore golang/github.com/sylabs/sif/v2@v2.20.2
  • @SocketSecurity ignore golang/github.com/google/s2a-go@v0.1.9
  • @SocketSecurity ignore golang/github.com/prometheus/common@v0.62.0
  • @SocketSecurity ignore golang/github.com/google/certificate-transparency-go@v1.3.1
  • @SocketSecurity ignore golang/github.com/google/go-containerregistry@v0.20.3
  • @SocketSecurity ignore golang/go.step.sm/crypto@v0.57.0
  • @SocketSecurity ignore golang/golang.org/x/tools@v0.30.0
  • @SocketSecurity ignore golang/helm.sh/helm/v3@v3.17.1

@zacharyblasczyk zacharyblasczyk changed the title chore: Update to go 1.24.0 chore: Update to go 1.24.0 and CI updates Feb 25, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/checks.yaml (1)

41-44: Consider increasing the linting timeout.

The 5-minute timeout might be insufficient for larger codebases. Consider increasing it to prevent timeouts in CI.

-          args: --timeout=5m
+          args: --timeout=10m
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ffbb624 and d5a4f13.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (11)
  • .github/workflows/checks.yaml (1 hunks)
  • .github/workflows/release.yaml (1 hunks)
  • .gitignore (1 hunks)
  • Makefile (1 hunks)
  • cmd/wsm/deploy.go (3 hunks)
  • cmd/wsm/list.go (3 hunks)
  • go.mod (1 hunks)
  • pkg/helm/chart.go (1 hunks)
  • pkg/helm/values/from.go (1 hunks)
  • pkg/term/task/task.go (5 hunks)
  • pkg/utils/tar.go (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • pkg/helm/chart.go
  • .gitignore
  • pkg/helm/values/from.go
  • pkg/utils/tar.go
  • pkg/term/task/task.go
🔇 Additional comments (24)
.github/workflows/release.yaml (2)

25-28: LGTM! Go setup configuration looks good.

The Go setup configuration is well-structured with caching enabled and the correct dependency path specified.


29-30: LGTM! Dependencies installation step is appropriate.

Adding explicit dependency installation ensures all required packages are available.

cmd/wsm/list.go (3)

6-6: LGTM! Using modern io package.

Correctly replacing deprecated ioutil with io package.


12-12: LGTM! Clear import alias.

Good use of tea alias for bubbletea package, improving code readability.


116-116: LGTM! Proper spinner execution.

Using Run() with error handling is the correct way to execute the spinner.

cmd/wsm/deploy.go (3)

6-8: LGTM! Required imports added.

Explicit imports for os and path packages are correctly added.


42-45: LGTM! Improved error handling for operator chart.

Good addition of error handling with early return to prevent cascading failures.


82-85: LGTM! Improved error handling for wandb chart.

Good addition of error handling with early return to prevent cascading failures.

.github/workflows/checks.yaml (3)

1-9: LGTM! Well-structured workflow triggers.

The workflow is correctly configured to run on pushes and pull requests to main branch.


10-24: LGTM! Proper setup job configuration.

Good setup job with Go installation, caching, and module verification.


73-76: LGTM! Comprehensive dependency check.

Good practice to ensure go.mod and go.sum are up to date and committed.

Makefile (10)

1-3: Updated Go and golangci-lint Versions.
The Go version and golangci-lint version have been updated to 1.24.0 and v1.64.5 respectively. This ensures consistency with the new toolchain and dependency upgrade requirements.


5-9: macOS Environment Variable Setup for Linker Warnings.
The new conditional block for macOS suppresses linker warnings by exporting CGO_LDFLAGS and LDFLAGS. This addition improves build output clarity on macOS systems. Confirm that these flags meet your intended behavior.


11-13: Addition of the Build Target.
The newly added build target using go build -o wsm ./cmd/wsm improves the build process by standardizing the binary output.


15-29: Enhanced golangci-lint Installation and Update Logic.
The install-lint target now uses a curl command to fetch and execute the installation script, and it smartly compares the currently installed version with the target version. This dynamic logic will help maintain the correct linter version. Please verify that the version extraction using awk and string manipulation using sed works as expected across environments.


30-35: New Clean-Lint Target for Removing Homebrew-installed golangci-lint.
The clean-lint target is a useful addition for cleaning up a possibly conflicting Homebrew-installed version of golangci-lint. The use of rm -f with a fallback (|| true) is appropriate here.


36-41: Lint Target with Integrated vet and golangci-lint.
The lint target now runs both go vet and golangci-lint with custom arguments. This layered approach should help catch a broader set of issues.


42-45: Automated Lint Fix Target.
The lint-fix target leverages the --fix option to automatically address linting issues. This should streamline code style corrections.


46-48: Code Formatting Target.
The added fmt target invokes go fmt to enforce consistent formatting, which is a welcomed best practice.


49-53: Safe Dependency Update Target.
The safe-update-deps target updates dependencies to their latest minor or patch versions and then runs go mod tidy to clean up the module file. This ensures that dependency management is both proactive and clean.


54-55: Updated .PHONY Declaration.
By updating the .PHONY declaration to include all new targets (install-lint, lint, lint-fix, fmt, test, build, clean-lint, safe-update-deps), you prevent conflicts with files of the same names.

go.mod (3)

3-4: Go Version Update in Module Definition.
The module now specifies go 1.24.0, which aligns with the changes in the Makefile and ensures compilation with the updated Go toolchain.


6-18: Main Dependency Upgrades.
Several key dependencies have been updated or introduced:

  • Upgraded github.com/Masterminds/semver/v3 to v3.3.1.
  • Updated Charmbracelet libraries (bubbles, bubbletea, lipgloss) to their newer versions.
  • Upgraded Kubernetes-related dependencies (k8s.io/api, k8s.io/apimachinery, k8s.io/client-go, k8s.io/kubectl) to v0.32.2.
  • Added/updated github.com/containers/image/v5 and others.

These changes appear aligned with the project’s dependency modernization goals. Please ensure that these upgrades have been tested within your integration environment to avoid any compatibility issues.


21-204: Extensive Indirect Dependency Updates.
The indirect dependencies block shows a comprehensive update with many packages now set to newer versions. Highlights include:

  • New versions for dependencies like github.com/Azure/go-ansiterm, several container-related libraries, and Kubernetes utilities.
  • The presence of both v3 and v4 semver libraries (e.g., github.com/Masterminds/semver/v3 and github.com/blang/semver/v4) should be double-checked to ensure there is no conflict.

Given the breadth of these changes, it is important to run a full build and test cycle to verify that there are no regressions or integration issues across the dependency tree.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@zacharyblasczyk

This comment was marked as resolved.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@zacharyblasczyk zacharyblasczyk merged commit 11c5c7e into main Feb 25, 2025
7 checks passed
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.

4 participants