furiko-io / furiko

Kubernetes cron and batch job platform
https://furiko.io
Apache License 2.0
478 stars 21 forks source link

fix(cli): Support AllowCustom and fix validation for select #109

Closed irvinlim closed 1 year ago

irvinlim commented 1 year ago

Fixes several CLI issues for furiko run.

  1. Support AllowCustom for Select options by using survey.Input in place of survey.Select

    asciicast

  2. Fixes a validation bug where Select options could not be selected when required is true.

  3. Adds unit tests.

codecov[bot] commented 1 year ago

Codecov Report

Base: 63.53% // Head: 64.56% // Increases project coverage by +1.02% :tada:

Coverage data is based on head (4e866db) compared to base (6525920). Patch coverage: 85.71% of modified lines in pull request are covered.

:exclamation: Current head 4e866db differs from pull request most recent head 0297d60. Consider uploading reports for the commit 0297d60 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #109 +/- ## ========================================== + Coverage 63.53% 64.56% +1.02% ========================================== Files 205 205 Lines 10957 10961 +4 ========================================== + Hits 6962 7077 +115 + Misses 3619 3505 -114 - Partials 376 379 +3 ``` | [Impacted Files](https://codecov.io/gh/furiko-io/furiko/pull/109?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io) | Coverage Δ | | |---|---|---| | [pkg/cli/cmd/common.go](https://codecov.io/gh/furiko-io/furiko/pull/109/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvY29tbW9uLmdv) | `49.20% <ø> (ø)` | | | [pkg/cli/prompt/prompt.go](https://codecov.io/gh/furiko-io/furiko/pull/109/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9wcm9tcHQvcHJvbXB0Lmdv) | `80.89% <84.21%> (+63.08%)` | :arrow_up: | | [pkg/cli/prompt/validator.go](https://codecov.io/gh/furiko-io/furiko/pull/109/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9wcm9tcHQvdmFsaWRhdG9yLmdv) | `62.06% <100.00%> (+50.95%)` | :arrow_up: | | [pkg/execution/mutation/mutation.go](https://codecov.io/gh/furiko-io/furiko/pull/109/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2V4ZWN1dGlvbi9tdXRhdGlvbi9tdXRhdGlvbi5nbw==) | `89.09% <0.00%> (ø)` | | | [apis/execution/v1alpha1/job\_types.go](https://codecov.io/gh/furiko-io/furiko/pull/109/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-YXBpcy9leGVjdXRpb24vdjFhbHBoYTEvam9iX3R5cGVzLmdv) | `100.00% <0.00%> (ø)` | | | [pkg/execution/validation/validation.go](https://codecov.io/gh/furiko-io/furiko/pull/109/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2V4ZWN1dGlvbi92YWxpZGF0aW9uL3ZhbGlkYXRpb24uZ28=) | `91.03% <0.00%> (ø)` | | | [apis/execution/v1alpha1/jobconfig\_types.go](https://codecov.io/gh/furiko-io/furiko/pull/109/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-YXBpcy9leGVjdXRpb24vdjFhbHBoYTEvam9iY29uZmlnX3R5cGVzLmdv) | `100.00% <0.00%> (ø)` | | | [...ion/webhooks/jobconfigvalidatingwebhook/webhook.go](https://codecov.io/gh/furiko-io/furiko/pull/109/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2V4ZWN1dGlvbi93ZWJob29rcy9qb2Jjb25maWd2YWxpZGF0aW5nd2ViaG9vay93ZWJob29rLmdv) | `0.00% <0.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.