Skip to content

fix: Handle errors for failed to retreive user spec.  Don't return an error for invalid chart config in spec.#96

Merged
danielpanzella merged 2 commits intomainfrom
danielpanzella/fail-on-user-spec-errors
Jul 25, 2025
Merged

fix: Handle errors for failed to retreive user spec.  Don't return an error for invalid chart config in spec.#96
danielpanzella merged 2 commits intomainfrom
danielpanzella/fail-on-user-spec-errors

Conversation

@danielpanzella
Copy link
Copy Markdown
Contributor

@danielpanzella danielpanzella commented Jul 25, 2025

  • Handle errors retrieving user spec
  • Stop returning an error for missing chart in spec
    • its expected that some of the specs don't have chart configs, and we have checks later that confirm a chart config ends up in the merged specs

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling when retrieving user input specifications, ensuring more accurate feedback and recovery in error scenarios.
    • Adjusted logic to allow successful retrieval of user specifications even when certain chart information is missing, preventing unnecessary errors.
  • Tests

    • Added and updated test cases to verify correct creation of empty user specifications and to ensure proper handling when chart information is absent.
  • Chores

    • Updated multiple dependencies to their latest versions for improved stability and performance.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 25, 2025

Walkthrough

The changes revise error handling in the user input and secret spec retrieval logic, particularly eliminating errors for missing charts and handling missing user input specs more explicitly. Associated tests are updated or added to reflect these new behaviors, ensuring the code now returns empty or partial specs instead of errors in these scenarios. Additionally, dependency versions in go.mod were updated.

Changes

File(s) Change Summary
controllers/weightsandbiases_controller.go Reordered imports; revised reconciliation logic to handle missing user input specs and errors with explicit checks.
controllers/weightsandbiases_controller_test.go Added a test case to verify creation of an empty user spec when none exists.
pkg/wandb/spec/state/secrets/manager_test.go Updated test to expect no error and a nil chart when release is missing, instead of expecting an error.
pkg/wandb/spec/state/secrets/secrets.go Removed error return for missing chart; now returns spec with possible nil chart instead of error.
go.mod Bumped several dependency versions including helm.sh/helm/v3 and multiple golang.org/x modules.

Sequence Diagram(s)

sequenceDiagram
    participant Controller
    participant SpecManager
    participant SecretsManager

    Controller->>SpecManager: GetUserInput()
    alt UserInputSpec not found
        SpecManager->>Controller: Create empty UserInputSpec
        Controller->>Controller: Set empty UserInputSpec
        Controller->>Controller: Requeue if setting fails
    else Other error
        SpecManager->>Controller: Log and requeue with error
    else UserInputSpec found
        SpecManager->>Controller: Return UserInputSpec
    end
Loading
sequenceDiagram
    participant SecretsManager
    participant Charts

    SecretsManager->>Charts: Get(maybeChart)
    alt Chart found
        SecretsManager->>Caller: Return spec with chart
    else Chart not found
        SecretsManager->>Caller: Return spec with chart = nil (no error)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

  • fix: Bump deps #70: Dependency version bumps in go.mod overlapping with this PR’s updates to helm and golang.org/x modules.

Suggested reviewers

  • zacharyblasczyk

Poem

In the warren of code, a gentle shift,
Errors for empty specs now quietly drift.
Where once a chart’s absence would cause a loud cry,
Now nil is returned, and the code hops by.
With tests to ensure all works as planned,
This rabbit applauds with a helping hand! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 86d0310 and 8d0af6f.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Test
  • GitHub Check: Build
  • GitHub Check: build-and-scan
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch danielpanzella/fail-on-user-spec-errors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @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.

@danielpanzella danielpanzella changed the title fix: Handle errors for failed to retreive user spec. Don't return an… fix: Handle errors for failed to retreive user spec.  Don't return an error for invalid chart config in spec. Jul 25, 2025
Copy link
Copy Markdown

@mwhooker mwhooker left a comment

Choose a reason for hiding this comment

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

nice

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedhelm.sh/​helm/​v3@​v3.17.1 ⏵ v3.17.473 +1100 +1910010080

View full report

@danielpanzella danielpanzella merged commit 4254c64 into main Jul 25, 2025
10 checks passed
@danielpanzella danielpanzella deleted the danielpanzella/fail-on-user-spec-errors branch July 25, 2025 17:51
jsbroks pushed a commit that referenced this pull request Jul 25, 2025
### [1.20.1](v1.20.0...v1.20.1) (2025-07-25)

### Bug Fixes

* Handle errors for failed to retreive user spec.  Don't return an error for invalid chart config in spec. ([#96](#96)) ([4254c64](4254c64))
@jsbroks
Copy link
Copy Markdown
Member

jsbroks commented Jul 25, 2025

This PR is included in version 1.20.1 🎉

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.

5 participants