Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 12 additions & 9 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,27 @@ function check_incorrect_makefile_variable_brackets() {
}

function pre_commit() {
if [[ "${MDB_UPDATE_LICENSES:-""}" == "true" ]]; then
( (time update_licenses) 2>&1 | prepend "update_licenses" ) &
fi
( (time scripts/evergreen/lint_code.sh) 2>&1 | prepend "lint_code.sh" ) &
( (time start_shellcheck) 2>&1 | prepend "shellcheck" ) &

# Update release.json first in case there is a newer version
(time update_release_json) 2>&1 | prepend "update_release_json"
# We need to generate the values files first
(time update_values_yaml_files) 2>&1 | prepend "update_values_yaml_files"
# The values files are used for generating the standalone yaml
(time generate_standalone_yaml) 2>&1 | prepend "generate_standalone_yaml"
# Run black on python files that have changed
(time python_formatting) 2>&1 | prepend "python_formatting"

(time regenerate_public_rbac_multi_cluster) 2>&1 | prepend "regenerate_public_rbac_multi_cluster"

(time start_shellcheck) 2>&1 | prepend "shellcheck"
( (time regenerate_public_rbac_multi_cluster) 2>&1 | prepend "regenerate_public_rbac_multi_cluster" ) &

(time check_erroneous_kubebuilder_annotations) 2>&1 | prepend "check_erroneous_kubebuilder_annotations"
# Run black and isort on python files that have changed
( (time python_formatting) 2>&1 | prepend "python_formatting") &

(time scripts/evergreen/lint_code.sh) 2>&1 | prepend "lint_code.sh"
( (time check_erroneous_kubebuilder_annotations) 2>&1 | prepend "check_erroneous_kubebuilder_annotations" ) &

(time update_licenses) 2>&1 | prepend "update_licenses"
wait
}

# Function to run shellcheck on a single file
Expand Down Expand Up @@ -196,7 +199,7 @@ if [[ "${cmd}" == "generate_standalone_yaml" ]]; then
shift 1
generate_standalone_yaml "$@"
elif [[ "${cmd}" == "pre-commit" ]]; then
pre_commit
time pre_commit
elif [[ "${cmd}" == "shellcheck" ]]; then
start_shellcheck
elif [[ "${cmd}" == "lint" ]]; then
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ prerequisites:
@ scripts/dev/install.sh

precommit:
@ EVERGREEN_MODE=true .githooks/pre-commit
@ .githooks/pre-commit

precommit-with-licenses:
@ MDB_UPDATE_LICENSE=true .githooks/pre-commit

switch:
@ scripts/dev/switch_context.sh $(context) $(additional_override)
Expand Down
2 changes: 2 additions & 0 deletions scripts/dev/contexts/evg-private-context
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,5 @@ export cognito_workload_federation_client_secret="${cognito_workload_federation_
export cognito_user_password="${cognito_user_password}"
export cognito_workload_url="${cognito_workload_url}"
export cognito_workload_user_id="${cognito_workload_user_id}"

export MDB_UPDATE_LICENSES=true
3 changes: 3 additions & 0 deletions scripts/dev/contexts/private-context-template
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ export e2e_cloud_qa_user_owner_static_2="${OM_USER}"

# TODO to be removed at public preview stage of community-search
export COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON="<dockerconfigjson secret>"

# uncomment to enable license update with pre-commit script
# export MDB_UPDATE_LICENSES=true