-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[2025.2][DEVOPS-3735] ci: github actions for PR static check #31526
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: "yb-gh" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, reopened, synchronize] | ||
| paths: | ||
| - 'src/**/*.proto' | ||
|
|
||
| jobs: | ||
| pr-upgrade: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check PR upgrade info | ||
| run: | | ||
| body="${{ github.event.pull_request.body }}" | ||
| UPG_RE='upgrade.*(downgrade|rollback)\ssafety' | ||
| # downcase the body for regex matching | ||
| if [[ ! "${body,,}" =~ $UPG_RE ]]; then | ||
| echo "::error ::PR description must include upgrade/rollback safety information" | ||
| echo "::error ::for any changes to .proto files." | ||
| echo "::error ::This should include whether the change is safe for rollback" | ||
| echo "::error ::and any special procedures needed." | ||
| echo "::error ::Example: Upgrade/Downgrade Safety: ..." | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: "yb-gh" | ||
|
|
||
| # The title/description checks are only really needed on open/edit events, | ||
| # But then it won't be available from head commit if the PR is synchronized. | ||
| on: | ||
| pull_request: | ||
| types: [opened, edited, synchronize, reopened] | ||
| paths-ignore: | ||
| - README.md | ||
| - 'docs/**' | ||
|
|
||
| jobs: | ||
| pr-title: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check PR title | ||
| run: | | ||
| TITLE_RE='^(\[(BACKPORT )?([0-9]+(\.[0-9]+)+)\])?' | ||
| TITLE_RE+='\[((#[0-9]+(,#[0-9]+)*)|([A-Z]+-[0-9]+(,[A-Z]+-[0-9]+)*))\]' | ||
| TITLE_RE+=' [a-zA-Z0-9_-]+(,[[a-zA-Z0-9_]-]+)*:' | ||
| TITLE_RE+=' \S.{8,98}\S$' | ||
|
|
||
| if [[ ! "${{ github.event.pull_request.title }}" =~ $TITLE_RE ]]; then | ||
| echo "::error ::PR title must include issue ID, code area (no extra whitespace)," | ||
| echo "::error :: and a short description." | ||
| echo "::error ::Issue referenced must be a github issue or YB-internal Jira ID" | ||
| echo "::error ::Short description must be less than 100 characters." | ||
| echo "::error ::Backport branch should be used only for non-master release branches." | ||
| echo "::error ::Examples:" | ||
| echo "::error :: [#12345,#12367] area: Cool feature xyz" | ||
| echo "::error :: [BACKPORT 2045.1][#12345] area1,area2: Must have fix" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Check Backport title | ||
| run: | | ||
| BACKPORT_RE='^(\[(BACKPORT )?([0-9]+(\.[0-9]+)+)\])' | ||
| if [[ "${{ github.base_ref }}" == "master" ]]; then | ||
| if [[ "${{ github.event.pull_request.title }}" =~ $BACKPORT_RE ]]; then | ||
| echo "::error ::PR title should not specify target branch if targeting master." | ||
| exit 1 | ||
| fi | ||
| else | ||
| if [[ "${{ github.event.pull_request.title }}" =~ $BACKPORT_RE ]]; then | ||
| BACKPORT_BRANCH="${BASH_REMATCH[1]}" | ||
| if [[ "${BACKPORT_BRANCH}" != "${{ github.base_ref }}" ]]; then | ||
| echo "::error ::Backport branch in title (${BACKPORT_BRANCH}) does not match" | ||
| echo "::error :: PR base ref (${{ github.base_ref }})." | ||
| exit 1 | ||
| fi | ||
| else | ||
| echo "::error ::PR title must begin with target release branch in square brackets." | ||
| echo "::error ::Examples:" | ||
| echo "::error :: [BACKPORT 2045.1][#12345] area1,area2: Must have fix from master" | ||
| echo "::error :: [2045.2][#12345] area: release-specific change" | ||
| exit 1 | ||
| fi | ||
| fi | ||
| # Check if there is backport commit/PR info in desc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: "yb-gh" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, edited ] | ||
| paths-ignore: | ||
| - README.md | ||
| - 'docs/**' | ||
|
|
||
| jobs: | ||
| pr-lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: 'false' | ||
|
|
||
| # TODO: Create GH custom image with pycodestyle & golint installed | ||
| - name: Lint | ||
| run: | | ||
| docker run \ | ||
| --user root \ | ||
| -v "$(pwd):$(pwd)" \ | ||
| -w "$(pwd)" \ | ||
| yugabyteci/yb_build_infra_ubuntu2204_x86_64:latest \ | ||
| bash -c 'chown -R yugabyteci .' | ||
| docker run \ | ||
| --user yugabyteci \ | ||
| -v "$(pwd):$(pwd)" \ | ||
| -w "$(pwd)" \ | ||
| yugabyteci/yb_build_infra_ubuntu2204_x86_64:latest \ | ||
| bash -c ' | ||
| set -euo pipefail | ||
| # Base reference should be set for PR actions. | ||
| set -x | ||
| if [[ -n "${{ github.base_ref }}" ]]; then | ||
| git fetch origin ${{ github.base_ref }} | ||
| ./build-support/lint.py --rev origin/${{ github.base_ref }} | ||
| else | ||
| echo No base reference to compare | ||
| exit 1 | ||
| fi | ||
| ' |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code causes an unconditional build failure and appears to be leftover debugging or testing code. It should be removed before merging.