Skip to content
Open
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
13 changes: 0 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ on:
- '.gitignore'
- '.github/vale-styles/**'

pull_request:
branches:
- master
# Duplicated list because github does not support YAML anchors.
# https://github.com/actions/runner/issues/1182
paths-ignore:
- README.md
- 'docs/**'
- 'architecture/**'
- 'managed/**'
- '.gitignore'
- '.github/vale-styles/**'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/managed-java-checks.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/pull_check_upgrade.yml
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
76 changes: 76 additions & 0 deletions .github/workflows/pull_checks.yml
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
44 changes: 44 additions & 0 deletions .github/workflows/pull_lint.yml
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
'
44 changes: 0 additions & 44 deletions .github/workflows/yb-ctl-test.yml

This file was deleted.

3 changes: 3 additions & 0 deletions build-support/jenkins/yb-jenkins-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ EOT

echo "Jenkins Build script ${BASH_SOURCE[0]} is running"

echo "Intentional build failure"
exit 1

Comment on lines +42 to +44
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

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.

while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
Expand Down
Loading