Skip to content
Closed
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
29 changes: 29 additions & 0 deletions .github/workflows/pull_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Check PR Title"

on:
pull_request:
types: [opened, edited]
paths-ignore:
- README.md
- 'docs/**'

jobs:
gh-pr-title:
runs-on: ubuntu-latest
steps:
- name: Check PR title
run: |
TITLE_RE='^(\[(BACKPORT )?(\d+(\.\d+)+)\])?'
TITLE_RE+='\[((#\d+(,#[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), and short description.)"
echo "::error :: [#12345,#12367] area: Cool feature xyz"
echo "::error :: [BACKPORT branch][#12345] area1,area2: Must have fix"
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."
exit 1
fi
41 changes: 41 additions & 0 deletions .github/workflows/pull_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Lint"

on:
pull_request:
types: [opened, synchronize, reopened, edited ]
paths-ignore:
- README.md
- 'docs/**'

jobs:
gh-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: 'false'

- name: Lint
run: |
docker run \
--user yugabyteci \
-v "$(pwd):$(pwd)" \
-w "$(pwd)" \
yugabyteci/yb_build_infra_ubuntu2204_x86_64:latest \
bash -c '
set -euo pipefail
export PATH=/usr/local/bin:$HOME/yb-cpplint/cpplint:$PATH
echo ::group::Lint
# Base reference should not be set for non-PR actions.
set -x
git config --global --add safe.directory $(pwd)
if [[ -n "${{ github.base_ref }}" ]]; then
echo Base reference: ${{ github.base_ref }}
git fetch origin ${{ github.base_ref }}
./build-support/lint.py --rev origin/${{ github.base_ref }}
else
echo No base reference: Skipping Lint Step
exit 1
fi
'
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 unconditional exit 1 statement will cause all Jenkins builds to fail immediately. This code appears to be for testing purposes and must be removed before merging to avoid breaking the CI/CD pipeline.

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