-
Notifications
You must be signed in to change notification settings - Fork 3
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
secrets edit
creates a secret if it doesn't exist
#267
Conversation
Based on the discussion we had in #255, for rapid iteration over these commands, do I merge this PR which introduces automatic file creation, or do I keep working on it and implement the platform-specific |
If we're keeping to the iterative style then we should merge the current fix and move editor changes to a new issue. There's a little more work to do here however. We need to use the new secret contents serialiser to stream over the secret contents. |
4f7d704
to
8092393
Compare
Oh, do you mean that we stop using |
Yep, we nee to use the new serialiser to get the contents but also send the changed file back. |
b7170cc
to
00f1fbe
Compare
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 need to add tests to show functionality of this command. Its actually a problem that there are no tests already but understandable because its kinda hard to test interactive input. You can create a test node or bash script and use that as a psudo editor for testing. The script will do two things, return to the test the contents of the file so we can verify it, but also edit the file with the contents we provide it.
These tests are essential to check for regressions when future changes are made so we really need tests here that cover all the intended functionality of the command. There are two main cases.
- edit the file and check that the contents are updated. With the current code this would actually fail.
- Edit a new file and show that it is created with the contents.
Polykey-CLI/src/secrets/CommandEdit.ts Line 89 in 6c483ad
Apparently when you invoke environment variables using However, logging the value of It is weird, because |
secrets edit
commandsecrets edit
creates a secret if it doesn't exist
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.
Some small changes are we're good.
feat: added tests for secrets edit chore: fixed logic errors and added review changes
684eb7b
to
c2682d6
Compare
Description
This PR tracks improving the
secrets edit
command to create a file in the vault if it didn't exist, otherwise edit the file contents as usual.This iteration will focus on creating a new secret if it didn't exist at the time of editing it. Other features from the issue, including platform agnostic editor search or using
RawHandler
to stream file contents instead ofUnaryHandler
will be implemented in future iterations.Issues Fixed
secrets edit
command #266Tasks
secrets edit
Final checklist