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

Do not submit enhancements #8470

Merged
merged 6 commits into from
Jul 14, 2023
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
6 changes: 4 additions & 2 deletions .github/workflows/codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
# 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 }}
6 changes: 6 additions & 0 deletions changelog/v1.15.0-beta21/do-not-submit-fixes.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions ci/do-not-submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the comment above this line indicates that only go files are checked, but this is no longer true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also a comment at the top of the file

((file_count++))
line_number=1
while IFS= read -r line; do
Expand All @@ -40,4 +40,4 @@ if [[ "$OUTPUT" == "" ]]; then
else
echo "$OUTPUT"
exit -1
fi
fi