fix(secrets): default secrets delete --type to shared to match secrets set - #375
fix(secrets): default secrets delete --type to shared to match secrets set#375rmdly wants to merge 1 commit into
Conversation
|
✅ CLA satisfied. All contributors have signed the current CLA. The |
|
| Filename | Overview |
|---|---|
| packages/cmd/secrets.go | Changes the delete type default to the existing shared-secret constant; explicit personal deletion remains available. |
| packages/cmd/secrets_test.go | Adds a focused test verifying that both secret mutation commands register the shared type default. |
Reviews (1): Last reviewed commit: "fix(secrets): default secrets delete --t..." | Re-trigger Greptile
|
Gentle nudge on this one. CI has been green since 26 August and the CLA check is passing. There is also the overlapping #381 flagged above, which does the same change without the regression test. Genuinely no preference from me on which lands, I would just rather it not sit indefinitely because of the duplication. If #381 is the one you would rather take, I am happy to send |
Fixes Infisical/infisical#7805
secrets setcreates a shared secret by default, butsecrets deletelooked for a personal one by default, so deleting a secret you had just created failed with a 404:The delete flag also hardcoded the string
"personal"rather than usingutil.SECRET_TYPE_PERSONAL, and repeated the default in its usage text, which cobra already prints.This aligns the two defaults on
util.SECRET_TYPE_SHARED. Deleting a personal secret still works with an explicit--type personal.Worth flagging: this is a behaviour change for anyone scripting
secrets deleteagainst personal secrets without passing--type. It seemed like the right call becausesecrets setalready defaults to shared and thepersonaldefault on delete is not documented, but happy to switch to one of the other options in the issue if you would rather not change the default.TestSecretsTypeFlagDefaultsasserts both commands agree on the default so they cannot drift apart again.One thing I noticed while adding it: nothing in CI runs
./packages/cmd, and the package will not build undergo testbecause of four pre-existingnon-constant format stringvet errors inrun.go, so the existing unit tests there are not running either. I have left that alone here, but I am happy to open a separate PR fixing those if it would be useful.