From 8e4942ae739a92024db1d10440c0545af21f8900 Mon Sep 17 00:00:00 2001 From: Jacob Bohanon <57016439+jbohanon@users.noreply.github.com> Date: Fri, 14 Jul 2023 14:19:47 -0400 Subject: [PATCH] Do not submit enhancements (#8470) * check proto files; use newer changed-files action and don't try to check deleted files * add changelog * add comment for action docs * fix comment * codegen * remove deliberate failure --- .github/workflows/codegen.yaml | 6 ++++-- changelog/v1.15.0-beta21/do-not-submit-fixes.yaml | 6 ++++++ ci/do-not-submit.sh | 8 ++++---- 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 changelog/v1.15.0-beta21/do-not-submit-fixes.yaml diff --git a/.github/workflows/codegen.yaml b/.github/workflows/codegen.yaml index d332b0bcaa0..566b7462a7b 100644 --- a/.github/workflows/codegen.yaml +++ b/.github/workflows/codegen.yaml @@ -19,6 +19,8 @@ jobs: ./ci/check-generated-code.sh - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v35 + uses: tj-actions/changed-files@v37 - name: Check for DO_NOT_SUBMIT - run: ./ci/do-not-submit.sh ${{ steps.changed-files.outputs.all_modified_files }} \ No newline at end of file + # documentation for where we get the list of files to pass into the script: + # https://github.com/marketplace/actions/changed-files?version=v37#outputs + run: ./ci/do-not-submit.sh ${{ steps.changed-files.outputs.all_changed_files }} diff --git a/changelog/v1.15.0-beta21/do-not-submit-fixes.yaml b/changelog/v1.15.0-beta21/do-not-submit-fixes.yaml new file mode 100644 index 00000000000..e754c9ec7c7 --- /dev/null +++ b/changelog/v1.15.0-beta21/do-not-submit-fixes.yaml @@ -0,0 +1,6 @@ +changelog: +- type: NON_USER_FACING + description: >- + Check .proto files for DO_NOT_SUBMIT and do not attempt to check deleted files + skipCI-kube-tests:true + skipCI-docs-build:true diff --git a/ci/do-not-submit.sh b/ci/do-not-submit.sh index 736ffb9b020..c3730975875 100755 --- a/ci/do-not-submit.sh +++ b/ci/do-not-submit.sh @@ -4,7 +4,7 @@ # of those files for comments including the DO_NOT_SUBMIT keyword. If the # keyword is present, the script exits with -1. # -# This initial implementation only checks *.go files for single-line comments +# This implementation checks go.mod, *.go, and *.proto files for single-line comments # (i.e. starting with // rather than /* ... */). # # This script is invoked by .github/workflows/do-not-submit.yaml @@ -18,11 +18,11 @@ NEWLINE=$'\n' OUTPUT="" DO_NOT_SUBMIT_REGEX="[[:space:]]*//[[:space:]]*DO_NOT_SUBMIT" -# Keeps track of number of *.go files (as opposed to all files provided) +# Keeps track of number of go.mod, *.go, and *.proto files (as opposed to all files provided) file_count=0 for filename in "$@"; do # Only check *.go files for now - if [[ "$filename" == *".go" || "$filename" == *"go.mod" ]]; then + if [[ "$filename" == *".go" || "$filename" == *"go.mod" || "$filename" == *".proto" ]]; then ((file_count++)) line_number=1 while IFS= read -r line; do @@ -40,4 +40,4 @@ if [[ "$OUTPUT" == "" ]]; then else echo "$OUTPUT" exit -1 -fi \ No newline at end of file +fi