Skip to content
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

PXP-477: [CLI] Develop the config secrets push command #81

Merged
merged 43 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f0caed3
feat(secret-edit): added a command to edit the secret via cli
mfauzaan Mar 28, 2023
7ed5b4c
style: removed unnnesry returns
mfauzaan Mar 28, 2023
b0f4d69
style: fix clippy issues
mfauzaan Mar 28, 2023
30caa42
test(secrets-edit-commands): generated snapshots for wukong cli
mfauzaan Mar 29, 2023
cb6b946
test(secrets-edit-commands): generated snapshots for wukong commands
mfauzaan Mar 29, 2023
ec33e69
style: removed duplicate variables
mfauzaan Mar 29, 2023
7926a1c
test(secrets-edit-commands): added test case for test_generate_checkl…
mfauzaan Mar 29, 2023
edafcf1
test(test_generate_checklist_items): added test case to verify the le…
mfauzaan Mar 29, 2023
7636c3e
test(test_generate_checklist_items): changed the logic to check the c…
mfauzaan Mar 29, 2023
72a1dce
style: removed the unused error codes
mfauzaan Mar 29, 2023
86a270d
style: updated function name and naming of some variables
mfauzaan Mar 30, 2023
9745555
WIP
mfauzaan Mar 31, 2023
4942fe7
refactor: changed the logic to fetch annotations on provided path
mfauzaan Apr 3, 2023
49e6d3a
feat: added vault update logic
mfauzaan Apr 3, 2023
5474889
style: fix fmt issues
mfauzaan Apr 3, 2023
6d7186a
chore: added reccursive function
mfauzaan Apr 3, 2023
120f178
feat: added a logic to bypass the annotation picker if there is only …
mfauzaan Apr 3, 2023
73cf714
bug: fix an issue where there is always a new line at the end of the …
mfauzaan Apr 3, 2023
7b966ae
feat: generated autocompletions
mfauzaan Apr 3, 2023
e9805db
refactor: changed the flow to behave like git diff
mfauzaan Apr 4, 2023
91727dd
style: fix issues on style
mfauzaan Apr 4, 2023
ec6afd5
style: fix issues on style
mfauzaan Apr 4, 2023
ffeceac
style: clippy fixes
mfauzaan Apr 4, 2023
0c186f5
chore: generated autocompletions
mfauzaan Apr 5, 2023
8b93601
revert: removed async-recursion function
mfauzaan Apr 5, 2023
263791a
revert(errors): unnesry changes in errors
mfauzaan Apr 5, 2023
d7f041f
feat: added new sub command group
mfauzaan Apr 5, 2023
3a89583
feat: disable selection if there is only one option available
mfauzaan Apr 5, 2023
da070ee
refactor: changed diff library to similar.rs
mfauzaan Apr 5, 2023
89e7ba3
chore: updated autocompletions
mfauzaan Apr 5, 2023
1ea3b3f
style: updated function names
mfauzaan Apr 5, 2023
b6c6740
test: fix autocompletion failed test cases
mfauzaan Apr 5, 2023
b1d8f6a
test: added some test cases
mfauzaan Apr 5, 2023
5e6843c
fix: updated cargo.lock to fix merge conflicts
mfauzaan Apr 6, 2023
ba17fa8
feat: updated error codes
mfauzaan Apr 6, 2023
6a92bc4
reverted config file
mfauzaan Apr 6, 2023
3426fd0
fix: updated config code to throw error if dev secret not found
mfauzaan Apr 6, 2023
a2d8dc8
test: updated test snapshots
mfauzaan Apr 6, 2023
c4c6d9d
style: change upto date error to a simple println
mfauzaan Apr 6, 2023
ce4e54b
fix: updated error path to show config path instead of secret path
mfauzaan Apr 6, 2023
5d7a6ca
test: updated test cases for remove_parent_directories function
mfauzaan Apr 6, 2023
38714f3
fix: reverted tmp tested variable
mfauzaan Apr 6, 2023
62d1748
style: fix clippy
mfauzaan Apr 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ miette = { version = "5.5.0", features = ["fancy"] }
ignore = "0.4.20"
rayon = "1.7.0"
tree-sitter = "0.20.9"
similar = { version = "2.2.1", features = ["inline"] }

[dev-dependencies]
httpmock = "0.6.7"
Expand Down
175 changes: 172 additions & 3 deletions completions/bash/wukong.bash
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ _wukong() {
wukong__deployment__help,rollback)
cmd="wukong__deployment__help__rollback"
;;
wukong__dev,config)
cmd="wukong__dev__config"
;;
wukong__dev,config-lint)
cmd="wukong__dev__config__lint"
;;
Expand All @@ -108,6 +111,21 @@ _wukong() {
wukong__dev,help)
cmd="wukong__dev__help"
;;
wukong__dev__config,help)
cmd="wukong__dev__config__help"
;;
wukong__dev__config,push)
cmd="wukong__dev__config__push"
;;
wukong__dev__config__help,help)
cmd="wukong__dev__config__help__help"
;;
wukong__dev__config__help,push)
cmd="wukong__dev__config__help__push"
;;
wukong__dev__help,config)
cmd="wukong__dev__help__config"
;;
wukong__dev__help,config-lint)
cmd="wukong__dev__help__config__lint"
;;
Expand All @@ -117,6 +135,9 @@ _wukong() {
wukong__dev__help,help)
cmd="wukong__dev__help__help"
;;
wukong__dev__help__config,push)
cmd="wukong__dev__help__config__push"
;;
wukong__help,application)
cmd="wukong__help__application"
;;
Expand Down Expand Up @@ -165,12 +186,18 @@ _wukong() {
wukong__help__deployment,rollback)
cmd="wukong__help__deployment__rollback"
;;
wukong__help__dev,config)
cmd="wukong__help__dev__config"
;;
wukong__help__dev,config-lint)
cmd="wukong__help__dev__config__lint"
;;
wukong__help__dev,config-synthesizer)
cmd="wukong__help__dev__config__synthesizer"
;;
wukong__help__dev__config,push)
cmd="wukong__help__dev__config__push"
;;
wukong__help__pipeline,ci-status)
cmd="wukong__help__pipeline__ci__status"
;;
Expand Down Expand Up @@ -677,7 +704,7 @@ _wukong() {
return 0
;;
wukong__dev)
opts="-a -v -q -h --application --verbose --quiet --help config-lint config-synthesizer help"
opts="-a -v -q -h --application --verbose --quiet --help config-lint config-synthesizer config help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand All @@ -698,6 +725,28 @@ _wukong() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__config)
opts="-a -v -q -h --application --verbose --quiet --help push help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--application)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
-a)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__config__lint)
opts="-a -v -q -h --application --verbose --quiet --help [PATH]"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
Expand Down Expand Up @@ -742,8 +791,72 @@ _wukong() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__config__help)
opts="push help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__config__help__help)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__config__help__push)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__config__push)
opts="-a -v -q -h --application --verbose --quiet --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--application)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
-a)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__help)
opts="config-lint config-synthesizer help"
opts="config-lint config-synthesizer config help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand All @@ -756,6 +869,20 @@ _wukong() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__help__config)
opts="push"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__help__config__lint)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
Expand Down Expand Up @@ -784,6 +911,20 @@ _wukong() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__help__config__push)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__dev__help__help)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
Expand Down Expand Up @@ -967,7 +1108,7 @@ _wukong() {
return 0
;;
wukong__help__dev)
opts="config-lint config-synthesizer"
opts="config-lint config-synthesizer config"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand All @@ -980,6 +1121,20 @@ _wukong() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__help__dev__config)
opts="push"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__help__dev__config__lint)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
Expand Down Expand Up @@ -1008,6 +1163,20 @@ _wukong() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__help__dev__config__push)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 5 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
wukong__help__help)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
Expand Down
Loading