Skip to content

Commit 3634f91

Browse files
authored
Merge branch 'master' into lsierant/remove-multi-crd
2 parents b24883b + b338418 commit 3634f91

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

.githooks/pre-commit

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,24 +142,27 @@ function check_incorrect_makefile_variable_brackets() {
142142
}
143143

144144
function pre_commit() {
145+
if [[ "${MDB_UPDATE_LICENSES:-""}" == "true" ]]; then
146+
( (time update_licenses) 2>&1 | prepend "update_licenses" ) &
147+
fi
148+
( (time scripts/evergreen/lint_code.sh) 2>&1 | prepend "lint_code.sh" ) &
149+
( (time start_shellcheck) 2>&1 | prepend "shellcheck" ) &
150+
145151
# Update release.json first in case there is a newer version
146152
(time update_release_json) 2>&1 | prepend "update_release_json"
147153
# We need to generate the values files first
148154
(time update_values_yaml_files) 2>&1 | prepend "update_values_yaml_files"
149155
# The values files are used for generating the standalone yaml
150156
(time generate_standalone_yaml) 2>&1 | prepend "generate_standalone_yaml"
151-
# Run black on python files that have changed
152-
(time python_formatting) 2>&1 | prepend "python_formatting"
153-
154-
(time regenerate_public_rbac_multi_cluster) 2>&1 | prepend "regenerate_public_rbac_multi_cluster"
155157

156-
(time start_shellcheck) 2>&1 | prepend "shellcheck"
158+
( (time regenerate_public_rbac_multi_cluster) 2>&1 | prepend "regenerate_public_rbac_multi_cluster" ) &
157159

158-
(time check_erroneous_kubebuilder_annotations) 2>&1 | prepend "check_erroneous_kubebuilder_annotations"
160+
# Run black and isort on python files that have changed
161+
( (time python_formatting) 2>&1 | prepend "python_formatting") &
159162

160-
(time scripts/evergreen/lint_code.sh) 2>&1 | prepend "lint_code.sh"
163+
( (time check_erroneous_kubebuilder_annotations) 2>&1 | prepend "check_erroneous_kubebuilder_annotations" ) &
161164

162-
(time update_licenses) 2>&1 | prepend "update_licenses"
165+
wait
163166
}
164167

165168
# Function to run shellcheck on a single file
@@ -196,7 +199,7 @@ if [[ "${cmd}" == "generate_standalone_yaml" ]]; then
196199
shift 1
197200
generate_standalone_yaml "$@"
198201
elif [[ "${cmd}" == "pre-commit" ]]; then
199-
pre_commit
202+
time pre_commit
200203
elif [[ "${cmd}" == "shellcheck" ]]; then
201204
start_shellcheck
202205
elif [[ "${cmd}" == "lint" ]]; then

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ prerequisites:
5757
@ scripts/dev/install.sh
5858

5959
precommit:
60-
@ EVERGREEN_MODE=true .githooks/pre-commit
60+
@ .githooks/pre-commit
61+
62+
precommit-with-licenses:
63+
@ MDB_UPDATE_LICENSE=true .githooks/pre-commit
6164

6265
switch:
6366
@ scripts/dev/switch_context.sh $(context) $(additional_override)

scripts/dev/contexts/evg-private-context

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,5 @@ export cognito_workload_federation_client_secret="${cognito_workload_federation_
120120
export cognito_user_password="${cognito_user_password}"
121121
export cognito_workload_url="${cognito_workload_url}"
122122
export cognito_workload_user_id="${cognito_workload_user_id}"
123+
124+
export MDB_UPDATE_LICENSES=true

scripts/dev/contexts/private-context-template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,6 @@ export e2e_cloud_qa_user_owner_static_2="${OM_USER}"
9999

100100
# TODO to be removed at public preview stage of community-search
101101
export COMMUNITY_PRIVATE_PREVIEW_PULLSECRET_DOCKERCONFIGJSON="<dockerconfigjson secret>"
102+
103+
# uncomment to enable license update with pre-commit script
104+
# export MDB_UPDATE_LICENSES=true

0 commit comments

Comments
 (0)