furiko-io / furiko

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

feat(cli): Enhance CLI completion #121

Closed irvinlim closed 1 year ago

irvinlim commented 1 year ago

Adds enhancements to completion.

  1. Refactor to extract common and completion packages from cmd.
  2. Support sort, filter, format functions for completion.
  3. Refactor CompletionHelper into separate Completers.
  4. By default, sort jobs by creation timestamp in descending order for ListJobsCompleter.
  5. By default, display phase and creation timestamp for ListJobsCompleter.
  6. By default, display state and last executed timestamp for ListJobConfigsCompleter.
  7. Implement unit test framework for Completer.
codecov[bot] commented 1 year ago

Codecov Report

Base: 68.79% // Head: 69.45% // Increases project coverage by +0.65% :tada:

Coverage data is based on head (c8c4f5f) compared to base (278d1e2). Patch coverage: 84.35% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #121 +/- ## ========================================== + Coverage 68.79% 69.45% +0.65% ========================================== Files 188 192 +4 Lines 9644 9765 +121 ========================================== + Hits 6635 6782 +147 + Misses 2647 2617 -30 - Partials 362 366 +4 ``` | [Impacted Files](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io) | Coverage Δ | | |---|---|---| | [pkg/cli/completion/completion.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jb21wbGV0aW9uL2NvbXBsZXRpb24uZ28=) | `38.88% <38.88%> (ø)` | | | [pkg/runtime/testing/fixture.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL3J1bnRpbWUvdGVzdGluZy9maXh0dXJlLmdv) | `75.00% <50.00%> (-6.25%)` | :arrow_down: | | [pkg/cli/cmd/cmd\_get.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvY21kX2dldC5nbw==) | `88.46% <66.66%> (ø)` | | | [pkg/cli/cmd/cmd\_list.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvY21kX2xpc3QuZ28=) | `90.00% <66.66%> (ø)` | | | [pkg/cli/cmd/cmd.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvY21kLmdv) | `86.95% <75.00%> (ø)` | | | [pkg/cli/cmd/cmd\_list\_job.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvY21kX2xpc3Rfam9iLmdv) | `81.06% <90.00%> (ø)` | | | [pkg/cli/completion/completer\_list\_namespaces.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jb21wbGV0aW9uL2NvbXBsZXRlcl9saXN0X25hbWVzcGFjZXMuZ28=) | `90.32% <90.32%> (ø)` | | | [pkg/runtime/testing/completion.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL3J1bnRpbWUvdGVzdGluZy9jb21wbGV0aW9uLmdv) | `90.32% <90.32%> (ø)` | | | [pkg/cli/completion/completer\_list\_jobconfigs.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jb21wbGV0aW9uL2NvbXBsZXRlcl9saXN0X2pvYmNvbmZpZ3MuZ28=) | `91.17% <91.17%> (ø)` | | | [pkg/cli/cmd/cmd\_run.go](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvY21kX3J1bi5nbw==) | `80.00% <92.30%> (ø)` | | | ... and [15 more](https://codecov.io/gh/furiko-io/furiko/pull/121?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io) | | 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.