-
Notifications
You must be signed in to change notification settings - Fork 736
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
Allow not providing values to selected configurable variables through CLI #42978
Open
ravinperera00
wants to merge
11
commits into
ballerina-platform:master
Choose a base branch
from
ravinperera00:issue_42859
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Allow not providing values to selected configurable variables through CLI #42978
ravinperera00
wants to merge
11
commits into
ballerina-platform:master
from
ravinperera00:issue_42859
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix a bug that didn't allow to enter values for configurable variables through CLI when values for some variables are left empty. Add an improvement that allows providing configurable values for types such as int? through the CLI.
HindujaB
reviewed
Jun 25, 2024
...-runtime/src/main/java/io/ballerina/runtime/internal/configurable/providers/ConfigUtils.java
Outdated
Show resolved
Hide resolved
...time/src/main/java/io/ballerina/runtime/internal/configurable/providers/cli/CliProvider.java
Show resolved
Hide resolved
Let's shorten the PR title as well. We can elaborate on it inside the description and approach. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #42978 +/- ##
=========================================
Coverage 77.34% 77.34%
- Complexity 58233 58236 +3
=========================================
Files 3450 3450
Lines 218919 218920 +1
Branches 28726 28726
=========================================
+ Hits 169315 169316 +1
Misses 40281 40281
Partials 9323 9323 ☔ View full report in Codecov by Sentry. |
HindujaB
reviewed
Jun 28, 2024
bvm/ballerina-runtime/src/test/java/io/ballerina/runtime/test/config/ConfigTest.java
Outdated
Show resolved
Hide resolved
...-runtime/src/main/java/io/ballerina/runtime/internal/configurable/providers/ConfigUtils.java
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Fixes #42859
Approach
Bug fix
When considering unsupported configurable values in the CLI, there could be two cases:
Case 1
A type that is not supported through the CLI is used as a configurable variable but the value is not provided through the CLI. This should not be a problem and the CLI should allow leaving the value for that out as long as a default values is provided through other methods.
Case 2
A type that is not supported through the CLI is used as a configurable variable but the value for that is provided through the CLI. This should cause and error stopping the program.
Checking whether the variable value is null before executing the checks regarding the type can produce the expected outcome.
Improvement
The Ballerina spec mentions the following regarding the supported types for configurable values.
Therefore types such as int? should be supported through the CLI. This can be achieved by accepting the
()
type as a valid member type within union types.Check List