Support EDITOR having arguments in encrypted secrets Rake tasks
What does this MR do and why?
Previously if you had EDITOR set to something like emacs -nw,
rake gitlab:ldap:secret:edit would quietly fail without launching an
editor and write a blank encrypted secrets file to disk. This commit
does two things to improve this:
- Splits the
EDITORenvironment variable and passes the arguments with a splat operator tosystemto handle multiple arguments. - Checks the return value of the
systemto ensure that the editor returned successfully.
Relates to #431339 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
- In your
gitlabdir,mkdir -p shared/encrypted_settings. - Run:
GITLAB_GENERATE_ENCRYPTED_SETTINGS_KEY_BASE=1 EDITOR='emacs -nw' bundle exec rake gitlab:ldap:secret:edit - Verify the editor comes up.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Stan Hu