-
Notifications
You must be signed in to change notification settings - Fork 60
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
feature: add support for installing completions at package build time #779
Conversation
@ghthor , just so I'm clear, this change is specific for Nix? |
@ghthor, you should be able to rebase & push and the builds should run properly now. |
It is not. It would apply to any packaging system, though it may need an additional feature to override the executable path. For instance if we wanted to add a PKGBUILD to the AUR I believe we'd need to override the executable path as it wouldn't be the same at build time versus runtime after the package was installed; while with Nix the executable path is the same at build time as runtime. But this is a general pattern that enables packagers to incorporate the shell completions into package builds. I just used nix in my example as it's my current target to get support for. |
Enables installing the completions at build time (aka during package building) and also simplifies the management of completions in the long run as the only required modification to the shell rc file can be a single line.
Bump @synfinatic anything I can do to help get this merged? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #779 +/- ##
==========================================
- Coverage 82.49% 80.32% -2.16%
==========================================
Files 35 37 +2
Lines 3266 3405 +139
==========================================
+ Hits 2694 2735 +41
- Misses 504 595 +91
- Partials 68 75 +7
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Sorry... been busy with non-SSO related things. Anyways, the proposed code change looks good, but do you mind adding some unit tests and an appropriate comment in the CHANGELOG.md file? |
@ghthor FYI, i've enabled the build job to automatically run without approval for you. shouldn't be any more delays. |
I don't see any benefit to increasing the coverage of the tests for a bunch of toss it and return errors that have no handling behavior other than return. Do see any behavior remaining that would be worthwhile to add test cases for? |
I'm happy to work on improving coverage else where as a followup to this PR |
Thanks for the PR and your patience @ghthor . |
Enables installing the completions at build time (aka during package building) and also simplifies the management of completions in the long run as the only required modification to the shell rc file can be a single line.
I need some pointers on how to add this feature into the documentation, I wasn't able to figure it out but I also didn't give it 100%.
This feature makes the processing of installing the completions into the standard system locations at package build time line up with how the cobra framework does it as well as many other CLI frameworks.
For instance the following is from the nixpkg of a command that uses cobra.
https://github.com/nix-community/gomod2nix/blob/master/default.nix#L39
For comparison, the aws-sso-cli package would then do something like the following.
ghthor/nixpkgs@c7c2ea6