diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e6a413b..67cf94c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ default_install_hook_types: [ pre-commit, commit-msg ] repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: end-of-file-fixer stages: [commit] @@ -18,7 +18,7 @@ repos: stages: [commit] args: ["--allow-missing-credentials"] - repo: https://github.com/golangci/golangci-lint - rev: v1.60.3 + rev: v1.61.0 hooks: - id: golangci-lint stages: [commit] @@ -29,7 +29,7 @@ repos: - id: go-imports stages: [commit] - repo: https://github.com/gitguardian/ggshield - rev: v1.31.0 + rev: v1.32.1 hooks: - id: ggshield language: python diff --git a/catalog-info.generator.sh b/catalog-info.generator.sh index 30f8da4..f2f7faa 100755 --- a/catalog-info.generator.sh +++ b/catalog-info.generator.sh @@ -69,22 +69,30 @@ get_gh_team() { REPO_NAME=$(basename "$(pwd)") SERVICE_NAMES=(${(s: :)$(yq e '.jobs.repository-release-prod.with.helm_release_names' "$RELEASE_WORKFLOW")}) -if [[ ${#SERVICE_NAMES[@]} == 0 || "$SERVICE_NAMES" == "null" && -f "customized_helm_release_names.txt" ]]; then +if [[ ${#SERVICE_NAMES[@]} == 0 || "$SERVICE_NAMES" == "null" || $SERVICE_NAMES == \$* ]]; then SERVICE_NAMES=($(cat "customized_helm_release_names.txt")) fi if [[ ${#SERVICE_NAMES[@]} == 0 || "$SERVICE_NAMES" == "null" ]]; then SERVICE_NAMES=(${(s: :)$(jq -r ".manual_service_names[]" $META_DATA_FILE)}) fi +if [[ ${#SERVICE_NAMES[@]} == 0 || "$SERVICE_NAMES" == "null" ]]; then + SERVICE_NAMES=($(jq --arg p "$REPO_NAME" -r 'to_entries | .[] | .value as $version | ($version | split(".")[0] | tonumber) as $major | + if $major >= 2 then + "\($p)-\(.key)-v\($major)" + else + "\($p)-\(.key)" + end' .release-please-manifest.json)) + SERVICE_NAMES+=($REPO_NAME) +fi if [[ ${#SERVICE_NAMES[@]} == 0 || "$SERVICE_NAMES" == "null" ]]; then SERVICE_NAMES=($REPO_NAME) fi SQUAD_NAME=$(yq e '.jobs.repository-release-prod.with.argocd_state_repo' "$RELEASE_WORKFLOW") -SQUAD_NAME=$(echo "$SQUAD_NAME" | cut -c 14-50) -if [[ -z $SQUAD_NAME || "$SQUAD_NAME" == "null" ]]; then +if [[ -z $SQUAD_NAME || "$SQUAD_NAME" == "null" || $SQUAD_NAME == \$* ]]; then SQUAD_NAME=$(jq -r '.squad_name' $META_DATA_FILE) else - SQUAD_NAME="$SQUAD_NAME-squad" + SQUAD_NAME="$(echo "$SQUAD_NAME" | cut -c 14-50)-squad" fi SQUAD_NAME=$(get_squad_name $SQUAD_NAME) GH_TEAM=$(get_gh_team $SQUAD_NAME) @@ -121,6 +129,8 @@ for SERVICE in $SERVICE_NAMES; do SERVICE_RUNBOOK=$(jq -r ".\"$SERVICE\".runbook" $META_DATA_FILE) # Default dependencies DEPENDENCIES=(${(s: :)$(jq -r ".manual_dependencies[]" $META_DATA_FILE)}) + # Service specific dependencies + DEPENDENCIES+=(${(s: :)$(jq -r ".\"$SERVICE\".manual_dependencies[]?" $META_DATA_FILE)}) TOPICS=(${(s: :)$(grep Topic "config/config.go" | sed -n 's/.*default:"\([^"]*\)".*/\1/p')}) for topic in $TOPICS; do DEPENDENCIES+=("resource:confluent-$topic") diff --git a/spell-check.sh b/spell-check.sh index 0bf2577..e1419b4 100755 --- a/spell-check.sh +++ b/spell-check.sh @@ -102,7 +102,7 @@ EOF echo "$dictionary" > dictionary.text # Your string to check -string=$(cat $1) +string=$(cat "$1") echo "$string"