-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[BACKPORT 2025.2][DEVOPS-3735] ci: github actions for PR static check #31528
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
Open
svarnau
wants to merge
11
commits into
yugabyte:2025.2
Choose a base branch
from
svarnau:gh2025.2b
base: 2025.2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8c6d69c
Squashed commit of the following:
svarnau 6b7cbc1
[BACKPORT 2025.2][PLAT-20774][CLI]Fix access key issue in create prov…
Deepti-yb 477b328
[BACKPORT 2025.2][PLAT-20778] K8s YBA restore fails because kubectl b…
nkhogen d64f94c
[BACKPORT 2025.2][PLAT-20628]: Support bundle redaction is taking a l…
rajivkumar-dev a148537
[BACKPORT 2025.2][#31091] CDC: Move restart time when restart_lsn is …
Sumukh-Phalgaonkar ad3dabd
[BACKPORT 2025.2][PLAT-20108]the create backup schedule UI doesn't se…
haikarthikssk ea0a9e2
fix extract
svarnau 3546e06
Merge branch 'gh2025.2' into gh2025.2b
svarnau b3104d3
rematch index
svarnau 450d91f
first bp info
svarnau fe1a927
format of title checks
svarnau 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,76 @@ | ||
| 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, synchronize, reopened, edited ] | ||
| 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[2]}" | ||
| 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 | ||
| - name: Check Backport refernces | ||
| run: | | ||
| BACKPORT_RE='^\[BACKPORT ([0-9]+(\.[0-9]+)+)\]' | ||
| # Check for true backport, not just target branch in title. | ||
| if [[ "${{ github.event.pull_request.title }}" =~ $BACKPORT_RE ]]; then | ||
| COMMIT_RE='^Original commit: ([0-9a-f]+) / ([#D][0-9]+)' | ||
| body="${{ github.event.pull_request.body }}" | ||
| if ! echo "$body" | grep -qE "$COMMIT_RE"; then | ||
| echo "::error ::Backport PR must include original commit SHA and issue reference" | ||
| echo "::error ::in the PR description. Examples:" | ||
| echo "::error ::Original commit: 123abc / #12345" | ||
| echo "::error ::Original commits:" | ||
| echo "::error ::- 123abc / #12345" | ||
| echo "::error ::- 345def / #43555" | ||
| exit 1 | ||
| fi | ||
| # original_commit_re = Regexp.new('^Original commit(s)?:') | ||
| # commit_sha_revision_re = Regexp.new('(^- )?([0-9a-f]+) / ([#D][0-9]+)') | ||
| 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,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.
The intentional build failure and exit command will prevent the script from executing. This code appears to be for testing purposes and should be removed before merging this pull request.