-
Notifications
You must be signed in to change notification settings - Fork 30
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
Simplify CDK ExtraArg processing with jcommander overrides #1016
Simplify CDK ExtraArg processing with jcommander overrides #1016
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1016 +/- ##
============================================
+ Coverage 80.20% 80.27% +0.07%
- Complexity 2722 2728 +6
============================================
Files 365 366 +1
Lines 13603 13605 +2
Branches 941 941
============================================
+ Hits 10910 10922 +12
+ Misses 2118 2108 -10
Partials 575 575
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
I love making command line parsing easier. I don't like doing it at the expense of the UX for users using the command line directly. I use the command line directly many times per day and usually I cannot see all of the args that I pass at once.
CreateSnapshot/src/main/java/org/opensearch/migrations/CreateSnapshot.java
Outdated
Show resolved
Hide resolved
...yServer/src/main/java/org/opensearch/migrations/trafficcapture/proxyserver/CaptureProxy.java
Show resolved
Hide resolved
deployment/cdk/opensearch-service-migration/lib/service-stacks/reindex-from-snapshot-stack.ts
Outdated
Show resolved
Hide resolved
207e411
to
cb16200
Compare
// Extract command prefix | ||
const commandPrefix = baseCommand.substring(0, baseCommand.indexOf('--')).trim(); | ||
const baseArgs = baseCommand.substring(baseCommand.indexOf('--')); | ||
export function parseArgsToDict(argString: string | undefined): Record<string, string[]> { |
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.
We're not using the values now, only the keys (except in the unit tests), but i thought it could be useful to keep this in here in case we use it.
I had originally put it in for the RFS Env Variable stuff, but since we don't support overriding the secretArn, we didn't need to use it
cb16200
to
a68628a
Compare
…obust Signed-off-by: Andre Kurait <[email protected]>
a68628a
to
f934cb5
Compare
Closing due to error - 2024-09-26 18:55:28,638 -- Report creating failed: {"message":"Token required because branch is protected"} Tracking in codecov/codecov-action#1580 |
Description
Simplify CDK ExtraArg processing with jcommander overrides.
Now, given two parameters
--s3-region us-east-2 --s3-region us-west-2
, jcommander will use the latter one.Fixed places where parameter values which may have spaces weren't wrapped in quotes.
Removed cdk dependency on yargs
Fixed an issue where List arguments would split on
,
incorrectly e.g.--setHeader name "value1,value2"
Note: There's two use cases missing from this PR. 1. being able to remove/set an argument to null. 2. correct behavior with extraArgs in RFS for arguments placed in the ENV variables
Issues Resolved
[List any issues this PR will resolve]
Is this a backport? If so, please add backport PR # and/or commits #
Testing
[Please provide details of testing done: unit testing, integration testing and manual testing]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.