-
Notifications
You must be signed in to change notification settings - Fork 68
✨ Bundle configuration is now validated - errors caught early with clear messages. #2316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
✨ Bundle configuration is now validated - errors caught early with clear messages. #2316
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
c547c6d to
05d349b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2316 +/- ##
==========================================
+ Coverage 71.14% 74.06% +2.91%
==========================================
Files 91 91
Lines 7046 7198 +152
==========================================
+ Hits 5013 5331 +318
+ Misses 1618 1446 -172
- Partials 415 421 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a753a5c to
f15ea9f
Compare
f15ea9f to
e9352a6
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e9352a6 to
c2e887e
Compare
1f3451a to
65bd4ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors bundle configuration validation to use JSON Schema for comprehensive validation rather than imperative Go code. The change moves all validation logic (structural checks, format validation, and install mode compatibility) into a dynamically generated JSON schema.
Key Changes:
- Replaces manual validation logic with JSON Schema-based validation using the
jsonschema/v6library - Introduces schema generation functions that create validation rules tailored to bundle install modes
- Adds comprehensive error formatting to translate JSON schema validation errors into user-friendly messages
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
internal/operator-controller/rukpak/bundle/config.go |
Complete rewrite of validation logic to use JSON Schema; adds schema generation, custom format validators, and error message formatting functions |
internal/operator-controller/rukpak/bundle/config_test.go |
Updates test cases to reflect new behavior where nil config is treated as {} for validation |
go.mod |
Moves github.com/santhosh-tekuri/jsonschema/v6 from indirect to direct dependency |
Comments suppressed due to low confidence (1)
internal/operator-controller/rukpak/bundle/config.go:505
- [nitpick] The function
substringBetweenhas a confusing parameter namefinishthat represents the index, not the end marker itself. The variable should be namedendIdxto match the pattern used withbegin→beginindex calculation.
Consider renaming for consistency:
endIdx := strings.Index(remaining, end)
if endIdx == -1 {
return ""
}
return remaining[:endIdx] return ""
}
return value[idx+len(token):]
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
65bd4ef to
195d51d
Compare
d78bf4a to
920f78e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Bundle configuration is now validated using JSONSchema. Configuration errors (typos, missing required fields, wrong types) are caught immediately with clear error messages instead of failing during installation. Assisted-by: Cursor
920f78e to
aaa71d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Bundle configuration is now validated using JSONSchema. Configuration
errors (typos, missing required fields, wrong types) are caught
immediately with clear error messages instead of failing during installation.
Motivation
https://issues.redhat.com/browse/OPRUN-4112
Criterias
Examples
✅ Works - AllNamespaces bundle without config
✅ Works - OwnNamespace bundle with config
❌ Fails - OwnNamespace bundle without config
❌ Fails - Invalid field