diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 92d95bfe34c..b541376f4de 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -6,7 +6,7 @@ go.sum @ajm188 @deepthi @harshit-gangal @mattlord @rohit-nayak-ps @systay @froui
/.github/ISSUE_TEMPLATE/ @deepthi @frouioui @mattlord
/.github/workflows/ @deepthi @frouioui @mattlord @rohit-nayak-ps
/config/mycnf/ @deepthi @shlomi-noach @mattlord
-/doc/ @deepthi @frouioui @GuptaManan100 @rsajwani
+/doc/ @deepthi @frouioui @GuptaManan100
/docker/ @deepthi @derekperkins @dkhenry @mattlord @GuptaManan100 @frouioui
/examples/compose @shlomi-noach @GuptaManan100 @frouioui
/examples/demo @mattlord @rohit-nayak-ps
@@ -26,12 +26,12 @@ go.sum @ajm188 @deepthi @harshit-gangal @mattlord @rohit-nayak-ps @systay @froui
/go/test/endtoend/onlineddl @rohit-nayak-ps @shlomi-noach
/go/test/endtoend/messaging @mattlord @rohit-nayak-ps @derekperkins
/go/test/endtoend/vtgate @harshit-gangal @systay @frouioui
-/go/test/endtoend/vtorc @deepthi @shlomi-noach @GuptaManan100 @rsajwani
+/go/test/endtoend/vtorc @deepthi @shlomi-noach @GuptaManan100
/go/tools/ @frouioui @systay
/go/vt/dbconnpool @harshit-gangal @mattlord
/go/vt/discovery @deepthi @frouioui
/go/vt/discovery/*tablet_picker* @rohit-nayak-ps @mattlord
-/go/vt/mysqlctl @deepthi @mattlord @rsajwani
+/go/vt/mysqlctl @deepthi @mattlord
/go/vt/proto @deepthi @harshit-gangal @mattlord
/go/vt/proto/vtadmin @ajm188 @notfelineit
/go/vt/schema @mattlord @shlomi-noach
@@ -39,8 +39,8 @@ go.sum @ajm188 @deepthi @harshit-gangal @mattlord @rohit-nayak-ps @systay @froui
/go/vt/sqlparser @harshit-gangal @systay @GuptaManan100
/go/vt/srvtopo @deepthi @mattlord
/go/vt/sysvars @harshit-gangal @systay
-/go/vt/topo @deepthi @mattlord @rsajwani
-/go/vt/topotools @deepthi @mattlord @rsajwani
+/go/vt/topo @deepthi @mattlord
+/go/vt/topotools @deepthi @mattlord
/go/vt/vitessdriver @harshit-gangal
/go/vt/vtadmin @ajm188 @notfelineit @rohit-nayak-ps
/go/vt/vtctl @ajm188 @deepthi @rohit-nayak-ps
@@ -56,18 +56,18 @@ go.sum @ajm188 @deepthi @harshit-gangal @mattlord @rohit-nayak-ps @systay @froui
/go/vt/vtgate/endtoend/*vstream* @rohit-nayak-ps @mattlord
/go/vt/vtgate/planbuilder @harshit-gangal @systay @frouioui @GuptaManan100 @arthurschreiber
/go/vt/vtgate/*vstream* @rohit-nayak-ps @mattlord
-/go/vt/vtorc @deepthi @shlomi-noach @GuptaManan100 @rsajwani
+/go/vt/vtorc @deepthi @shlomi-noach @GuptaManan100
/go/vt/vttablet/*conn* @harshit-gangal @systay
/go/vt/vttablet/endtoend @harshit-gangal @mattlord @rohit-nayak-ps @systay
-/go/vt/vttablet/grpc* @ajm188 @rohit-nayak-ps @rsajwani @shlomi-noach @harshit-gangal
+/go/vt/vttablet/grpc* @ajm188 @rohit-nayak-ps @shlomi-noach @harshit-gangal
/go/vt/vttablet/onlineddl @mattlord @rohit-nayak-ps @shlomi-noach
/go/vt/vttablet/queryservice @harshit-gangal @systay
-/go/vt/vttablet/tabletmanager @deepthi @GuptaManan100 @rohit-nayak-ps @rsajwani @shlomi-noach
+/go/vt/vttablet/tabletmanager @deepthi @GuptaManan100 @rohit-nayak-ps @shlomi-noach
/go/vt/vttablet/tabletmanager/vreplication @rohit-nayak-ps @mattlord
/go/vt/vttablet/tabletmanager/vstreamer @rohit-nayak-ps @mattlord
/go/vt/vttablet/tabletserver* @harshit-gangal @systay @shlomi-noach @rohit-nayak-ps
/go/vt/vttablet/tabletserver/messager @mattlord @rohit-nayak-ps @derekperkins
-/go/vt/vttablet/*tmclient* @ajm188 @GuptaManan100 @rohit-nayak-ps @rsajwani @shlomi-noach
+/go/vt/vttablet/*tmclient* @ajm188 @GuptaManan100 @rohit-nayak-ps @shlomi-noach
/go/vt/vttablet/vexec @mattlord @rohit-nayak-ps @shlomi-noach
/go/vt/wrangler @deepthi @mattlord @rohit-nayak-ps
/go/vt/workflow @mattlord @rohit-nayak-ps
diff --git a/.github/workflows/assign_milestone.yml b/.github/workflows/assign_milestone.yml
new file mode 100644
index 00000000000..3a81bc4067c
--- /dev/null
+++ b/.github/workflows/assign_milestone.yml
@@ -0,0 +1,30 @@
+name: Assign Milestone
+
+on:
+ pull_request_target:
+ types: [opened]
+
+permissions: read-all
+
+env:
+ GH_TOKEN: ${{ github.token }}
+
+jobs:
+ build:
+ name: Assign Milestone
+ runs-on: ubuntu-22.04
+ permissions:
+ pull-requests: write
+
+ steps:
+ - name: Set up Go
+ uses: actions/setup-go@v4
+ with:
+ go-version: 1.21.1
+
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ - name: Assign Milestone
+ run: |
+ gh pr edit ${{ github.event.number }} --milestone "v$(sed -n 's/.*versionName.*\"\([[:digit:]\.]*\).*\"/\1/p' ./go/vt/servenv/version.go)"
diff --git a/.github/workflows/check_label.yml b/.github/workflows/check_label.yml
index df9e5173dd8..c3c89273df8 100644
--- a/.github/workflows/check_label.yml
+++ b/.github/workflows/check_label.yml
@@ -7,6 +7,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Check Pull Request labels')
cancel-in-progress: true
+permissions: read-all
+
jobs:
check_pull_request_labels:
name: Check Pull Request labels
@@ -17,7 +19,7 @@ jobs:
- name: Release Notes label
run: |
if [[ "${{contains( github.event.pull_request.labels.*.name, 'release notes (needs details)')}}" == "true" ]]; then
- echo The "release notes (needs details)" label is set. The changes made in this Pull Request need to be documented in the release notes summary "('./doc/releasenotes/16_0_0_summary.md')". Once documented, the "release notes (needs details)" label can be removed.
+ echo The "release notes (needs details)" label is set. The changes made in this Pull Request need to be documented in the release notes summary "('./changelog/17.0/17.0.0/summary.md')". Once documented, the "release notes (needs details)" label can be removed.
exit 1
fi
@@ -42,7 +44,7 @@ jobs:
exit 1
fi
- - name: Check NeedsWebsiteDocsUpdate and NeedsDescriptionUpdate are off
+ - name: Check all Needs labels are off
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
@@ -62,6 +64,10 @@ jobs:
echo "Expecting PR to not have the NeedsWebsiteDocsUpdate label, please update the documentation and remove the label."
exit 1
fi
+ if cat ${LABELS_JSON} | jq -r '.[].name ' | grep -q 'NeedsIssue' ; then
+ echo "Expecting PR to not have the NeedsIssue label; please create a linked issue and remove the label."
+ exit 1
+ fi
- name: Do Not Merge label
diff --git a/.github/workflows/check_make_vtadmin_authz_testgen.yml b/.github/workflows/check_make_vtadmin_authz_testgen.yml
index dac6d60996e..a61169c94e1 100644
--- a/.github/workflows/check_make_vtadmin_authz_testgen.yml
+++ b/.github/workflows/check_make_vtadmin_authz_testgen.yml
@@ -1,7 +1,9 @@
name: check_make_vtadmin_authz_testgen
on: [push, pull_request]
-jobs:
+permissions: read-all
+
+jobs:
build:
name: Check Make vtadmin_authz_testgen
runs-on: ubuntu-22.04
@@ -45,10 +47,10 @@ jobs:
- '.github/workflows/check_make_vtadmin_authz_testgen.yml'
- name: Set up Go
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.vtadmin_changes == 'true'
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.vtadmin_changes == 'true'
diff --git a/.github/workflows/check_make_vtadmin_web_proto.yml b/.github/workflows/check_make_vtadmin_web_proto.yml
index 2ff3144ed85..12d8da13f7c 100644
--- a/.github/workflows/check_make_vtadmin_web_proto.yml
+++ b/.github/workflows/check_make_vtadmin_web_proto.yml
@@ -1,7 +1,9 @@
name: check_make_vtadmin_web_proto
on: [push, pull_request]
-jobs:
+permissions: read-all
+
+jobs:
build:
name: Check Make VTAdmin Web Proto
runs-on: ubuntu-22.04
@@ -47,17 +49,17 @@ jobs:
- '.github/workflows/check_make_vtadmin_web_proto.yml'
- name: Set up Go
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true'
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Setup Node
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true'
uses: actions/setup-node@v3
with:
# node-version should match package.json
- node-version: '16.19.0'
+ node-version: '18.16.0'
- name: Install npm dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.proto_changes == 'true'
diff --git a/.github/workflows/close_stale_pull_requests.yml b/.github/workflows/close_stale_pull_requests.yml
index 971fcc39f06..e0201c0104b 100644
--- a/.github/workflows/close_stale_pull_requests.yml
+++ b/.github/workflows/close_stale_pull_requests.yml
@@ -5,12 +5,14 @@ on:
workflow_dispatch: {}
-permissions:
- pull-requests: write
+permissions: read-all
jobs:
close_stale_pull_requests:
runs-on: ubuntu-22.04
+ permissions:
+ pull-requests: write
+
steps:
- uses: actions/stale@v5
with:
diff --git a/.github/workflows/cluster_endtoend_12.yml b/.github/workflows/cluster_endtoend_12.yml
index 47d8315fde4..0fb288573be 100644
--- a/.github/workflows/cluster_endtoend_12.yml
+++ b/.github/workflows/cluster_endtoend_12.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (12)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (12)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard 12 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_13.yml b/.github/workflows/cluster_endtoend_13.yml
index 63b00f89a3e..4878167a91f 100644
--- a/.github/workflows/cluster_endtoend_13.yml
+++ b/.github/workflows/cluster_endtoend_13.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (13)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (13)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard 13 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_15.yml b/.github/workflows/cluster_endtoend_15.yml
index 42e5d1c91d1..ba78ff2ab8d 100644
--- a/.github/workflows/cluster_endtoend_15.yml
+++ b/.github/workflows/cluster_endtoend_15.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (15)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (15)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard 15 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_18.yml b/.github/workflows/cluster_endtoend_18.yml
index bf70e99fa0b..af5df2313cd 100644
--- a/.github/workflows/cluster_endtoend_18.yml
+++ b/.github/workflows/cluster_endtoend_18.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (18)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (18)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -107,7 +116,7 @@ jobs:
make tools
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -116,7 +125,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -127,16 +136,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard 18 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_21.yml b/.github/workflows/cluster_endtoend_21.yml
index 1705e38762a..30b1372399d 100644
--- a/.github/workflows/cluster_endtoend_21.yml
+++ b/.github/workflows/cluster_endtoend_21.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (21)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (21)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard 21 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_22.yml b/.github/workflows/cluster_endtoend_22.yml
index e1decec0259..266352f7436 100644
--- a/.github/workflows/cluster_endtoend_22.yml
+++ b/.github/workflows/cluster_endtoend_22.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (22)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (22)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard 22 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_backup_pitr.yml b/.github/workflows/cluster_endtoend_backup_pitr.yml
index 1f913eb801e..5983e95761d 100644
--- a/.github/workflows/cluster_endtoend_backup_pitr.yml
+++ b/.github/workflows/cluster_endtoend_backup_pitr.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (backup_pitr)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (backup_pitr)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard backup_pitr | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_backup_pitr_mysql57.yml b/.github/workflows/cluster_endtoend_backup_pitr_mysql57.yml
index 35f6c6c925d..ea8020f519a 100644
--- a/.github/workflows/cluster_endtoend_backup_pitr_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_backup_pitr_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (backup_pitr) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (backup_pitr) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -113,7 +122,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -122,7 +131,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -133,16 +142,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard backup_pitr | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml b/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml
similarity index 68%
rename from .github/workflows/cluster_endtoend_tabletmanager_throttler.yml
rename to .github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml
index 02c9ea87657..e11ae259062 100644
--- a/.github/workflows/cluster_endtoend_tabletmanager_throttler.yml
+++ b/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml
@@ -1,11 +1,13 @@
# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"
-name: Cluster (tabletmanager_throttler)
+name: Cluster (backup_pitr_xtrabackup)
on: [push, pull_request]
concurrency:
- group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (tabletmanager_throttler)')
+ group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (backup_pitr_xtrabackup)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -13,8 +15,8 @@ env:
jobs:
build:
- name: Run endtoend tests on Cluster (tabletmanager_throttler)
- runs-on: ubuntu-22.04
+ name: Run endtoend tests on Cluster (backup_pitr_xtrabackup)
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -56,13 +65,13 @@ jobs:
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- - '.github/workflows/cluster_endtoend_tabletmanager_throttler.yml'
+ - '.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -82,15 +91,16 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
- # Get key to latest MySQL repo
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
- # Setup MySQL 8.0
- wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb
- echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections
- sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config*
+ # Setup Percona Server for MySQL 8.0
sudo apt-get update
+ sudo apt-get install -y lsb-release gnupg2 curl
+ wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
+ sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
+ sudo percona-release setup ps80
+ sudo apt-get update
+
# Install everything else we need, and configure
- sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5
+ sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils libncurses5
sudo service mysql stop
sudo service etcd stop
@@ -101,8 +111,10 @@ jobs:
# install JUnit report formatter
go install github.com/vitessio/go-junit-report@HEAD
+ sudo apt-get install -y percona-xtrabackup-80 lz4
+
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +123,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +134,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
- eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_throttler | tee -a output.txt | go-junit-report -set-exit-code > report.xml
+ eatmydata -- go run test.go -docker=false -follow -shard backup_pitr_xtrabackup | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup_mysql57.yml b/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup_mysql57.yml
new file mode 100644
index 00000000000..866af80713c
--- /dev/null
+++ b/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup_mysql57.yml
@@ -0,0 +1,175 @@
+# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"
+
+name: Cluster (backup_pitr_xtrabackup) mysql57
+on: [push, pull_request]
+concurrency:
+ group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (backup_pitr_xtrabackup) mysql57')
+ cancel-in-progress: true
+
+permissions: read-all
+
+env:
+ LAUNCHABLE_ORGANIZATION: "vitess"
+ LAUNCHABLE_WORKSPACE: "vitess-app"
+ GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
+
+ # This is used if we need to pin the xtrabackup version used in tests.
+ # If this is NOT set then the latest version available will be used.
+ #XTRABACKUP_VERSION: "2.4.24-1"
+
+jobs:
+ build:
+ name: Run endtoend tests on Cluster (backup_pitr_xtrabackup) mysql57
+ runs-on: gh-hosted-runners-4cores-1
+
+ steps:
+ - name: Skip CI
+ run: |
+ if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
+ echo "skipping CI due to the 'Skip CI' label"
+ exit 1
+ fi
+
+ - name: Check if workflow needs to be skipped
+ id: skip-workflow
+ run: |
+ skip='false'
+ if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then
+ skip='true'
+ fi
+ echo Skip ${skip}
+ echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
+ - name: Check out code
+ if: steps.skip-workflow.outputs.skip-workflow == 'false'
+ uses: actions/checkout@v3
+
+ - name: Check for changes in relevant files
+ if: steps.skip-workflow.outputs.skip-workflow == 'false'
+ uses: frouioui/paths-filter@main
+ id: changes
+ with:
+ token: ''
+ filters: |
+ end_to_end:
+ - 'go/**/*.go'
+ - 'test.go'
+ - 'Makefile'
+ - 'build.env'
+ - 'go.sum'
+ - 'go.mod'
+ - 'proto/*.proto'
+ - 'tools/**'
+ - 'config/**'
+ - 'bootstrap.sh'
+ - '.github/workflows/cluster_endtoend_backup_pitr_xtrabackup_mysql57.yml'
+
+ - name: Set up Go
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ uses: actions/setup-go@v4
+ with:
+ go-version: 1.21.1
+
+ - name: Set up python
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ uses: actions/setup-python@v4
+
+ - name: Tune the OS
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ run: |
+ sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
+ # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
+ echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
+ sudo sysctl -p /etc/sysctl.conf
+
+ - name: Get dependencies
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ run: |
+ sudo apt-get update
+
+ # Uninstall any previously installed MySQL first
+ sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
+ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
+
+ sudo systemctl stop apparmor
+ sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common
+ sudo apt-get -y autoremove
+ sudo apt-get -y autoclean
+ sudo deluser mysql
+ sudo rm -rf /var/lib/mysql
+ sudo rm -rf /etc/mysql
+
+ # Get key to latest MySQL repo
+ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
+
+ wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb
+ # Bionic packages are still compatible for Jammy since there's no MySQL 5.7
+ # packages for Jammy.
+ echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections
+ echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections
+ sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config*
+ sudo apt-get update
+ sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5
+
+ sudo apt-get install -y make unzip g++ etcd curl git wget eatmydata
+ sudo service mysql stop
+ sudo service etcd stop
+
+ # install JUnit report formatter
+ go install github.com/vitessio/go-junit-report@HEAD
+
+ wget "https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb"
+ sudo apt-get install -y gnupg2
+ sudo dpkg -i "percona-release_latest.$(lsb_release -sc)_all.deb"
+ sudo apt-get update
+ if [[ -n $XTRABACKUP_VERSION ]]; then
+ debfile="percona-xtrabackup-24_$XTRABACKUP_VERSION.$(lsb_release -sc)_amd64.deb"
+ wget "https://repo.percona.com/pxb-24/apt/pool/main/p/percona-xtrabackup-24/$debfile"
+ sudo apt install -y "./$debfile"
+ else
+ sudo apt-get install -y percona-xtrabackup-24
+ fi
+
+ - name: Setup launchable dependencies
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
+ run: |
+ # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
+ pip3 install --user launchable~=1.0 > /dev/null
+
+ # verify that launchable setup is all correct.
+ launchable verify || true
+
+ # Tell Launchable about the build you are producing and testing
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
+
+ - name: Run cluster endtoend test
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ timeout-minutes: 45
+ run: |
+ # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
+ # which musn't be more than 107 characters long.
+ export VTDATAROOT="/tmp/"
+ source build.env
+
+ set -exo pipefail
+
+ # run the tests however you normally do, then produce a JUnit XML file
+ eatmydata -- go run test.go -docker=false -follow -shard backup_pitr_xtrabackup | tee -a output.txt | go-junit-report -set-exit-code > report.xml
+
+ - name: Print test output and Record test result in launchable if PR is not a draft
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
+ run: |
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
+
+ # print test output
+ cat output.txt
diff --git a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml
index a6739b71f2c..3a411e90238 100644
--- a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml
+++ b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (ers_prs_newfeatures_heavy)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (ers_prs_newfeatures_heavy)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -145,11 +154,13 @@ jobs:
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard ers_prs_newfeatures_heavy | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_mysql80.yml b/.github/workflows/cluster_endtoend_mysql80.yml
index 7f27203c5ce..5ab2697ef52 100644
--- a/.github/workflows/cluster_endtoend_mysql80.yml
+++ b/.github/workflows/cluster_endtoend_mysql80.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (mysql80)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (mysql80)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard mysql80 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_mysql_server_vault.yml b/.github/workflows/cluster_endtoend_mysql_server_vault.yml
index 9a2c3d198ae..462838b2ef9 100644
--- a/.github/workflows/cluster_endtoend_mysql_server_vault.yml
+++ b/.github/workflows/cluster_endtoend_mysql_server_vault.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (mysql_server_vault)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (mysql_server_vault)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -107,7 +116,7 @@ jobs:
make tools
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -116,7 +125,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -127,16 +136,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard mysql_server_vault | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_ghost.yml b/.github/workflows/cluster_endtoend_onlineddl_ghost.yml
index 50ca5315c86..511865c710c 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_ghost.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_ghost.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_ghost)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_ghost)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -103,7 +112,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -112,7 +121,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -123,16 +132,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_ghost | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql57.yml
index a073589625f..252e73a7cd6 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_ghost_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_ghost) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_ghost) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -114,7 +123,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -123,7 +132,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -134,16 +143,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_ghost | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert.yml b/.github/workflows/cluster_endtoend_onlineddl_revert.yml
index f3479168002..307d0e8e81d 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_revert.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_revert.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_revert)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_revert)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -103,7 +112,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -112,7 +121,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -123,16 +132,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_revert | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql57.yml
index 33c9436d62a..5ba94452b85 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_revert_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_revert_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_revert) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_revert) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -114,7 +123,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -123,7 +132,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -134,16 +143,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_revert | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml
index 45cfa768821..c30dd0f71f5 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_scheduler)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_scheduler)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -103,7 +112,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -112,7 +121,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -123,16 +132,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_scheduler | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql57.yml
index 4f0c1a5b698..485ac7667ad 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_scheduler) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_scheduler) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -114,7 +123,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -123,7 +132,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -134,16 +143,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_scheduler | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml
index ae982540c38..ae7d17bc965 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -103,7 +112,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -112,7 +121,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -123,16 +132,22 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml
index 45d6ae0f029..1639f26e106 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -114,7 +123,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -123,7 +132,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -134,16 +143,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml
index 02236a6f4a4..3221e35099f 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl_stress)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl_stress)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -103,7 +112,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -112,7 +121,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -123,16 +132,22 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_stress | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql57.yml
index 42d83f85756..7f1fd124c3d 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl_stress) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl_stress) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -114,7 +123,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -123,7 +132,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -134,16 +143,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_stress | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml
index ad52f5c396c..cd7e3ccfcee 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl_stress_suite)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl_stress_suite)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -103,7 +112,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -112,7 +121,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -123,16 +132,22 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_stress_suite | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql57.yml
index 6321e28069a..e0a83f18ef7 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl_stress_suite) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl_stress_suite) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -114,7 +123,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -123,7 +132,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -134,16 +143,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_stress_suite | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml
index 0c682296e9c..19ab02ac2dd 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl_suite)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl_suite)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -103,7 +112,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -112,7 +121,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -123,16 +132,22 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_suite | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql57.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql57.yml
index fb4ab1fd4d2..d28e472cd4b 100644
--- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (onlineddl_vrepl_suite) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (onlineddl_vrepl_suite) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -114,7 +123,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -123,7 +132,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -134,16 +143,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard onlineddl_vrepl_suite | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml
index 49c0a3e0d48..c415d1e131c 100644
--- a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml
+++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (schemadiff_vrepl)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (schemadiff_vrepl)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -103,7 +112,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -112,7 +121,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -123,16 +132,22 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard schemadiff_vrepl | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql57.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql57.yml
index 7510e14aa4c..28319debd01 100644
--- a/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (schemadiff_vrepl) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (schemadiff_vrepl) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -61,9 +70,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -114,7 +123,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -123,7 +132,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -134,16 +143,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard schemadiff_vrepl | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml
index 21a0369083d..838f476f463 100644
--- a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml
+++ b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (tabletmanager_consul)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (tabletmanager_consul)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -107,7 +116,7 @@ jobs:
make tools
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -116,7 +125,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -127,16 +136,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_consul | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml
index 53e26a5e1a7..e050c82ec0c 100644
--- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml
+++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (tabletmanager_tablegc)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (tabletmanager_tablegc)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_tablegc | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql57.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql57.yml
index 7ee6aaa46a3..cb29cc5d7ad 100644
--- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (tabletmanager_tablegc) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (tabletmanager_tablegc) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -113,7 +122,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -122,7 +131,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -133,16 +142,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_tablegc | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml b/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml
index 20b45988bdf..2d9ccd8cbbd 100644
--- a/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml
+++ b/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (tabletmanager_throttler_topo)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (tabletmanager_throttler_topo)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_throttler_topo | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_topo_connection_cache.yml b/.github/workflows/cluster_endtoend_topo_connection_cache.yml
index ce64d2ff3b6..2e8201a6044 100644
--- a/.github/workflows/cluster_endtoend_topo_connection_cache.yml
+++ b/.github/workflows/cluster_endtoend_topo_connection_cache.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (topo_connection_cache)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (topo_connection_cache)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard topo_connection_cache | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml
index ba4d149a711..c0001a6aaea 100644
--- a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml
+++ b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vreplication_across_db_versions)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vreplication_across_db_versions)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -142,14 +151,20 @@ jobs:
slow-query-log=OFF
EOF
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vreplication_across_db_versions | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vreplication_basic.yml b/.github/workflows/cluster_endtoend_vreplication_basic.yml
index 3e6a33ae7df..fe0f08136ef 100644
--- a/.github/workflows/cluster_endtoend_vreplication_basic.yml
+++ b/.github/workflows/cluster_endtoend_vreplication_basic.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vreplication_basic)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vreplication_basic)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -142,14 +151,20 @@ jobs:
slow-query-log=OFF
EOF
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vreplication_basic | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml
index 9ab7c51f43e..3c010b6d558 100644
--- a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml
+++ b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vreplication_cellalias)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vreplication_cellalias)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -142,14 +151,20 @@ jobs:
slow-query-log=OFF
EOF
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vreplication_cellalias | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml b/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml
index 93d71284166..5291a7aaf28 100644
--- a/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml
+++ b/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vreplication_migrate_vdiff2_convert_tz)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vreplication_migrate_vdiff2_convert_tz)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -142,14 +151,20 @@ jobs:
slow-query-log=OFF
EOF
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vreplication_migrate_vdiff2_convert_tz | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vreplication_multicell.yml b/.github/workflows/cluster_endtoend_vreplication_multicell.yml
index ed1050fbde2..8bb26aea060 100644
--- a/.github/workflows/cluster_endtoend_vreplication_multicell.yml
+++ b/.github/workflows/cluster_endtoend_vreplication_multicell.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vreplication_multicell)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vreplication_multicell)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -142,14 +151,20 @@ jobs:
slow-query-log=OFF
EOF
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vreplication_multicell | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml b/.github/workflows/cluster_endtoend_vreplication_partial_movetables_basic.yml
similarity index 69%
rename from .github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml
rename to .github/workflows/cluster_endtoend_vreplication_partial_movetables_basic.yml
index 2deb7b3c8f5..681c038a3f2 100644
--- a/.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml
+++ b/.github/workflows/cluster_endtoend_vreplication_partial_movetables_basic.yml
@@ -1,11 +1,13 @@
# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"
-name: Cluster (tabletmanager_throttler_custom_config)
+name: Cluster (vreplication_partial_movetables_basic)
on: [push, pull_request]
concurrency:
- group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (tabletmanager_throttler_custom_config)')
+ group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vreplication_partial_movetables_basic)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -13,8 +15,8 @@ env:
jobs:
build:
- name: Run endtoend tests on Cluster (tabletmanager_throttler_custom_config)
- runs-on: ubuntu-22.04
+ name: Run endtoend tests on Cluster (vreplication_partial_movetables_basic)
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -56,13 +65,13 @@ jobs:
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- - '.github/workflows/cluster_endtoend_tabletmanager_throttler_custom_config.yml'
+ - '.github/workflows/cluster_endtoend_vreplication_partial_movetables_basic.yml'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,40 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
-
+ set -exo pipefail
+
+ # Increase our open file descriptor limit as we could hit this
+ ulimit -n 65536
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ innodb_buffer_pool_dump_at_shutdown=OFF
+ innodb_buffer_pool_in_core_file=OFF
+ innodb_buffer_pool_load_at_startup=OFF
+ innodb_buffer_pool_size=64M
+ innodb_doublewrite=OFF
+ innodb_flush_log_at_trx_commit=0
+ innodb_flush_method=O_DIRECT
+ innodb_numa_interleave=ON
+ innodb_adaptive_hash_index=OFF
+ sync_binlog=0
+ sync_relay_log=0
+ performance_schema=OFF
+ slow-query-log=OFF
+ EOF
+
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
- eatmydata -- go run test.go -docker=false -follow -shard tabletmanager_throttler_custom_config | tee -a output.txt | go-junit-report -set-exit-code > report.xml
+ eatmydata -- go run test.go -docker=false -follow -shard vreplication_partial_movetables_basic | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vreplication_partial_movetables_sequences.yml b/.github/workflows/cluster_endtoend_vreplication_partial_movetables_sequences.yml
new file mode 100644
index 00000000000..27ed797032d
--- /dev/null
+++ b/.github/workflows/cluster_endtoend_vreplication_partial_movetables_sequences.yml
@@ -0,0 +1,170 @@
+# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"
+
+name: Cluster (vreplication_partial_movetables_sequences)
+on: [push, pull_request]
+concurrency:
+ group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vreplication_partial_movetables_sequences)')
+ cancel-in-progress: true
+
+permissions: read-all
+
+env:
+ LAUNCHABLE_ORGANIZATION: "vitess"
+ LAUNCHABLE_WORKSPACE: "vitess-app"
+ GITHUB_PR_HEAD_SHA: "${{ github.event.pull_request.head.sha }}"
+
+jobs:
+ build:
+ name: Run endtoend tests on Cluster (vreplication_partial_movetables_sequences)
+ runs-on: gh-hosted-runners-4cores-1
+
+ steps:
+ - name: Skip CI
+ run: |
+ if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
+ echo "skipping CI due to the 'Skip CI' label"
+ exit 1
+ fi
+
+ - name: Check if workflow needs to be skipped
+ id: skip-workflow
+ run: |
+ skip='false'
+ if [[ "${{github.event.pull_request}}" == "" ]] && [[ "${{github.ref}}" != "refs/heads/main" ]] && [[ ! "${{github.ref}}" =~ ^refs/heads/release-[0-9]+\.[0-9]$ ]] && [[ ! "${{github.ref}}" =~ "refs/tags/.*" ]]; then
+ skip='true'
+ fi
+ echo Skip ${skip}
+ echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
+ - name: Check out code
+ if: steps.skip-workflow.outputs.skip-workflow == 'false'
+ uses: actions/checkout@v3
+
+ - name: Check for changes in relevant files
+ if: steps.skip-workflow.outputs.skip-workflow == 'false'
+ uses: frouioui/paths-filter@main
+ id: changes
+ with:
+ token: ''
+ filters: |
+ end_to_end:
+ - 'go/**/*.go'
+ - 'test.go'
+ - 'Makefile'
+ - 'build.env'
+ - 'go.sum'
+ - 'go.mod'
+ - 'proto/*.proto'
+ - 'tools/**'
+ - 'config/**'
+ - 'bootstrap.sh'
+ - '.github/workflows/cluster_endtoend_vreplication_partial_movetables_sequences.yml'
+
+ - name: Set up Go
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ uses: actions/setup-go@v4
+ with:
+ go-version: 1.21.1
+
+ - name: Set up python
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ uses: actions/setup-python@v4
+
+ - name: Tune the OS
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ run: |
+ # Limit local port range to not use ports that overlap with server side
+ # ports that we listen on.
+ sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
+ # Increase the asynchronous non-blocking I/O. More information at https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_use_native_aio
+ echo "fs.aio-max-nr = 1048576" | sudo tee -a /etc/sysctl.conf
+ sudo sysctl -p /etc/sysctl.conf
+
+ - name: Get dependencies
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ run: |
+
+ # Get key to latest MySQL repo
+ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
+ # Setup MySQL 8.0
+ wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.24-1_all.deb
+ echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections
+ sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config*
+ sudo apt-get update
+ # Install everything else we need, and configure
+ sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5
+
+ sudo service mysql stop
+ sudo service etcd stop
+ sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
+ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
+ go mod download
+
+ # install JUnit report formatter
+ go install github.com/vitessio/go-junit-report@HEAD
+
+ - name: Setup launchable dependencies
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
+ run: |
+ # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
+ pip3 install --user launchable~=1.0 > /dev/null
+
+ # verify that launchable setup is all correct.
+ launchable verify || true
+
+ # Tell Launchable about the build you are producing and testing
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
+
+ - name: Run cluster endtoend test
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ timeout-minutes: 45
+ run: |
+ # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
+ # which musn't be more than 107 characters long.
+ export VTDATAROOT="/tmp/"
+ source build.env
+
+ set -exo pipefail
+
+ # Increase our open file descriptor limit as we could hit this
+ ulimit -n 65536
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ innodb_buffer_pool_dump_at_shutdown=OFF
+ innodb_buffer_pool_in_core_file=OFF
+ innodb_buffer_pool_load_at_startup=OFF
+ innodb_buffer_pool_size=64M
+ innodb_doublewrite=OFF
+ innodb_flush_log_at_trx_commit=0
+ innodb_flush_method=O_DIRECT
+ innodb_numa_interleave=ON
+ innodb_adaptive_hash_index=OFF
+ sync_binlog=0
+ sync_relay_log=0
+ performance_schema=OFF
+ slow-query-log=OFF
+ EOF
+
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
+ # run the tests however you normally do, then produce a JUnit XML file
+ eatmydata -- go run test.go -docker=false -follow -shard vreplication_partial_movetables_sequences | tee -a output.txt | go-junit-report -set-exit-code > report.xml
+
+ - name: Print test output and Record test result in launchable if PR is not a draft
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
+ run: |
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
+
+ # print test output
+ cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vreplication_v2.yml b/.github/workflows/cluster_endtoend_vreplication_v2.yml
index a1a478aa982..7e389bc7b07 100644
--- a/.github/workflows/cluster_endtoend_vreplication_v2.yml
+++ b/.github/workflows/cluster_endtoend_vreplication_v2.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vreplication_v2)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vreplication_v2)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -142,14 +151,20 @@ jobs:
slow-query-log=OFF
EOF
+ cat <<-EOF>>./config/mycnf/mysql80.cnf
+ binlog-transaction-compression=ON
+ EOF
+
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vreplication_v2 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vstream_failover.yml b/.github/workflows/cluster_endtoend_vstream_failover.yml
index cdf5c899ddc..f2c459605b7 100644
--- a/.github/workflows/cluster_endtoend_vstream_failover.yml
+++ b/.github/workflows/cluster_endtoend_vstream_failover.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vstream_failover)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vstream_failover)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vstream_failover | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml b/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml
index 978c92b4a30..524930341b0 100644
--- a/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml
+++ b/.github/workflows/cluster_endtoend_vstream_stoponreshard_false.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vstream_stoponreshard_false)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vstream_stoponreshard_false)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vstream_stoponreshard_false | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml b/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml
index 983ad94e794..04054cb5ced 100644
--- a/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml
+++ b/.github/workflows/cluster_endtoend_vstream_stoponreshard_true.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vstream_stoponreshard_true)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vstream_stoponreshard_true)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vstream_stoponreshard_true | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml b/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml
index f62019138cb..29ebd2fec74 100644
--- a/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml
+++ b/.github/workflows/cluster_endtoend_vstream_with_keyspaces_to_watch.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vstream_with_keyspaces_to_watch)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vstream_with_keyspaces_to_watch)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vstream_with_keyspaces_to_watch | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtbackup.yml b/.github/workflows/cluster_endtoend_vtbackup.yml
index da3c849bc04..6a615f23bb2 100644
--- a/.github/workflows/cluster_endtoend_vtbackup.yml
+++ b/.github/workflows/cluster_endtoend_vtbackup.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtbackup)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtbackup)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtbackup | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml
index 697e3d31780..d8dcfc50768 100644
--- a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml
+++ b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtctlbackup_sharded_clustertest_heavy)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtctlbackup_sharded_clustertest_heavy)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -145,11 +154,13 @@ jobs:
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtctlbackup_sharded_clustertest_heavy | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml
index 83e91d390c4..0cdc30bc676 100644
--- a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_concurrentdml)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_concurrentdml)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_concurrentdml | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_gen4.yml b/.github/workflows/cluster_endtoend_vtgate_gen4.yml
index 7c39d688bcc..8e298848a1a 100644
--- a/.github/workflows/cluster_endtoend_vtgate_gen4.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_gen4.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_gen4)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_gen4)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_gen4 | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml
index a69c7634137..b525f3f6e4f 100644
--- a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_general_heavy)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_general_heavy)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -145,11 +154,13 @@ jobs:
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_general_heavy | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_godriver.yml b/.github/workflows/cluster_endtoend_vtgate_godriver.yml
index 2bf75e96788..090d740daa2 100644
--- a/.github/workflows/cluster_endtoend_vtgate_godriver.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_godriver.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_godriver)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_godriver)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_godriver | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml b/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml
index 209f26943e8..261116f5938 100644
--- a/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_partial_keyspace)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_partial_keyspace)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_partial_keyspace -partial-keyspace=true | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_queries.yml b/.github/workflows/cluster_endtoend_vtgate_queries.yml
index 2ba81844503..6d7e842df82 100644
--- a/.github/workflows/cluster_endtoend_vtgate_queries.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_queries.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_queries)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_queries)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_queries | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml
index 55dd4c3c34b..0a9b8b36c8c 100644
--- a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_readafterwrite)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_readafterwrite)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_readafterwrite | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml
index d5e90674bc5..e440f38895d 100644
--- a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_reservedconn)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_reservedconn)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_reservedconn | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_schema.yml b/.github/workflows/cluster_endtoend_vtgate_schema.yml
index 07f06f06452..48c3dda15b1 100644
--- a/.github/workflows/cluster_endtoend_vtgate_schema.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_schema.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_schema)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_schema)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_schema | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml
index 57ff927fb7d..ca97a400efe 100644
--- a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_schema_tracker)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_schema_tracker)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_schema_tracker | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml
index e81c473ecc3..7689c02e796 100644
--- a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_tablet_healthcheck_cache)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_tablet_healthcheck_cache)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_tablet_healthcheck_cache | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_topo.yml b/.github/workflows/cluster_endtoend_vtgate_topo.yml
index bdbf6b09c6a..dc1c634d634 100644
--- a/.github/workflows/cluster_endtoend_vtgate_topo.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_topo.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_topo)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_topo)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_topo | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml
index 36cc1319b04..28c35af0137 100644
--- a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_topo_consul)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_topo_consul)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -107,7 +116,7 @@ jobs:
make tools
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -116,7 +125,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -127,16 +136,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_topo_consul | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml
index ee9329d4fa7..1affa75b2f4 100644
--- a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_topo_etcd)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_topo_etcd)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_topo_etcd | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_transaction.yml b/.github/workflows/cluster_endtoend_vtgate_transaction.yml
index d3914dd0e2d..2d8f1708bd4 100644
--- a/.github/workflows/cluster_endtoend_vtgate_transaction.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_transaction.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_transaction)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_transaction)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_transaction | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml
index 679ec5ee324..f4e713fd2c9 100644
--- a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_unsharded)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_unsharded)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_unsharded | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml
index 2372f13cfb3..bfe68c86770 100644
--- a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_vindex_heavy)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_vindex_heavy)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,7 +131,7 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# Increase our open file descriptor limit as we could hit this
ulimit -n 65536
@@ -145,11 +154,13 @@ jobs:
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_vindex_heavy | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtgate_vschema.yml b/.github/workflows/cluster_endtoend_vtgate_vschema.yml
index 139421f9ff7..935ee642fa4 100644
--- a/.github/workflows/cluster_endtoend_vtgate_vschema.yml
+++ b/.github/workflows/cluster_endtoend_vtgate_vschema.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtgate_vschema)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtgate_vschema)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtgate_vschema | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtorc.yml b/.github/workflows/cluster_endtoend_vtorc.yml
index 300dc1864ba..b14c99f6648 100644
--- a/.github/workflows/cluster_endtoend_vtorc.yml
+++ b/.github/workflows/cluster_endtoend_vtorc.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtorc)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtorc)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtorc | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vtorc_mysql57.yml b/.github/workflows/cluster_endtoend_vtorc_mysql57.yml
index e3cb4e639f1..1dd7b021556 100644
--- a/.github/workflows/cluster_endtoend_vtorc_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_vtorc_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vtorc) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vtorc) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -113,7 +122,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -122,7 +131,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -133,16 +142,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vtorc | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml b/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml
index 9bc4c4d5b07..6fb044df961 100644
--- a/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml
+++ b/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (vttablet_prscomplex)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (vttablet_prscomplex)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,7 +111,7 @@ jobs:
go install github.com/vitessio/go-junit-report@HEAD
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -111,7 +120,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -122,16 +131,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard vttablet_prscomplex | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_xb_backup.yml b/.github/workflows/cluster_endtoend_xb_backup.yml
index 3e10039b7e1..1b88ab9d64b 100644
--- a/.github/workflows/cluster_endtoend_xb_backup.yml
+++ b/.github/workflows/cluster_endtoend_xb_backup.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (xb_backup)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (xb_backup)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,10 +111,10 @@ jobs:
# install JUnit report formatter
go install github.com/vitessio/go-junit-report@HEAD
- sudo apt-get install percona-xtrabackup-80 lz4
+ sudo apt-get install -y percona-xtrabackup-80 lz4
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -114,7 +123,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -125,16 +134,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard xb_backup | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_xb_backup_mysql57.yml b/.github/workflows/cluster_endtoend_xb_backup_mysql57.yml
index 3e4dcab8d04..294dcc56eeb 100644
--- a/.github/workflows/cluster_endtoend_xb_backup_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_xb_backup_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (xb_backup) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -18,7 +20,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (xb_backup) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -38,6 +40,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -64,9 +73,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -129,7 +138,7 @@ jobs:
fi
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -138,7 +147,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -149,16 +158,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard xb_backup | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_xb_recovery.yml b/.github/workflows/cluster_endtoend_xb_recovery.yml
index 1d402e7f883..33015d4ca60 100644
--- a/.github/workflows/cluster_endtoend_xb_recovery.yml
+++ b/.github/workflows/cluster_endtoend_xb_recovery.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (xb_recovery)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (xb_recovery)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -102,10 +111,10 @@ jobs:
# install JUnit report formatter
go install github.com/vitessio/go-junit-report@HEAD
- sudo apt-get install percona-xtrabackup-80 lz4
+ sudo apt-get install -y percona-xtrabackup-80 lz4
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -114,7 +123,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -125,16 +134,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard xb_recovery | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/cluster_endtoend_xb_recovery_mysql57.yml b/.github/workflows/cluster_endtoend_xb_recovery_mysql57.yml
index 55562726fa4..728448c19ac 100644
--- a/.github/workflows/cluster_endtoend_xb_recovery_mysql57.yml
+++ b/.github/workflows/cluster_endtoend_xb_recovery_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Cluster (xb_recovery) mysql57')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -18,7 +20,7 @@ env:
jobs:
build:
name: Run endtoend tests on Cluster (xb_recovery) mysql57
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -38,6 +40,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -64,9 +73,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -129,7 +138,7 @@ jobs:
fi
- name: Setup launchable dependencies
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main'
run: |
# Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
pip3 install --user launchable~=1.0 > /dev/null
@@ -138,7 +147,7 @@ jobs:
launchable verify || true
# Tell Launchable about the build you are producing and testing
- launchable record build --name "$GITHUB_RUN_ID" --source .
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run cluster endtoend test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -149,16 +158,18 @@ jobs:
export VTDATAROOT="/tmp/"
source build.env
- set -x
+ set -exo pipefail
# run the tests however you normally do, then produce a JUnit XML file
eatmydata -- go run test.go -docker=false -follow -shard xb_recovery | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && always()
run: |
- # send recorded tests to launchable
- launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/code_freeze.yml b/.github/workflows/code_freeze.yml
index efe1d6e8856..5640bc01b69 100644
--- a/.github/workflows/code_freeze.yml
+++ b/.github/workflows/code_freeze.yml
@@ -2,6 +2,8 @@ name: Code Freeze
on:
pull_request:
+permissions: read-all
+
jobs:
build:
name: Code Freeze
diff --git a/.github/workflows/codeql_analysis.yml b/.github/workflows/codeql_analysis.yml
index 16c7264a506..7f87d2745fc 100644
--- a/.github/workflows/codeql_analysis.yml
+++ b/.github/workflows/codeql_analysis.yml
@@ -9,6 +9,8 @@ on:
- cron: '0 0 * * 1'
workflow_dispatch:
+permissions: read-all
+
jobs:
analyze:
name: Analyze
@@ -40,9 +42,9 @@ jobs:
# queries: security-extended,security-and-quality
- name: Set up Go
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Get base dependencies
run: |
@@ -77,7 +79,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
- name: Building binaries
timeout-minutes: 30
diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml
index 39cd7592fa9..1da6d9f7190 100644
--- a/.github/workflows/create_release.yml
+++ b/.github/workflows/create_release.yml
@@ -7,27 +7,30 @@ on:
release:
types: [created]
+permissions: read-all
+
jobs:
build:
name: Create Release
runs-on: ubuntu-22.04
+ permissions:
+ contents: write
steps:
- name: Set up Go
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
+ with:
+ go-version: 1.21.1
+
+ - name: Setup node
+ uses: actions/setup-node@v3
with:
- go-version: 1.20.1
+ node-version: '18.16.0'
- name: Tune the OS
run: |
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
- # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
- run: |
- echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
-
- name: Check out code
uses: actions/checkout@v3
diff --git a/.github/workflows/docker_test_cluster_10.yml b/.github/workflows/docker_test_cluster_10.yml
index 3438b84ef89..72dd314590a 100644
--- a/.github/workflows/docker_test_cluster_10.yml
+++ b/.github/workflows/docker_test_cluster_10.yml
@@ -1,10 +1,11 @@
name: docker_test_cluster_10
on: [push, pull_request]
+permissions: read-all
jobs:
build:
name: Docker Test Cluster 10
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -51,9 +52,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -61,13 +62,6 @@ jobs:
echo "value: " ${{steps.skip-workflow.outputs.skip-workflow}}
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
- # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- run: |
- echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
-
- name: Run tests which require docker - 1
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
diff --git a/.github/workflows/docker_test_cluster_25.yml b/.github/workflows/docker_test_cluster_25.yml
index ae77594a6bb..e1ad48bf396 100644
--- a/.github/workflows/docker_test_cluster_25.yml
+++ b/.github/workflows/docker_test_cluster_25.yml
@@ -1,10 +1,11 @@
name: docker_test_cluster_25
on: [push, pull_request]
+permissions: read-all
jobs:
build:
name: Docker Test Cluster 25
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -51,22 +52,15 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
- # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- run: |
- echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
-
- name: Run tests which require docker - 2
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
diff --git a/.github/workflows/e2e_race.yml b/.github/workflows/e2e_race.yml
index 682e658bb72..1b52520ba6d 100644
--- a/.github/workflows/e2e_race.yml
+++ b/.github/workflows/e2e_race.yml
@@ -1,10 +1,11 @@
name: e2e_race
on: [push, pull_request]
+permissions: read-all
jobs:
build:
name: End-to-End Test (Race)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
run: |
@@ -49,9 +50,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -86,4 +87,4 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 30
run: |
- make e2e_test_race
+ NOVTADMINBUILD=1 make e2e_test_race
diff --git a/.github/workflows/endtoend.yml b/.github/workflows/endtoend.yml
index aea86fd21e6..1b8b496ba51 100644
--- a/.github/workflows/endtoend.yml
+++ b/.github/workflows/endtoend.yml
@@ -1,10 +1,11 @@
name: endtoend
on: [push, pull_request]
+permissions: read-all
jobs:
build:
name: End-to-End Test
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
run: |
@@ -49,22 +50,15 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
- # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- run: |
- echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
-
- name: Get dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
@@ -84,10 +78,14 @@ jobs:
- name: Build
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
- make build
+ NOVTADMINBUILD=1 make build
- name: endtoend
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 30
run: |
+ # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
+ # which musn't be more than 107 characters long.
+ export VTDATAROOT="/tmp/"
+
eatmydata -- tools/e2e_test_runner.sh
diff --git a/.github/workflows/local_example.yml b/.github/workflows/local_example.yml
index c1b1cd3a7c2..cd470dfcc63 100644
--- a/.github/workflows/local_example.yml
+++ b/.github/workflows/local_example.yml
@@ -1,13 +1,13 @@
name: local_example
on: [push, pull_request]
+permissions: read-all
jobs:
build:
- name: Local example using ${{ matrix.topo }} on ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
+ name: Local example using ${{ matrix.topo }} on ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
strategy:
matrix:
- os: [ubuntu-22.04]
topo: [consul,etcd,k8s]
steps:
@@ -55,9 +55,15 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
+
+ - uses: actions/setup-node@v3
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
+ with:
+ # node-version should match package.json
+ node-version: '18.16.0'
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
diff --git a/.github/workflows/region_example.yml b/.github/workflows/region_example.yml
index f86bd2e6a31..e7f7b36b408 100644
--- a/.github/workflows/region_example.yml
+++ b/.github/workflows/region_example.yml
@@ -1,13 +1,13 @@
name: region_example
on: [push, pull_request]
+permissions: read-all
jobs:
build:
- name: Region Sharding example using ${{ matrix.topo }} on ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
+ name: Region Sharding example using ${{ matrix.topo }} on ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
strategy:
matrix:
- os: [ubuntu-22.04]
topo: [etcd]
steps:
@@ -55,9 +55,15 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
+
+ - uses: actions/setup-node@v3
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
+ with:
+ # node-version should match package.json
+ node-version: '18.16.0'
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.examples == 'true'
diff --git a/.github/workflows/sonar_analysis.yml b/.github/workflows/sonar_analysis.yml
deleted file mode 100644
index c28966de09d..00000000000
--- a/.github/workflows/sonar_analysis.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-name: sonar_analysis
-on:
- push:
- branches:
- - 'sonartest'
-jobs:
-
- build:
- runs-on: ubuntu-22.04
-
- steps:
- - name: Set up Go
- uses: actions/setup-go@v3
- with:
- go-version: 1.19
-
- - name: Tune the OS
- run: |
- sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
-
- # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
- run: |
- echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
-
- - name: Check out code
- uses: actions/checkout@v3
-
- - name: Get dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata
- sudo service mysql stop
- sudo service etcd stop
- sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
- sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- go mod download
-
- - name: Execute unit test and cluster endtoend test
- run: |
- eatmydata -- ./tools/all_test_for_coverage.sh
- mkdir report
- cp /tmp/*.out ./report/.
-
- - name: Analyse sonar
- run: |
- export SONAR_SCANNER_VERSION=4.2.0.1873
- export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
- curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- export PATH=$SONAR_SCANNER_HOME/bin:$PATH
- export SONAR_SCANNER_OPTS="-server"
-
- sonar-scanner \
- -Dsonar.projectKey=vitessio \
- -Dsonar.organization=vitess \
- -Dsonar.host.url=https://sonarcloud.io \
- -Dsonar.login=${SONAR_TOKEN} \
- -Dsonar.go.coverage.reportPaths=report/*.out
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
diff --git a/.github/workflows/static_checks_etc.yml b/.github/workflows/static_checks_etc.yml
index 41a27adfe31..6b708f0aea1 100644
--- a/.github/workflows/static_checks_etc.yml
+++ b/.github/workflows/static_checks_etc.yml
@@ -4,6 +4,8 @@ on:
- pull_request
- push
+permissions: read-all
+
jobs:
build:
name: Static Code Checks Etc
@@ -33,7 +35,7 @@ jobs:
- name: Run FOSSA scan and upload build data
if: steps.skip-workflow.outputs.skip-workflow == 'false'
- uses: fossa-contrib/fossa-action@v1
+ uses: fossa-contrib/fossa-action@v2
with:
fossa-api-key: 76d7483ea206d530d9452e44bffe7ba8
@@ -97,25 +99,22 @@ jobs:
ci_config:
- 'test/config.json'
- '.github/workflows/static_checks_etc.yml'
+ release_notes:
+ - 'changelog/**'
+ - './go/tools/releases/**'
+ - '.github/workflows/static_checks_etc.yml'
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && (steps.changes.outputs.go_files == 'true' || steps.changes.outputs.parser_changes == 'true' || steps.changes.outputs.proto_changes == 'true')
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true'
run: |
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
- # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true'
- run: |
- echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
-
- name: Run go fmt
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true'
run: |
@@ -169,7 +168,7 @@ jobs:
- name: Install golangci-lint
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true'
- run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
+ run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2
- name: Clean Env
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true'
@@ -181,7 +180,7 @@ jobs:
- name: Run golangci-lint
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true'
- run: $(go env GOPATH)/bin/golangci-lint run go/... || exit 1
+ run: $(go env GOPATH)/bin/golangci-lint run go/... --timeout 10m || exit 1
- name: Run go mod tidy
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.go_files == 'true'
@@ -206,3 +205,18 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && (steps.changes.outputs.go_files == 'true' || steps.changes.outputs.ci_config == 'true')
run: |
go run ./go/tools/ci-config/main.go || exit 1
+
+ - name: Check changelog
+ if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.release_notes == 'true'
+ run: |
+ set -e
+ go run ./go/tools/releases/releases.go
+ output=$(git status -s)
+ if [ -z "${output}" ]; then
+ exit 0
+ fi
+ echo 'We wish to maintain a consistent changelog directory, please run `go run ./go/tools/releases/releases.go`, commit and push again.'
+ echo 'Running `go run ./go/tools/releases/releases.go` on CI yields the following changes:'
+ echo "$output"
+ echo ""
+ exit 1
diff --git a/.github/workflows/unit_race.yml b/.github/workflows/unit_race.yml
index 098741d08f2..d1cb499bbe1 100644
--- a/.github/workflows/unit_race.yml
+++ b/.github/workflows/unit_race.yml
@@ -4,11 +4,13 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'unit_race')
cancel-in-progress: true
+permissions: read-all
+
jobs:
build:
name: Unit Test (Race)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
steps:
- name: Skip CI
run: |
@@ -53,9 +55,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Tune the OS
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
@@ -91,6 +93,11 @@ jobs:
- name: unit_race
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
- timeout-minutes: 30
+ timeout-minutes: 45
run: |
+ # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
+ # which musn't be more than 107 characters long.
+ export VTDATAROOT="/tmp/"
+ export NOVTADMINBUILD=1
+
eatmydata -- make unit_test_race
diff --git a/.github/workflows/unit_test_mysql57.yml b/.github/workflows/unit_test_mysql57.yml
index 6e315b38986..c08d4ed89d7 100644
--- a/.github/workflows/unit_test_mysql57.yml
+++ b/.github/workflows/unit_test_mysql57.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Unit Test (mysql57)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
test:
name: Unit Test (mysql57)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
@@ -125,30 +134,37 @@ jobs:
run: |
make tools
- # Temporarily stop sending unit test data to launchable
- # - name: Setup launchable dependencies
- # if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
- # run: |
- # # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
- # pip3 install --user launchable~=1.0 > /dev/null
+ - name: Setup launchable dependencies
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && github.base_ref == 'main'
+ run: |
+ # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
+ pip3 install --user launchable~=1.0 > /dev/null
- # # verify that launchable setup is all correct.
- # # launchable verify || true
+ # verify that launchable setup is all correct.
+ launchable verify || true
- # # Tell Launchable about the build you are producing and testing
- # launchable record build --name "$GITHUB_RUN_ID" --source .
+ # Tell Launchable about the build you are producing and testing
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
timeout-minutes: 30
run: |
+ set -exo pipefail
+ # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
+ # which musn't be more than 107 characters long.
+ export VTDATAROOT="/tmp/"
+
+ export NOVTADMINBUILD=1
eatmydata -- make unit_test | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && always()
run: |
- # send recorded tests to launchable
- # launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/unit_test_mysql80.yml b/.github/workflows/unit_test_mysql80.yml
index a4716164ca6..7eac25a23ce 100644
--- a/.github/workflows/unit_test_mysql80.yml
+++ b/.github/workflows/unit_test_mysql80.yml
@@ -6,6 +6,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Unit Test (mysql80)')
cancel-in-progress: true
+permissions: read-all
+
env:
LAUNCHABLE_ORGANIZATION: "vitess"
LAUNCHABLE_WORKSPACE: "vitess-app"
@@ -14,7 +16,7 @@ env:
jobs:
test:
name: Unit Test (mysql80)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
@@ -34,6 +36,13 @@ jobs:
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
+ PR_DATA=$(curl \
+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+ -H "Accept: application/vnd.github.v3+json" \
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}")
+ draft=$(echo "$PR_DATA" | jq .draft -r)
+ echo "is_draft=${draft}" >> $GITHUB_OUTPUT
+
- name: Check out code
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3
@@ -60,9 +69,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
@@ -122,30 +131,37 @@ jobs:
run: |
make tools
- # Temporarily stop sending unit test data to launchable
- # - name: Setup launchable dependencies
- # if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
- # run: |
- # # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
- # pip3 install --user launchable~=1.0 > /dev/null
+ - name: Setup launchable dependencies
+ if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && github.base_ref == 'main'
+ run: |
+ # Get Launchable CLI installed. If you can, make it a part of the builder image to speed things up
+ pip3 install --user launchable~=1.0 > /dev/null
- # # verify that launchable setup is all correct.
- # # launchable verify || true
+ # verify that launchable setup is all correct.
+ launchable verify || true
- # # Tell Launchable about the build you are producing and testing
- # launchable record build --name "$GITHUB_RUN_ID" --source .
+ # Tell Launchable about the build you are producing and testing
+ launchable record build --name "$GITHUB_RUN_ID" --no-commit-collection --source .
- name: Run test
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
timeout-minutes: 30
run: |
+ set -exo pipefail
+ # We set the VTDATAROOT to the /tmp folder to reduce the file path of mysql.sock file
+ # which musn't be more than 107 characters long.
+ export VTDATAROOT="/tmp/"
+
+ export NOVTADMINBUILD=1
eatmydata -- make unit_test | tee -a output.txt | go-junit-report -set-exit-code > report.xml
- - name: Print test output and Record test result in launchable
+ - name: Print test output and Record test result in launchable if PR is not a draft
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && always()
run: |
- # send recorded tests to launchable
- # launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ if [[ "${{steps.skip-workflow.outputs.is_draft}}" == "false" ]]; then
+ # send recorded tests to launchable
+ launchable record tests --build "$GITHUB_RUN_ID" go-test . || true
+ fi
# print test output
cat output.txt
diff --git a/.github/workflows/update_golang_version.yml b/.github/workflows/update_golang_version.yml
new file mode 100644
index 00000000000..31b17e4a6b3
--- /dev/null
+++ b/.github/workflows/update_golang_version.yml
@@ -0,0 +1,90 @@
+name: Update Golang Version
+
+on:
+ schedule:
+ - cron: "0 0 * * *" # Runs every day at midnight UTC
+ workflow_dispatch:
+
+permissions: read-all
+
+jobs:
+ update_golang_version:
+ if: github.repository == 'vitessio/vitess'
+ permissions:
+ contents: write
+ pull-requests: write
+ strategy:
+ matrix:
+ branch: [ main, release-17.0, release-16.0, release-15.0 ]
+ name: Update Golang Version
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up Go
+ uses: actions/setup-go@v4
+ with:
+ go-version: 1.21.1
+
+ - name: Check out code
+ uses: actions/checkout@v3
+ with:
+ ref: ${{ matrix.branch }}
+
+ - name: Detect new version and update codebase
+ env:
+ GH_TOKEN: ${{ github.token }}
+ id: detect-and-update
+ run: |
+ old_go_version=$(go run ./go/tools/go-upgrade/go-upgrade.go get go-version)
+ echo "old-go-version=${old_go_version}" >> $GITHUB_OUTPUT
+
+ if [ ${{ matrix.branch }} == "main" ]; then
+ go run ./go/tools/go-upgrade/go-upgrade.go upgrade --workflow-update=false --main --allow-major-upgrade
+ else
+ go run ./go/tools/go-upgrade/go-upgrade.go upgrade --workflow-update=false
+ fi
+
+ output=$(git status -s)
+ if [ -z "${output}" ]; then
+ exit 0
+ fi
+
+ go_version=$(go run ./go/tools/go-upgrade/go-upgrade.go get go-version)
+ bootstrap_version=$(go run ./go/tools/go-upgrade/go-upgrade.go get bootstrap-version)
+ echo "go-version=${go_version}" >> $GITHUB_OUTPUT
+ echo "bootstrap-version=${bootstrap_version}" >> $GITHUB_OUTPUT
+
+ # Check if the PR already exists, if it does then do not create new PR.
+ gh pr list -S "is:open [${{ matrix.branch }}] Upgrade the Golang version to go${go_version}" > out.txt 2>&1 | true
+ if [ -s out.txt ]; then
+ rm -f out.txt
+ exit 0
+ fi
+ rm -f out.txt
+ echo "create-pr=true" >> $GITHUB_OUTPUT
+
+ - name: Create Pull Request
+ if: steps.detect-and-update.outputs.create-pr == 'true'
+ uses: peter-evans/create-pull-request@v4
+ with:
+ branch: "upgrade-go-to-${{steps.detect-and-update.outputs.go-version}}-on-${{ matrix.branch }}"
+ commit-message: "bump go version to go${{steps.detect-and-update.outputs.go-version}}"
+ signoff: true
+ delete-branch: true
+ title: "[${{ matrix.branch }}] Upgrade the Golang version to `go${{steps.detect-and-update.outputs.go-version}}`"
+ body: |
+ This Pull Request bumps the Golang version to `go${{steps.detect-and-update.outputs.go-version}}` and the bootstrap version to `${{steps.detect-and-update.outputs.bootstrap-version}}`.
+
+ > Do not trust the bot blindly. A thorough code review must be done to ensure all the files have been correctly modified.
+
+ There are a few manual steps remaining:
+ - [ ] Make sure you update the Golang version used in the previous and next release branches for the Upgrade/Downgrade tests.
+ - [ ] Build and Push the bootstrap images to Docker Hub, the bot cannot handle that.
+ - [ ] Update the `./.github/workflows/*.yml` files with the newer Golang version, the bot cannot handle that due to permissions.
+ - To accomplish this, run the following: `go run ./go/tools/go-upgrade/go-upgrade.go upgrade workflows --go-to=${{steps.detect-and-update.outputs.go-version}}`
+ base: ${{ matrix.branch }}
+ labels: |
+ Skip CI
+ go
+ Benchmark me
+ Component: General
+ Type: CI/Build
diff --git a/.github/workflows/upgrade_downgrade_test_backups_e2e.yml b/.github/workflows/upgrade_downgrade_test_backups_e2e.yml
index bde1a3283f7..ed7ee91d20d 100644
--- a/.github/workflows/upgrade_downgrade_test_backups_e2e.yml
+++ b/.github/workflows/upgrade_downgrade_test_backups_e2e.yml
@@ -7,11 +7,13 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing - Backups - E2E')
cancel-in-progress: true
+permissions: read-all
+
jobs:
get_previous_release:
if: always()
name: Get Previous Release - Backups - E2E
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
previous_release: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
@@ -32,7 +34,7 @@ jobs:
timeout-minutes: 60
if: always() && needs.get_previous_release.result == 'success'
name: Run Upgrade Downgrade Test - Backups - E2E
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_previous_release
@@ -81,9 +83,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -112,7 +114,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the last release of Vitess
- name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }})
@@ -131,7 +133,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -151,7 +153,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -161,8 +163,10 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vttablet
+ rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vttablet --version
# Run test with VTTablet at version N-1 and VTBackup at version N
@@ -181,9 +185,11 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vtbackup $PWD/bin/vttablet
+ rm -f $PWD/bin/vtbackup $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-current/bin/vtbackup $PWD/bin/vtbackup
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vtbackup --version
vttablet --version
diff --git a/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml b/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml
index d92da4088e0..47877bb78b8 100644
--- a/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml
+++ b/.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml
@@ -7,11 +7,13 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing - Backups - E2E - Next Release')
cancel-in-progress: true
+permissions: read-all
+
jobs:
get_next_release:
if: always()
name: Get Latest Release - Backups - E2E - Next Release
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
next_release: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
@@ -32,7 +34,7 @@ jobs:
timeout-minutes: 60
if: always() && needs.get_next_release.result == 'success'
name: Run Upgrade Downgrade Test - Backups - E2E - Next Release
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_next_release
@@ -84,9 +86,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -115,7 +117,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the next release of Vitess
- name: Check out other version's code (${{ needs.get_next_release.outputs.next_release }})
@@ -134,7 +136,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -154,7 +156,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -164,8 +166,10 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vttablet
+ rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vttablet --version
# Run test with VTTablet at version N+1 and VTBackup at version N
@@ -184,9 +188,11 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vtbackup $PWD/bin/vttablet
- cp /tmp/vitess-build-current/bin/vtbackup $PWD/bin/vtbackup
- cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ rm -f $PWD/bin/vtbackup $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
+ cp /tmp/vitess-build-other/bin/vtbackup $PWD/bin/vtbackup
+ cp /tmp/vitess-build-current/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-current/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-current/bin/mysqlctld $PWD/bin/mysqlctld
vtbackup --version
vttablet --version
diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual.yml b/.github/workflows/upgrade_downgrade_test_backups_manual.yml
index 6201d9b49ba..d310e01c0ac 100644
--- a/.github/workflows/upgrade_downgrade_test_backups_manual.yml
+++ b/.github/workflows/upgrade_downgrade_test_backups_manual.yml
@@ -7,11 +7,13 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing - Backups - Manual')
cancel-in-progress: true
+permissions: read-all
+
jobs:
get_previous_release:
if: always()
name: Get Previous Release - Backups - Manual
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
previous_release: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
@@ -33,7 +35,7 @@ jobs:
timeout-minutes: 40
if: always() && (needs.get_previous_release.result == 'success')
name: Run Upgrade Downgrade Test - Backups - Manual
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_previous_release
@@ -83,9 +85,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -96,13 +98,6 @@ jobs:
run: |
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
- # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- run: |
- echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
-
- name: Get base dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
@@ -139,7 +134,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the last release of Vitess
- name: Checkout to the other version's code (${{ needs.get_previous_release.outputs.previous_release }})
@@ -158,7 +153,7 @@ jobs:
timeout-minutes: 5
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -183,7 +178,7 @@ jobs:
timeout-minutes: 5
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -234,8 +229,10 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vttablet
+ rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vttablet --version
# Starting the tablets again, they will automatically start restoring the last backup.
@@ -276,22 +273,16 @@ jobs:
source build.env ; cd examples/backups
./take_backups.sh
- # Stopping the tablets so we can perform the upgrade.
- - name: Stop tablets
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- timeout-minutes: 10
- run: |
- source build.env ; cd examples/backups
- ./stop_tablets.sh
-
# We upgrade: we swap binaries and use the version N of the tablet.
- name: Upgrade - Swap binaries, use VTTablet N
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
source build.env
- rm -f $PWD/bin/vttablet
+ rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-current/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-current/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-current/bin/mysqlctld $PWD/bin/mysqlctld
vttablet --version
# Starting the tablets again and restoring the previous backup.
@@ -300,9 +291,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env ; cd examples/backups
- ./restart_tablets.sh
- # give enough time to the tablets to restore the backup
- sleep 90
+ ./upgrade_cluster.sh
# We count the number of rows in every table to check that the restore step was successful.
- name: Assert the number of rows in every table
diff --git a/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml b/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml
index dc0ad902478..1622622c556 100644
--- a/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml
+++ b/.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml
@@ -7,11 +7,13 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing - Backups - Manual - Next Release')
cancel-in-progress: true
+permissions: read-all
+
jobs:
get_next_release:
if: always()
name: Get Previous Release - Backups - Manual - Next Release
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
next_release: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
@@ -33,7 +35,7 @@ jobs:
timeout-minutes: 40
if: always() && (needs.get_next_release.result == 'success')
name: Run Upgrade Downgrade Test - Backups - Manual - Next Release
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_next_release
@@ -86,9 +88,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -99,13 +101,6 @@ jobs:
run: |
sudo sysctl -w net.ipv4.ip_local_port_range="22768 65535"
- # TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- - name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- run: |
- echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- # DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
-
- name: Get base dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
@@ -142,7 +137,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the next release of Vitess
- name: Checkout to the other version's code (${{ needs.get_next_release.outputs.next_release }})
@@ -161,7 +156,7 @@ jobs:
timeout-minutes: 5
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -186,7 +181,7 @@ jobs:
timeout-minutes: 5
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -237,8 +232,10 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vttablet
+ rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vttablet --version
# Starting the tablets again, they will automatically start restoring the last backup.
@@ -279,22 +276,16 @@ jobs:
source build.env ; cd examples/backups
./take_backups.sh
- # Stopping the tablets so we can perform the upgrade.
- - name: Stop tablets
- if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- timeout-minutes: 10
- run: |
- source build.env ; cd examples/backups
- ./stop_tablets.sh
-
# We upgrade: we swap binaries and use the version N of the tablet.
- name: Upgrade - Swap binaries, use VTTablet N
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
run: |
source build.env
- rm -f $PWD/bin/vttablet
+ rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-current/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-current/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-current/bin/mysqlctld $PWD/bin/mysqlctld
vttablet --version
# Starting the tablets again and restoring the next backup.
@@ -303,9 +294,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env ; cd examples/backups
- ./restart_tablets.sh
- # give enough time to the tablets to restore the backup
- sleep 90
+ ./upgrade_cluster.sh
# We count the number of rows in every table to check that the restore step was successful.
- name: Assert the number of rows in every table
diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml
index 2d8aceb6ceb..9c299c0cec6 100644
--- a/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml
+++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries.yml
@@ -7,6 +7,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Query Serving (Queries)')
cancel-in-progress: true
+permissions: read-all
+
# This test ensures that our end-to-end tests work using Vitess components
# (vtgate, vttablet, etc) built on different versions.
@@ -14,7 +16,7 @@ jobs:
get_previous_release:
if: always()
name: Get Previous Release - Query Serving (Queries)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
previous_release: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
@@ -34,7 +36,7 @@ jobs:
upgrade_downgrade_test:
if: always() && (needs.get_previous_release.result == 'success')
name: Run Upgrade Downgrade Test - Query Serving (Queries)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_previous_release
@@ -83,9 +85,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -130,7 +132,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the last release of Vitess
- name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }})
@@ -149,7 +151,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -169,7 +171,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -209,9 +211,11 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vtgate $PWD/bin/vttablet
+ rm -f $PWD/bin/vtgate $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-current/bin/vtgate $PWD/bin/vtgate
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vtgate --version
vttablet --version
diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml b/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml
index 7de07a3892d..326384bb3cc 100644
--- a/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml
+++ b/.github/workflows/upgrade_downgrade_test_query_serving_queries_next_release.yml
@@ -7,6 +7,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Query Serving (Queries) Next Release')
cancel-in-progress: true
+permissions: read-all
+
# This test ensures that our end-to-end tests work using Vitess components
# (vtgate, vttablet, etc) built on different versions.
@@ -14,7 +16,7 @@ jobs:
get_next_release:
if: always()
name: Get Latest Release - Query Serving (Queries) Next Release
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
next_release: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
@@ -34,7 +36,7 @@ jobs:
upgrade_downgrade_test:
if: always() && (needs.get_next_release.result == 'success')
name: Run Upgrade Downgrade Test - Query Serving (Queries) Next Release
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_next_release
@@ -86,9 +88,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -133,7 +135,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the next release of Vitess
- name: Check out other version's code (${{ needs.get_next_release.outputs.next_release }})
@@ -152,7 +154,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -172,7 +174,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -212,9 +214,11 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vtgate $PWD/bin/vttablet
+ rm -f $PWD/bin/vtgate $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-current/bin/vtgate $PWD/bin/vtgate
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vtgate --version
vttablet --version
diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml
index 5b8e3107757..45d61d955fc 100644
--- a/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml
+++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema.yml
@@ -7,6 +7,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Query Serving (Schema)')
cancel-in-progress: true
+permissions: read-all
+
# This test ensures that our end-to-end tests work using Vitess components
# (vtgate, vttablet, etc) built on different versions.
@@ -14,7 +16,7 @@ jobs:
get_previous_release:
if: always()
name: Get Previous Release - Query Serving (Schema)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
previous_release: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
@@ -34,7 +36,7 @@ jobs:
upgrade_downgrade_test:
if: always() && (needs.get_previous_release.result == 'success')
name: Run Upgrade Downgrade Test - Query Serving (Schema)
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_previous_release
@@ -83,9 +85,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -130,7 +132,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the last release of Vitess
- name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }})
@@ -149,7 +151,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -169,7 +171,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -209,9 +211,11 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vtgate $PWD/bin/vttablet
+ rm -f $PWD/bin/vtgate $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-current/bin/vtgate $PWD/bin/vtgate
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vtgate --version
vttablet --version
diff --git a/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml b/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml
index 18075b62e0f..19ee1819763 100644
--- a/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml
+++ b/.github/workflows/upgrade_downgrade_test_query_serving_schema_next_release.yml
@@ -7,6 +7,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Query Serving (Schema) Next Release')
cancel-in-progress: true
+permissions: read-all
+
# This test ensures that our end-to-end tests work using Vitess components
# (vtgate, vttablet, etc) built on different versions.
@@ -14,7 +16,7 @@ jobs:
get_next_release:
if: always()
name: Get Latest Release - Query Serving (Schema) Next Release
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
next_release: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
@@ -34,7 +36,7 @@ jobs:
upgrade_downgrade_test:
if: always() && (needs.get_next_release.result == 'success')
name: Run Upgrade Downgrade Test - Query Serving (Schema) Next Release
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_next_release
@@ -86,9 +88,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -133,7 +135,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the next release of Vitess
- name: Check out other version's code (${{ needs.get_next_release.outputs.next_release }})
@@ -152,7 +154,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -172,7 +174,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -212,9 +214,11 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vtgate $PWD/bin/vttablet
+ rm -f $PWD/bin/vtgate $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-current/bin/vtgate $PWD/bin/vtgate
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vtgate --version
vttablet --version
diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml
index cca38725a37..088c82b21da 100644
--- a/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml
+++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vtctl.yml
@@ -7,6 +7,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Reparent New Vtctl')
cancel-in-progress: true
+permissions: read-all
+
# This test ensures that our end-to-end tests work using Vitess components
# (vtctl, vttablet, etc) built on different versions.
@@ -14,7 +16,7 @@ jobs:
get_next_release:
if: always()
name: Get Latest Release - Reparent New Vtctl
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
next_release: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
@@ -34,7 +36,7 @@ jobs:
upgrade_downgrade_test:
if: always() && (needs.get_next_release.result == 'success')
name: Run Upgrade Downgrade Test - Reparent New Vtctl
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_next_release
@@ -86,9 +88,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -133,7 +135,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the next release of Vitess
- name: Check out other version's code (${{ needs.get_next_release.outputs.next_release }})
@@ -152,7 +154,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -172,7 +174,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
diff --git a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml
index 6cc0f1d9882..d331ec978dc 100644
--- a/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml
+++ b/.github/workflows/upgrade_downgrade_test_reparent_new_vttablet.yml
@@ -7,6 +7,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Reparent New VTTablet')
cancel-in-progress: true
+permissions: read-all
+
# This test ensures that our end-to-end tests work using Vitess components
# (vtctl, vttablet, etc) built on different versions.
@@ -14,7 +16,7 @@ jobs:
get_next_release:
if: always()
name: Get Latest Release - Reparent New VTTablet
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
next_release: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
@@ -34,7 +36,7 @@ jobs:
upgrade_downgrade_test:
if: always() && (needs.get_next_release.result == 'success')
name: Run Upgrade Downgrade Test - Reparent New VTTablet
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_next_release
@@ -86,9 +88,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -133,7 +135,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the next release of Vitess
- name: Check out other version's code (${{ needs.get_next_release.outputs.next_release }})
@@ -152,7 +154,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -172,7 +174,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -182,8 +184,10 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vttablet
+ rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vtctl --version
vttablet --version
diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml
index 908be6519f6..8d9374ecac0 100644
--- a/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml
+++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vtctl.yml
@@ -7,6 +7,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Reparent Old Vtctl')
cancel-in-progress: true
+permissions: read-all
+
# This test ensures that our end-to-end tests work using Vitess components
# (vtctl, vttablet, etc) built on different versions.
@@ -14,7 +16,7 @@ jobs:
get_previous_release:
if: always()
name: Get Previous Release - Reparent Old Vtctl
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
previous_release: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
@@ -34,7 +36,7 @@ jobs:
upgrade_downgrade_test:
if: always() && (needs.get_previous_release.result == 'success')
name: Run Upgrade Downgrade Test - Reparent Old Vtctl
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_previous_release
@@ -83,9 +85,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -130,7 +132,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the last release of Vitess
- name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }})
@@ -149,7 +151,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -169,7 +171,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
diff --git a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml
index bbb17c43e99..a4356a16217 100644
--- a/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml
+++ b/.github/workflows/upgrade_downgrade_test_reparent_old_vttablet.yml
@@ -7,6 +7,8 @@ concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Reparent Old VTTablet')
cancel-in-progress: true
+permissions: read-all
+
# This test ensures that our end-to-end tests work using Vitess components
# (vtctl, vttablet, etc) built on different versions.
@@ -14,7 +16,7 @@ jobs:
get_previous_release:
if: always()
name: Get Previous Release - Reparent Old VTTablet
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
outputs:
previous_release: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }}
@@ -34,7 +36,7 @@ jobs:
upgrade_downgrade_test:
if: always() && (needs.get_previous_release.result == 'success')
name: Run Upgrade Downgrade Test - Reparent Old VTTablet
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-16cores-1
needs:
- get_previous_release
@@ -83,9 +85,9 @@ jobs:
- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
- uses: actions/setup-go@v3
+ uses: actions/setup-go@v4
with:
- go-version: 1.20.1
+ go-version: 1.21.1
- name: Set up python
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
@@ -130,7 +132,7 @@ jobs:
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
- sudo apt-get install percona-xtrabackup-24
+ sudo apt-get install -y percona-xtrabackup-24
# Checkout to the last release of Vitess
- name: Check out other version's code (${{ needs.get_previous_release.outputs.previous_release }})
@@ -149,7 +151,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
@@ -169,7 +171,7 @@ jobs:
timeout-minutes: 10
run: |
source build.env
- make build
+ NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
@@ -179,8 +181,10 @@ jobs:
run: |
source build.env
- rm -f $PWD/bin/vttablet
+ rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
+ cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
+ cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vtctl --version
vttablet --version
diff --git a/.github/workflows/vtadmin_web_build.yml b/.github/workflows/vtadmin_web_build.yml
index c0b668641ea..24ade4d9227 100644
--- a/.github/workflows/vtadmin_web_build.yml
+++ b/.github/workflows/vtadmin_web_build.yml
@@ -12,9 +12,11 @@ on:
- '.github/workflows/vtadmin_web_build.yml'
- 'web/vtadmin/**'
+permissions: read-all
+
jobs:
build:
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
run: |
@@ -40,7 +42,7 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false'
with:
# node-version should match package.json
- node-version: '16.19.0'
+ node-version: '18.16.0'
- name: Install dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false'
diff --git a/.github/workflows/vtadmin_web_lint.yml b/.github/workflows/vtadmin_web_lint.yml
index 9b7e9a68847..055e1934fb0 100644
--- a/.github/workflows/vtadmin_web_lint.yml
+++ b/.github/workflows/vtadmin_web_lint.yml
@@ -12,6 +12,8 @@ on:
- '.github/workflows/vtadmin_web_lint.yml'
- 'web/vtadmin/**'
+permissions: read-all
+
jobs:
lint:
runs-on: ubuntu-22.04
@@ -40,7 +42,7 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false'
with:
# node-version should match package.json
- node-version: '16.19.0'
+ node-version: '18.16.0'
- name: Install dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false'
diff --git a/.github/workflows/vtadmin_web_unit_tests.yml b/.github/workflows/vtadmin_web_unit_tests.yml
index bfc4a5d15ff..1efa474fde3 100644
--- a/.github/workflows/vtadmin_web_unit_tests.yml
+++ b/.github/workflows/vtadmin_web_unit_tests.yml
@@ -12,9 +12,11 @@ on:
- '.github/workflows/vtadmin_web_unit_tests.yml'
- 'web/vtadmin/**'
+permissions: read-all
+
jobs:
unit-tests:
- runs-on: ubuntu-22.04
+ runs-on: gh-hosted-runners-4cores-1
steps:
- name: Skip CI
run: |
@@ -40,7 +42,7 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false'
with:
# node-version should match package.json
- node-version: '16.19.0'
+ node-version: '18.16.0'
- name: Install dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false'
diff --git a/.gitignore b/.gitignore
index 25dfe2c63f3..881e89890cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -70,7 +70,7 @@ _test/
/vendor/*/
# release folder
-releases
+/releases/
# Local examples
/examples/local/vtdataroot
@@ -83,3 +83,6 @@ venv
.scannerwork
report
+
+# plan test output
+/go/vt/vtgate/planbuilder/testdata/plan_test*
diff --git a/.golangci.yml b/.golangci.yml
index e2bdb5336e4..9c674953a76 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,8 +1,6 @@
run:
- go: 1.19
+ go: 1.20
timeout: 10m
- skip-dirs:
- - go/vt/topo/k8stopo/client
linters-settings:
errcheck:
@@ -154,4 +152,4 @@ issues:
# https://github.com/golangci/golangci/wiki/Configuration
service:
- golangci-lint-version: 1.51.2 # use the fixed version to not introduce new linters unexpectedly
+ golangci-lint-version: 1.52.2 # use the fixed version to not introduce new linters unexpectedly
diff --git a/ADOPTERS.md b/ADOPTERS.md
index a254b54e14d..a471983a06e 100644
--- a/ADOPTERS.md
+++ b/ADOPTERS.md
@@ -19,5 +19,6 @@ This is an alphabetical list of known adopters of Vitess. Some have already gone
* [Square](https://square.com)
* [Stitch Labs](https://stitchlabs.com)
* [Twitter](https://twitter.com)
+* [Vinted](https://www.vinted.com/)
* [Weave](https://www.getweave.com)
* [YouTube](https://youtube.com)
diff --git a/GOVERNANCE.md b/GOVERNANCE.md
index 8adec25f8d9..8b408d8ba55 100644
--- a/GOVERNANCE.md
+++ b/GOVERNANCE.md
@@ -55,13 +55,13 @@ A maintainer is not allowed to merge their change without approval from other ma
Anyone can become a maintainer; there are no special requirements, other than to have shown a willingness and ability to participate in the project as a team player. Typically, a potential maintainer will need to show that they have an understanding of the project, its objectives and its strategy. They will also have provided valuable contributions to the project over a period of time.
-New maintainers can be nominated by any existing maintainer. Once they have been nominated, there will be a vote by the steering committee. Maintainer voting is one of the few activities that takes place on the project’s private management list. This is to allow committee members to freely express their opinions about a nominee without causing embarrassment. Once the vote has been held, the aggregated voting results are published on the public mailing list. The nominee is entitled to request an explanation of any ‘no’ votes against them, regardless of the outcome of the vote. This explanation will be provided by the Steering Committee Chair (see below) and will be anonymous and constructive in nature.
+New maintainers can be nominated by any existing maintainer. Once they have been nominated, there will be a vote by the maintainer team to decide whether to accept or reject the nomination.
-Nominees may decline their appointment as a maintainer. However, this is unusual, as the project does not expect any specific time or resource commitment from its community members. The intention behind the role of maintainer is to allow people to contribute to the project more easily, not to tie them in to the project in any formal way.
+Nominees may decline their appointment as a maintainer. The project does not expect any specific time or resource commitment from its community members, however it is expected that maintainers are evangelists for the project.
-It is important to recognise that maintainer-ship is a privilege, not a right. That privilege must be earned and once earned it can be removed by the Steering Committee for conduct inconsistent with the [Guiding Principles](https://github.com/vitessio/vitess/blob/main/GUIDING_PRINCIPLES.md) or if they drop below a level of commitment and engagement required to be a maintainer, as determined by the Steering Committee. The Steering Committee also reserves the right to remove a person for any other reason inconsistent with the goals of the project.
+It is important to recognise that maintainer-ship is a privilege, not a right. That privilege must be earned and once earned it can be removed by the [Steering Committee](https://github.com/vitessio/vitess/blob/main/STEERING.md) for conduct inconsistent with the [Guiding Principles](https://github.com/vitessio/vitess/blob/main/GUIDING_PRINCIPLES.md) or if they drop below a level of commitment and engagement required to be a maintainer, as determined by the Steering Committee. The Steering Committee also reserves the right to remove a person for any other reason inconsistent with the goals of the project.
-A maintainer who shows an above-average level of contribution to the project, particularly with respect to its strategic direction and long-term health, may be nominated to become a member of the Steering Committee. This role is described in the [Steering Committee document](https://github.com/vitessio/vitess/blob/main/STEERING.md).
+A maintainer who shows an above-average level of contribution to the project, particularly with respect to its strategic direction and long-term health, may be nominated to become a member of the Steering Committee.
# Support
@@ -72,7 +72,7 @@ Anyone can contribute to the project, regardless of their skills, as there are m
The Slack workspace is the most appropriate place for a contributor to ask for help when making their first contribution.
-# Decision Making Process
+# Decision-Making Process
Decisions about the future of the project are made by the Steering Committee. New proposals and ideas can be brought to the Committee’s attention through the Slack workspace or by filing an issue. If necessary, the Committee will seek input from others to come to the final decision.
diff --git a/Makefile b/Makefile
index 24b0bb6ed49..e1831f76b3a 100644
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,7 @@ export REWRITER=go/vt/sqlparser/rewriter.go
# Since we are not using this Makefile for compilation, limiting parallelism will not increase build time.
.NOTPARALLEL:
-.PHONY: all build install test clean unit_test unit_test_cover unit_test_race integration_test proto proto_banner site_test site_integration_test docker_bootstrap docker_test docker_unit_test java_test reshard_tests e2e_test e2e_test_race minimaltools tools generate_ci_workflows
+.PHONY: all build install test clean unit_test unit_test_cover unit_test_race integration_test proto proto_banner site_test site_integration_test docker_bootstrap docker_test docker_unit_test java_test reshard_tests e2e_test e2e_test_race minimaltools tools generate_ci_workflows generate-flag-testdata
all: build
@@ -61,6 +61,10 @@ ifdef VT_EXTRA_BUILD_FLAGS
export EXTRA_BUILD_FLAGS := $(VT_EXTRA_BUILD_FLAGS)
endif
+ifdef VT_EXTRA_BUILD_LDFLAGS
+export EXTRA_BUILD_LDFLAGS := $(VT_EXTRA_BUILD_LDFLAGS)
+endif
+
# This should be the root of the vitess Git directory.
ifndef VTROOT
export VTROOT=${PWD}
@@ -76,7 +80,7 @@ ifndef NOBANNER
endif
bash ./build.env
go build -trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) \
- -ldflags "$(shell tools/build_version_flags.sh)" \
+ -ldflags "$(EXTRA_BUILD_LDFLAGS) $(shell tools/build_version_flags.sh)" \
-o ${VTROOTBIN} ./go/...
# build the vitess binaries statically
@@ -89,8 +93,12 @@ endif
# Binaries will be placed in ${VTROOTBIN}.
CGO_ENABLED=0 go build \
-trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) \
- -ldflags "$(shell tools/build_version_flags.sh)" \
+ -ldflags "$(EXTRA_BUILD_LDFLAGS) $(shell tools/build_version_flags.sh)" \
-o ${VTROOTBIN} ./go/...
+ifndef NOVTADMINBUILD
+ echo "Building VTAdmin Web, disable VTAdmin build by setting 'NOVTADMINBUILD'"
+ PREFIX="" ./web/vtadmin/build.sh
+endif
# cross-build can be used to cross-compile Vitess client binaries
# Outside of select client binaries (namely vtctlclient & vtexplain), cross-compiled Vitess Binaries are not recommended for production deployments
@@ -107,7 +115,7 @@ endif
mkdir -p ${VTROOTBIN}/${GOOS}_${GOARCH}
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build \
-trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) \
- -ldflags "$(shell tools/build_version_flags.sh)" \
+ -ldflags "$(EXTRA_BUILD_LDFLAGS) $(shell tools/build_version_flags.sh)" \
-o ${VTROOTBIN}/${GOOS}_${GOARCH} ./go/...
@if [ ! -x "${VTROOTBIN}/${GOOS}_${GOARCH}/vttablet" ]; then \
@@ -121,7 +129,7 @@ endif
bash ./build.env
go build -trimpath \
$(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) \
- -ldflags "$(shell tools/build_version_flags.sh)" \
+ -ldflags "$(EXTRA_BUILD_LDFLAGS) $(shell tools/build_version_flags.sh)" \
-gcflags -'N -l' \
-o ${VTROOTBIN} ./go/...
@@ -245,7 +253,7 @@ PROTO_SRCS = $(wildcard proto/*.proto)
PROTO_SRC_NAMES = $(basename $(notdir $(PROTO_SRCS)))
PROTO_GO_OUTS = $(foreach name, $(PROTO_SRC_NAMES), go/vt/proto/$(name)/$(name).pb.go)
# This rule rebuilds all the go files from the proto definitions for gRPC.
-proto: $(PROTO_GO_OUTS)
+proto: $(PROTO_GO_OUTS) vtadmin_web_proto_types
ifndef NOBANNER
echo $$(date): Compiling proto definitions
@@ -256,9 +264,10 @@ $(PROTO_GO_OUTS): minimaltools install_protoc-gen-go proto/*.proto
--go_out=. --plugin protoc-gen-go="${VTROOTBIN}/protoc-gen-go" \
--go-grpc_out=. --plugin protoc-gen-go-grpc="${VTROOTBIN}/protoc-gen-go-grpc" \
--go-vtproto_out=. --plugin protoc-gen-go-vtproto="${VTROOTBIN}/protoc-gen-go-vtproto" \
- --go-vtproto_opt=features=marshal+unmarshal+size+pool \
+ --go-vtproto_opt=features=marshal+unmarshal+size+pool+clone \
--go-vtproto_opt=pool=vitess.io/vitess/go/vt/proto/query.Row \
--go-vtproto_opt=pool=vitess.io/vitess/go/vt/proto/binlogdata.VStreamRowsResponse \
+ --go-vtproto_opt=pool=vitess.io/vitess/go/vt/proto/binlogdata.VStreamTablesResponse \
-I${PWD}/dist/vt-protoc-21.3/include:proto $(PROTO_SRCS)
cp -Rf vitess.io/vitess/go/vt/proto/* go/vt/proto
rm -rf vitess.io/vitess/go/vt/proto/
@@ -269,7 +278,7 @@ $(PROTO_GO_OUTS): minimaltools install_protoc-gen-go proto/*.proto
# This rule builds the bootstrap images for all flavors.
DOCKER_IMAGES_FOR_TEST = mysql57 mysql80 percona57 percona80
DOCKER_IMAGES = common $(DOCKER_IMAGES_FOR_TEST)
-BOOTSTRAP_VERSION=15
+BOOTSTRAP_VERSION=22
ensure_bootstrap_version:
find docker/ -type f -exec sed -i "s/^\(ARG bootstrap_version\)=.*/\1=${BOOTSTRAP_VERSION}/" {} \;
sed -i 's/\(^.*flag.String(\"bootstrap-version\",\) *\"[^\"]\+\"/\1 \"${BOOTSTRAP_VERSION}\"/' test.go
@@ -323,6 +332,9 @@ DOCKER_LITE_TARGETS = $(addprefix docker_lite_,$(DOCKER_LITE_SUFFIX))
$(DOCKER_LITE_TARGETS): docker_lite_%:
${call build_docker_image,docker/lite/Dockerfile.$*,vitess/lite:$*}
+docker_lite_push:
+ for i in $(DOCKER_LITE_SUFFIX); do echo "pushing lite image: $$i"; docker push vitess/lite:$$i || exit 1; done
+
docker_lite_all: docker_lite $(DOCKER_LITE_TARGETS)
docker_local:
@@ -375,69 +387,11 @@ tools:
minimaltools:
echo $$(date): Installing minimal dependencies
- BUILD_CHROME=0 BUILD_JAVA=0 BUILD_CONSUL=0 ./bootstrap.sh
+ BUILD_JAVA=0 BUILD_CONSUL=0 ./bootstrap.sh
dependency_check:
./tools/dependency_check.sh
-install_k8s-code-generator: tools/tools.go go.mod
- go install k8s.io/code-generator/cmd/deepcopy-gen
- go install k8s.io/code-generator/cmd/client-gen
- go install k8s.io/code-generator/cmd/lister-gen
- go install k8s.io/code-generator/cmd/informer-gen
-
-DEEPCOPY_GEN=$(VTROOTBIN)/deepcopy-gen
-CLIENT_GEN=$(VTROOTBIN)/client-gen
-LISTER_GEN=$(VTROOTBIN)/lister-gen
-INFORMER_GEN=$(VTROOTBIN)/informer-gen
-
-GEN_BASE_DIR ?= vitess.io/vitess/go/vt/topo/k8stopo
-
-client_go_gen: install_k8s-code-generator
- echo $$(date): Regenerating client-go code
- # Delete and re-generate the deepcopy types
- find $(VTROOT)/go/vt/topo/k8stopo/apis/topo/v1beta1 -name "zz_generated.deepcopy.go" -delete
-
- # We output to ./ and then copy over the generated files to the appropriate path
- # This is done so we don't have rely on the repository being cloned to `$GOPATH/src/vitess.io/vitess`
-
- $(DEEPCOPY_GEN) -o ./ \
- --input-dirs $(GEN_BASE_DIR)/apis/topo/v1beta1 \
- -O zz_generated.deepcopy \
- --bounding-dirs $(GEN_BASE_DIR)/apis \
- --go-header-file ./go/vt/topo/k8stopo/boilerplate.go.txt
-
- # Delete existing code
- rm -rf go/vt/topo/k8stopo/client
-
- # Generate clientset
- $(CLIENT_GEN) -o ./ \
- --clientset-name versioned \
- --input-base $(GEN_BASE_DIR)/apis \
- --input 'topo/v1beta1' \
- --output-package $(GEN_BASE_DIR)/client/clientset \
- --fake-clientset=true \
- --go-header-file ./go/vt/topo/k8stopo/boilerplate.go.txt
-
- # Generate listers
- $(LISTER_GEN) -o ./ \
- --input-dirs $(GEN_BASE_DIR)/apis/topo/v1beta1 \
- --output-package $(GEN_BASE_DIR)/client/listers \
- --go-header-file ./go/vt/topo/k8stopo/boilerplate.go.txt
-
- # Generate informers
- $(INFORMER_GEN) -o ./ \
- --input-dirs $(GEN_BASE_DIR)/apis/topo/v1beta1 \
- --output-package $(GEN_BASE_DIR)/client/informers \
- --versioned-clientset-package $(GEN_BASE_DIR)/client/clientset/versioned \
- --listers-package $(GEN_BASE_DIR)/client/listers \
- --go-header-file ./go/vt/topo/k8stopo/boilerplate.go.txt
-
- # Move and cleanup
- mv vitess.io/vitess/go/vt/topo/k8stopo/client go/vt/topo/k8stopo/
- mv vitess.io/vitess/go/vt/topo/k8stopo/apis/topo/v1beta1/zz_generated.deepcopy.go go/vt/topo/k8stopo/apis/topo/v1beta1/zz_generated.deepcopy.go
- rm -rf vitess.io/vitess/go/vt/topo/k8stopo/
-
vtadmin_web_install:
cd web/vtadmin && npm install
@@ -457,8 +411,8 @@ vtadmin_authz_testgen:
generate_ci_workflows:
cd test && go run ci_workflow_gen.go && cd ..
-release-notes:
- go run ./go/tools/release-notes --from "$(FROM)" --to "$(TO)" --version "$(VERSION)" --summary "$(SUMMARY)"
+generate-flag-testdata:
+ ./tools/generate_flag_testdata.sh
install_kubectl_kind:
./tools/get_kubectl_kind.sh
diff --git a/README.md b/README.md
index ed2d8d80404..6f021141aca 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,8 @@
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.vitess/vitess-jdbc/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.vitess/vitess-jdbc)
-[![Build Status](https://travis-ci.org/vitessio/vitess.svg?branch=master)](https://travis-ci.org/vitessio/vitess/builds)
[![codebeat badge](https://codebeat.co/badges/51c9a056-1103-4522-9a9c-dc623821ea87)](https://codebeat.co/projects/github-com-youtube-vitess)
[![Go Report Card](https://goreportcard.com/badge/vitess.io/vitess)](https://goreportcard.com/report/vitess.io/vitess)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fvitessio%2Fvitess.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fvitessio%2Fvitess?ref=badge_shield)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1724/badge)](https://bestpractices.coreinfrastructure.org/projects/1724)
-[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=vitessio&metric=coverage)](https://sonarcloud.io/dashboard?id=vitessio)
# Vitess
diff --git a/bootstrap.sh b/bootstrap.sh
index 4dffa15cb7c..f95302ea771 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -25,7 +25,6 @@ source ./dev.env
BUILD_JAVA=${BUILD_JAVA:-1}
BUILD_CONSUL=${BUILD_CONSUL:-1}
-BUILD_CHROME=${BUILD_CHROME:-1}
VITESS_RESOURCES_DOWNLOAD_BASE_URL="https://github.com/vitessio/vitess-resources/releases/download"
VITESS_RESOURCES_RELEASE="v4.0"
@@ -114,8 +113,8 @@ install_protoc() {
esac
# This is how we'd download directly from source:
- $VTROOT/tools/wget-retry https://github.com/protocolbuffers/protobuf/releases/download/v$version/protoc-$version-$platform-${target}.zip
- #$VTROOT/tools/wget-retry "${VITESS_RESOURCES_DOWNLOAD_URL}/protoc-$version-$platform-${target}.zip"
+ "${VTROOT}/tools/wget-retry" https://github.com/protocolbuffers/protobuf/releases/download/v$version/protoc-$version-$platform-${target}.zip
+ #"${VTROOT}/tools/wget-retry" "${VITESS_RESOURCES_DOWNLOAD_URL}/protoc-$version-$platform-${target}.zip"
unzip "protoc-$version-$platform-${target}.zip"
ln -snf "$dist/bin/protoc" "$VTROOT/bin/protoc"
@@ -129,7 +128,7 @@ install_zookeeper() {
zk="zookeeper-$version"
# This is how we'd download directly from source:
# wget "https://dlcdn.apache.org/zookeeper/$zk/apache-$zk.tar.gz"
- $VTROOT/tools/wget-retry "${VITESS_RESOURCES_DOWNLOAD_URL}/apache-${zk}.tar.gz"
+ "${VTROOT}/tools/wget-retry" "${VITESS_RESOURCES_DOWNLOAD_URL}/apache-${zk}.tar.gz"
tar -xzf "$dist/apache-$zk.tar.gz"
mvn -f $dist/apache-$zk/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml clean install -P fatjar -DskipTests
mkdir -p $dist/lib
@@ -159,8 +158,8 @@ install_etcd() {
file="etcd-${version}-${platform}-${target}.${ext}"
# This is how we'd download directly from source:
- $VTROOT/tools/wget-retry "https://github.com/etcd-io/etcd/releases/download/$version/$file"
- #$VTROOT/tools/wget-retry "${VITESS_RESOURCES_DOWNLOAD_URL}/${file}"
+ "${VTROOT}/tools/wget-retry" "https://github.com/etcd-io/etcd/releases/download/$version/$file"
+ #"${VTROOT}/tools/wget-retry" "${VITESS_RESOURCES_DOWNLOAD_URL}/${file}"
if [ "$ext" = "tar.gz" ]; then
tar xzf "$file"
else
@@ -171,35 +170,6 @@ install_etcd() {
ln -snf "$dist/etcd-${version}-${platform}-${target}/etcdctl" "$VTROOT/bin/etcdctl"
}
-
-# Download and install k3s, link k3s binary into our root
-install_k3s() {
- local version="$1"
- local dist="$2"
- case $(uname) in
- Linux) local platform=linux;;
- *) echo "WARNING: unsupported platform. K3s only supports running on Linux, the k8s topology will not be available for local examples."; return;;
- esac
-
- case $(get_arch) in
- aarch64) local target="-arm64";;
- x86_64) local target="";;
- arm64) local target="-arm64";;
- *) echo "WARNING: unsupported architecture, the k8s topology will not be available for local examples."; return;;
- esac
-
- file="k3s${target}"
-
- local dest="$dist/k3s${target}-${version}-${platform}"
- # This is how we'd download directly from source:
- # download_url=https://github.com/rancher/k3s/releases/download
- # wget -O $dest "$download_url/$version/$file"
- $VTROOT/tools/wget-retry -O $dest "${VITESS_RESOURCES_DOWNLOAD_URL}/$file-$version"
- chmod +x $dest
- ln -snf $dest "$VTROOT/bin/k3s"
-}
-
-
# Download and install consul, link consul binary into our root.
install_consul() {
local version="$1"
@@ -221,41 +191,35 @@ install_consul() {
# This is how we'd download directly from source:
# download_url=https://releases.hashicorp.com/consul
# wget "${download_url}/${version}/consul_${version}_${platform}_${target}.zip"
- $VTROOT/tools/wget-retry "${VITESS_RESOURCES_DOWNLOAD_URL}/consul_${version}_${platform}_${target}.zip"
+ "${VTROOT}/tools/wget-retry" "${VITESS_RESOURCES_DOWNLOAD_URL}/consul_${version}_${platform}_${target}.zip"
unzip "consul_${version}_${platform}_${target}.zip"
ln -snf "$dist/consul" "$VTROOT/bin/consul"
}
-# Download chromedriver
-install_chromedriver() {
+# Download and install toxiproxy, link toxiproxy binary into our root.
+install_toxiproxy() {
local version="$1"
local dist="$2"
case $(uname) in
Linux) local platform=linux;;
- *) echo "Platform not supported for vtctl-web tests. Skipping chromedriver install."; return;;
+ Darwin) local platform=darwin;;
+ *) echo "WARNING: unsupported platform. Some tests that rely on toxiproxy will not function."; return;;
esac
- if [ "$(arch)" == "aarch64" ] ; then
- os=$(cat /etc/*release | grep "^ID=" | cut -d '=' -f 2)
- case $os in
- ubuntu|debian)
- sudo apt-get update -y && sudo apt install -y --no-install-recommends unzip libglib2.0-0 libnss3 libx11-6
- ;;
- centos|fedora)
- sudo yum update -y && yum install -y libX11 unzip wget
- ;;
- esac
- echo "For Arm64, using prebuilt binary from electron (https://github.com/electron/electron/) of version 76.0.3809.126"
- $VTROOT/tools/wget-retry https://github.com/electron/electron/releases/download/v6.0.3/chromedriver-v6.0.3-linux-arm64.zip
- unzip -o -q chromedriver-v6.0.3-linux-arm64.zip -d "$dist"
- rm chromedriver-v6.0.3-linux-arm64.zip
- else
- $VTROOT/tools/wget-retry "https://chromedriver.storage.googleapis.com/$version/chromedriver_linux64.zip"
- unzip -o -q chromedriver_linux64.zip -d "$dist"
- rm chromedriver_linux64.zip
- fi
+ case $(get_arch) in
+ aarch64) local target=arm64;;
+ x86_64) local target=amd64;;
+ arm64) local target=arm64;;
+ *) echo "WARNING: unsupported architecture. Some tests that rely on toxiproxy will not function."; return;;
+ esac
+
+ # This is how we'd download directly from source:
+ file="toxiproxy-server-${platform}-${target}"
+ "${VTROOT}/tools/wget-retry" "https://github.com/Shopify/toxiproxy/releases/download/$version/$file"
+ chmod +x "$dist/$file"
+ ln -snf "$dist/$file" "$VTROOT/bin/toxiproxy-server"
}
install_all() {
@@ -274,18 +238,13 @@ install_all() {
# etcd
install_dep "etcd" "v3.5.6" "$VTROOT/dist/etcd" install_etcd
- # k3s
- command -v k3s || install_dep "k3s" "v1.0.0" "$VTROOT/dist/k3s" install_k3s
-
# consul
if [ "$BUILD_CONSUL" == 1 ] ; then
install_dep "Consul" "1.11.4" "$VTROOT/dist/consul" install_consul
fi
- # chromedriver
- if [ "$BUILD_CHROME" == 1 ] ; then
- install_dep "chromedriver" "90.0.4430.24" "$VTROOT/dist/chromedriver" install_chromedriver
- fi
+ # toxiproxy
+ install_dep "toxiproxy" "v2.5.0" "$VTROOT/dist/toxiproxy" install_toxiproxy
echo
echo "bootstrap finished - run 'make build' to compile"
diff --git a/build.env b/build.env
index 64a55711da8..6077197fe88 100755
--- a/build.env
+++ b/build.env
@@ -17,7 +17,7 @@
source ./tools/shell_functions.inc
go version >/dev/null 2>&1 || fail "Go is not installed or is not in \$PATH. See https://vitess.io/contributing/build-from-source for install instructions."
-goversion_min 1.20.1 || fail "Go version reported: `go version`. Version 1.20.1+ required. See https://vitess.io/contributing/build-from-source for install instructions."
+goversion_min 1.21.1 || echo "Go version reported: `go version`. Version 1.21.1+ recommended. See https://vitess.io/contributing/build-from-source for install instructions."
mkdir -p dist
mkdir -p bin
diff --git a/doc/releasenotes/10_0_0_release_notes.md b/changelog/10.0/10.0.0/release_notes.md
similarity index 100%
rename from doc/releasenotes/10_0_0_release_notes.md
rename to changelog/10.0/10.0.0/release_notes.md
diff --git a/doc/releasenotes/10_0_1_release_notes.md b/changelog/10.0/10.0.1/release_notes.md
similarity index 100%
rename from doc/releasenotes/10_0_1_release_notes.md
rename to changelog/10.0/10.0.1/release_notes.md
diff --git a/doc/releasenotes/10_0_2_release_notes.md b/changelog/10.0/10.0.2/release_notes.md
similarity index 100%
rename from doc/releasenotes/10_0_2_release_notes.md
rename to changelog/10.0/10.0.2/release_notes.md
diff --git a/doc/releasenotes/10_0_3_release_notes.md b/changelog/10.0/10.0.3/release_notes.md
similarity index 100%
rename from doc/releasenotes/10_0_3_release_notes.md
rename to changelog/10.0/10.0.3/release_notes.md
diff --git a/doc/releasenotes/10_0_3_summary.md b/changelog/10.0/10.0.3/summary.md
similarity index 100%
rename from doc/releasenotes/10_0_3_summary.md
rename to changelog/10.0/10.0.3/summary.md
diff --git a/doc/releasenotes/10_0_4_release_notes.md b/changelog/10.0/10.0.4/release_notes.md
similarity index 100%
rename from doc/releasenotes/10_0_4_release_notes.md
rename to changelog/10.0/10.0.4/release_notes.md
diff --git a/doc/releasenotes/10_0_4_summary.md b/changelog/10.0/10.0.4/summary.md
similarity index 100%
rename from doc/releasenotes/10_0_4_summary.md
rename to changelog/10.0/10.0.4/summary.md
diff --git a/doc/releasenotes/10_0_5_release_notes.md b/changelog/10.0/10.0.5/release_notes.md
similarity index 100%
rename from doc/releasenotes/10_0_5_release_notes.md
rename to changelog/10.0/10.0.5/release_notes.md
diff --git a/doc/releasenotes/10_0_5_summary.md b/changelog/10.0/10.0.5/summary.md
similarity index 100%
rename from doc/releasenotes/10_0_5_summary.md
rename to changelog/10.0/10.0.5/summary.md
diff --git a/changelog/10.0/README.md b/changelog/10.0/README.md
new file mode 100644
index 00000000000..304cc933a16
--- /dev/null
+++ b/changelog/10.0/README.md
@@ -0,0 +1,18 @@
+## v10.0
+* **[10.0.5](10.0.5)**
+ * [Release Notes](10.0.5/release_notes.md)
+
+* **[10.0.4](10.0.4)**
+ * [Release Notes](10.0.4/release_notes.md)
+
+* **[10.0.3](10.0.3)**
+ * [Release Notes](10.0.3/release_notes.md)
+
+* **[10.0.2](10.0.2)**
+ * [Release Notes](10.0.2/release_notes.md)
+
+* **[10.0.1](10.0.1)**
+ * [Release Notes](10.0.1/release_notes.md)
+
+* **[10.0.0](10.0.0)**
+ * [Release Notes](10.0.0/release_notes.md)
diff --git a/doc/releasenotes/11_0_0_release_notes.md b/changelog/11.0/11.0.0/release_notes.md
similarity index 100%
rename from doc/releasenotes/11_0_0_release_notes.md
rename to changelog/11.0/11.0.0/release_notes.md
diff --git a/doc/releasenotes/11_0_1_release_notes.md b/changelog/11.0/11.0.1/release_notes.md
similarity index 100%
rename from doc/releasenotes/11_0_1_release_notes.md
rename to changelog/11.0/11.0.1/release_notes.md
diff --git a/doc/releasenotes/11_0_2_release_notes.md b/changelog/11.0/11.0.2/release_notes.md
similarity index 100%
rename from doc/releasenotes/11_0_2_release_notes.md
rename to changelog/11.0/11.0.2/release_notes.md
diff --git a/doc/releasenotes/11_0_2_summary.md b/changelog/11.0/11.0.2/summary.md
similarity index 100%
rename from doc/releasenotes/11_0_2_summary.md
rename to changelog/11.0/11.0.2/summary.md
diff --git a/doc/releasenotes/11_0_3_release_notes.md b/changelog/11.0/11.0.3/release_notes.md
similarity index 100%
rename from doc/releasenotes/11_0_3_release_notes.md
rename to changelog/11.0/11.0.3/release_notes.md
diff --git a/doc/releasenotes/11_0_3_summary.md b/changelog/11.0/11.0.3/summary.md
similarity index 100%
rename from doc/releasenotes/11_0_3_summary.md
rename to changelog/11.0/11.0.3/summary.md
diff --git a/doc/releasenotes/11_0_4_release_notes.md b/changelog/11.0/11.0.4/release_notes.md
similarity index 100%
rename from doc/releasenotes/11_0_4_release_notes.md
rename to changelog/11.0/11.0.4/release_notes.md
diff --git a/doc/releasenotes/11_0_4_summary.md b/changelog/11.0/11.0.4/summary.md
similarity index 100%
rename from doc/releasenotes/11_0_4_summary.md
rename to changelog/11.0/11.0.4/summary.md
diff --git a/changelog/11.0/README.md b/changelog/11.0/README.md
new file mode 100644
index 00000000000..51dfb2e5648
--- /dev/null
+++ b/changelog/11.0/README.md
@@ -0,0 +1,15 @@
+## v11.0
+* **[11.0.4](11.0.4)**
+ * [Release Notes](11.0.4/release_notes.md)
+
+* **[11.0.3](11.0.3)**
+ * [Release Notes](11.0.3/release_notes.md)
+
+* **[11.0.2](11.0.2)**
+ * [Release Notes](11.0.2/release_notes.md)
+
+* **[11.0.1](11.0.1)**
+ * [Release Notes](11.0.1/release_notes.md)
+
+* **[11.0.0](11.0.0)**
+ * [Release Notes](11.0.0/release_notes.md)
diff --git a/doc/releasenotes/12_0_0_release_notes.md b/changelog/12.0/12.0.0/release_notes.md
similarity index 100%
rename from doc/releasenotes/12_0_0_release_notes.md
rename to changelog/12.0/12.0.0/release_notes.md
diff --git a/doc/releasenotes/12_0_0_summary.md b/changelog/12.0/12.0.0/summary.md
similarity index 100%
rename from doc/releasenotes/12_0_0_summary.md
rename to changelog/12.0/12.0.0/summary.md
diff --git a/doc/releasenotes/12_0_1_release_notes.md b/changelog/12.0/12.0.1/release_notes.md
similarity index 100%
rename from doc/releasenotes/12_0_1_release_notes.md
rename to changelog/12.0/12.0.1/release_notes.md
diff --git a/doc/releasenotes/12_0_1_summary.md b/changelog/12.0/12.0.1/summary.md
similarity index 100%
rename from doc/releasenotes/12_0_1_summary.md
rename to changelog/12.0/12.0.1/summary.md
diff --git a/doc/releasenotes/12_0_2_release_notes.md b/changelog/12.0/12.0.2/release_notes.md
similarity index 100%
rename from doc/releasenotes/12_0_2_release_notes.md
rename to changelog/12.0/12.0.2/release_notes.md
diff --git a/doc/releasenotes/12_0_2_summary.md b/changelog/12.0/12.0.2/summary.md
similarity index 100%
rename from doc/releasenotes/12_0_2_summary.md
rename to changelog/12.0/12.0.2/summary.md
diff --git a/doc/releasenotes/12_0_3_release_notes.md b/changelog/12.0/12.0.3/release_notes.md
similarity index 100%
rename from doc/releasenotes/12_0_3_release_notes.md
rename to changelog/12.0/12.0.3/release_notes.md
diff --git a/doc/releasenotes/12_0_3_summary.md b/changelog/12.0/12.0.3/summary.md
similarity index 100%
rename from doc/releasenotes/12_0_3_summary.md
rename to changelog/12.0/12.0.3/summary.md
diff --git a/doc/releasenotes/12_0_4_release_notes.md b/changelog/12.0/12.0.4/release_notes.md
similarity index 100%
rename from doc/releasenotes/12_0_4_release_notes.md
rename to changelog/12.0/12.0.4/release_notes.md
diff --git a/doc/releasenotes/12_0_5_changelog.md b/changelog/12.0/12.0.5/changelog.md
similarity index 100%
rename from doc/releasenotes/12_0_5_changelog.md
rename to changelog/12.0/12.0.5/changelog.md
diff --git a/doc/releasenotes/12_0_5_release_notes.md b/changelog/12.0/12.0.5/release_notes.md
similarity index 92%
rename from doc/releasenotes/12_0_5_release_notes.md
rename to changelog/12.0/12.0.5/release_notes.md
index fc2c613e4da..dbff8a5aade 100644
--- a/doc/releasenotes/12_0_5_release_notes.md
+++ b/changelog/12.0/12.0.5/release_notes.md
@@ -9,7 +9,7 @@ Below is a summary of this patch release. You can learn more [here](https://go.d
> go1.17.12 (released 2022-07-12) includes security fixes to the compress/gzip, encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath packages, as well as bug fixes to the compiler, the go command, the runtime, and the runtime/metrics package. [See the Go 1.17.12 milestone](https://github.com/golang/go/issues?q=milestone%3AGo1.17.12+label%3ACherryPickApproved) on our issue tracker for details.
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/12_0_5_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/12.0/12.0.5/changelog.md).
The release includes 7 commits (excluding merges)
diff --git a/doc/releasenotes/12_0_6_changelog.md b/changelog/12.0/12.0.6/changelog.md
similarity index 100%
rename from doc/releasenotes/12_0_6_changelog.md
rename to changelog/12.0/12.0.6/changelog.md
diff --git a/doc/releasenotes/12_0_6_release_notes.md b/changelog/12.0/12.0.6/release_notes.md
similarity index 93%
rename from doc/releasenotes/12_0_6_release_notes.md
rename to changelog/12.0/12.0.6/release_notes.md
index 8afbe0a4239..c9c743d95ea 100644
--- a/doc/releasenotes/12_0_6_release_notes.md
+++ b/changelog/12.0/12.0.6/release_notes.md
@@ -15,7 +15,7 @@ This change is documented on our website [here](https://vitess.io/docs/12.0/over
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/12_0_6_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/12.0/12.0.6/changelog.md).
The release includes 11 commits (excluding merges)
diff --git a/doc/releasenotes/12_0_6_summary.md b/changelog/12.0/12.0.6/summary.md
similarity index 100%
rename from doc/releasenotes/12_0_6_summary.md
rename to changelog/12.0/12.0.6/summary.md
diff --git a/changelog/12.0/README.md b/changelog/12.0/README.md
new file mode 100644
index 00000000000..131b2df443d
--- /dev/null
+++ b/changelog/12.0/README.md
@@ -0,0 +1,23 @@
+## v12.0
+* **[12.0.6](12.0.6)**
+ * [Changelog](12.0.6/changelog.md)
+ * [Release Notes](12.0.6/release_notes.md)
+
+* **[12.0.5](12.0.5)**
+ * [Changelog](12.0.5/changelog.md)
+ * [Release Notes](12.0.5/release_notes.md)
+
+* **[12.0.4](12.0.4)**
+ * [Release Notes](12.0.4/release_notes.md)
+
+* **[12.0.3](12.0.3)**
+ * [Release Notes](12.0.3/release_notes.md)
+
+* **[12.0.2](12.0.2)**
+ * [Release Notes](12.0.2/release_notes.md)
+
+* **[12.0.1](12.0.1)**
+ * [Release Notes](12.0.1/release_notes.md)
+
+* **[12.0.0](12.0.0)**
+ * [Release Notes](12.0.0/release_notes.md)
diff --git a/doc/releasenotes/13_0_0_release_notes.md b/changelog/13.0/13.0.0/release_notes.md
similarity index 100%
rename from doc/releasenotes/13_0_0_release_notes.md
rename to changelog/13.0/13.0.0/release_notes.md
diff --git a/doc/releasenotes/13_0_0_summary.md b/changelog/13.0/13.0.0/summary.md
similarity index 100%
rename from doc/releasenotes/13_0_0_summary.md
rename to changelog/13.0/13.0.0/summary.md
diff --git a/doc/releasenotes/13_0_1_release_notes.md b/changelog/13.0/13.0.1/release_notes.md
similarity index 100%
rename from doc/releasenotes/13_0_1_release_notes.md
rename to changelog/13.0/13.0.1/release_notes.md
diff --git a/doc/releasenotes/13_0_2_changelog.md b/changelog/13.0/13.0.2/changelog.md
similarity index 100%
rename from doc/releasenotes/13_0_2_changelog.md
rename to changelog/13.0/13.0.2/changelog.md
diff --git a/doc/releasenotes/13_0_2_release_notes.md b/changelog/13.0/13.0.2/release_notes.md
similarity index 93%
rename from doc/releasenotes/13_0_2_release_notes.md
rename to changelog/13.0/13.0.2/release_notes.md
index 310eb5e633a..12692031e2a 100644
--- a/doc/releasenotes/13_0_2_release_notes.md
+++ b/changelog/13.0/13.0.2/release_notes.md
@@ -9,7 +9,7 @@ Below is a summary of this patch release. You can learn more [here](https://go.d
> go1.17.12 (released 2022-07-12) includes security fixes to the compress/gzip, encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath packages, as well as bug fixes to the compiler, the go command, the runtime, and the runtime/metrics package. [See the Go 1.17.12 milestone](https://github.com/golang/go/issues?q=milestone%3AGo1.17.12+label%3ACherryPickApproved) on our issue tracker for details.
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/13_0_2_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/13.0/13.0.2/changelog.md).
The release includes 28 commits (excluding merges)
Thanks to all our contributors: @GuptaManan100, @aquarapid, @frouioui, @harshit-gangal, @mattlord, @rohit-nayak-ps, @systay, @vitess-bot[bot], @vmg
\ No newline at end of file
diff --git a/doc/releasenotes/13_0_2_summary.md b/changelog/13.0/13.0.2/summary.md
similarity index 100%
rename from doc/releasenotes/13_0_2_summary.md
rename to changelog/13.0/13.0.2/summary.md
diff --git a/doc/releasenotes/13_0_3_changelog.md b/changelog/13.0/13.0.3/changelog.md
similarity index 100%
rename from doc/releasenotes/13_0_3_changelog.md
rename to changelog/13.0/13.0.3/changelog.md
diff --git a/doc/releasenotes/13_0_3_release_notes.md b/changelog/13.0/13.0.3/release_notes.md
similarity index 93%
rename from doc/releasenotes/13_0_3_release_notes.md
rename to changelog/13.0/13.0.3/release_notes.md
index 3fee980f099..b04c0d69d20 100644
--- a/doc/releasenotes/13_0_3_release_notes.md
+++ b/changelog/13.0/13.0.3/release_notes.md
@@ -15,7 +15,7 @@ This change is documented on our website [here](https://vitess.io/docs/13.0/over
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/13_0_3_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/13.0/13.0.3/changelog.md).
The release includes 17 commits(excluding merges)
diff --git a/doc/releasenotes/13_0_3_summary.md b/changelog/13.0/13.0.3/summary.md
similarity index 100%
rename from doc/releasenotes/13_0_3_summary.md
rename to changelog/13.0/13.0.3/summary.md
diff --git a/changelog/13.0/README.md b/changelog/13.0/README.md
new file mode 100644
index 00000000000..780625ef69a
--- /dev/null
+++ b/changelog/13.0/README.md
@@ -0,0 +1,14 @@
+## v13.0
+* **[13.0.3](13.0.3)**
+ * [Changelog](13.0.3/changelog.md)
+ * [Release Notes](13.0.3/release_notes.md)
+
+* **[13.0.2](13.0.2)**
+ * [Changelog](13.0.2/changelog.md)
+ * [Release Notes](13.0.2/release_notes.md)
+
+* **[13.0.1](13.0.1)**
+ * [Release Notes](13.0.1/release_notes.md)
+
+* **[13.0.0](13.0.0)**
+ * [Release Notes](13.0.0/release_notes.md)
diff --git a/doc/releasenotes/14_0_0_changelog.md b/changelog/14.0/14.0.0/changelog.md
similarity index 100%
rename from doc/releasenotes/14_0_0_changelog.md
rename to changelog/14.0/14.0.0/changelog.md
diff --git a/doc/releasenotes/14_0_0_release_notes.md b/changelog/14.0/14.0.0/release_notes.md
similarity index 99%
rename from doc/releasenotes/14_0_0_release_notes.md
rename to changelog/14.0/14.0.0/release_notes.md
index a7b4bcf4ef0..5f88f6975db 100644
--- a/doc/releasenotes/14_0_0_release_notes.md
+++ b/changelog/14.0/14.0.0/release_notes.md
@@ -319,7 +319,7 @@ Work has gone into making the advisory locks (`get_lock()`, `release_lock()`, et
A long time ago, the sharding column and type were specified at the keyspace level. This syntax is now deprecated and will be removed in v15.
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/14_0_0_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.0/changelog.md).
The release includes 1101 commits (excluding merges)
diff --git a/doc/releasenotes/14_0_0_summary.md b/changelog/14.0/14.0.0/summary.md
similarity index 100%
rename from doc/releasenotes/14_0_0_summary.md
rename to changelog/14.0/14.0.0/summary.md
diff --git a/doc/releasenotes/14_0_1_changelog.md b/changelog/14.0/14.0.1/changelog.md
similarity index 100%
rename from doc/releasenotes/14_0_1_changelog.md
rename to changelog/14.0/14.0.1/changelog.md
diff --git a/doc/releasenotes/14_0_1_release_notes.md b/changelog/14.0/14.0.1/release_notes.md
similarity index 94%
rename from doc/releasenotes/14_0_1_release_notes.md
rename to changelog/14.0/14.0.1/release_notes.md
index 57d68be31c2..639af4fce96 100644
--- a/doc/releasenotes/14_0_1_release_notes.md
+++ b/changelog/14.0/14.0.1/release_notes.md
@@ -13,7 +13,7 @@ Below is a summary of this patch release. You can learn more [here](https://go.d
> go1.18.4 (released 2022-07-12) includes security fixes to the compress/gzip, encoding/gob, encoding/xml, go/parser, io/fs, net/http, and path/filepath packages, as well as bug fixes to the compiler, the go command, the linker, the runtime, and the runtime/metrics package. [See the Go 1.18.4 milestone](https://github.com/golang/go/issues?q=milestone%3AGo1.18.4+label%3ACherryPickApproved) on our issue tracker for details.
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/14_0_1_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.1/changelog.md).
The release includes 25 commits (excluding merges)
diff --git a/doc/releasenotes/14_0_1_summary.md b/changelog/14.0/14.0.1/summary.md
similarity index 100%
rename from doc/releasenotes/14_0_1_summary.md
rename to changelog/14.0/14.0.1/summary.md
diff --git a/doc/releasenotes/14_0_2_changelog.md b/changelog/14.0/14.0.2/changelog.md
similarity index 100%
rename from doc/releasenotes/14_0_2_changelog.md
rename to changelog/14.0/14.0.2/changelog.md
diff --git a/doc/releasenotes/14_0_2_release_notes.md b/changelog/14.0/14.0.2/release_notes.md
similarity index 95%
rename from doc/releasenotes/14_0_2_release_notes.md
rename to changelog/14.0/14.0.2/release_notes.md
index d83b940f45c..724673af576 100644
--- a/doc/releasenotes/14_0_2_release_notes.md
+++ b/changelog/14.0/14.0.2/release_notes.md
@@ -18,7 +18,7 @@ Since the end-of-life of MariaDB 10.2, its Docker image is unavailable, and we d
You can find more information on the list of supported databases on our documentation website, [here](https://vitess.io/docs/14.0/overview/supported-databases/).
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/14_0_2_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.2/changelog.md).
The release includes 23 commits (excluding merges)
diff --git a/doc/releasenotes/14_0_2_summary.md b/changelog/14.0/14.0.2/summary.md
similarity index 100%
rename from doc/releasenotes/14_0_2_summary.md
rename to changelog/14.0/14.0.2/summary.md
diff --git a/doc/releasenotes/14_0_3_changelog.md b/changelog/14.0/14.0.3/changelog.md
similarity index 100%
rename from doc/releasenotes/14_0_3_changelog.md
rename to changelog/14.0/14.0.3/changelog.md
diff --git a/doc/releasenotes/14_0_3_release_notes.md b/changelog/14.0/14.0.3/release_notes.md
similarity index 93%
rename from doc/releasenotes/14_0_3_release_notes.md
rename to changelog/14.0/14.0.3/release_notes.md
index 721c47640e2..5d5cc9b871c 100644
--- a/doc/releasenotes/14_0_3_release_notes.md
+++ b/changelog/14.0/14.0.3/release_notes.md
@@ -12,7 +12,7 @@ This problem could be resolved by restarting the VTOrc so that it discovers all
frequently, this posed a greater challenge, since some pods when evicted and rescheduled on a different node, would sometimes fail to be discovered by VTOrc.
This has problem has been addressed in this patch by the fix https://github.com/vitessio/vitess/pull/10662.
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/14_0_3_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.3/changelog.md).
The release includes 12 commits (excluding merges)
diff --git a/doc/releasenotes/14_0_3_summary.md b/changelog/14.0/14.0.3/summary.md
similarity index 100%
rename from doc/releasenotes/14_0_3_summary.md
rename to changelog/14.0/14.0.3/summary.md
diff --git a/doc/releasenotes/14_0_4_changelog.md b/changelog/14.0/14.0.4/changelog.md
similarity index 100%
rename from doc/releasenotes/14_0_4_changelog.md
rename to changelog/14.0/14.0.4/changelog.md
diff --git a/doc/releasenotes/14_0_4_release_notes.md b/changelog/14.0/14.0.4/release_notes.md
similarity index 93%
rename from doc/releasenotes/14_0_4_release_notes.md
rename to changelog/14.0/14.0.4/release_notes.md
index 334efefd05f..31cbbc26627 100644
--- a/doc/releasenotes/14_0_4_release_notes.md
+++ b/changelog/14.0/14.0.4/release_notes.md
@@ -14,7 +14,7 @@ Below is a summary of this patch release. You can learn more [here](https://go.d
An issue in versions `<= v14.0.3` and `<= v15.0.0` that generated corrupted results for non-full-group-by queries with a JOIN
is now fixed. The full issue can be found [here](https://github.com/vitessio/vitess/issues/11625), and its fix [here](https://github.com/vitessio/vitess/pull/11633).
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/14_0_4_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.4/changelog.md).
The release includes 24 commits (excluding merges)
diff --git a/doc/releasenotes/14_0_4_summary.md b/changelog/14.0/14.0.4/summary.md
similarity index 100%
rename from doc/releasenotes/14_0_4_summary.md
rename to changelog/14.0/14.0.4/summary.md
diff --git a/changelog/14.0/14.0.5/changelog.md b/changelog/14.0/14.0.5/changelog.md
new file mode 100644
index 00000000000..695adc1274d
--- /dev/null
+++ b/changelog/14.0/14.0.5/changelog.md
@@ -0,0 +1,55 @@
+# Changelog of Vitess v14.0.5
+
+### Bug fixes
+#### Observability
+ * Reset the current lag when closing the replication lag reader. [#12683](https://github.com/vitessio/vitess/pull/12683)
+#### Online DDL
+ * Mysqld.GetSchema: tolerate tables being dropped while inspecting schema [#12641](https://github.com/vitessio/vitess/pull/12641)
+#### Query Serving
+ * Fix CheckMySQL by setting the correct wanted state [#11895](https://github.com/vitessio/vitess/pull/11895)
+ * [release-14.0] Fix sending a ServerLost error when reading a packet fails (#11920) [#11928](https://github.com/vitessio/vitess/pull/11928)
+ * Fix: Date math with Interval keyword [#12082](https://github.com/vitessio/vitess/pull/12082)
+ * BugFix: Cast expression translation by evaluation engine [#12111](https://github.com/vitessio/vitess/pull/12111)
+ * Fix aggregation on outer joins [#12298](https://github.com/vitessio/vitess/pull/12298)
+ * [release-14.0] fix: added null safe operator precendence rule (#12297) [#12305](https://github.com/vitessio/vitess/pull/12305)
+ * Fix scalar aggregation engine primitive for column truncation [#12468](https://github.com/vitessio/vitess/pull/12468)
+ * [release-16.0] BugFix: Unsharded query using a derived table and a dual table [#12484](https://github.com/vitessio/vitess/pull/12484)
+ * collations: fix sorting in UCA900 collations [#12555](https://github.com/vitessio/vitess/pull/12555)
+ * [release-14.0] `ApplyVSchemaDDL`: escape Sequence names when writing the VSchema (#12519) [#12597](https://github.com/vitessio/vitess/pull/12597)
+ * [gen4 planner] Make sure to not push down expressions when not possible [#12607](https://github.com/vitessio/vitess/pull/12607)
+ * [release-14.0] Fix `panic` when executing a prepare statement with over `65,528` parameters [#12628](https://github.com/vitessio/vitess/pull/12628)
+ * [planner bugfix] add expressions to HAVING [#12668](https://github.com/vitessio/vitess/pull/12668)
+ * [release-14.0] Always add columns in the `Derived` operator [#12681](https://github.com/vitessio/vitess/pull/12681)
+ * [planner fix] make unknown column an error only for sharded queries [#12704](https://github.com/vitessio/vitess/pull/12704)
+### CI/Build
+#### Build/CI
+ * Move towards MySQL 8.0 as the default template generation [#11153](https://github.com/vitessio/vitess/pull/11153)
+ * Fix deprecated usage of set-output [#11844](https://github.com/vitessio/vitess/pull/11844)
+ * Use `go1.18.9` in the next release upgrade downgrade E2E tests [#11925](https://github.com/vitessio/vitess/pull/11925)
+ * [release-14.0] Make upgrade downgrade job names unique [#12497](https://github.com/vitessio/vitess/pull/12497)
+ * v14 backport: CI: increase overall test timeouts for all OnlineDDL tests [#12590](https://github.com/vitessio/vitess/pull/12590)
+#### Online DDL
+ * CI: extend timeouts in onlineddl_vrepl due to slow CI runners [#12583](https://github.com/vitessio/vitess/pull/12583)
+#### TabletManager
+ * Fix closing the body for HTTP requests [#11842](https://github.com/vitessio/vitess/pull/11842)
+### Enhancement
+#### Build/CI
+ * Auto upgrade the Golang version [#12585](https://github.com/vitessio/vitess/pull/12585)
+#### Governance
+ * [release-14.0] Add manan and florent to Docker files CODEOWNERS (#11981) [#11982](https://github.com/vitessio/vitess/pull/11982)
+### Internal Cleanup
+#### General
+ * [release-14.0] Fix release script for the version in the docker script (#12285) [#12290](https://github.com/vitessio/vitess/pull/12290)
+### Performance
+#### Cluster management
+ * Bug fix: Cache filtered out tablets in topology watcher to avoid unnecessary GetTablet calls to topo [#12194](https://github.com/vitessio/vitess/pull/12194)
+### Release
+#### Build/CI
+ * [release-14.0] Tooling improvements backports [#12526](https://github.com/vitessio/vitess/pull/12526)
+#### Documentation
+ * Re-organize the `releasenotes` directory into `changelog` [#12566](https://github.com/vitessio/vitess/pull/12566)
+#### General
+ * Back to dev mode after v14.0.4 [#11845](https://github.com/vitessio/vitess/pull/11845)
+ * Release of v14.0.4 [#11846](https://github.com/vitessio/vitess/pull/11846)
+ * Code freeze of `release-14.0` for `v14.0.5` [#12763](https://github.com/vitessio/vitess/pull/12763)
+
diff --git a/changelog/14.0/14.0.5/release_notes.md b/changelog/14.0/14.0.5/release_notes.md
new file mode 100644
index 00000000000..ec2a762d4a5
--- /dev/null
+++ b/changelog/14.0/14.0.5/release_notes.md
@@ -0,0 +1,7 @@
+# Release of Vitess v14.0.5
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/14.0/14.0.5/changelog.md).
+
+The release includes 33 commits (excluding merges)
+
+Thanks to all our contributors: @GuptaManan100, @dbussink, @frouioui, @harshit-gangal, @rsajwani, @shlomi-noach, @systay, @vitess-bot[bot], @vmg
+
diff --git a/changelog/14.0/README.md b/changelog/14.0/README.md
new file mode 100644
index 00000000000..1b251dd0b01
--- /dev/null
+++ b/changelog/14.0/README.md
@@ -0,0 +1,24 @@
+## v14.0
+* **[14.0.5](14.0.5)**
+ * [Changelog](14.0.5/changelog.md)
+ * [Release Notes](14.0.5/release_notes.md)
+
+* **[14.0.4](14.0.4)**
+ * [Changelog](14.0.4/changelog.md)
+ * [Release Notes](14.0.4/release_notes.md)
+
+* **[14.0.3](14.0.3)**
+ * [Changelog](14.0.3/changelog.md)
+ * [Release Notes](14.0.3/release_notes.md)
+
+* **[14.0.2](14.0.2)**
+ * [Changelog](14.0.2/changelog.md)
+ * [Release Notes](14.0.2/release_notes.md)
+
+* **[14.0.1](14.0.1)**
+ * [Changelog](14.0.1/changelog.md)
+ * [Release Notes](14.0.1/release_notes.md)
+
+* **[14.0.0](14.0.0)**
+ * [Changelog](14.0.0/changelog.md)
+ * [Release Notes](14.0.0/release_notes.md)
diff --git a/doc/releasenotes/15_0_0_changelog.md b/changelog/15.0/15.0.0/changelog.md
similarity index 100%
rename from doc/releasenotes/15_0_0_changelog.md
rename to changelog/15.0/15.0.0/changelog.md
diff --git a/doc/releasenotes/15_0_0_release_notes.md b/changelog/15.0/15.0.0/release_notes.md
similarity index 99%
rename from doc/releasenotes/15_0_0_release_notes.md
rename to changelog/15.0/15.0.0/release_notes.md
index 430100fa8f5..f60fd0547f1 100644
--- a/doc/releasenotes/15_0_0_release_notes.md
+++ b/changelog/15.0/15.0.0/release_notes.md
@@ -455,7 +455,7 @@ Below are the changes for each binary.
- [zkctld](https://github.com/vitessio/vitess/blob/release-15.0/doc/flags/14.0-to-15.0-transition/zkctld.diff)
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/15_0_0_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/15.0/15.0.0/changelog.md).
The release includes 595 commits (excluding merges)
diff --git a/doc/releasenotes/15_0_0_summary.md b/changelog/15.0/15.0.0/summary.md
similarity index 100%
rename from doc/releasenotes/15_0_0_summary.md
rename to changelog/15.0/15.0.0/summary.md
diff --git a/doc/releasenotes/15_0_1_changelog.md b/changelog/15.0/15.0.1/changelog.md
similarity index 100%
rename from doc/releasenotes/15_0_1_changelog.md
rename to changelog/15.0/15.0.1/changelog.md
diff --git a/doc/releasenotes/15_0_1_release_notes.md b/changelog/15.0/15.0.1/release_notes.md
similarity index 93%
rename from doc/releasenotes/15_0_1_release_notes.md
rename to changelog/15.0/15.0.1/release_notes.md
index caeba725787..1737f0fd2f8 100644
--- a/doc/releasenotes/15_0_1_release_notes.md
+++ b/changelog/15.0/15.0.1/release_notes.md
@@ -16,7 +16,7 @@ This issue is fixed in 15.0.1. The full issue can be found [here](https://github
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/15_0_1_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/15.0/15.0.1/changelog.md).
The release includes 25 commits (excluding merges)
diff --git a/doc/releasenotes/15_0_1_summary.md b/changelog/15.0/15.0.1/summary.md
similarity index 100%
rename from doc/releasenotes/15_0_1_summary.md
rename to changelog/15.0/15.0.1/summary.md
diff --git a/doc/releasenotes/15_0_2_changelog.md b/changelog/15.0/15.0.2/changelog.md
similarity index 100%
rename from doc/releasenotes/15_0_2_changelog.md
rename to changelog/15.0/15.0.2/changelog.md
diff --git a/doc/releasenotes/15_0_2_release_notes.md b/changelog/15.0/15.0.2/release_notes.md
similarity index 91%
rename from doc/releasenotes/15_0_2_release_notes.md
rename to changelog/15.0/15.0.2/release_notes.md
index 92317b60dc4..33ece0e1c73 100644
--- a/doc/releasenotes/15_0_2_release_notes.md
+++ b/changelog/15.0/15.0.2/release_notes.md
@@ -12,7 +12,7 @@ Below is a summary of this patch release. You can learn more [here](https://grou
------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/15_0_2_changelog.md).
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/15.0/15.0.2/changelog.md).
The release includes 14 commits (excluding merges)
diff --git a/doc/releasenotes/15_0_2_summary.md b/changelog/15.0/15.0.2/summary.md
similarity index 79%
rename from doc/releasenotes/15_0_2_summary.md
rename to changelog/15.0/15.0.2/summary.md
index 6f3346efa47..b12a97879a5 100644
--- a/doc/releasenotes/15_0_2_summary.md
+++ b/changelog/15.0/15.0.2/summary.md
@@ -3,7 +3,7 @@
### Upgrade to `go1.18.9`
Vitess `v15.0.2` now runs on `go1.18.9`.
-The patch release of Go, `go1.18.9`, was one of the main reasons for this release as it includes an important security fixe to `net/http` package, which is use extensively by Vitess.
+The patch release of Go, `go1.18.9`, was one of the main reasons for this release as it includes an important security fix to `net/http` package, which is used extensively by Vitess.
Below is a summary of this patch release. You can learn more [here](https://groups.google.com/g/golang-announce/c/L_3rmdT0BMU).
> go1.18.9 (released 2022-12-06) includes security fixes to the net/http and os packages, as well as bug fixes to cgo, the compiler, the runtime, and the crypto/x509 and os/exec packages.
diff --git a/changelog/15.0/15.0.3/changelog.md b/changelog/15.0/15.0.3/changelog.md
new file mode 100644
index 00000000000..5634b7aa24a
--- /dev/null
+++ b/changelog/15.0/15.0.3/changelog.md
@@ -0,0 +1,89 @@
+# Changelog of Vitess v15.0.3
+
+### Bug fixes
+#### Backup and Restore
+ * mysqlctl: flags should be added to vtbackup [#12048](https://github.com/vitessio/vitess/pull/12048)
+#### Build/CI
+ * Fix `codeql` workflow timeout issue [#11760](https://github.com/vitessio/vitess/pull/11760)
+ * [release-15.0] Use `go1.20.1` in upgrade/downgrade tests [#12512](https://github.com/vitessio/vitess/pull/12512)
+#### CLI
+ * Purge logs without panicking [#12187](https://github.com/vitessio/vitess/pull/12187)
+ * Fix `vtctldclient`'s Root command to return an error on unknown command [#12481](https://github.com/vitessio/vitess/pull/12481)
+#### Cluster management
+ * Skip `TestReparentDoesntHangIfPrimaryFails` in vttablet v16 and above [#12387](https://github.com/vitessio/vitess/pull/12387)
+ * Fix initialization code to also stop replication to prevent crash [#12534](https://github.com/vitessio/vitess/pull/12534)
+#### Observability
+ * Reset the current lag when closing the replication lag reader. [#12683](https://github.com/vitessio/vitess/pull/12683)
+#### Online DDL
+ * Bugfix/Backport to v15: Fix schema migrations requested_timestamp zero values [#12263](https://github.com/vitessio/vitess/pull/12263)
+ * Mysqld.GetSchema: tolerate tables being dropped while inspecting schema [#12641](https://github.com/vitessio/vitess/pull/12641)
+#### Operator
+ * Fix rbac config in the vtop example [#12034](https://github.com/vitessio/vitess/pull/12034)
+#### Query Serving
+ * [release-15.0] only expand when we have full information (#11998) [#12002](https://github.com/vitessio/vitess/pull/12002)
+ * Fix: Date math with Interval keyword [#12082](https://github.com/vitessio/vitess/pull/12082)
+ * BugFix: Cast expression translation by evaluation engine [#12111](https://github.com/vitessio/vitess/pull/12111)
+ * [Gen4] Fix lookup vindexes with `autocommit` enabled [#12172](https://github.com/vitessio/vitess/pull/12172)
+ * VTGate: Ensure HealthCheck Cache Secondary Maps Stay in Sync With Authoritative Map on Tablet Delete [#12178](https://github.com/vitessio/vitess/pull/12178)
+ * Fix aggregation on outer joins [#12298](https://github.com/vitessio/vitess/pull/12298)
+ * [release-15.0] fix: added null safe operator precendence rule (#12297) [#12306](https://github.com/vitessio/vitess/pull/12306)
+ * [release-15.0] Fix bug in vtexplain around JOINs (#12376) [#12383](https://github.com/vitessio/vitess/pull/12383)
+ * Fix scalar aggregation engine primitive for column truncation [#12468](https://github.com/vitessio/vitess/pull/12468)
+ * [release-16.0] BugFix: Unsharded query using a derived table and a dual table [#12484](https://github.com/vitessio/vitess/pull/12484)
+ * [bug fix] USING planning on information_schema [#12542](https://github.com/vitessio/vitess/pull/12542)
+ * handle filter on top of UNION [#12543](https://github.com/vitessio/vitess/pull/12543)
+ * collations: fix sorting in UCA900 collations [#12555](https://github.com/vitessio/vitess/pull/12555)
+ * VSchema DDL: Add grammar to accept qualified table names in Vindex option values [#12577](https://github.com/vitessio/vitess/pull/12577)
+ * [release-15.0] `ApplyVSchemaDDL`: escape Sequence names when writing the VSchema (#12519) [#12598](https://github.com/vitessio/vitess/pull/12598)
+ * [gen4 planner] Make sure to not push down expressions when not possible [#12607](https://github.com/vitessio/vitess/pull/12607)
+ * Fix `panic` when executing a prepare statement with over `65,528` parameters [#12614](https://github.com/vitessio/vitess/pull/12614)
+ * [planner bugfix] add expressions to HAVING [#12668](https://github.com/vitessio/vitess/pull/12668)
+ * Use a left join to make sure that tables with tablespace=innodb_system are included in the schema [#12672](https://github.com/vitessio/vitess/pull/12672)
+ * [release-15.0] Always add columns in the `Derived` operator [#12680](https://github.com/vitessio/vitess/pull/12680)
+ * [planner fix] make unknown column an error only for sharded queries [#12704](https://github.com/vitessio/vitess/pull/12704)
+#### VReplication
+ * VReplication Last Error: retry error if it happens after timeout [#12114](https://github.com/vitessio/vitess/pull/12114)
+#### VTorc
+ * Fix unhandled error in VTOrc `recoverDeadPrimary` [#12511](https://github.com/vitessio/vitess/pull/12511)
+### CI/Build
+#### Build/CI
+ * [release-15.0] Make upgrade downgrade job names unique [#12498](https://github.com/vitessio/vitess/pull/12498)
+ * v15 backport: CI: increase overall test timeouts for all OnlineDDL tests [#12591](https://github.com/vitessio/vitess/pull/12591)
+#### Online DDL
+ * CI: extend timeouts in onlineddl_vrepl due to slow CI runners [#12583](https://github.com/vitessio/vitess/pull/12583)
+#### Query Serving
+ * [release-15.0] Flakes: Properly Test HealthCheck Cache Response Handling (#12226) [#12227](https://github.com/vitessio/vitess/pull/12227)
+### Dependabot
+#### Build/CI
+ * Bump golang.org/x/net from 0.5.0 to 0.7.0 (#12390) [#12405](https://github.com/vitessio/vitess/pull/12405)
+### Enhancement
+#### Build/CI
+ * Auto upgrade the Golang version [#12585](https://github.com/vitessio/vitess/pull/12585)
+#### Governance
+ * [release-15.0] Add manan and florent to Docker files CODEOWNERS (#11981) [#11983](https://github.com/vitessio/vitess/pull/11983)
+#### VTorc
+ * Release-15: Cherry pick vtorc no cgo [#12223](https://github.com/vitessio/vitess/pull/12223)
+### Internal Cleanup
+#### Build/CI
+ * [15.0] CI: remove pitrtls test [#12064](https://github.com/vitessio/vitess/pull/12064)
+#### General
+ * Remove removed flags from being used for v16+ binaries [#12128](https://github.com/vitessio/vitess/pull/12128)
+ * [release-15.0] Fix release script for the version in the docker script [#12285](https://github.com/vitessio/vitess/pull/12285)
+### Other
+#### Other
+ * Code freeze of release-15.0 [#12764](https://github.com/vitessio/vitess/pull/12764)
+### Performance
+#### Cluster management
+ * Bug fix: Cache filtered out tablets in topology watcher to avoid unnecessary GetTablet calls to topo [#12194](https://github.com/vitessio/vitess/pull/12194)
+### Release
+#### Build/CI
+ * [release-15.0] Tooling improvements backports [#12527](https://github.com/vitessio/vitess/pull/12527)
+#### Documentation
+ * Re-organize the `releasenotes` directory into `changelog` [#12566](https://github.com/vitessio/vitess/pull/12566)
+#### General
+ * Release of v15.0.2 [#11961](https://github.com/vitessio/vitess/pull/11961)
+ * Back to dev mode after v15.0.2 [#11962](https://github.com/vitessio/vitess/pull/11962)
+### Testing
+#### General
+ * Fix vtbackup upgrade/downgrade test [#12437](https://github.com/vitessio/vitess/pull/12437)
+
diff --git a/changelog/15.0/15.0.3/release_notes.md b/changelog/15.0/15.0.3/release_notes.md
new file mode 100644
index 00000000000..aabb3770528
--- /dev/null
+++ b/changelog/15.0/15.0.3/release_notes.md
@@ -0,0 +1,7 @@
+# Release of Vitess v15.0.3
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/15.0/15.0.3/changelog.md).
+
+The release includes 52 commits (excluding merges)
+
+Thanks to all our contributors: @GuptaManan100, @ajm188, @dbussink, @deepthi, @frouioui, @harshit-gangal, @mattlord, @rsajwani, @shlomi-noach, @systay, @vitess-bot[bot], @vmg
+
diff --git a/changelog/15.0/15.0.4/changelog.md b/changelog/15.0/15.0.4/changelog.md
new file mode 100644
index 00000000000..f70fd1090a7
--- /dev/null
+++ b/changelog/15.0/15.0.4/changelog.md
@@ -0,0 +1,61 @@
+# Changelog of Vitess v15.0.4
+
+### Bug fixes
+#### Build/CI
+ * [release-15.0] Small fixes to the auto-upgrade golang tool (#12838) [#12847](https://github.com/vitessio/vitess/pull/12847)
+ * [release-15.0] Add timeout to golangci-lint and bump its version (#12852) [#12853](https://github.com/vitessio/vitess/pull/12853)
+ * [release-15.0] Remove recent golangci-lint version bump [#12910](https://github.com/vitessio/vitess/pull/12910)
+#### Cluster management
+ * [release-15.0] Prevent resetting replication every time we set replication source (#13377) [#13393](https://github.com/vitessio/vitess/pull/13393)
+ * [release-15.0] Don't run any reparent commands if the host is empty (#13396) [#13403](https://github.com/vitessio/vitess/pull/13403)
+ * [release-15.0] ignore all error for views in engine reload (#13590) [#13592](https://github.com/vitessio/vitess/pull/13592)
+#### Examples
+ * [release-15.0] `examples/compose`: fix `consul:latest` error w/`docker-compose up -d` (#13468) [#13471](https://github.com/vitessio/vitess/pull/13471)
+#### Online DDL
+ * v15 backport: vitess Online DDL atomic cut-over [#13376](https://github.com/vitessio/vitess/pull/13376)
+#### Query Serving
+ * [release-15.0] planbuilder bugfix - do not push aggregations into derived tables [#12824](https://github.com/vitessio/vitess/pull/12824)
+ * [release-15.0] Fix `vtgate_schema_tracker` flaky tests (#12780) [#12850](https://github.com/vitessio/vitess/pull/12850)
+ * [release-15.0] fix: union distinct between unsharded route and sharded join (#12968) [#12982](https://github.com/vitessio/vitess/pull/12982)
+ * gen4 planner: allow last_insert_id with arguments (15.0) [#13035](https://github.com/vitessio/vitess/pull/13035)
+ * [release-15.0] Fix the resilientQuery to give correct results during initialization (#13080) [#13086](https://github.com/vitessio/vitess/pull/13086)
+ * [release-15.0] Remove indentation limit in the sqlparser (#13158) [#13167](https://github.com/vitessio/vitess/pull/13167)
+ * [release-15.0] Fix: TabletServer ReserveBeginExecute to return transaction ID on error (#13193) [#13196](https://github.com/vitessio/vitess/pull/13196)
+ * [15.0] Fix: errant GTID in health streamer (#13184) [#13226](https://github.com/vitessio/vitess/pull/13226)
+#### Schema Tracker
+ * [release-15.0] Ignore error while reading table data in Schema.Engine reload (#13421) [#13425](https://github.com/vitessio/vitess/pull/13425)
+ * Backport v15: schema.Reload(): ignore column reading errors for views only, error for tables #13442 [#13457](https://github.com/vitessio/vitess/pull/13457)
+### Enhancement
+#### Build/CI
+ * Use go1.20.3 in the upgrade downgrade tests [#12839](https://github.com/vitessio/vitess/pull/12839)
+ * [release-15.0] Set the number of threads for release notes generation with a flag [#13315](https://github.com/vitessio/vitess/pull/13315)
+#### General
+ * Use `go1.20.4` on `release-15.0` upgrade test [#13071](https://github.com/vitessio/vitess/pull/13071)
+#### Query Serving
+ * [release-15.0] planner fix: scoping rules for JOIN ON expression inside a subquery [#12890](https://github.com/vitessio/vitess/pull/12890)
+### Internal Cleanup
+#### Operator
+ * Use vitess-operator `v2.8.4` in the examples [#12993](https://github.com/vitessio/vitess/pull/12993)
+#### VTorc
+ * [release-15.0] Remove excessive logging in VTOrc APIs (#13459) [#13463](https://github.com/vitessio/vitess/pull/13463)
+### Performance
+#### TabletManager
+ * [release-15.0] BaseShowTablesWithSizes: optimize MySQL 8.0 query (#13375) [#13388](https://github.com/vitessio/vitess/pull/13388)
+### Release
+#### Build/CI
+ * [release-15.0] Optimize release notes generation to use GitHub Milestones (#13398) [#13620](https://github.com/vitessio/vitess/pull/13620)
+#### Documentation
+ * Prepare release note `v15.0.4` [#13619](https://github.com/vitessio/vitess/pull/13619)
+### Testing
+#### Build/CI
+ * [release-15.0] fakedbclient: Add locking to avoid races (#12814) [#12821](https://github.com/vitessio/vitess/pull/12821)
+#### Cluster management
+ * [release-15.0] Flaky tests: Fix wrangler tests (#13568) [#13570](https://github.com/vitessio/vitess/pull/13570)
+#### General
+ * [release-15.0] Update Upgrade/Downgrade tests to use `go1.20.5` [#13271](https://github.com/vitessio/vitess/pull/13271)
+#### Query Serving
+ * [release-15.0] Fix benchmarks in `plan_test.go` (#13096) [#13125](https://github.com/vitessio/vitess/pull/13125)
+ * [release-15.0] Fix `TestGatewayBufferingWhileReparenting` flakiness (#13469) [#13502](https://github.com/vitessio/vitess/pull/13502)
+#### VTorc
+ * [release-15.0]: Fix flakiness in VTOrc tests (#13489) [#13529](https://github.com/vitessio/vitess/pull/13529)
+
diff --git a/changelog/15.0/15.0.4/release_notes.md b/changelog/15.0/15.0.4/release_notes.md
new file mode 100644
index 00000000000..38fa25f9c78
--- /dev/null
+++ b/changelog/15.0/15.0.4/release_notes.md
@@ -0,0 +1,7 @@
+# Release of Vitess v15.0.4
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/15.0/15.0.4/changelog.md).
+
+The release includes 33 merged Pull Requests.
+
+Thanks to all our contributors: @GuptaManan100, @app/vitess-bot, @frouioui, @harshit-gangal, @shlomi-noach, @systay
+
diff --git a/go/test/endtoend/onlineddl/vrepl_suite/testdata/gbk-charset/extra_args b/changelog/15.0/15.0.4/summary.md
similarity index 100%
rename from go/test/endtoend/onlineddl/vrepl_suite/testdata/gbk-charset/extra_args
rename to changelog/15.0/15.0.4/summary.md
diff --git a/changelog/15.0/README.md b/changelog/15.0/README.md
new file mode 100644
index 00000000000..17807db2ebc
--- /dev/null
+++ b/changelog/15.0/README.md
@@ -0,0 +1,21 @@
+## v15.0
+The dedicated team for this release can be found [here](team.md).
+* **[15.0.4](15.0.4)**
+ * [Changelog](15.0.4/changelog.md)
+ * [Release Notes](15.0.4/release_notes.md)
+
+* **[15.0.3](15.0.3)**
+ * [Changelog](15.0.3/changelog.md)
+ * [Release Notes](15.0.3/release_notes.md)
+
+* **[15.0.2](15.0.2)**
+ * [Changelog](15.0.2/changelog.md)
+ * [Release Notes](15.0.2/release_notes.md)
+
+* **[15.0.1](15.0.1)**
+ * [Changelog](15.0.1/changelog.md)
+ * [Release Notes](15.0.1/release_notes.md)
+
+* **[15.0.0](15.0.0)**
+ * [Changelog](15.0.0/changelog.md)
+ * [Release Notes](15.0.0/release_notes.md)
diff --git a/changelog/15.0/team.md b/changelog/15.0/team.md
new file mode 100644
index 00000000000..b8cbdf809bf
--- /dev/null
+++ b/changelog/15.0/team.md
@@ -0,0 +1,5 @@
+## Release Team for v15
+
+- **Lead:** Rameez Sajwani ([rsajwani](https://github.com/rsajwani)) rameez@planetscale.com
+- **Shadow:** Manan Gupta ([GuptaManan100](https://github.com/GuptaManan100)) manan@planetscale.com
+- **Mentor:** Florent Poinsard ([frouioui](https://github.com/frouioui)) florent@planetscale.com
\ No newline at end of file
diff --git a/doc/releasenotes/16_0_0_changelog.md b/changelog/16.0/16.0.0/changelog.md
similarity index 100%
rename from doc/releasenotes/16_0_0_changelog.md
rename to changelog/16.0/16.0.0/changelog.md
diff --git a/doc/releasenotes/16_0_0_summary.md b/changelog/16.0/16.0.0/release_notes.md
similarity index 91%
rename from doc/releasenotes/16_0_0_summary.md
rename to changelog/16.0/16.0.0/release_notes.md
index 7a14f2533b7..e17a74a8d0f 100644
--- a/doc/releasenotes/16_0_0_summary.md
+++ b/changelog/16.0/16.0.0/release_notes.md
@@ -1,9 +1,13 @@
+# Release of Vitess v16.0.0
## Summary
### Table of Contents
- **[Known Issues](#known-issues)**
- - [MySQL & Xtrabackup known issue](#mysql-xtrabackup-ddl)
+ - [MySQL & Xtrabackup known issue](#mysql-xtrabackup-ddl)
+ - [VTTablet Restore Metrics](#vttablet-restore-metrics)
+ - [Schema-initialization stuck on semi-sync ACKs while upgrading to v16.0.0](#schema-init-upgrade)
+ - [Broken downgrade from v17.x.x when super_read_only turned on by default](#init-db-sql-turned-on)
- **[Major Changes](#major-changes)**
- **[Breaking Changes](#breaking-changes)**
- [VTGate Advertised MySQL Version](#advertised-mysql-version)
@@ -99,6 +103,29 @@ or
> ALTER TABLE your_table ENGINE=InnoDB;
```
+### VTTablet Restore Metrics
+
+As part of the VTTablet Sidecar Schema Maintenance Refactor in v16.0.0, we dropped the `local_metadata` table from the sidecar database schema. This table was storing a couple of metrics related to restores from backup, which have now been lost.
+They have been re-introduced in v17.0.0 as metrics that can be accessed from `/debug/vars`.
+
+The original issue can be found [here](https://github.com/vitessio/vitess/issues/13336).
+
+### Schema-initialization stuck on semi-sync ACKs while upgrading to `v16.0.0`
+
+During upgrades from `<= v15.x.x` to `v16.0.0`, as part of `PromoteReplica` call, the schema-init realizes that there are schema diffs to apply and ends up writing to the database.
+The issue is that if [semi-sync](https://vitess.io/docs/16.0/reference/features/mysql-replication/#semi-sync) is enabled, all of these writes get blocked indefinitely.
+Eventually, `PromoteReplica` fails, and this fails the entire PRS call.
+
+A fix for this issue was merged on `release-16.0` in [PR#13441](https://github.com/vitessio/vitess/pull/13441), read the [corresponding bug report to learn more](https://github.com/vitessio/vitess/issues/13426).
+
+This issue is fixed in `v16.0.3` and later patch releases.
+
+### Broken downgrade from v17.x.x when super_read_only turned on by default
+
+In `v17.x.x` `super_read_only` is turned on by default meaning that downgrading from `v17` to `v16.0.0` breaks due to `init_db.sql` needing write access.
+
+This issue is fixed in `>= v16.0.3` thanks to [PR #13525](https://github.com/vitessio/vitess/pull/13525)
+
## Major Changes
### Breaking Changes
@@ -108,6 +135,8 @@ or
Since [Pull Request #11989](https://github.com/vitessio/vitess/pull/11989), VTGate advertises MySQL version 8.0.30. This is a breaking change for clients that rely on the VTGate advertised MySQL version and still use MySQL 5.7.
The users can set the `mysql_server_version` flag to advertise the correct version.
+It is worth noting that [the feature to avoid using reserved connections](https://vitess.io/docs/16.0/reference/query-serving/reserved-conn/#avoiding-the-use-of-reserved-connections) depends on the `mysql_server_version` CLI flag, which default value has been changed from `5.7.9-vitess` to `8.0.30-vitess`. We recommend that users running MySQL 5.7 set vtgate's `mysql_server_version` CLI flag to `5.7.9-vitess` to prevent the queries from being unexpectedly rewritten.
+
#### Default MySQL version on Docker
The default major MySQL version used by our `vitess/lite:latest` image is going from `5.7` to `8.0`. Additionally, the patch version of MySQL80 has been upgraded from `8.0.23` to `8.0.30`.
@@ -522,3 +551,11 @@ performs the required `create` or `alter` to reach it. This is done whenever a p
The sidecar tables `local_metadata` and `shard_metadata` are no longer in use and all references to them are removed as
part of this refactor. They were used previously for Orchestrator support, which has been superseded by `vtorc`.
+
+------------
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/16.0/16.0.0/changelog.md).
+
+The release includes 378 commits (excluding merges)
+
+Thanks to all our contributors: @EmadMokhtar, @GuptaManan100, @Weijun-H, @WilliamLu99, @ajm188, @arthurschreiber, @arvind-murty, @brendar, @brirams, @dbussink, @deepthi, @dependabot[bot], @draftcode, @ejortegau, @frouioui, @harshit-gangal, @jjh-kim, @johanoskarsson, @kbslvsk, @mattlord, @maxenglander, @mdlayher, @notfelineit, @pbibra, @pudiva, @rohit-nayak-ps, @rsajwani, @shlomi-noach, @systay, @timvaillancourt, @vitess-bot[bot], @vmg, @yoheimuta
+
diff --git a/doc/releasenotes/16_0_0_release_notes.md b/changelog/16.0/16.0.0/summary.md
similarity index 93%
rename from doc/releasenotes/16_0_0_release_notes.md
rename to changelog/16.0/16.0.0/summary.md
index 1b91f15c28d..c895a33130b 100644
--- a/doc/releasenotes/16_0_0_release_notes.md
+++ b/changelog/16.0/16.0.0/summary.md
@@ -1,10 +1,12 @@
-# Release of Vitess v16.0.0
## Summary
### Table of Contents
- **[Known Issues](#known-issues)**
- [MySQL & Xtrabackup known issue](#mysql-xtrabackup-ddl)
+ - [VTTablet Restore Metrics](#vttablet-restore-metrics)
+ - [Schema-initialization stuck on semi-sync ACKs while upgrading to v16.0.0](#schema-init-upgrade)
+ - [Broken downgrade from v17.x.x when super_read_only turned on by default](#init-db-sql-turned-on)
- **[Major Changes](#major-changes)**
- **[Breaking Changes](#breaking-changes)**
- [VTGate Advertised MySQL Version](#advertised-mysql-version)
@@ -100,6 +102,28 @@ or
> ALTER TABLE your_table ENGINE=InnoDB;
```
+### VTTablet Restore Metrics
+
+As part of the VTTablet Sidecar Schema Maintenance Refactor in v16.0.0, we dropped the `local_metadata` table from the sidecar database schema. This table was storing a couple of metrics related to restores from backup, which have now been lost.
+They have been re-introduced in v17.0.0 as metrics that can be accessed from `/debug/vars`.
+
+The original issue can be found [here](https://github.com/vitessio/vitess/issues/13336).
+
+### Schema-initialization stuck on semi-sync ACKs while upgrading to `v16.0.0`
+
+During upgrades from `<= v15.x.x` to `v16.0.0`, as part of `PromoteReplica` call, the schema-init realizes that there are schema diffs to apply and ends up writing to the database if [semi-sync](https://vitess.io/docs/16.0/reference/features/mysql-replication/#semi-sync) is enabled, all of these writes get blocked indefinitely.
+Eventually, `PromoteReplica` fails, and this fails the entire PRS call.
+
+A fix for this issue was merged on `release-16.0` in [PR#13441](https://github.com/vitessio/vitess/pull/13441), read the [corresponding bug report to learn more](https://github.com/vitessio/vitess/issues/13426).
+
+This issue is fixed in `v16.0.3` and later patch releases.
+
+### Broken downgrade from v17.x.x when super_read_only turned on by default
+
+In `v17.x.x` `super_read_only` is turned on by default meaning that downgrading from `v17` to `v16.0.0` breaks due to `init_db.sql` needing write access.
+
+This issue is fixed in `>= v16.0.3` thanks to [PR #13525](https://github.com/vitessio/vitess/pull/13525).
+
## Major Changes
### Breaking Changes
@@ -109,6 +133,8 @@ or
Since [Pull Request #11989](https://github.com/vitessio/vitess/pull/11989), VTGate advertises MySQL version 8.0.30. This is a breaking change for clients that rely on the VTGate advertised MySQL version and still use MySQL 5.7.
The users can set the `mysql_server_version` flag to advertise the correct version.
+It is worth noting that [the feature to avoid using reserved connections](https://vitess.io/docs/16.0/reference/query-serving/reserved-conn/#avoiding-the-use-of-reserved-connections) depends on the `mysql_server_version` CLI flag, which default value has been changed from `5.7.9-vitess` to `8.0.30-vitess`. We recommend that users running MySQL 5.7 set vtgate's `mysql_server_version` CLI flag to `5.7.9-vitess` to prevent the queries from being unexpectedly rewritten.
+
#### Default MySQL version on Docker
The default major MySQL version used by our `vitess/lite:latest` image is going from `5.7` to `8.0`. Additionally, the patch version of MySQL80 has been upgraded from `8.0.23` to `8.0.30`.
@@ -523,11 +549,3 @@ performs the required `create` or `alter` to reach it. This is done whenever a p
The sidecar tables `local_metadata` and `shard_metadata` are no longer in use and all references to them are removed as
part of this refactor. They were used previously for Orchestrator support, which has been superseded by `vtorc`.
-
-------------
-The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/doc/releasenotes/16_0_0_changelog.md).
-
-The release includes 378 commits (excluding merges)
-
-Thanks to all our contributors: @EmadMokhtar, @GuptaManan100, @Weijun-H, @WilliamLu99, @ajm188, @arthurschreiber, @arvind-murty, @brendar, @brirams, @dbussink, @deepthi, @dependabot[bot], @draftcode, @ejortegau, @frouioui, @harshit-gangal, @jjh-kim, @johanoskarsson, @kbslvsk, @mattlord, @maxenglander, @mdlayher, @notfelineit, @pbibra, @pudiva, @rohit-nayak-ps, @rsajwani, @shlomi-noach, @systay, @timvaillancourt, @vitess-bot[bot], @vmg, @yoheimuta
-
diff --git a/changelog/16.0/16.0.1/changelog.md b/changelog/16.0/16.0.1/changelog.md
new file mode 100644
index 00000000000..47ea58c2469
--- /dev/null
+++ b/changelog/16.0/16.0.1/changelog.md
@@ -0,0 +1,71 @@
+# Changelog of Vitess v16.0.1
+
+### Bug fixes
+#### Build/CI
+ * Fix `TestFuzz` that hangs on `go1.20.1` [#12514](https://github.com/vitessio/vitess/pull/12514)
+ * Fix dubious ownership of git directory in `vitess/base` Docker build [#12530](https://github.com/vitessio/vitess/pull/12530)
+#### CLI
+ * Purge logs without panicking [#12187](https://github.com/vitessio/vitess/pull/12187)
+ * Fix `vtctldclient`'s Root command to return an error on unknown command [#12481](https://github.com/vitessio/vitess/pull/12481)
+#### Cluster management
+ * Fix initialization code to also stop replication to prevent crash [#12534](https://github.com/vitessio/vitess/pull/12534)
+ * [Backport] Update topo {Get,Create}Keyspace to prevent invalid keyspace names [#12732](https://github.com/vitessio/vitess/pull/12732)
+#### General
+ * Fixing backup tests flakiness [#12655](https://github.com/vitessio/vitess/pull/12655)
+ * [release-16.0] Port two flaky test fixes #12603 and #12546 [#12745](https://github.com/vitessio/vitess/pull/12745)
+#### Observability
+ * Reset the current lag when closing the replication lag reader. [#12683](https://github.com/vitessio/vitess/pull/12683)
+#### Online DDL
+ * Throttler: Store Config in Global Keyspace Topo Record [#12520](https://github.com/vitessio/vitess/pull/12520)
+ * v16: Online DDL: enforce ALGORITHM=COPY on shadow table [#12522](https://github.com/vitessio/vitess/pull/12522)
+ * Mysqld.GetSchema: tolerate tables being dropped while inspecting schema [#12641](https://github.com/vitessio/vitess/pull/12641)
+#### Query Serving
+ * collations: fix sorting in UCA900 collations [#12555](https://github.com/vitessio/vitess/pull/12555)
+ * VSchema DDL: Add grammar to accept qualified table names in Vindex option values [#12577](https://github.com/vitessio/vitess/pull/12577)
+ * [release-16.0] `ApplyVSchemaDDL`: escape Sequence names when writing the VSchema (#12519) [#12599](https://github.com/vitessio/vitess/pull/12599)
+ * [gen4 planner] Make sure to not push down expressions when not possible [#12607](https://github.com/vitessio/vitess/pull/12607)
+ * Fix `panic` when executing a prepare statement with over `65,528` parameters [#12614](https://github.com/vitessio/vitess/pull/12614)
+ * Always add columns in the `Derived` operator [#12634](https://github.com/vitessio/vitess/pull/12634)
+ * planner: fix predicate simplifier [#12650](https://github.com/vitessio/vitess/pull/12650)
+ * [planner bugfix] add expressions to HAVING [#12668](https://github.com/vitessio/vitess/pull/12668)
+ * Use a left join to make sure that tables with tablespace=innodb_system are included in the schema [#12672](https://github.com/vitessio/vitess/pull/12672)
+ * [planner fix] make unknown column an error only for sharded queries [#12704](https://github.com/vitessio/vitess/pull/12704)
+#### VReplication
+ * VStreamer: improve representation of integers in json data types [#12630](https://github.com/vitessio/vitess/pull/12630)
+#### VTorc
+ * Fix unhandled error in VTOrc `recoverDeadPrimary` [#12510](https://github.com/vitessio/vitess/pull/12510)
+### CI/Build
+#### Build/CI
+ * [release-16.0] Make upgrade downgrade job names unique [#12499](https://github.com/vitessio/vitess/pull/12499)
+#### Examples
+ * Examples, Flakes: Wait for Shard's VReplication Engine to Open [#12560](https://github.com/vitessio/vitess/pull/12560)
+#### General
+ * [release-16.0] Upgrade the Golang version to `go1.20.2` [#12723](https://github.com/vitessio/vitess/pull/12723)
+#### Online DDL
+ * CI: extend timeouts in onlineddl_vrepl due to slow CI runners [#12583](https://github.com/vitessio/vitess/pull/12583)
+ * [release-16.0] CI: increase overall test timeouts for all OnlineDDL tests (#12584) [#12589](https://github.com/vitessio/vitess/pull/12589)
+### Enhancement
+#### Build/CI
+ * Auto upgrade the Golang version [#12585](https://github.com/vitessio/vitess/pull/12585)
+### Internal Cleanup
+#### Build/CI
+ * Run launchable only on PRs against `main` [#12694](https://github.com/vitessio/vitess/pull/12694)
+#### General
+ * Add a known issue into the release notes for xtrabackup and DDLs [#12536](https://github.com/vitessio/vitess/pull/12536)
+### Release
+#### Build/CI
+ * [release-16.0] Tooling improvements backports [#12528](https://github.com/vitessio/vitess/pull/12528)
+#### Documentation
+ * Re-organize the `releasenotes` directory into `changelog` [#12566](https://github.com/vitessio/vitess/pull/12566)
+ * Addition of the `v16.0.1` release summary [#12751](https://github.com/vitessio/vitess/pull/12751)
+#### General
+ * Back to dev mode after v16.0.0 [#12515](https://github.com/vitessio/vitess/pull/12515)
+ * Release 16.0 code freeze for 16.0.1 patch release [#12762](https://github.com/vitessio/vitess/pull/12762)
+#### VTAdmin
+ * Add the vtadmin `web` directory to the release packages [#12639](https://github.com/vitessio/vitess/pull/12639)
+### Testing
+#### General
+ * Fix fullstatus test for backward compat [#12685](https://github.com/vitessio/vitess/pull/12685)
+#### VReplication
+ * Flakes: Use new healthy shard check in vreplication e2e tests [#12502](https://github.com/vitessio/vitess/pull/12502)
+
diff --git a/changelog/16.0/16.0.1/release_notes.md b/changelog/16.0/16.0.1/release_notes.md
new file mode 100644
index 00000000000..c1354eac4ee
--- /dev/null
+++ b/changelog/16.0/16.0.1/release_notes.md
@@ -0,0 +1,41 @@
+# Release of Vitess v16.0.1
+
+## Known Issues
+
+### Schema-initialization stuck on semi-sync ACKs while upgrading to `v16.0.1`
+
+During upgrades from `<= v15.x.x` to `v16.0.1`, as part of `PromoteReplica` call, the schema-init realizes that there are schema diffs to apply and ends up writing to the database if [semi-sync](https://vitess.io/docs/16.0/reference/features/mysql-replication/#semi-sync) is enabled, all of these writes get blocked indefinitely.
+Eventually, `PromoteReplica` fails, and this fails the entire PRS call.
+
+A fix for this issue was merged on `release-16.0` in [PR#13441](https://github.com/vitessio/vitess/pull/13441), read the [corresponding bug report to learn more](https://github.com/vitessio/vitess/issues/13426).
+
+This issue is fixed in `v16.0.3` and later patch releases.
+
+### Broken downgrade from v17.x.x when super_read_only turned on by default
+
+In `v17.x.x` `super_read_only` is turned on by default meaning that downgrading from `v17` to `v16.0.1` breaks due to `init_db.sql` needing write access.
+
+This issue is fixed in `>= v16.0.3` thanks to [PR #13525](https://github.com/vitessio/vitess/pull/13525)
+
+## Major Changes
+
+### Upgrade to `go1.20.2`
+
+Vitess `v16.0.1` now runs on `go1.20.2`.
+Below is a summary of this Go patch release. You can learn more [here](https://go.dev/doc/devel/release#go1.20).
+
+> go1.20.2 (released 2023-03-07) includes a security fix to the crypto/elliptic package, as well as bug fixes to the compiler, the covdata command, the linker, the runtime, and the crypto/ecdh, crypto/rsa, crypto/x509, os, and syscall packages.
+
+### Keyspace name validation in TopoServer
+
+Prior to v16.0.1, it was possible to create a keyspace with invalid characters, which would then be inaccessible to various cluster management operations.
+
+Keyspace names may no longer contain the forward slash ("/") character, and TopoServer's `GetKeyspace` and `CreateKeyspace` methods return an error if given such a name.
+
+------------
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/16.0/16.0.1/changelog.md).
+
+The release includes 39 commits (excluding merges)
+
+Thanks to all our contributors: @GuptaManan100, @ajm188, @frouioui, @github-actions[bot], @mattlord, @rohit-nayak-ps, @rsajwani, @shlomi-noach, @systay, @vitess-bot[bot]
+
diff --git a/changelog/16.0/16.0.1/summary.md b/changelog/16.0/16.0.1/summary.md
new file mode 100644
index 00000000000..f9af9672ea1
--- /dev/null
+++ b/changelog/16.0/16.0.1/summary.md
@@ -0,0 +1,32 @@
+## Known Issues
+
+### Schema-initialization stuck on semi-sync ACKs while upgrading to `v16.0.1`
+
+During upgrades from `<= v15.x.x` to `v16.0.1`, as part of `PromoteReplica` call, the schema-init realizes that there are schema diffs to apply and ends up writing to the database if [semi-sync](https://vitess.io/docs/16.0/reference/features/mysql-replication/#semi-sync) is enabled, all of these writes get blocked indefinitely.
+Eventually, `PromoteReplica` fails, and this fails the entire PRS call.
+
+A fix for this issue was merged on `release-16.0` in [PR#13441](https://github.com/vitessio/vitess/pull/13441), read the [corresponding bug report to learn more](https://github.com/vitessio/vitess/issues/13426).
+
+This issue is fixed in `v16.0.3` and later patch releases.
+
+### Broken downgrade from v17.x.x when super_read_only turned on by default
+
+In `v17.x.x` `super_read_only` is turned on by default meaning that downgrading from `v17` to `v16.0.1` breaks due to `init_db.sql` needing write access.
+
+This issue is fixed in `>= v16.0.3` thanks to [PR #13525](https://github.com/vitessio/vitess/pull/13525)
+
+## Major Changes
+
+### Upgrade to `go1.20.2`
+
+Vitess `v16.0.1` now runs on `go1.20.2`.
+Below is a summary of this Go patch release. You can learn more [here](https://go.dev/doc/devel/release#go1.20).
+
+> go1.20.2 (released 2023-03-07) includes a security fix to the crypto/elliptic package, as well as bug fixes to the compiler, the covdata command, the linker, the runtime, and the crypto/ecdh, crypto/rsa, crypto/x509, os, and syscall packages.
+
+### Keyspace name validation in TopoServer
+
+Prior to v16.0.1, it was possible to create a keyspace with invalid characters, which would then be inaccessible to various cluster management operations.
+
+Keyspace names may no longer contain the forward slash ("/") character, and TopoServer's `GetKeyspace` and `CreateKeyspace` methods return an error if given such a name.
+
diff --git a/changelog/16.0/16.0.2/changelog.md b/changelog/16.0/16.0.2/changelog.md
new file mode 100644
index 00000000000..978cf9441e6
--- /dev/null
+++ b/changelog/16.0/16.0.2/changelog.md
@@ -0,0 +1,50 @@
+# Changelog of Vitess v16.0.2
+
+### Bug fixes
+#### Build/CI
+ * Small fixes to the auto-upgrade golang tool [#12838](https://github.com/vitessio/vitess/pull/12838)
+ * Add timeout to `golangci-lint` and bump its version [#12852](https://github.com/vitessio/vitess/pull/12852)
+ * [release-16.0] Remove recent golangci-lint version bump [#12909](https://github.com/vitessio/vitess/pull/12909)
+#### Cluster management
+ * Backport: [topo] Disallow the slash character in shard names #12843 [#12858](https://github.com/vitessio/vitess/pull/12858)
+#### Query Serving
+ * Fix `vtgate_schema_tracker` flaky tests [#12780](https://github.com/vitessio/vitess/pull/12780)
+ * [planbuilder bugfix] do not push aggregations into derived tables [#12810](https://github.com/vitessio/vitess/pull/12810)
+ * [16.0] Fix: reset transaction session when no reserved connection [#12877](https://github.com/vitessio/vitess/pull/12877)
+ * [release-16.0] fix: union distinct between unsharded route and sharded join (#12968) [#12974](https://github.com/vitessio/vitess/pull/12974)
+### CI/Build
+#### General
+ * Do not fail build on incorrect Go version [#12809](https://github.com/vitessio/vitess/pull/12809)
+ * [release-16.0] Upgrade the Golang version to `go1.20.3` [#12832](https://github.com/vitessio/vitess/pull/12832)
+### Documentation
+#### Query Serving
+ * update v16 release notes about VTGate Advertised MySQL Version [#12957](https://github.com/vitessio/vitess/pull/12957)
+### Enhancement
+#### Build/CI
+ * Remove unnecessary code bits in workflows [#12756](https://github.com/vitessio/vitess/pull/12756)
+#### General
+ * Automatically add milestone to new Pull Request [#12759](https://github.com/vitessio/vitess/pull/12759)
+#### Query Serving
+ * [release-16.0] planner fix: scoping rules for JOIN ON expression inside a subquery [#12891](https://github.com/vitessio/vitess/pull/12891)
+### Internal Cleanup
+#### CLI
+ * Cleanup TODOs in vtorc flag parsing code from v15 [#12787](https://github.com/vitessio/vitess/pull/12787)
+#### TabletManager
+ * Table GC: remove spammy log entry [#12625](https://github.com/vitessio/vitess/pull/12625)
+### Regression
+#### ACL
+ * vtgate : Disable Automatically setting immediateCallerID to user from static authentication context [#12961](https://github.com/vitessio/vitess/pull/12961)
+#### Query Serving
+ * gen4 planner: allow last_insert_id with arguments [#13026](https://github.com/vitessio/vitess/pull/13026)
+### Release
+#### Documentation
+ * Fix incorrect path during release notes generation [#12769](https://github.com/vitessio/vitess/pull/12769)
+#### General
+ * Back to dev mode after v16.0.1 [#12783](https://github.com/vitessio/vitess/pull/12783)
+ * Summary changes and code freeze for release of v16.0.2 [#13049](https://github.com/vitessio/vitess/pull/13049)
+### Testing
+#### Build/CI
+ * [release-16.0] Throttler: Expose Tablet's Config & Leverage to Deflake Tests [#12791](https://github.com/vitessio/vitess/pull/12791)
+ * fakedbclient: Add locking to avoid races [#12814](https://github.com/vitessio/vitess/pull/12814)
+ * [release-16.0] test: fix cfc flaky test (#12941) [#12960](https://github.com/vitessio/vitess/pull/12960)
+
diff --git a/changelog/16.0/16.0.2/release_notes.md b/changelog/16.0/16.0.2/release_notes.md
new file mode 100644
index 00000000000..806cf87d208
--- /dev/null
+++ b/changelog/16.0/16.0.2/release_notes.md
@@ -0,0 +1,48 @@
+# Release of Vitess v16.0.2
+
+## Known Issues
+
+### Schema-initialization stuck on semi-sync ACKs while upgrading to `v16.0.2`
+
+During upgrades from `<= v15.x.x` to `v16.0.2`, as part of `PromoteReplica` call, the schema-init realizes that there are schema diffs to apply and ends up writing to the database if [semi-sync](https://vitess.io/docs/16.0/reference/features/mysql-replication/#semi-sync) is enabled, all of these writes get blocked indefinitely.
+Eventually, `PromoteReplica` fails, and this fails the entire PRS call.
+
+A fix for this issue was merged on `release-16.0` in [PR#13441](https://github.com/vitessio/vitess/pull/13441), read the [corresponding bug report to learn more](https://github.com/vitessio/vitess/issues/13426).
+
+This issue is fixed in `v16.0.3` and later patch releases.
+
+### Broken downgrade from v17.x.x when super_read_only turned on by default
+
+In `v17.x.x` `super_read_only` is turned on by default meaning that downgrading from `v17` to `v16.0.2` breaks due to `init_db.sql` needing write access.
+
+This issue is fixed in `>= v16.0.3` thanks to [PR #13525](https://github.com/vitessio/vitess/pull/13525)
+
+## Major Changes
+
+### Upgrade to `go1.20.3`
+
+Vitess `v16.0.2` now runs on `go1.20.3`.
+Below is a summary of this Go patch release. You can learn more [here](https://go.dev/doc/devel/release#go1.20).
+
+> go1.20.3 (released 2023-04-04) includes security fixes to the go/parser, html/template, mime/multipart, net/http, and net/textproto packages, as well as bug fixes to the compiler, the linker, the runtime, and the time package. See the Go 1.20.3 milestone on our issue tracker for details.
+
+### EffectiveCallerId in Vtgate gRPC calls
+
+A new flag `grpc-use-static-authentication-callerid` is added to gate the behavior introduced in https://github.com/vitessio/vitess/pull/12050.
+Earlier, we used to automatically set immediateCallerID to user from static authentication context that overrode the EffectiveCallerId.
+
+
+### Shard name validation in TopoServer
+
+Prior to v16.0.2, it was possible to create a shard name with invalid characters, which would then be inaccessible to various cluster management operations.
+
+Shard names may no longer contain the forward slash ("/") character, and TopoServer's `CreateShard` method returns an error if given such a name.
+
+
+------------
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/16.0/16.0.2/changelog.md).
+
+The release includes 24 commits (excluding merges)
+
+Thanks to all our contributors: @GuptaManan100, @ajm188, @frouioui, @github-actions[bot], @harshit-gangal, @mattlord, @systay, @vitess-bot[bot]
+
diff --git a/changelog/16.0/16.0.2/summary.md b/changelog/16.0/16.0.2/summary.md
new file mode 100644
index 00000000000..faef0207921
--- /dev/null
+++ b/changelog/16.0/16.0.2/summary.md
@@ -0,0 +1,39 @@
+## Known Issues
+
+### Schema-initialization stuck on semi-sync ACKs while upgrading to `v16.0.2`
+
+During upgrades from `<= v15.x.x` to `v16.0.2`, as part of `PromoteReplica` call, the schema-init realizes that there are schema diffs to apply and ends up writing to the database if [semi-sync](https://vitess.io/docs/16.0/reference/features/mysql-replication/#semi-sync) is enabled, all of these writes get blocked indefinitely.
+Eventually, `PromoteReplica` fails, and this fails the entire PRS call.
+
+A fix for this issue was merged on `release-16.0` in [PR#13441](https://github.com/vitessio/vitess/pull/13441), read the [corresponding bug report to learn more](https://github.com/vitessio/vitess/issues/13426).
+
+This issue is fixed in `v16.0.3` and later patch releases.
+
+### Broken downgrade from v17.x.x when super_read_only turned on by default
+
+In `v17.x.x` `super_read_only` is turned on by default meaning that downgrading from `v17` to `v16.0.2` breaks due to `init_db.sql` needing write access.
+
+This issue is fixed in `>= v16.0.3` thanks to [PR #13525](https://github.com/vitessio/vitess/pull/13525)
+
+
+## Major Changes
+
+### Upgrade to `go1.20.3`
+
+Vitess `v16.0.2` now runs on `go1.20.3`.
+Below is a summary of this Go patch release. You can learn more [here](https://go.dev/doc/devel/release#go1.20).
+
+> go1.20.3 (released 2023-04-04) includes security fixes to the go/parser, html/template, mime/multipart, net/http, and net/textproto packages, as well as bug fixes to the compiler, the linker, the runtime, and the time package. See the Go 1.20.3 milestone on our issue tracker for details.
+
+### EffectiveCallerId in Vtgate gRPC calls
+
+A new flag `grpc-use-static-authentication-callerid` is added to gate the behavior introduced in https://github.com/vitessio/vitess/pull/12050.
+Earlier, we used to automatically set immediateCallerID to user from static authentication context that overrode the EffectiveCallerId.
+
+
+### Shard name validation in TopoServer
+
+Prior to v16.0.2, it was possible to create a shard name with invalid characters, which would then be inaccessible to various cluster management operations.
+
+Shard names may no longer contain the forward slash ("/") character, and TopoServer's `CreateShard` method returns an error if given such a name.
+
diff --git a/changelog/16.0/16.0.3/changelog.md b/changelog/16.0/16.0.3/changelog.md
new file mode 100644
index 00000000000..3f43d9b6049
--- /dev/null
+++ b/changelog/16.0/16.0.3/changelog.md
@@ -0,0 +1,67 @@
+# Changelog of Vitess v16.0.3
+
+### Bug fixes
+#### Cluster management
+ * [release-16.0] Prevent resetting replication every time we set replication source (#13377) [#13392](https://github.com/vitessio/vitess/pull/13392)
+ * [release-16.0] Don't run any reparent commands if the host is empty (#13396) [#13402](https://github.com/vitessio/vitess/pull/13402)
+ * [release-16.0] Upgrade-Downgrade Fix: Schema-initialization stuck on semi-sync ACKs while upgrading (#13411) [#13441](https://github.com/vitessio/vitess/pull/13441)
+ * [release-16.0] Flaky tests: Fix race in memory topo (#13559) [#13576](https://github.com/vitessio/vitess/pull/13576)
+ * [release-16.0] ignore all error for views in engine reload (#13590) [#13593](https://github.com/vitessio/vitess/pull/13593)
+ * [release-16.0] check keyspace snapshot time if none specified for backup restores (#13557) [#13634](https://github.com/vitessio/vitess/pull/13634)
+#### Examples
+ * [release-16.0] `examples/compose`: fix `consul:latest` error w/`docker-compose up -d` (#13468) [#13472](https://github.com/vitessio/vitess/pull/13472)
+#### Operator
+ * [release-16.0] Upgrade mysqld memory limits to 1024Mi (#13122) [#13204](https://github.com/vitessio/vitess/pull/13204)
+#### Query Serving
+ * [release-16.0] Fix the resilientQuery to give correct results during initialization (#13080) [#13087](https://github.com/vitessio/vitess/pull/13087)
+ * [16.0] evalengine: TypeOf for Columns should only use value type when we have a value [#13154](https://github.com/vitessio/vitess/pull/13154)
+ * [release-16.0] Remove indentation limit in the sqlparser (#13158) [#13166](https://github.com/vitessio/vitess/pull/13166)
+ * Fix: errant GTID in health streamer [#13184](https://github.com/vitessio/vitess/pull/13184)
+ * [16.0] Fix: TabletServer ReserveBeginExecute to return transaction ID on error [#13193](https://github.com/vitessio/vitess/pull/13193)
+ * [release-16.0] Bug fix: SQL queries erroring with message `unknown aggregation random` (#13330) [#13334](https://github.com/vitessio/vitess/pull/13334)
+ * [release-16.0] ignore ongoing backfill vindex from routing selection (#13523) [#13607](https://github.com/vitessio/vitess/pull/13607)
+#### Schema Tracker
+ * [release-16.0] Ignore error while reading table data in Schema.Engine reload (#13421) [#13424](https://github.com/vitessio/vitess/pull/13424)
+ * Backport v16: schema.Reload(): ignore column reading errors for views only, error for tables #13442 [#13456](https://github.com/vitessio/vitess/pull/13456)
+#### TabletManager
+ * [release-16.0] mysqlctl: Correctly encode database and table names (#13312) [#13323](https://github.com/vitessio/vitess/pull/13323)
+#### VReplication
+ * [release-16.0] VReplication: Do not delete sharded target vschema table entries on Cancel (#13146) [#13155](https://github.com/vitessio/vitess/pull/13155)
+ * [release-16.0] VReplication: Pass on --keep_routing_rules flag value for Cancel action (#13171) [#13194](https://github.com/vitessio/vitess/pull/13194)
+ * [release-16.0] VReplication: Fix VDiff2 DeleteByUUID Query (#13255) [#13282](https://github.com/vitessio/vitess/pull/13282)
+ * [release-16.0] VReplication: Ensure ROW events are sent within a transaction (#13547) [#13580](https://github.com/vitessio/vitess/pull/13580)
+### CI/Build
+#### General
+ * [release-16.0] Upgrade the Golang version to `go1.20.4` [#13053](https://github.com/vitessio/vitess/pull/13053)
+### Documentation
+#### Documentation
+ * [release-16.0] update link for reparenting guide (#13350) [#13356](https://github.com/vitessio/vitess/pull/13356)
+### Enhancement
+#### Build/CI
+ * [release-16.0] Set the number of threads for release notes generation with a flag [#13316](https://github.com/vitessio/vitess/pull/13316)
+### Performance
+#### TabletManager
+ * [release-16.0] BaseShowTablesWithSizes: optimize MySQL 8.0 query (#13375) [#13389](https://github.com/vitessio/vitess/pull/13389)
+### Release
+#### Build/CI
+ * [release-16.0] Optimize release notes generation to use GitHub Milestones (#13398) [#13621](https://github.com/vitessio/vitess/pull/13621)
+#### Documentation
+ * [release-16.0] Fix format error in the `v16.0.2` release notes (#13057) [#13058](https://github.com/vitessio/vitess/pull/13058)
+### Testing
+#### Backup and Restore
+ * [release-16.0]: Fix `upgrade-downgrade` test setup and fix the `init_db.sql` [#13525](https://github.com/vitessio/vitess/pull/13525)
+#### Cluster management
+ * [release-16.0] Deflake `TestPlannedReparentShardPromoteReplicaFail` (#13548) [#13549](https://github.com/vitessio/vitess/pull/13549)
+ * [release-16.0] Flaky tests: Fix wrangler tests (#13568) [#13571](https://github.com/vitessio/vitess/pull/13571)
+#### General
+ * TestFix: `Upgrade Downgrade Testing - Backups - Manual` [#13408](https://github.com/vitessio/vitess/pull/13408)
+#### Query Serving
+ * [release-16.0] Fix benchmarks in `plan_test.go` (#13096) [#13126](https://github.com/vitessio/vitess/pull/13126)
+ * [release-16.0] Deflake `TestQueryTimeoutWithDual` test (#13405) [#13409](https://github.com/vitessio/vitess/pull/13409)
+ * [release-16.0] Fix `TestGatewayBufferingWhileReparenting` flakiness (#13469) [#13500](https://github.com/vitessio/vitess/pull/13500)
+ * [release-16.0] fix TestQueryTimeoutWithTables flaky test (#13579) [#13585](https://github.com/vitessio/vitess/pull/13585)
+#### VTorc
+ * [release-16.0]: Fix flakiness in VTOrc tests (#13489) [#13528](https://github.com/vitessio/vitess/pull/13528)
+#### vtctl
+ * Fix new vtctl upgrade downgrade test on `release-16.0` [#13252](https://github.com/vitessio/vitess/pull/13252)
+
diff --git a/changelog/16.0/16.0.3/release_notes.md b/changelog/16.0/16.0.3/release_notes.md
new file mode 100644
index 00000000000..d377bdc24f9
--- /dev/null
+++ b/changelog/16.0/16.0.3/release_notes.md
@@ -0,0 +1,7 @@
+# Release of Vitess v16.0.3
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/16.0/16.0.3/changelog.md).
+
+The release includes 38 merged Pull Requests.
+
+Thanks to all our contributors: @GuptaManan100, @app/github-actions, @app/vitess-bot, @frouioui, @harshit-gangal, @shlomi-noach, @systay
+
diff --git a/changelog/16.0/16.0.3/summary.md b/changelog/16.0/16.0.3/summary.md
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/changelog/16.0/16.0.4/changelog.md b/changelog/16.0/16.0.4/changelog.md
new file mode 100644
index 00000000000..45c4944aa25
--- /dev/null
+++ b/changelog/16.0/16.0.4/changelog.md
@@ -0,0 +1,24 @@
+# Changelog of Vitess v16.0.4
+
+### Bug fixes
+#### Backup and Restore
+ * Manual cherry-pick of 13339 [#13733](https://github.com/vitessio/vitess/pull/13733)
+ * [release-16.0] Address vttablet memory usage with backups to Azure Blob Service (#13770) [#13774](https://github.com/vitessio/vitess/pull/13774)
+#### Online DDL
+ * v16 backport: Fix closed channel panic in Online DDL cutover [#13732](https://github.com/vitessio/vitess/pull/13732)
+ * v16 backport: Solve RevertMigration.Comment read/write concurrency issue [#13736](https://github.com/vitessio/vitess/pull/13736)
+#### Query Serving
+ * planbuilder: Fix infinite recursion for subqueries [#13783](https://github.com/vitessio/vitess/pull/13783)
+ * [release-16.0] vtgate: fix race condition iterating tables and views from schema tracker (#13673) [#13795](https://github.com/vitessio/vitess/pull/13795)
+ * [16.0] bugfixes: collection of fixes to bugs found while fuzzing [#13805](https://github.com/vitessio/vitess/pull/13805)
+### CI/Build
+#### Online DDL
+ * [release-16.0] CI: fix onlineddl_scheduler flakiness (#13754) [#13759](https://github.com/vitessio/vitess/pull/13759)
+### Release
+#### General
+ * Back to dev mode after v16.0.3 [#13660](https://github.com/vitessio/vitess/pull/13660)
+ * Release 16.0 code freeze for `v16.0.3` release [#13810](https://github.com/vitessio/vitess/pull/13810)
+### Testing
+#### Build/CI
+ * [release-16.0] Flakes: Delete VTDATAROOT files in reparent test teardown within CI (#13793) [#13797](https://github.com/vitessio/vitess/pull/13797)
+
diff --git a/changelog/16.0/16.0.4/release_notes.md b/changelog/16.0/16.0.4/release_notes.md
new file mode 100644
index 00000000000..d46559f5fec
--- /dev/null
+++ b/changelog/16.0/16.0.4/release_notes.md
@@ -0,0 +1,7 @@
+# Release of Vitess v16.0.4
+The entire changelog for this release can be found [here](https://github.com/vitessio/vitess/blob/main/changelog/16.0/16.0.4/changelog.md).
+
+The release includes 11 merged Pull Requests.
+
+Thanks to all our contributors: @GuptaManan100, @app/vitess-bot, @dbussink, @rohit-nayak-ps, @shlomi-noach, @systay
+
diff --git a/changelog/16.0/16.0.4/summary.md b/changelog/16.0/16.0.4/summary.md
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/changelog/16.0/README.md b/changelog/16.0/README.md
new file mode 100644
index 00000000000..75b3f3a0a1f
--- /dev/null
+++ b/changelog/16.0/README.md
@@ -0,0 +1,21 @@
+## v16.0
+The dedicated team for this release can be found [here](team.md).
+* **[16.0.4](16.0.4)**
+ * [Changelog](16.0.4/changelog.md)
+ * [Release Notes](16.0.4/release_notes.md)
+
+* **[16.0.3](16.0.3)**
+ * [Changelog](16.0.3/changelog.md)
+ * [Release Notes](16.0.3/release_notes.md)
+
+* **[16.0.2](16.0.2)**
+ * [Changelog](16.0.2/changelog.md)
+ * [Release Notes](16.0.2/release_notes.md)
+
+* **[16.0.1](16.0.1)**
+ * [Changelog](16.0.1/changelog.md)
+ * [Release Notes](16.0.1/release_notes.md)
+
+* **[16.0.0](16.0.0)**
+ * [Changelog](16.0.0/changelog.md)
+ * [Release Notes](16.0.0/release_notes.md)
diff --git a/changelog/16.0/team.md b/changelog/16.0/team.md
new file mode 100644
index 00000000000..76b11c38145
--- /dev/null
+++ b/changelog/16.0/team.md
@@ -0,0 +1,5 @@
+## Release Team for v16
+
+- **Lead:** Manan Gupta ([GuptaManan100](https://github.com/GuptaManan100)) manan@planetscale.com
+- **Shadow:** Matt Lord ([mattlord](https://github.com/mattlord)) mlord@planetscale.com
+- **Mentor:** Florent Poinsard ([frouioui](https://github.com/frouioui)) florent@planetscale.com
\ No newline at end of file
diff --git a/changelog/17.0/17.0.0/changelog.md b/changelog/17.0/17.0.0/changelog.md
new file mode 100644
index 00000000000..3c3e107b54e
--- /dev/null
+++ b/changelog/17.0/17.0.0/changelog.md
@@ -0,0 +1,557 @@
+# Changelog of Vitess v17.0.0
+
+### Announcement
+#### Governance
+ * maintainers: add dbussink and rework some sections [#12329](https://github.com/vitessio/vitess/pull/12329)
+### Bug fixes
+#### Backup and Restore
+ * go/vt/mysqlctl/backupstats: increment *_bytes metric by actual number of bytes [#12501](https://github.com/vitessio/vitess/pull/12501)
+ * Avoid crash during BuiltinBackup FileUpload method [#12703](https://github.com/vitessio/vitess/pull/12703)
+ * do not demote a new primary after backup completion [#12856](https://github.com/vitessio/vitess/pull/12856)
+ * go/vt/mysqlctl: fix dup open/close backup stats [#12947](https://github.com/vitessio/vitess/pull/12947)
+ * Incremental backup: fix calculation of binlog files to use [#13066](https://github.com/vitessio/vitess/pull/13066)
+ * restore: Run PITR through mysqlctl [#13123](https://github.com/vitessio/vitess/pull/13123)
+#### Build/CI
+ * Prevent bootstrap of ZK from clearing previous dist binaries [#12236](https://github.com/vitessio/vitess/pull/12236)
+ * Fix dubious ownership of git directory in `vitess/base` Docker build [#12530](https://github.com/vitessio/vitess/pull/12530)
+ * Small fixes to the auto-upgrade golang tool [#12838](https://github.com/vitessio/vitess/pull/12838)
+ * Add timeout to `golangci-lint` and bump its version [#12852](https://github.com/vitessio/vitess/pull/12852)
+ * codegen: ensure goimports also simplifies [#12883](https://github.com/vitessio/vitess/pull/12883)
+#### CLI
+ * Purge logs without panicking [#12187](https://github.com/vitessio/vitess/pull/12187)
+ * Fix `vtctldclient`'s Root command to return an error on unknown command [#12481](https://github.com/vitessio/vitess/pull/12481)
+ * vtctldclient: Format GetKeyspace output using cli.MarshalJSON [#12495](https://github.com/vitessio/vitess/pull/12495)
+ * VReplication: Pass on --keep_routing_rules flag value for Cancel action [#13171](https://github.com/vitessio/vitess/pull/13171)
+#### Cluster management
+ * Fix initialization code to also stop replication to prevent crash [#12534](https://github.com/vitessio/vitess/pull/12534)
+ * Update topo {Get,Create}Keyspace to prevent invalid keyspace names [#12732](https://github.com/vitessio/vitess/pull/12732)
+ * Flaky TestRestart: give mysqlctld process time to shutdown [#12799](https://github.com/vitessio/vitess/pull/12799)
+ * Fix `TestGatewayBufferingWhileReparenting` flakiness [#12817](https://github.com/vitessio/vitess/pull/12817)
+ * [topo] Disallow the slash character in shard names [#12843](https://github.com/vitessio/vitess/pull/12843)
+ * TabletThrottler: `vtctlclient UpdateThrottlerConfig` use VtctldServer RPC [#12936](https://github.com/vitessio/vitess/pull/12936)
+ * Keep retrying mysql port if it is 0 in Vttablets [#12986](https://github.com/vitessio/vitess/pull/12986)
+ * Fix: convertBoolToSemiSyncAction method to account for all semi sync actions [#13075](https://github.com/vitessio/vitess/pull/13075)
+#### Evalengine
+ * evalengine: fix bugs with decimal rounding [#12360](https://github.com/vitessio/vitess/pull/12360)
+ * json: Fix JSON SQL serialization and ensure to run tests [#12861](https://github.com/vitessio/vitess/pull/12861)
+ * evalengine: unset Type for NewColumnWithCollation [#12886](https://github.com/vitessio/vitess/pull/12886)
+ * datetime: Fix weekday calculation for DST changes [#12931](https://github.com/vitessio/vitess/pull/12931)
+ * evalengine: Fix wrong coercion into float [#12998](https://github.com/vitessio/vitess/pull/12998)
+ * evalengine: TypeOf for Columns should only use value type when we have a value [#13148](https://github.com/vitessio/vitess/pull/13148)
+#### Examples
+ * Examples: Add lib functions to wait for shard states [#12239](https://github.com/vitessio/vitess/pull/12239)
+ * Fixes for local docker environment [#12382](https://github.com/vitessio/vitess/pull/12382)
+ * Examples: Correct VTAdmin Discovery File Path And Add Check [#12415](https://github.com/vitessio/vitess/pull/12415)
+ * Fix Vtop example and release script [#12457](https://github.com/vitessio/vitess/pull/12457)
+ * Open vtadmin-api port in docker-local example to enable vtadmin access [#12467](https://github.com/vitessio/vitess/pull/12467)
+ * Use new init_db.sql file in all places and update v17.0.0 summary [#12716](https://github.com/vitessio/vitess/pull/12716)
+ * [release-17.0] Use $hostname in vtadmin script as all other scripts do (#13231) [#13236](https://github.com/vitessio/vitess/pull/13236)
+#### General
+ * Fix shorthand flag for recursive delete in zk tool [#12460](https://github.com/vitessio/vitess/pull/12460)
+ * Forward port of #12436: Sidecar schema init: use COPY algorithm while altering sidecardb tables [#12464](https://github.com/vitessio/vitess/pull/12464)
+ * Fixing backup tests flakiness [#12655](https://github.com/vitessio/vitess/pull/12655)
+ * Fix backup flaky tests [#12834](https://github.com/vitessio/vitess/pull/12834)
+ * Fix auto-upgrade-golang tooling [#13048](https://github.com/vitessio/vitess/pull/13048)
+ * Flakes: Skip flaky viperutil test TestPersistConfig for now to unblock CI [#13186](https://github.com/vitessio/vitess/pull/13186)
+ * Temporarily disable panic in mysqld when socket files are directly used [#13198](https://github.com/vitessio/vitess/pull/13198)
+#### Observability
+ * Reset the current lag when closing the replication lag reader. [#12683](https://github.com/vitessio/vitess/pull/12683)
+#### Online DDL
+ * Allow zero (in) date when setting up internal _vt schema [#12262](https://github.com/vitessio/vitess/pull/12262)
+ * Online DDL: improve retry of vreplication errors with `vitess` `ALTER TABLE` migrations [#12323](https://github.com/vitessio/vitess/pull/12323)
+ * OnlineDDL: mitigate scenario where a migration sees recurring cut-over timeouts [#12451](https://github.com/vitessio/vitess/pull/12451)
+ * Throttler: Store Config in Global Keyspace Topo Record [#12520](https://github.com/vitessio/vitess/pull/12520)
+ * Online DDL: enforce ALGORITHM=COPY on shadow table [#12521](https://github.com/vitessio/vitess/pull/12521)
+ * Online DDL: `ready_to_complete` race fix [#12612](https://github.com/vitessio/vitess/pull/12612)
+ * Mysqld.GetSchema: tolerate tables being dropped while inspecting schema [#12641](https://github.com/vitessio/vitess/pull/12641)
+ * Flaky test fix: OnlineDDL: convert time->unix->TIMESTAMP in golang space [#12826](https://github.com/vitessio/vitess/pull/12826)
+ * OnlineDDL: reject partial key coverage in PRIMARY KEY for vitess migrations [#12921](https://github.com/vitessio/vitess/pull/12921)
+#### Operator
+ * Use latest k8s for operator example to work [#13085](https://github.com/vitessio/vitess/pull/13085)
+ * Upgrade mysqld memory limits to 1024Mi [#13122](https://github.com/vitessio/vitess/pull/13122)
+#### Query Serving
+ * fix dual table handling [#12204](https://github.com/vitessio/vitess/pull/12204)
+ * grpcvtgateconn: add Dial and deprecate DialWithOpts [#12210](https://github.com/vitessio/vitess/pull/12210)
+ * Subquery bugfix [#12254](https://github.com/vitessio/vitess/pull/12254)
+ * fix: transaction_isolation to be applied at session level [#12281](https://github.com/vitessio/vitess/pull/12281)
+ * fix dual table handling [#12292](https://github.com/vitessio/vitess/pull/12292)
+ * fix: added null safe operator precendence rule [#12297](https://github.com/vitessio/vitess/pull/12297)
+ * Fix aggregation on outer joins [#12298](https://github.com/vitessio/vitess/pull/12298)
+ * (re)Formalize SQLError in VReplication, add underlying wrap/unwrap functionality [#12327](https://github.com/vitessio/vitess/pull/12327)
+ * sqlparser/schemadiff: normalize CAST type case [#12372](https://github.com/vitessio/vitess/pull/12372)
+ * Fix bug in vtexplain around JOINs [#12376](https://github.com/vitessio/vitess/pull/12376)
+ * Fix for USING when column names not lower cased [#12378](https://github.com/vitessio/vitess/pull/12378)
+ * Fix additional casting bugs in the sqlparser [#12393](https://github.com/vitessio/vitess/pull/12393)
+ * Fix scalar aggregation engine primitive for column truncation [#12468](https://github.com/vitessio/vitess/pull/12468)
+ * [release-16.0] BugFix: Unsharded query using a derived table and a dual table [#12484](https://github.com/vitessio/vitess/pull/12484)
+ * `ApplyVSchemaDDL`: escape Sequence names when writing the VSchema [#12519](https://github.com/vitessio/vitess/pull/12519)
+ * collations: fix sorting in UCA900 collations [#12555](https://github.com/vitessio/vitess/pull/12555)
+ * VSchema DDL: Add grammar to accept qualified table names in Vindex option values [#12577](https://github.com/vitessio/vitess/pull/12577)
+ * [gen4 planner] Make sure to not push down expressions when not possible [#12607](https://github.com/vitessio/vitess/pull/12607)
+ * Fix `panic` when executing a prepare statement with over `65,528` parameters [#12614](https://github.com/vitessio/vitess/pull/12614)
+ * Always add columns in the `Derived` operator [#12634](https://github.com/vitessio/vitess/pull/12634)
+ * planner: fix predicate simplifier [#12650](https://github.com/vitessio/vitess/pull/12650)
+ * [planner bugfix] add expressions to HAVING [#12668](https://github.com/vitessio/vitess/pull/12668)
+ * Use a left join to make sure that tables with tablespace=innodb_system are included in the schema [#12672](https://github.com/vitessio/vitess/pull/12672)
+ * [planner fix] make unknown column an error only for sharded queries [#12704](https://github.com/vitessio/vitess/pull/12704)
+ * Fix handling of table information for missing column [#12705](https://github.com/vitessio/vitess/pull/12705)
+ * Fix the returned schema object for broken views [#12713](https://github.com/vitessio/vitess/pull/12713)
+ * Fix `vtgate_schema_tracker` flaky tests [#12780](https://github.com/vitessio/vitess/pull/12780)
+ * [planbuilder bugfix] do not push aggregations into derived tables [#12810](https://github.com/vitessio/vitess/pull/12810)
+ * Fix: reset transaction session when no reserved connection [#12878](https://github.com/vitessio/vitess/pull/12878)
+ * fix: union distinct between unsharded route and sharded join [#12968](https://github.com/vitessio/vitess/pull/12968)
+ * bugfix: fix nil pointer in vtgate on topo connection error [#13010](https://github.com/vitessio/vitess/pull/13010)
+ * Cleanup rate limiters [#13016](https://github.com/vitessio/vitess/pull/13016)
+ * restrict flush statement on non primary tablets [#13042](https://github.com/vitessio/vitess/pull/13042)
+ * Fix the resilientQuery to give correct results during initialization [#13080](https://github.com/vitessio/vitess/pull/13080)
+ * Fix flakiness in `TestGatewayBufferingWhileReparenting` [#13106](https://github.com/vitessio/vitess/pull/13106)
+ * sqlparser: Treat view names as case sensitive [#13107](https://github.com/vitessio/vitess/pull/13107)
+ * Add a timeout to prevent unbounded waits that cause the primary tablet's health check stuck [#13111](https://github.com/vitessio/vitess/pull/13111)
+ * VTGate StreamExecute rpc to return session as response [#13131](https://github.com/vitessio/vitess/pull/13131)
+ * Remove the `200` indentation limit in the SQL parser [#13158](https://github.com/vitessio/vitess/pull/13158)
+ * vindexes: make lookup_unicodeloosemd5_hash non-planable [#13200](https://github.com/vitessio/vitess/pull/13200)
+ * fix: GetField to use existing session for query [#13219](https://github.com/vitessio/vitess/pull/13219)
+ * [17.0] Fix and Make aggregation planner handle aggregation functions better and handle Distinct in operator [#13277](https://github.com/vitessio/vitess/pull/13277)
+ * Bug fix: SQL queries erroring with message `unknown aggregation random` [#13330](https://github.com/vitessio/vitess/pull/13330)
+ * bugfixes: collection of fixes to bugs found while fuzzing [#13332](https://github.com/vitessio/vitess/pull/13332)
+ * bug: don't always wrap aggregation in coalesce [#13348](https://github.com/vitessio/vitess/pull/13348)
+#### TabletManager
+ * TableFilter: fix excluded RE listing [#12318](https://github.com/vitessio/vitess/pull/12318)
+ * TableGC: fix PURGE race condition [#12505](https://github.com/vitessio/vitess/pull/12505)
+ * Fix transaction throttler ignoring the initial rate [#12618](https://github.com/vitessio/vitess/pull/12618)
+ * Skip recalculating the rate in MaxReplicationLagModule when it can't be done [#12620](https://github.com/vitessio/vitess/pull/12620)
+ * mysqlctl: Correctly encode database and table names [#13312](https://github.com/vitessio/vitess/pull/13312)
+#### VReplication
+ * VReplication Last Error: retry error if it happens after timeout [#12114](https://github.com/vitessio/vitess/pull/12114)
+ * VReplication: workflows with multiple streams fail to start on multi-primary setups [#12228](https://github.com/vitessio/vitess/pull/12228)
+ * VReplication: ignore GC tables in schema analysis [#12320](https://github.com/vitessio/vitess/pull/12320)
+ * VSCopy: Ensure that vgtid event includes a complete TableLastPK proto message [#12623](https://github.com/vitessio/vitess/pull/12623)
+ * VDiff: use PK column collation for proper ordering [#12845](https://github.com/vitessio/vitess/pull/12845)
+ * Fix bug in `SwitchTraffic` that wasn't respecting `--dry_run` for readonly and replica tablets during a resharding event [#12992](https://github.com/vitessio/vitess/pull/12992)
+ * Fix vreplication_log usage in VReplicationExec [#13038](https://github.com/vitessio/vitess/pull/13038)
+ * ApplySchema vttablet RPC: allow special characters in table and column names [#13054](https://github.com/vitessio/vitess/pull/13054)
+ * Purge old schema versions from memory in historian [#13056](https://github.com/vitessio/vitess/pull/13056)
+ * Flaky vplayer tests: temporarily disable noblob variant [#13100](https://github.com/vitessio/vitess/pull/13100)
+ * VReplication: Do not delete sharded target vschema table entries on Cancel [#13146](https://github.com/vitessio/vitess/pull/13146)
+ * VReplication: Handle reference tables in sharded->sharded MoveTables [#13161](https://github.com/vitessio/vitess/pull/13161)
+ * VReplication: Fix VDiff2 DeleteByUUID Query [#13255](https://github.com/vitessio/vitess/pull/13255)
+#### VTAdmin
+ * [vtadmin] racy vtexplain [#12635](https://github.com/vitessio/vitess/pull/12635)
+ * fix: vtadmin vttablet url protocol [#12836](https://github.com/vitessio/vitess/pull/12836)
+ * update vite base to respect absolute path [#13110](https://github.com/vitessio/vitess/pull/13110)
+#### VTorc
+ * Fix Vtorc recovery time during `DeadPrimary` [#12870](https://github.com/vitessio/vitess/pull/12870)
+ * Add new field to health status [#12942](https://github.com/vitessio/vitess/pull/12942)
+### CI/Build
+#### Build/CI
+ * Makefile: use buildx when GOOS/GOARCH are specified [#12081](https://github.com/vitessio/vitess/pull/12081)
+ * onlineddl_vrepl suite: fix auto_increment flakyness [#12246](https://github.com/vitessio/vitess/pull/12246)
+ * Use a working MariaDB mirror for CI [#12253](https://github.com/vitessio/vitess/pull/12253)
+ * Download mariadb from vitess-resources [#12271](https://github.com/vitessio/vitess/pull/12271)
+ * Bump the vitess-resources release increment from v2 to v4 [#12272](https://github.com/vitessio/vitess/pull/12272)
+ * sqlparser: Tools cleanup [#12407](https://github.com/vitessio/vitess/pull/12407)
+ * Make upgrade downgrade job names unique [#12485](https://github.com/vitessio/vitess/pull/12485)
+ * Update fossa check for Node deprecation [#12871](https://github.com/vitessio/vitess/pull/12871)
+ * Flakes: Wait for throttler to open in throttler custom config test [#12980](https://github.com/vitessio/vitess/pull/12980)
+ * Add minimal token permissions (continued) [#12996](https://github.com/vitessio/vitess/pull/12996)
+ * workflows: Update to latest actions/setup-go [#13023](https://github.com/vitessio/vitess/pull/13023)
+ * CI: add a check on NeedsIssue label [#13044](https://github.com/vitessio/vitess/pull/13044)
+#### Examples
+ * Examples, Flakes: Wait for Shard's VReplication Engine to Open [#12560](https://github.com/vitessio/vitess/pull/12560)
+#### General
+ * Bump reported version of main to 17.0.0-SNAPSHOT [#12234](https://github.com/vitessio/vitess/pull/12234)
+ * [main] Upgrade the Golang version to `go1.20.2` [#12706](https://github.com/vitessio/vitess/pull/12706)
+ * Do not fail build on incorrect Go version [#12809](https://github.com/vitessio/vitess/pull/12809)
+ * [main] Upgrade the Golang version to `go1.20.3` [#12833](https://github.com/vitessio/vitess/pull/12833)
+ * Remove misleading message in `build.env` [#12841](https://github.com/vitessio/vitess/pull/12841)
+ * [main] Upgrade the Golang version to `go1.20.4` [#13052](https://github.com/vitessio/vitess/pull/13052)
+ * Code owners update [#13070](https://github.com/vitessio/vitess/pull/13070)
+ * [release-17.0] Upgrade the Golang version to `go1.20.5` [#13266](https://github.com/vitessio/vitess/pull/13266)
+#### Online DDL
+ * Fixing `onlineddl_vrepl` flakiness, and adding more tests [#12325](https://github.com/vitessio/vitess/pull/12325)
+ * CI: extend timeouts in onlineddl_vrepl due to slow CI runners [#12583](https://github.com/vitessio/vitess/pull/12583)
+ * CI: increase overall test timeouts for all OnlineDDL tests [#12584](https://github.com/vitessio/vitess/pull/12584)
+#### Query Serving
+ * Fix `SHOW VSCHEMA TABLES` tests using v17 vtgate that expected `dual` [#12381](https://github.com/vitessio/vitess/pull/12381)
+ * go/vt/vttablet/tabletserver: temporarily skip flaky consolidation test [#12604](https://github.com/vitessio/vitess/pull/12604)
+#### VReplication
+ * [release-17.0] Flakes: Remove CI endtoend test for VReplication Copy Phase Throttling (#13343) [#13345](https://github.com/vitessio/vitess/pull/13345)
+#### VTAdmin
+ * Remove `nvm use` from vtadmin-up.sh script [#12788](https://github.com/vitessio/vitess/pull/12788)
+### Dependabot
+#### Build/CI
+ * Bump golang.org/x/net from 0.5.0 to 0.7.0 [#12390](https://github.com/vitessio/vitess/pull/12390)
+ * Update additional Go dependencies [#12401](https://github.com/vitessio/vitess/pull/12401)
+ * Fix another mixin dep [#12403](https://github.com/vitessio/vitess/pull/12403)
+#### Observability
+ * Bump vitess.io/vitess from 0.15.2 to 0.16.1 in /vitess-mixin [#12875](https://github.com/vitessio/vitess/pull/12875)
+ * build(deps): bump vitess.io/vitess from 0.16.1 to 0.16.2 in /vitess-mixin [#13076](https://github.com/vitessio/vitess/pull/13076)
+#### VTAdmin
+ * Bump dns-packet from 5.3.1 to 5.4.0 in /web/vtadmin [#12545](https://github.com/vitessio/vitess/pull/12545)
+ * Bump webpack from 5.65.0 to 5.76.1 in /web/vtadmin [#12632](https://github.com/vitessio/vitess/pull/12632)
+ * [release-17.0] build(deps-dev): bump vite from 4.2.1 to 4.2.3 in /web/vtadmin (#13240) [#13254](https://github.com/vitessio/vitess/pull/13254)
+### Documentation
+#### Cluster management
+ * fix help text for backup_storage_number_blocks [#12258](https://github.com/vitessio/vitess/pull/12258)
+#### Documentation
+ * release notes and misc cleanup around tabletenv flags [#12953](https://github.com/vitessio/vitess/pull/12953)
+ * Add Vinted to the list of adopters [#13134](https://github.com/vitessio/vitess/pull/13134)
+ * update link for reparenting guide [#13350](https://github.com/vitessio/vitess/pull/13350)
+#### Query Serving
+ * Copy remaining query serving design docs [#12170](https://github.com/vitessio/vitess/pull/12170)
+ * Add release notes summary for views [#12422](https://github.com/vitessio/vitess/pull/12422)
+ * SQLError: adding some code comments [#12613](https://github.com/vitessio/vitess/pull/12613)
+ * update v16 release notes about VTGate Advertised MySQL Version [#12957](https://github.com/vitessio/vitess/pull/12957)
+### Enhancement
+#### ACL
+ * remove tablet server's ACL check on the /healthz HTTP api route [#12897](https://github.com/vitessio/vitess/pull/12897)
+#### Backup and Restore
+ * vtbackup, mysqlctl: detailed backup and restore metrics [#11979](https://github.com/vitessio/vitess/pull/11979)
+ * go/vt/mysqlctl: add configurable read buffer to builtin backups [#12073](https://github.com/vitessio/vitess/pull/12073)
+ * go/{vt,flags}: register builtin backup flags with vtbackup [#12558](https://github.com/vitessio/vitess/pull/12558)
+ * go/vt/mysqlctl: optionally store decompressor cmd in manifest [#12633](https://github.com/vitessio/vitess/pull/12633)
+ * Fix restore from backup execution path to use context from caller [#12828](https://github.com/vitessio/vitess/pull/12828)
+ * Incremental backup and point in time recovery for XtraBackup [#13156](https://github.com/vitessio/vitess/pull/13156)
+#### Build/CI
+ * Revert default MySQL 80 version to `8.0.30` [#12252](https://github.com/vitessio/vitess/pull/12252)
+ * Block merge if the `Do Not Merge` label is set [#12489](https://github.com/vitessio/vitess/pull/12489)
+ * Auto upgrade the Golang version [#12585](https://github.com/vitessio/vitess/pull/12585)
+ * Add read-only token permissions to GitHub Action workflows [#12718](https://github.com/vitessio/vitess/pull/12718)
+ * Remove unnecessary code bits in workflows [#12756](https://github.com/vitessio/vitess/pull/12756)
+ * tools/build_version_flags: allow configurable `build time` [#12876](https://github.com/vitessio/vitess/pull/12876)
+ * Set the number of threads for release notes generation with a flag [#13273](https://github.com/vitessio/vitess/pull/13273)
+#### CLI
+ * [flags] extract tabletenv seconds type [#12920](https://github.com/vitessio/vitess/pull/12920)
+#### Cluster management
+ * Introducing new error counter in VTTablet [#12266](https://github.com/vitessio/vitess/pull/12266)
+ * Auto refresh tables on vtgate Status Page [#12335](https://github.com/vitessio/vitess/pull/12335)
+ * Add configuration option for minimum TLS version [#12424](https://github.com/vitessio/vitess/pull/12424)
+ * Add tablet type filtering to vtctldclient GetTablets [#12915](https://github.com/vitessio/vitess/pull/12915)
+ * topo: Move to allow list for invalid names [#12917](https://github.com/vitessio/vitess/pull/12917)
+ * Add vstream metrics to vtgate [#13098](https://github.com/vitessio/vitess/pull/13098)
+ * [release-17.0] increase length of reparent_journal columns (#13287) [#13291](https://github.com/vitessio/vitess/pull/13291)
+#### Evalengine
+ * evalengine: virtual machine [#12369](https://github.com/vitessio/vitess/pull/12369)
+ * Add 128 bit hashing for the evalengine [#12428](https://github.com/vitessio/vitess/pull/12428)
+ * evalengine: add more coercion paths to Hash128 [#12463](https://github.com/vitessio/vitess/pull/12463)
+ * evalengine: Implement integer division and modulo [#12656](https://github.com/vitessio/vitess/pull/12656)
+ * [ast & semantics] Make more type information available [#12710](https://github.com/vitessio/vitess/pull/12710)
+ * evalengine: New integration API [#12724](https://github.com/vitessio/vitess/pull/12724)
+ * vtgate: use collation when hashing query plans [#12728](https://github.com/vitessio/vitess/pull/12728)
+ * Implement logic to handle more JSON conversion [#12733](https://github.com/vitessio/vitess/pull/12733)
+ * evalengine: Add handling for current timestamp functions [#12742](https://github.com/vitessio/vitess/pull/12742)
+ * evalengine: Add support for more arithmetic functions [#12778](https://github.com/vitessio/vitess/pull/12778)
+ * evalengine: Fix handling of datetime and numeric comparisons [#12789](https://github.com/vitessio/vitess/pull/12789)
+ * evalengine: Implement ROUND() and TRUNCATE() [#12797](https://github.com/vitessio/vitess/pull/12797)
+ * evalengine: Implement CRC32 & CONV [#12804](https://github.com/vitessio/vitess/pull/12804)
+ * evalengine: Improve the timezone parsing logic [#12827](https://github.com/vitessio/vitess/pull/12827)
+ * evalengine: Implement initial crypto functions [#12835](https://github.com/vitessio/vitess/pull/12835)
+ * datetime: Add week number formatting [#12884](https://github.com/vitessio/vitess/pull/12884)
+ * evalengine: Add CONVERT_TZ function [#12892](https://github.com/vitessio/vitess/pull/12892)
+ * evalengine: Improve handling of datetime / time with precision and add more functions [#12907](https://github.com/vitessio/vitess/pull/12907)
+ * evalengine: Implement additional week modes [#12916](https://github.com/vitessio/vitess/pull/12916)
+ * evalengine: Add support for `UNIX_TIMESTAMP & `FROM_UNIXTIME` [#12928](https://github.com/vitessio/vitess/pull/12928)
+ * evalengine: Implement `MAKEDATE` and `MAKETIME`. [#12938](https://github.com/vitessio/vitess/pull/12938)
+ * evalengine: Implement LEFT, RIGHT, LPAD & RPAD [#13013](https://github.com/vitessio/vitess/pull/13013)
+ * evalengine: Implement TRIM, RTRIM and LTRIM [#13024](https://github.com/vitessio/vitess/pull/13024)
+ * evalengine: Implement UNHEX [#13028](https://github.com/vitessio/vitess/pull/13028)
+ * evalengine: Implement ORD [#13029](https://github.com/vitessio/vitess/pull/13029)
+ * evalengine: Add support for `STRCMP` [#13063](https://github.com/vitessio/vitess/pull/13063)
+ * evalengine: Add support for handling `IF` [#13067](https://github.com/vitessio/vitess/pull/13067)
+ * evalengine: `INTERVAL` support [#13073](https://github.com/vitessio/vitess/pull/13073)
+ * evalengine: Implement IP related functions [#13082](https://github.com/vitessio/vitess/pull/13082)
+ * evalengine: Implement `CONCAT` and `CONCAT_WS` [#13091](https://github.com/vitessio/vitess/pull/13091)
+ * evalengine: Add UUID functions [#13097](https://github.com/vitessio/vitess/pull/13097)
+#### Examples
+ * examples schema: demi-idempotency via CREATE TABLE IF NOT EXISTS [#12453](https://github.com/vitessio/vitess/pull/12453)
+#### General
+ * Upgrade to `go1.20.1` [#12399](https://github.com/vitessio/vitess/pull/12399)
+ * adding log statment to vtbackup [#12569](https://github.com/vitessio/vitess/pull/12569)
+ * Automatically add milestone to new Pull Request [#12759](https://github.com/vitessio/vitess/pull/12759)
+ * Miscellaneous code modifications based on observations made while doing a code walkthrough [#12873](https://github.com/vitessio/vitess/pull/12873)
+ * Remove viper warnings from local examples [#13234](https://github.com/vitessio/vitess/pull/13234)
+#### Observability
+ * Add `Uptime` metric [#12712](https://github.com/vitessio/vitess/pull/12712)
+ * go/{stats,vt}: publish VReplicationStreamState to prometheus backend [#12772](https://github.com/vitessio/vitess/pull/12772)
+ * [vtadmin] log response errors [#12844](https://github.com/vitessio/vitess/pull/12844)
+#### Online DDL
+ * schemadiff/OnlineDDL: ExtractConstraintOriginalName understands auto-generated names [#12275](https://github.com/vitessio/vitess/pull/12275)
+ * schemadiff: diffing two schemas generates a rich SchemaDiff object [#12551](https://github.com/vitessio/vitess/pull/12551)
+ * Online DDL: remove artifact entry upon GC [#12592](https://github.com/vitessio/vitess/pull/12592)
+ * Online DDL: configurable cut-over threshold [#12594](https://github.com/vitessio/vitess/pull/12594)
+ * gh-ost migrations: improved error log message [#12882](https://github.com/vitessio/vitess/pull/12882)
+ * OnlineDDL/vitess: only KILL 'RENAME' statement if not known to be successful [#12989](https://github.com/vitessio/vitess/pull/12989)
+ * Online DDL: better reporting of error message when RENAME fails [#13143](https://github.com/vitessio/vitess/pull/13143)
+#### Query Serving
+ * VSCopy: Enable to copy from all shards in either a specified keyspace or all keyspaces [#11909](https://github.com/vitessio/vitess/pull/11909)
+ * vtgate: metrics for prepared stmts [#12141](https://github.com/vitessio/vitess/pull/12141)
+ * Add flag to select tx throttler tablet type [#12174](https://github.com/vitessio/vitess/pull/12174)
+ * sqlparser: Add parsing support to spatial POINT expression [#12198](https://github.com/vitessio/vitess/pull/12198)
+ * evalengine: new evaluation framework [#12247](https://github.com/vitessio/vitess/pull/12247)
+ * evalengine: it's time for JSON! [#12274](https://github.com/vitessio/vitess/pull/12274)
+ * Add parsing support for linestring constructor [#12299](https://github.com/vitessio/vitess/pull/12299)
+ * [main] add database name to _vt.views table (#12368) [#12374](https://github.com/vitessio/vitess/pull/12374)
+ * Schema RPC to fetch table/view definition [#12375](https://github.com/vitessio/vitess/pull/12375)
+ * sqlparser: add parsing support for polygon spatial datatype [#12377](https://github.com/vitessio/vitess/pull/12377)
+ * Emit per workload labels for existing per table vttablet metrics [#12394](https://github.com/vitessio/vitess/pull/12394)
+ * go/vt/vtgate: add json and use_fallback opts to numeric_static_map vdx [#12414](https://github.com/vitessio/vitess/pull/12414)
+ * Add basic metrics to `vttablet` transaction throttler [#12418](https://github.com/vitessio/vitess/pull/12418)
+ * Change `GetSchema` RPC to return `CreateView` instead of `SelectStmt` [#12421](https://github.com/vitessio/vitess/pull/12421)
+ * schemadiff: AlterTableAlgorithmStrategy [#12442](https://github.com/vitessio/vitess/pull/12442)
+ * GetSchema rpc to streaming api [#12447](https://github.com/vitessio/vitess/pull/12447)
+ * streamlog: make generic [#12494](https://github.com/vitessio/vitess/pull/12494)
+ * Horizon planning on operators [#12506](https://github.com/vitessio/vitess/pull/12506)
+ * Refactor and cleanup treatment of keyspace IDs and KeyRange [#12524](https://github.com/vitessio/vitess/pull/12524)
+ * collations: upgrade to MySQL 8.0.32 [#12557](https://github.com/vitessio/vitess/pull/12557)
+ * schemadiff: validate views' referenced columns via semantics [#12565](https://github.com/vitessio/vitess/pull/12565)
+ * sqlparser: Add parsing support to geom Collection types [#12608](https://github.com/vitessio/vitess/pull/12608)
+ * Parser: support PURGE BINARY LOGS statement [#12615](https://github.com/vitessio/vitess/pull/12615)
+ * sqlparser: Add parsing support for wkt funcs [#12651](https://github.com/vitessio/vitess/pull/12651)
+ * Add priority support to transaction throttler [#12662](https://github.com/vitessio/vitess/pull/12662)
+ * `schemadiff`: multi-error in schema normalization [#12675](https://github.com/vitessio/vitess/pull/12675)
+ * Add parsing support to wkb spatial funcs [#12739](https://github.com/vitessio/vitess/pull/12739)
+ * Log the length of the actual rows when the query exceeds the warning threshold [#12755](https://github.com/vitessio/vitess/pull/12755)
+ * [gen4 planner] Better handling of projections in operators [#12790](https://github.com/vitessio/vitess/pull/12790)
+ * Add parsing support to format functions [#12829](https://github.com/vitessio/vitess/pull/12829)
+ * Add parsing suppport to geom property functions [#12855](https://github.com/vitessio/vitess/pull/12855)
+ * planner fix: scoping rules for JOIN ON expression inside a subquery [#12881](https://github.com/vitessio/vitess/pull/12881)
+ * schemadiff: formalize SchemaDiff as the only schema diffing mechanism [#12885](https://github.com/vitessio/vitess/pull/12885)
+ * Trigger the loadTablets function when no primary is assigned to the shard [#12893](https://github.com/vitessio/vitess/pull/12893)
+ * Add vtgate and vttablet flag to truncate errors sent to client [#12899](https://github.com/vitessio/vitess/pull/12899)
+ * Add parsing support to point property functions [#12904](https://github.com/vitessio/vitess/pull/12904)
+ * schemadiff: rich `ImpossibleApplyDiffOrderError` [#12918](https://github.com/vitessio/vitess/pull/12918)
+ * Gen4: move insert planner to gen4 [#12934](https://github.com/vitessio/vitess/pull/12934)
+ * Optionally truncate queries that are written to logs [#12944](https://github.com/vitessio/vitess/pull/12944)
+ * Throttled transactions return MySQL error code 1041 ER_OUT_OF_RESOURCES [#12949](https://github.com/vitessio/vitess/pull/12949)
+ * Gen4 Operator Refactoring: ORDER BY & Debugging Enhancements [#12954](https://github.com/vitessio/vitess/pull/12954)
+ * `schemadiff`: better naming; formalizing `SchemaDiff` use. [#12955](https://github.com/vitessio/vitess/pull/12955)
+ * gen4 planner: Derived table handling on operators [#12978](https://github.com/vitessio/vitess/pull/12978)
+ * [Gen4] Aggregation and Grouping on Operators [#12994](https://github.com/vitessio/vitess/pull/12994)
+ * Add parsing support to linestring property functions [#12995](https://github.com/vitessio/vitess/pull/12995)
+ * planner: allow reference tables to specify global sources [#13030](https://github.com/vitessio/vitess/pull/13030)
+ * Add parsing support to := operator [#13032](https://github.com/vitessio/vitess/pull/13032)
+ * TxThrottler support for transactions outside BEGIN/COMMIT [#13040](https://github.com/vitessio/vitess/pull/13040)
+ * Add parsing support to geomCollection property functions and geohash/geojson functions [#13072](https://github.com/vitessio/vitess/pull/13072)
+ * Schema Tracking Refactor: Merge schema-tracking in health-streamer into schema.Engine [#13121](https://github.com/vitessio/vitess/pull/13121)
+ * enable settings pool by default [#13127](https://github.com/vitessio/vitess/pull/13127)
+ * Augmenting the `GetSchema` RPC to also work for `Table` and `All` type of input [#13197](https://github.com/vitessio/vitess/pull/13197)
+#### TabletManager
+ * ApplySchema: deprecate '--skip_preflight' flag [#10716](https://github.com/vitessio/vitess/pull/10716)
+ * Update tabletpicker to support cell pref and tablet order options [#12282](https://github.com/vitessio/vitess/pull/12282)
+ * SidecarDB Init: don't fail on schema init errors [#12328](https://github.com/vitessio/vitess/pull/12328)
+ * Tablet throttler: adding log entries [#12966](https://github.com/vitessio/vitess/pull/12966)
+ * Tablet throttler: throttler-config-via-topo defaults 'true', deprecation message for old flags [#13130](https://github.com/vitessio/vitess/pull/13130)
+ * Tablet throttler: be explicit about client app name, exempt some apps from checks and heartbeat renewals [#13195](https://github.com/vitessio/vitess/pull/13195)
+#### VReplication
+ * [main] VReplication: Use MariaDB Compat JSON Functions (#12420) [#12434](https://github.com/vitessio/vitess/pull/12434)
+ * Add Workflow Update Client Command [#12622](https://github.com/vitessio/vitess/pull/12622)
+ * VDiff: Add --update-table-stats flag to VDiff2 [#12868](https://github.com/vitessio/vitess/pull/12868)
+ * VReplication: Support MySQL Binary Log Transaction Compression [#12950](https://github.com/vitessio/vitess/pull/12950)
+ * VReplication: More intelligently manage vschema table entries on unsharded targets [#13220](https://github.com/vitessio/vitess/pull/13220)
+#### VTorc
+ * vtorc: have cooldown only apply to the same kind of analysis [#13103](https://github.com/vitessio/vitess/pull/13103)
+#### web UI
+ * update query-string dep due to reported vulnerability [#12673](https://github.com/vitessio/vitess/pull/12673)
+ * [VTAdmin] Migrate to Vite [#12831](https://github.com/vitessio/vitess/pull/12831)
+### Feature Request
+#### Cluster management
+ * Initialize Tablet with super_read_only mode [#12206](https://github.com/vitessio/vitess/pull/12206)
+#### Online DDL
+ * SchemaDiff: normalize boolean columns to tinyint(1), and, add TableQualifier hint to force adding a db qualifier to the alter diff. [#12133](https://github.com/vitessio/vitess/pull/12133)
+#### Query Serving
+ * Support Custom SidecarDB Names on VTTablets [#12240](https://github.com/vitessio/vitess/pull/12240)
+ * Create Views allowed for same keyspace [#12409](https://github.com/vitessio/vitess/pull/12409)
+ * Add Prepare, Execute and Deallocate Statement Support related to prepared statement [#12752](https://github.com/vitessio/vitess/pull/12752)
+ * feat: keep track of the full table name of expanded columns [#12976](https://github.com/vitessio/vitess/pull/12976)
+ * gen4 planner: push aggregation under filtering [#13169](https://github.com/vitessio/vitess/pull/13169)
+#### VReplication
+ * Workflow Show: display rows copied [#12231](https://github.com/vitessio/vitess/pull/12231)
+ * VReplication Workflows: support noblob binlog_row_image format for MoveTables and Reshard [#12905](https://github.com/vitessio/vitess/pull/12905)
+#### VTAdmin
+ * [VTAdmin] Add GetSrvKeyspaces and GetSrvKeyspace [#12702](https://github.com/vitessio/vitess/pull/12702)
+ * Add panic recovery handler to vtadmin http middleware [#12864](https://github.com/vitessio/vitess/pull/12864)
+### Internal Cleanup
+#### Build/CI
+ * Stop launchable integration for unit tests [#12386](https://github.com/vitessio/vitess/pull/12386)
+ * Run launchable only on PRs against `main` [#12694](https://github.com/vitessio/vitess/pull/12694)
+#### CLI
+ * Cleanup TODOs in vtorc flag parsing code from v15 [#12787](https://github.com/vitessio/vitess/pull/12787)
+ * [vtctld] Delete legacy dual purpose duration/int flag parsing [#12860](https://github.com/vitessio/vitess/pull/12860)
+#### Cluster management
+ * delete deprecated vtctld healthcheck flags and associated realtime stats code [#12373](https://github.com/vitessio/vitess/pull/12373)
+ * [misc] Delete `automation*` protos [#12449](https://github.com/vitessio/vitess/pull/12449)
+ * Deprecate `durability_policy` flag in vtctld [#12930](https://github.com/vitessio/vitess/pull/12930)
+#### Evalengine
+ * evalengine: use 128 bit hashing internally [#12452](https://github.com/vitessio/vitess/pull/12452)
+ * evalengine: Refactorings & fixes [#12554](https://github.com/vitessio/vitess/pull/12554)
+ * evalengine: More cleanup [#12573](https://github.com/vitessio/vitess/pull/12573)
+ * Move the JSON parser from evalengine [#12757](https://github.com/vitessio/vitess/pull/12757)
+ * datetime: Unify parse and print APIs [#12815](https://github.com/vitessio/vitess/pull/12815)
+ * evalengine/compiler: Unify compilation [#12913](https://github.com/vitessio/vitess/pull/12913)
+ * mysql/evalengine: Unify float parsing [#12979](https://github.com/vitessio/vitess/pull/12979)
+#### Examples
+ * Remove `are-you-alive` example [#12432](https://github.com/vitessio/vitess/pull/12432)
+#### General
+ * Fix CodeQL identified issues [#12199](https://github.com/vitessio/vitess/pull/12199)
+ * Fix typecasting issue for workflow types [#12217](https://github.com/vitessio/vitess/pull/12217)
+ * Fix additional integer type handling [#12237](https://github.com/vitessio/vitess/pull/12237)
+ * Move to independent sets package [#12251](https://github.com/vitessio/vitess/pull/12251)
+ * Copy release notes from release-16 to `main` [#12287](https://github.com/vitessio/vitess/pull/12287)
+ * Fix additional typecasting alerts [#12309](https://github.com/vitessio/vitess/pull/12309)
+ * Switch to using new Go 1.19 CRL parser [#12315](https://github.com/vitessio/vitess/pull/12315)
+ * Internal refactor: LastError as a public struct [#12321](https://github.com/vitessio/vitess/pull/12321)
+ * Move to Go 1.19 atomics [#12391](https://github.com/vitessio/vitess/pull/12391)
+ * Remove a bunch of debug logging [#12404](https://github.com/vitessio/vitess/pull/12404)
+ * Update the pull request template to include a checkpoint for verifying modified/created tests aren't flaky [#12443](https://github.com/vitessio/vitess/pull/12443)
+ * Add steps on how to merge during code-freeze [#12444](https://github.com/vitessio/vitess/pull/12444)
+ * [main] Add a known issue into the release notes for xtrabackup and DDLs (#12536) [#12537](https://github.com/vitessio/vitess/pull/12537)
+ * Remove unused JQuery includes [#12552](https://github.com/vitessio/vitess/pull/12552)
+ * Minor Cleanup of SidecarDB Package [#12652](https://github.com/vitessio/vitess/pull/12652)
+ * [misc] Cleanup/fix/delete TODO comments [#12758](https://github.com/vitessio/vitess/pull/12758)
+ * sqlutils: Cleanup dead code [#12929](https://github.com/vitessio/vitess/pull/12929)
+ * topo: Remove unused templating code [#12939](https://github.com/vitessio/vitess/pull/12939)
+ * template: Move all HTML templates to safehtml [#12940](https://github.com/vitessio/vitess/pull/12940)
+ * style(grpc_codec): use switch-case [#12956](https://github.com/vitessio/vitess/pull/12956)
+ * fix some code comments throughout the codebase [#12964](https://github.com/vitessio/vitess/pull/12964)
+ * servenv: Move away from using default HTTP muxer [#12987](https://github.com/vitessio/vitess/pull/12987)
+ * tools: Cleanup more unused code [#12991](https://github.com/vitessio/vitess/pull/12991)
+ * coverage: Remove sonar coverage setup [#13000](https://github.com/vitessio/vitess/pull/13000)
+ * Update GOVERNANCE.md [#13047](https://github.com/vitessio/vitess/pull/13047)
+ * Deprecate VTGR [#13301](https://github.com/vitessio/vitess/pull/13301)
+ * Cherry-pick all pending PRs into `release-17.0` [#13364](https://github.com/vitessio/vitess/pull/13364)
+#### Governance
+ * Added [Twitter] & [Etsy] to ADOPTERS.md [#12508](https://github.com/vitessio/vitess/pull/12508)
+#### Observability
+ * flags: deprecate vtctld_addr and delete related code [#12580](https://github.com/vitessio/vitess/pull/12580)
+#### Online DDL
+ * Deprecating VExec, part 2 - *post v16* [#12074](https://github.com/vitessio/vitess/pull/12074)
+ * Online DDL: remove legacy "stowaway table" logic [#12288](https://github.com/vitessio/vitess/pull/12288)
+ * [onlineddl] Remove some old backwards-compatibilities in online ddl code [#12427](https://github.com/vitessio/vitess/pull/12427)
+ * Query executor: preparing for `SHOW VITESS_MIGRATIONS` via `ShowBasic` [#12688](https://github.com/vitessio/vitess/pull/12688)
+#### Query Serving
+ * [vtgate planner] Routing & Merging refactor [#12197](https://github.com/vitessio/vitess/pull/12197)
+ * Use the correct uint32 type for the GTID file position [#12229](https://github.com/vitessio/vitess/pull/12229)
+ * Fix typecasting alerts inside vtgate engine [#12238](https://github.com/vitessio/vitess/pull/12238)
+ * Change SQL error codes to use explicit type [#12249](https://github.com/vitessio/vitess/pull/12249)
+ * fix linter warnings [#12286](https://github.com/vitessio/vitess/pull/12286)
+ * [healthcheck] Remove deprecated fields from TabletHealth json marshalling [#12429](https://github.com/vitessio/vitess/pull/12429)
+ * Semantics refactor: formalize errors [#12572](https://github.com/vitessio/vitess/pull/12572)
+ * Refactor: go/vt/vtgate/engine/opcode to reduce `semantics` package dependencies [#12663](https://github.com/vitessio/vitess/pull/12663)
+ * evalengine: misc. cleanups [#12684](https://github.com/vitessio/vitess/pull/12684)
+ * [gen4 planner] Move more horizon planning to operators [#12750](https://github.com/vitessio/vitess/pull/12750)
+ * Move vreplication to vitess json parser [#12761](https://github.com/vitessio/vitess/pull/12761)
+ * simplify views ddl execution path [#12874](https://github.com/vitessio/vitess/pull/12874)
+ * refactor: clean up and simplify the semantics package [#12894](https://github.com/vitessio/vitess/pull/12894)
+ * Cleanup panics in `txthrottler`, reorder for readability [#12901](https://github.com/vitessio/vitess/pull/12901)
+ * txthrottler: further code cleanup [#12902](https://github.com/vitessio/vitess/pull/12902)
+ * feat: re-introduce expanded columns info in semantic state [#12908](https://github.com/vitessio/vitess/pull/12908)
+ * Add limit planning to operators [#12927](https://github.com/vitessio/vitess/pull/12927)
+ * [vttablet] cleanup unused code in tabletserver [#12943](https://github.com/vitessio/vitess/pull/12943)
+ * goyacc: don't import "unsafe" if not used [#13008](https://github.com/vitessio/vitess/pull/13008)
+ * fix misleading primary not serving message [#13022](https://github.com/vitessio/vitess/pull/13022)
+ * Remove enable-query-plan-field-caching flag that was deprecated in v15 [#13141](https://github.com/vitessio/vitess/pull/13141)
+ * sqlparser: Improve interval parsing [#13165](https://github.com/vitessio/vitess/pull/13165)
+ * refactor QueryProjection [#13174](https://github.com/vitessio/vitess/pull/13174)
+#### TabletManager
+ * Table GC: remove spammy log entry [#12625](https://github.com/vitessio/vitess/pull/12625)
+ * mysqlctl: Remove unused schema version [#12999](https://github.com/vitessio/vitess/pull/12999)
+ * vttablet: Cleanup unused db version string [#13102](https://github.com/vitessio/vitess/pull/13102)
+ * mysqlctl: Remove custom callbacks [#13119](https://github.com/vitessio/vitess/pull/13119)
+ * mysqlctl: Remove usage of MYSQL_FLAVOR [#13135](https://github.com/vitessio/vitess/pull/13135)
+ * [release-17.0] k8stopo: Include deprecation warning (#13299) [#13302](https://github.com/vitessio/vitess/pull/13302)
+#### VReplication
+ * Use consistent type for vreplication id [#12218](https://github.com/vitessio/vitess/pull/12218)
+ * Use consistent type port and replication state [#12248](https://github.com/vitessio/vitess/pull/12248)
+#### VTAdmin
+ * [vtadmin-api] standardize cluster ids [#12803](https://github.com/vitessio/vitess/pull/12803)
+#### VTorc
+ * Cleanup vtorc ssl package [#12423](https://github.com/vitessio/vitess/pull/12423)
+ * vtgr: Remove unused code [#12975](https://github.com/vitessio/vitess/pull/12975)
+#### web UI
+ * Add nvm and node to vtadmin-up.sh [#12439](https://github.com/vitessio/vitess/pull/12439)
+### Performance
+#### General
+ * Use `MarshalVT`/`UnmarshalVT` instead of `proto.Marshal`/`proto.Unmarshal`. [#12525](https://github.com/vitessio/vitess/pull/12525)
+#### Online DDL
+ * OnlineDDL: optimizing --singleton-context conflict check [#12539](https://github.com/vitessio/vitess/pull/12539)
+### RFC
+#### General
+ * [RFC] Standardized viper framework for vitess configuration parameters [#11456](https://github.com/vitessio/vitess/pull/11456)
+### Regression
+#### ACL
+ * vtgate : Disable Automatically setting immediateCallerID to user from static authentication context [#12961](https://github.com/vitessio/vitess/pull/12961)
+#### Backup and Restore
+ * Add RestorePosition and RestoredBackupTime as metrics to vttablet [#13339](https://github.com/vitessio/vitess/pull/13339)
+#### Query Serving
+ * gen4 planner bugfix: issue when merging subqueries [#13025](https://github.com/vitessio/vitess/pull/13025)
+ * gen4 planner: allow last_insert_id with arguments [#13026](https://github.com/vitessio/vitess/pull/13026)
+ * fix: ShardedRouting clone to clone slice of reference correctly [#13265](https://github.com/vitessio/vitess/pull/13265)
+ * [release-17.0] Handle inconsistent state error in query buffering (#13333) [#13353](https://github.com/vitessio/vitess/pull/13353)
+### Release
+#### Documentation
+ * Update the release instructions after v16 code freeze [#12245](https://github.com/vitessio/vitess/pull/12245)
+ * Improve release instructions post `v16.0.0 GA` release [#12538](https://github.com/vitessio/vitess/pull/12538)
+ * Re-organize the `releasenotes` directory into `changelog` [#12566](https://github.com/vitessio/vitess/pull/12566)
+ * Update the release instructions for the local install guide [#12746](https://github.com/vitessio/vitess/pull/12746)
+ * Fix incorrect path during release notes generation [#12769](https://github.com/vitessio/vitess/pull/12769)
+ * Fix format error in the `v16.0.2` release notes [#13057](https://github.com/vitessio/vitess/pull/13057)
+ * consolidate all deprecated flags under one header in release notes [#13163](https://github.com/vitessio/vitess/pull/13163)
+ * Prepare and clean summary docs for `v17.0.0` [#13363](https://github.com/vitessio/vitess/pull/13363)
+#### General
+ * Fix release script for the version in the docker script [#12284](https://github.com/vitessio/vitess/pull/12284)
+ * Improve release process post `v16.0.0 GA` code freeze [#12487](https://github.com/vitessio/vitess/pull/12487)
+ * Copy release notes from release-16.0.0 to main [#12516](https://github.com/vitessio/vitess/pull/12516)
+ * Copy release notes for v16.0.1, v15.0.3, and v14.0.5 [#12768](https://github.com/vitessio/vitess/pull/12768)
+ * Copy release notes of v16.0.2 [#13051](https://github.com/vitessio/vitess/pull/13051)
+ * Review and cleanup of v17 RC release notes summary [#13209](https://github.com/vitessio/vitess/pull/13209)
+ * Code freeze of release-17.0 [#13210](https://github.com/vitessio/vitess/pull/13210)
+ * Release of v17.0.0-rc1 [#13211](https://github.com/vitessio/vitess/pull/13211)
+ * Back to dev mode [#13249](https://github.com/vitessio/vitess/pull/13249)
+ * Code freeze of release-17.0 for rc2 [#13296](https://github.com/vitessio/vitess/pull/13296)
+ * Release of v17.0.0-rc2 [#13305](https://github.com/vitessio/vitess/pull/13305)
+ * Back to dev mode after v17.0.0-rc2 [#13313](https://github.com/vitessio/vitess/pull/13313)
+#### VTAdmin
+ * Add the vtadmin `web` directory to the release packages [#12639](https://github.com/vitessio/vitess/pull/12639)
+### Testing
+#### Build/CI
+ * testutils: use a rows parser for test comparisons [#12138](https://github.com/vitessio/vitess/pull/12138)
+ * [main] Don't keep data in upgrade-downgrade tests (#12462) [#12465](https://github.com/vitessio/vitess/pull/12465)
+ * Flakes: Address Common Unit Test Races [#12546](https://github.com/vitessio/vitess/pull/12546)
+ * Throttler: Expose Tablet's Config & Leverage to Deflake Tests [#12737](https://github.com/vitessio/vitess/pull/12737)
+ * Remove TODO from e2e upgrade test [#12792](https://github.com/vitessio/vitess/pull/12792)
+ * fakesqldb: Guard query log usage with lock [#12813](https://github.com/vitessio/vitess/pull/12813)
+ * fakedbclient: Add locking to avoid races [#12814](https://github.com/vitessio/vitess/pull/12814)
+ * test: fix cfc flaky test [#12941](https://github.com/vitessio/vitess/pull/12941)
+ * [ci] add generator for templated flag testdata [#13150](https://github.com/vitessio/vitess/pull/13150)
+#### CLI
+ * Skip `--config-file-not-found-handling` in upgrade downgrade tests when `vttablet < 17.x.x` [#13275](https://github.com/vitessio/vitess/pull/13275)
+#### Evalengine
+ * evalengine: Try to reduce test flakyness around time [#12819](https://github.com/vitessio/vitess/pull/12819)
+ * evalengine: Skip integration tests under race detector [#12948](https://github.com/vitessio/vitess/pull/12948)
+#### Examples
+ * Examples: Add ENV Var to Local Examples to Skip VTAdmin [#12547](https://github.com/vitessio/vitess/pull/12547)
+#### General
+ * Fix fullstatus test for backward compat [#12685](https://github.com/vitessio/vitess/pull/12685)
+ * VDiff: cleanup test log output [#12840](https://github.com/vitessio/vitess/pull/12840)
+#### Online DDL
+ * OnlineDDL endtoend/CI: timestamp deviation toleration [#13046](https://github.com/vitessio/vitess/pull/13046)
+#### Query Serving
+ * Use atomic.Bool for fakesqldb behavior flags [#12603](https://github.com/vitessio/vitess/pull/12603)
+ * go/{mysql,sync2,vt}: rework tabletserver consolidator test, modify consolidator result type [#12609](https://github.com/vitessio/vitess/pull/12609)
+ * debug: add ToString to operators to make it easier to debug [#12952](https://github.com/vitessio/vitess/pull/12952)
+ * fix: deflake TestGetSchemaRPC test [#12977](https://github.com/vitessio/vitess/pull/12977)
+ * Fix `TestStartFindMysqlPort` test flakiness [#13019](https://github.com/vitessio/vitess/pull/13019)
+ * Fix benchmarks in `plan_test.go` [#13096](https://github.com/vitessio/vitess/pull/13096)
+ * tests: stop tests not supported by older versions from running [#13183](https://github.com/vitessio/vitess/pull/13183)
+#### VReplication
+ * Flakes: Use new healthy shard check in vreplication e2e tests [#12502](https://github.com/vitessio/vitess/pull/12502)
+ * Flakes: Handle Non-Determinstic Shard Ordering in VGTID [#12637](https://github.com/vitessio/vitess/pull/12637)
+ * Flakes: Handle Non-Deterministic VStream Event Ordering [#12642](https://github.com/vitessio/vitess/pull/12642)
+ * vreplication: Run all appropriate tests [#12862](https://github.com/vitessio/vitess/pull/12862)
+ * Generated Invisible Primary Keys: add vreplication test cases [#13004](https://github.com/vitessio/vitess/pull/13004)
+ * Flakes: enforce no concurrency/parallelism in vreplication unit test framework [#13104](https://github.com/vitessio/vitess/pull/13104)
+#### VTAdmin
+ * [vtctldserver] Remove parallelization from tests that mutate shared state [#12257](https://github.com/vitessio/vitess/pull/12257)
+#### VTorc
+ * Fix flakiness in `TestDeadPrimaryRecoversImmediately` [#13232](https://github.com/vitessio/vitess/pull/13232)
+
diff --git a/changelog/17.0/17.0.0/release_notes.md b/changelog/17.0/17.0.0/release_notes.md
new file mode 100644
index 00000000000..9900ded0e3c
--- /dev/null
+++ b/changelog/17.0/17.0.0/release_notes.md
@@ -0,0 +1,494 @@
+# Release of Vitess v17.0.0
+## Summary
+
+### Table of Contents
+
+- **[Known Issues](#known-issues)**
+ - [Schema-initialization stuck on semi-sync ACKs while upgrading to v17.0.0](#schema-init-upgrade)
+- **[Major Changes](#major-changes)**
+ - **[Breaking Changes](#breaking-changes)**
+ - [Default Local Cell Preference for TabletPicker](#tablet-picker-cell-preference)
+ - [Dedicated stats for VTGate Prepare operations](#dedicated-vtgate-prepare-stats)
+ - [VTAdmin web migrated from create-react-app to vite](#migrated-vtadmin)
+ - [Keyspace name validation in TopoServer](#keyspace-name-validation)
+ - [Shard name validation in TopoServer](#shard-name-validation)
+ - [Compression CLI flags removed from vtctld and vtctldclient binaries](#remove-compression-flags-from-vtctld-binaries)
+ - [VtctldClient command RestoreFromBackup will now use the correct context](#vtctldclient-command-restorefrombackup-will-now-use-the-correct-context)
+ - [VTTablet Restore Metrics](#vttablet-restore-metrics)
+ - **[New command line flags and behavior](#new-flag)**
+ - [Builtin backup: read buffering flags](#builtin-backup-read-buffering-flags)
+ - [Manifest backup external decompressor command](#manifest-backup-external-decompressor-command)
+ - [Throttler config via topo enabled by default](#throttler-config-via-topo)
+ - **[New stats](#new-stats)**
+ - [Detailed backup and restore stats](#detailed-backup-and-restore-stats)
+ - [VTtablet Error count with code](#vttablet-error-count-with-code)
+ - [VReplication stream status for Prometheus](#vreplication-stream-status-for-prometheus)
+ - **[Online DDL](#online-ddl)**
+ - [--cut-over-threshold DDL strategy flag](#online-ddl-cut-over-threshold-flag)
+ - **[VReplication](#vreplication)**
+ - [Support for MySQL 8.0 `binlog_transaction_compression`](#binlog-compression)
+ - [Support for the `noblob` binlog row image mode](#noblob)
+ - **[VTTablet](#vttablet)**
+ - [VTTablet: Initializing all replicas with super_read_only](#vttablet-initialization)
+ - [Vttablet Schema Reload Timeout](#vttablet-schema-reload-timeout)
+ - [Settings pool enabled](#settings-pool)
+ - **[VTGate](#vtgate)**
+ - [StreamExecute GRPC API](#stream-execute)
+ - [Insert Planner Gen4](#insert-planner)
+ - **[Deprecations and Deletions](#deprecations-and-deletions)**
+ - [Deprecated Flags](#deprecated-flags)
+ - [Deprecated Stats](#deprecated-stats)
+ - [Deprecated `vtgr`](#deprecated-vtgr)
+ - [Deprecated `k8stopo`](#deprecated-k8stopo)
+
+## Known Issues
+### Schema-initialization stuck on semi-sync ACKs while upgrading to `v17.0.0`
+
+During upgrades from `<= v16.x.x` to `v17.0.0`, as part of `PromoteReplica` call, the schema-init realizes that there are schema diffs to apply and ends up writing to the database if [semi-sync](https://vitess.io/docs/17.0/reference/features/mysql-replication/#semi-sync) is enabled, all of these writes get blocked indefinitely.
+Eventually, `PromoteReplica` fails, and this fails the entire PRS call.
+
+A fix for this issue was merged on `release-17.0` in [PR#13441](https://github.com/vitessio/vitess/pull/13411), read the [corresponding bug report to learn more](https://github.com/vitessio/vitess/issues/13426).
+
+This issue is addressed in the `>= v17.0.1` patch releases.
+
+
+## Major Changes
+
+### Breaking Changes
+
+#### Default Local Cell Preference for TabletPicker
+
+We added options to the `TabletPicker` that allow for specifying a cell preference in addition to making the default behavior to give priority to the local cell *and any alias it belongs to*. We are also introducing a new way to select tablet type preference which should eventually replace the `in_order:` hint currently used as a prefix for tablet types. The signature for creating a new `TabletPicker` now looks like:
+
+```go
+func NewTabletPicker(
+ ctx context.Context,
+ ts *topo.Server,
+ cells []string,
+ localCell, keyspace, shard, tabletTypesStr string,
+ options TabletPickerOptions,
+) (*TabletPicker, error) {...}
+```
+
+Where ctx, localCell, option are all new parameters.
+
+`option` is of type `TabletPickerOptions` and includes two fields, `CellPreference` and `TabletOrder`.
+- `CellPreference`: "PreferLocalWithAlias" (default) gives preference to vtgate's local cell, or "OnlySpecified" which only picks from the cells explicitly passed in by the client
+- `TabletOrder`: "Any" (default) for no ordering or random, or "InOrder" to use the order specified by the client
+
+See [PR 12282 Description](https://github.com/vitessio/vitess/pull/12282) for examples on how this changes cell picking behavior.
+
+#### Default TLS version changed for `vtgr`
+
+When using TLS with `vtgr`, we now default to TLS 1.2 if no other explicit version is configured. Configuration flags are provided to explicitly configure the minimum TLS version to be used.
+
+`vtgr` is now deprecated as part of `v17.0.0`, please see [the deprecation notice](#deprecated-vtgr).
+
+#### Dedicated stats for VTGate Prepare operations
+
+Prior to v17 Vitess incorrectly combined stats for VTGate `Execute` and `Prepare` operations under a single stats key (`Execute`). In v17 `Execute` and `Prepare` operations generate stats under independent stats keys.
+
+Here is a (condensed) example of stats output:
+
+```json
+{
+ "VtgateApi": {
+ "Histograms": {
+ "Execute.src.primary": {
+ "500000": 5
+ },
+ "Prepare.src.primary": {
+ "100000000": 0
+ }
+ }
+ },
+ "VtgateApiErrorCounts": {
+ "Execute.src.primary.INVALID_ARGUMENT": 3,
+ "Execute.src.primary.ALREADY_EXISTS": 1
+ }
+}
+```
+
+#### VTAdmin web migrated to vite
+
+Previously, VTAdmin web used the Create React App framework to test, build, and serve the application. In v17, Create React App has been removed, and [Vite](https://vitejs.dev/) is used in its place. Some of the main changes include:
+- Vite uses `VITE_*` environment variables instead of `REACT_APP_*` environment variables
+- Vite uses `import.meta.env` in place of `process.env`
+- [Vitest](https://vitest.dev/) is used in place of Jest for testing
+- Our protobufjs generator now produces an es6 module instead of commonjs to better work with Vite's defaults
+- `public/index.html` has been moved to root directory in web/vtadmin
+
+#### Keyspace name validation in TopoServer
+
+Prior to v17, it was possible to create a keyspace with invalid characters, which would then be inaccessible to various cluster management operations.
+
+Keyspace names are restricted to using only ASCII characters, digits and `_` and `-`. TopoServer's `GetKeyspace` and `CreateKeyspace` methods return an error if given an invalid name.
+
+#### Shard name validation in TopoServer
+
+Prior to v17, it was possible to create a shard name with invalid characters, which would then be inaccessible to various cluster management operations.
+
+Shard names are restricted to using only ASCII characters, digits and `_` and `-`. TopoServer's `GetShard` and `CreateShard` methods return an error if given an invalid name.
+
+#### Compression CLI flags remove from vtctld and vtctldclient binaries
+
+The CLI flags below were mistakenly added to `vtctld` and `vtctldclient` in v15. In v17, they are no longer present in those binaries.
+
+ * `--compression-engine-name`
+ * `--compression-level`
+ * `--external-compressor`
+ * `--external-compressor-extension`
+ * `--external-decompressor`
+
+#### VtctldClient command RestoreFromBackup will now use the correct context
+
+The VtctldClient command `RestoreFromBackup` initiates an asynchronous process on the specified tablet to restore data from either the latest backup or the closest one before the specified backup-timestamp.
+Prior to v17, this asynchronous process could run indefinitely in the background since it was called using the background context. In v17 [PR#12830](https://github.com/vitessio/vitess/issues/12830),
+this behavior was changed to use a context with a timeout of `action_timeout`. If you are using VtctldClient to initiate a restore, make sure you provide an appropriate value for action_timeout to give enough
+time for the restore process to complete. Otherwise, the restore will throw an error if the context expires before it completes.
+
+#### VTTablet Restore Metrics
+
+As part of the VTTablet Sidecar Schema Maintenance Refactor in v16.0.0, we dropped the `local_metadata` table from the sidecar database schema. This table was storing a couple of metrics related to restores from backup.
+They have now been re-introduced as metrics that can be accessed from `/debug/vars`.
+
+### Vttablet's transaction throttler now also throttles DML outside of `BEGIN; ...; COMMIT;` blocks
+
+Prior to v17, `vttablet`'s transaction throttler (enabled with `--enable-tx-throttler`) would only throttle requests done inside an explicit transaction, i.e., a `BEGIN; ...; COMMIT;` block.
+In v17 [PR#13040](https://github.com/vitessio/vitess/issues/13037), this behavior was being changed so that it also throttles work outside of explicit transactions for `INSERT/UPDATE/DELETE/LOAD` queries.
+
+### New command line flags and behavior
+
+#### Backup --builtinbackup-file-read-buffer-size and --builtinbackup-file-write-buffer-size
+
+Prior to v17 the builtin Backup Engine does not use read buffering for restores, and for backups uses a hardcoded write buffer size of `2097152 bytes`.
+
+In v17 these defaults may be tuned with, respectively `--builtinbackup-file-read-buffer-size` and `--builtinbackup-file-write-buffer-size`.
+
+- `--builtinbackup-file-read-buffer-size`: read files using an IO buffer of this many bytes. Golang defaults are used when set to `0`.
+- `--builtinbackup-file-write-buffer-size`: write files using an IO buffer of this many bytes. Golang defaults are used when set to `0`. (default `2097152`)
+
+These flags are applicable to the following programs:
+
+- `vtbackup`
+- `vtctld`
+- `vttablet`
+- `vttestserver`
+
+#### Manifest backup external decompressor command
+
+Add a new builtin/xtrabackup flag `--manifest-external-decompressor`. When set the value of that flag is stored in the manifest field `ExternalDecompressor`. This manifest field may be consulted when decompressing a backup that was compressed with an external command.
+
+This feature enables the following flow:
+
+ 1. Take a backup using an external compressor
+ ```
+ Backup --compression-engine=external \
+ --external-compressor=zstd \
+ --manifest-external-decompressor="zstd -d"
+ ```
+ 2. Restore that backup with a mere `Restore` command, without having to specify `--external-decompressor`.
+
+#### vttablet --throttler-config-via-topo
+
+This flag was introduced in v16 and defaulted to `false`. In v17 it defaults to `true`, and there is no need to supply it.
+
+Note that this flag overrides `--enable-lag-throttler` and `--throttle-threshold`, which now give warnings, and will be removed in v18.
+
+### New stats
+
+#### Detailed backup and restore stats
+
+##### Backup metrics
+
+Metrics related to backup operations are available in both Vtbackup and VTTablet.
+
+- `BackupBytes`
+- `BackupCount`
+- `BackupDurationNanosecond`
+
+Depending on the Backup Engine and Backup Storage in-use, a backup may be a complex pipeline of operations, including but not limited to:
+
+* Reading files from disk.
+* Compressing files.
+* Uploading compress files to cloud object storage.
+
+These operations are counted and timed, and the number of bytes consumed or produced by each stage of the pipeline are counted as well.
+
+##### Restore metrics
+
+Metrics related to restore operations are available in both Vtbackup and VTTablet:
+
+- `RestoreBytes`
+- `RestoreCount`
+- `RestoreDurationNanoseconds`
+
+Depending on the Backup Engine and Backup Storage in-use, a restore may be a complex pipeline of operations, including but not limited to:
+
+* Downloading compressed files from cloud object storage.
+* Decompressing files.
+* Writing decompressed files to disk.
+
+These operations are counted and timed, and the number of bytes consumed or produced by each stage of the pipeline are counted as well.
+
+##### Vtbackup metrics
+
+Vtbackup exports some metrics which are not available elsewhere:
+
+- `DurationByPhaseSeconds`
+
+Vtbackup fetches the last backup, restores it to an empty mysql installation, replicates recent changes into that installation, and then takes a backup of that installation.
+
+`DurationByPhaseSeconds` exports timings for these individual phases.
+
+##### Example
+
+**A snippet of vtbackup metrics after running it against the local example after creating the initial cluster**
+
+(Processed with `jq` for readability.)
+
+```json
+{
+ "BackupBytes": {
+ "BackupEngine.Builtin.Source:Read": 4777,
+ "BackupEngine.Builtin.Compressor:Write": 4616,
+ "BackupEngine.Builtin.Destination:Write": 162,
+ "BackupStorage.File.File:Write": 163
+ },
+ "BackupCount": {
+ "-.-.Backup": 1,
+ "BackupEngine.Builtin.Source:Open": 161,
+ "BackupEngine.Builtin.Source:Close": 322,
+ "BackupEngine.Builtin.Compressor:Close": 161,
+ "BackupEngine.Builtin.Destination:Open": 161,
+ "BackupEngine.Builtin.Destination:Close": 322
+ },
+ "BackupDurationNanoseconds": {
+ "-.-.Backup": 4188508542,
+ "BackupEngine.Builtin.Source:Open": 10649832,
+ "BackupEngine.Builtin.Source:Read": 55901067,
+ "BackupEngine.Builtin.Source:Close": 960826,
+ "BackupEngine.Builtin.Compressor:Write": 278358826,
+ "BackupEngine.Builtin.Compressor:Close": 79358372,
+ "BackupEngine.Builtin.Destination:Open": 16456627,
+ "BackupEngine.Builtin.Destination:Write": 11021043,
+ "BackupEngine.Builtin.Destination:Close": 17144630,
+ "BackupStorage.File.File:Write": 10743169
+ },
+ "DurationByPhaseSeconds": {
+ "InitMySQLd": 2,
+ "RestoreLastBackup": 6,
+ "CatchUpReplication": 1,
+ "TakeNewBackup": 4
+ },
+ "RestoreBytes": {
+ "BackupEngine.Builtin.Source:Read": 1095,
+ "BackupEngine.Builtin.Decompressor:Read": 950,
+ "BackupEngine.Builtin.Destination:Write": 209,
+ "BackupStorage.File.File:Read": 1113
+ },
+ "RestoreCount": {
+ "-.-.Restore": 1,
+ "BackupEngine.Builtin.Source:Open": 161,
+ "BackupEngine.Builtin.Source:Close": 322,
+ "BackupEngine.Builtin.Decompressor:Close": 161,
+ "BackupEngine.Builtin.Destination:Open": 161,
+ "BackupEngine.Builtin.Destination:Close": 322
+ },
+ "RestoreDurationNanoseconds": {
+ "-.-.Restore": 6204765541,
+ "BackupEngine.Builtin.Source:Open": 10542539,
+ "BackupEngine.Builtin.Source:Read": 104658370,
+ "BackupEngine.Builtin.Source:Close": 773038,
+ "BackupEngine.Builtin.Decompressor:Read": 165692120,
+ "BackupEngine.Builtin.Decompressor:Close": 51040,
+ "BackupEngine.Builtin.Destination:Open": 22715122,
+ "BackupEngine.Builtin.Destination:Write": 41679581,
+ "BackupEngine.Builtin.Destination:Close": 26954624,
+ "BackupStorage.File.File:Read": 102416075
+ },
+ "backup_duration_seconds": 4,
+ "restore_duration_seconds": 6
+}
+```
+
+Some notes to help understand these metrics:
+
+* `BackupBytes["BackupStorage.File.File:Write"]` measures how many bytes were read from disk by the `file` Backup Storage implementation during the backup phase.
+* `DurationByPhaseSeconds["CatchUpReplication"]` measures how long it took to catch-up replication after the restore phase.
+* `DurationByPhaseSeconds["RestoreLastBackup"]` measures to the duration of the restore phase.
+* `RestoreDurationNanoseconds["-.-.Restore"]` also measures to the duration of the restore phase.
+
+#### VTTablet error count with error code
+
+##### VTTablet Error Count
+
+We are introducing new error counter `QueryErrorCountsWithCode` for VTTablet. It is similar to existing [QueryErrorCounts](https://github.com/vitessio/vitess/blob/main/go/vt/vttablet/tabletserver/query_engine.go#L174) except it contains errorCode as additional dimension.
+We will deprecate `QueryErrorCounts` in v18.
+
+#### VReplication stream status for Prometheus
+
+VReplication publishes the `VReplicationStreamState` status which reports the state of VReplication streams. For example, here's what it looks like in the local cluster example after the MoveTables step:
+
+```
+"VReplicationStreamState": {
+ "commerce2customer.1": "Running"
+}
+```
+
+Prior to v17, this data was not available via the Prometheus backend. In v17, workflow states are also published as a Prometheus gauge with a `state` label and a value of `1.0`. For example:
+
+```
+# HELP vttablet_v_replication_stream_state State of vreplication workflow
+# TYPE vttablet_v_replication_stream_state gauge
+vttablet_v_replication_stream_state{counts="1",state="Running",workflow="commerce2customer"} 1
+```
+
+### VTTablet
+
+#### Initializing all replicas with super_read_only
+
+In order to prevent SUPER privileged users like `root` or `vt_dba` from producing errant GTIDs on replicas, all the replica MySQL servers are initialized with the MySQL
+global variable `super_read_only` value set to `ON`. During failovers, we set `super_read_only` to `OFF` for the promoted primary tablet. This will allow the
+primary to accept writes. All of the shard's tablets, except the current primary, will still have their global variable `super_read_only` set to `ON`. This will make sure that apart from
+MySQL replication no other component, offline system or operator can write directly to a replica.
+
+Reference PR for this change is [PR #12206](https://github.com/vitessio/vitess/pull/12206)
+
+An important note regarding this change is how the default `init_db.sql` file has changed.
+This is even more important if you are running Vitess on the vitess-operator.
+You must ensure your `init_db.sql` is up-to-date with the new default for `v17.0.0`.
+The default file can be found in `./config/init_db.sql`.
+
+#### Vttablet Schema Reload Timeout
+
+A new flag, `--schema-change-reload-timeout` has been added to timeout the reload of the schema that Vttablet does periodically. This is required because sometimes this operation can get stuck after MySQL restarts, etc. More details available in the issue https://github.com/vitessio/vitess/issues/13001.
+
+#### Settings Pool
+
+This was introduced in v15 and it enables pooling the connection with modified connection settings.
+To know more what it does read the [v15 release notes](https://github.com/vitessio/vitess/releases/tag/v15.0.0) or the [blog](https://vitess.io/blog/2023-03-27-connection-pooling-in-vitess/) or [docs](https://vitess.io/docs/17.0/reference/query-serving/reserved-conn/)
+
+### Online DDL
+
+#### --cut-over-threshold DDL strategy flag
+
+Online DDL's strategy now accepts `--cut-over-threshold` (type: `duration`) flag.
+
+This flag stand for the timeout in a `vitess` migration's cut-over phase, which includes the final locking of tables before finalizing the migration.
+
+The value of the cut-over threshold should be high enough to support the async nature of vreplication catchup phase, as well as accommodate some replication lag. But it mustn't be too high. While cutting over, the migrated table is being locked, causing app connection and query pileup, consuming query buffers, and holding internal mutexes.
+
+Recommended range for this variable is `5s` - `30s`. Default: `10s`.
+
+### VReplication
+
+#### Support for the `noblob` binlog row image mode
+
+The `noblob` binlog row image is now supported by the MoveTables and Reshard VReplication workflows. If the source
+or target database has this mode, other workflows like OnlineDDL, Materialize and CreateLookupVindex will error out.
+The row events streamed by the VStream API, where blobs and text columns have not changed, will contain null values
+for those columns, indicated by a `length:-1`.
+
+Reference PR for this change is [PR #12905](https://github.com/vitessio/vitess/pull/12905)
+
+#### Support for MySQL 8.0 binary log transaction compression
+
+MySQL 8.0 added support for [binary log compression via transaction (GTID) compression in 8.0.20](https://dev.mysql.com/blog-archive/mysql-8-0-20-replication-enhancements/).
+You can read more about this feature here: https://dev.mysql.com/doc/refman/8.0/en/binary-log-transaction-compression.html
+
+This can — at the cost of increased CPU usage — dramatically reduce the amount of data sent over the wire for MySQL replication while also dramatically reducing the overall
+storage space needed to retain binary logs (for replication, backup and recovery, CDC, etc). For larger installations this was a very desirable feature and while you could
+technically use it with Vitess (the MySQL replica-sets making up each shard could use it fine) there was one very big limitation — [VReplication workflows](https://vitess.io/docs/reference/vreplication/vreplication/)
+would not work. Given the criticality of VReplication workflows within Vitess, this meant that in practice this MySQL feature was not usable within Vitess clusters.
+
+We have addressed this issue in [PR #12950](https://github.com/vitessio/vitess/pull/12950) by adding support for processing the compressed transaction events in VReplication,
+without any (known) limitations.
+
+### VTGate
+
+#### Modified StreamExecute GRPC API
+
+Earlier VTGate grpc api for `StreamExecute` did not return the session in the response.
+Even though the underlying implementation supported transactions and other features that requires session persistence.
+With [PR #13131](https://github.com/vitessio/vitess/pull/13131) VTGate will return the session to the client
+so that it can be persisted with the client and sent back to VTGate on the next api call.
+
+This does not impact anyone using the mysql client library to connect to VTGate.
+This could be a breaking change for grpc api users based on how they have implemented their grpc clients.
+
+#### Insert Planning with Gen4
+
+Gen4 planner was made default in v14 for `SELECT` queries. In v15 `UPDATE` and `DELETE` queries were moved to Gen4 framework.
+With this release `INSERT` queries are moved to Gen4.
+
+Clients can move to old v3 planner for inserts by using `V3Insert` planner version with `--planner-version` vtgate flag or with comment directive /*vt+ planner=
- Alias: {{github_com_vitessio_vitess_vtctld_tablet .Tablet.AliasString}} - Keyspace: {{github_com_vitessio_vitess_vtctld_keyspace .Tablet.Keyspace}} Shard: {{github_com_vitessio_vitess_vtctld_shard .Tablet.Keyspace .Tablet.Shard}} Tablet Type: {{.Tablet.Type}} - SrvKeyspace: {{github_com_vitessio_vitess_vtctld_srv_keyspace .Tablet.Alias.Cell .Tablet.Keyspace}} - Replication graph: {{github_com_vitessio_vitess_vtctld_replication .Tablet.Alias.Cell .Tablet.Keyspace .Tablet.Shard}} + Alias: {{.Tablet.AliasString}} + Keyspace: {{.Tablet.Keyspace}} + Shard: {{.Tablet.Shard}} + Tablet Type: {{.Tablet.Type}} {{if .DeniedTables}} DeniedTables: {{range .DeniedTables}}{{.}} {{end}} {{end}} diff --git a/go/cmd/vttablet/docgen/main.go b/go/cmd/vttablet/docgen/main.go new file mode 100644 index 00000000000..9915d641352 --- /dev/null +++ b/go/cmd/vttablet/docgen/main.go @@ -0,0 +1,37 @@ +/* +Copyright 2023 The Vitess Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "github.com/spf13/cobra" + + "vitess.io/vitess/go/cmd/internal/docgen" + "vitess.io/vitess/go/cmd/vttablet/cli" +) + +func main() { + var dir string + cmd := cobra.Command{ + Use: "docgen [-d
+ // 7 URX_LB_END dataLoc # Check match len, restore input len
+ // 8 URX_LA_END dataLoc # Restore stack, input pos
+ //
+ // Allocate a block of matcher data, to contain (when running a match)
+ // 0: Stack ptr on entry
+ // 1: Input Index on entry
+ // 2: fActiveStart, the active bounds start on entry.
+ // 3: fActiveLimit, the active bounds limit on entry.
+ // 4: Start index of match current match attempt.
+ // The first four items must match the layout of data for LA_START / LA_END
+
+ // Generate match code for any pending literals.
+ c.fixLiterals(false)
+
+ // Allocate data space
+ dataLoc := c.allocateData(5)
+
+ // Emit URX_LB_START
+ c.appendOp(urxLbStart, dataLoc)
+
+ // Emit URX_LB_CONT
+ c.appendOp(urxLbCont, dataLoc)
+ c.appendOp(urxReservedOp, 0) // MinMatchLength. To be filled later.
+ c.appendOp(urxReservedOp, 0) // MaxMatchLength. To be filled later.
+
+ // Emit the NOPs
+ c.appendOp(urxNop, 0)
+ c.appendOp(urxNop, 0)
+
+ // On the Parentheses stack, start a new frame and add the postions
+ // of the URX_LB_CONT and the NOP.
+ c.parenStack = append(c.parenStack, int(c.modeFlags))
+ c.parenStack = append(c.parenStack, parenLookBehind)
+ c.parenStack = append(c.parenStack, len(c.out.compiledPat)-2)
+ c.parenStack = append(c.parenStack, len(c.out.compiledPat)-1)
+
+ // The final two instructions will be added when the ')' is encountered.
+
+ case doOpenLookBehindNeg:
+ // Compile a (?
+ // 8 URX_LBN_END dataLoc # Check match len, cause a FAIL
+ // 9 ...
+ //
+ // Allocate a block of matcher data, to contain (when running a match)
+ // 0: Stack ptr on entry
+ // 1: Input Index on entry
+ // 2: fActiveStart, the active bounds start on entry.
+ // 3: fActiveLimit, the active bounds limit on entry.
+ // 4: Start index of match current match attempt.
+ // The first four items must match the layout of data for LA_START / LA_END
+
+ // Generate match code for any pending literals.
+ c.fixLiterals(false)
+
+ // Allocate data space
+ dataLoc := c.allocateData(5)
+
+ // Emit URX_LB_START
+ c.appendOp(urxLbStart, dataLoc)
+
+ // Emit URX_LBN_CONT
+ c.appendOp(urxLbnCount, dataLoc)
+ c.appendOp(urxReservedOp, 0) // MinMatchLength. To be filled later.
+ c.appendOp(urxReservedOp, 0) // MaxMatchLength. To be filled later.
+ c.appendOp(urxReservedOp, 0) // Continue Loc. To be filled later.
+
+ // Emit the NOPs
+ c.appendOp(urxNop, 0)
+ c.appendOp(urxNop, 0)
+
+ // On the Parentheses stack, start a new frame and add the postions
+ // of the URX_LB_CONT and the NOP.
+ c.parenStack = append(c.parenStack, int(c.modeFlags))
+ c.parenStack = append(c.parenStack, parenLookBehindN)
+ c.parenStack = append(c.parenStack, len(c.out.compiledPat)-2)
+ c.parenStack = append(c.parenStack, len(c.out.compiledPat)-1)
+
+ // The final two instructions will be added when the ')' is encountered.
+
+ case doConditionalExpr, doPerlInline:
+ // Conditionals such as (?(1)a:b)
+ // Perl inline-condtionals. (?{perl code}a|b) We're not perl, no way to do them.
+ c.error(Unimplemented)
+
+ case doCloseParen:
+ c.handleCloseParen()
+ if len(c.parenStack) == 0 {
+ // Extra close paren, or missing open paren.
+ c.error(MismatchedParen)
+ }
+
+ case doNOP:
+
+ case doBadOpenParenType, doRuleError:
+ c.error(RuleSyntax)
+
+ case doMismatchedParenErr:
+ c.error(MismatchedParen)
+
+ case doPlus:
+ // Normal '+' compiles to
+ // 1. stuff to be repeated (already built)
+ // 2. jmp-sav 1
+ // 3. ...
+ //
+ // Or, if the item to be repeated can match a zero length string,
+ // 1. STO_INP_LOC data-loc
+ // 2. body of stuff to be repeated
+ // 3. JMP_SAV_X 2
+ // 4. ...
+
+ //
+ // Or, if the item to be repeated is simple
+ // 1. Item to be repeated.
+ // 2. LOOP_SR_I set number (assuming repeated item is a set ref)
+ // 3. LOOP_C stack location
+ topLoc := c.blockTopLoc(false) // location of item #1
+
+ // Check for simple constructs, which may get special optimized code.
+ if topLoc == len(c.out.compiledPat)-1 {
+ repeatedOp := c.out.compiledPat[topLoc]
+
+ if repeatedOp.typ() == urxSetref {
+ // Emit optimized code for [char set]+
+ c.appendOp(urxLoopSrI, repeatedOp.value())
+ frameLoc := c.allocateStackData(1)
+ c.appendOp(urxLoopC, frameLoc)
+ break
+ }
+
+ if repeatedOp.typ() == urxDotany || repeatedOp.typ() == urxDotanyAll || repeatedOp.typ() == urxDotanyUnix {
+ // Emit Optimized code for .+ operations.
+ loopOpI := c.buildOp(urxLoopDotI, 0)
+ if repeatedOp.typ() == urxDotanyAll {
+ // URX_LOOP_DOT_I operand is a flag indicating ". matches any" mode.
+ loopOpI |= 1
+ }
+ if c.modeFlags&UnixLines != 0 {
+ loopOpI |= 2
+ }
+ c.appendIns(loopOpI)
+ frameLoc := c.allocateStackData(1)
+ c.appendOp(urxLoopC, frameLoc)
+ break
+ }
+ }
+
+ // General case.
+
+ // Check for minimum match length of zero, which requires
+ // extra loop-breaking code.
+ if c.minMatchLength(topLoc, len(c.out.compiledPat)-1) == 0 {
+ // Zero length match is possible.
+ // Emit the code sequence that can handle it.
+ c.insertOp(topLoc)
+ frameLoc := c.allocateStackData(1)
+ op := c.buildOp(urxStoInpLoc, frameLoc)
+ c.out.compiledPat[topLoc] = op
+
+ c.appendOp(urxJmpSavX, topLoc+1)
+ } else {
+ // Simpler code when the repeated body must match something non-empty
+ c.appendOp(urxJmpSav, topLoc)
+ }
+
+ case doNGPlus:
+ // Non-greedy '+?' compiles to
+ // 1. stuff to be repeated (already built)
+ // 2. state-save 1
+ // 3. ...
+ topLoc := c.blockTopLoc(false)
+ c.appendOp(urxStateSave, topLoc)
+
+ case doOpt:
+ // Normal (greedy) ? quantifier.
+ // Compiles to
+ // 1. state save 3
+ // 2. body of optional block
+ // 3. ...
+ // Insert the state save into the compiled pattern, and we're done.
+ saveStateLoc := c.blockTopLoc(true)
+ saveStateOp := c.buildOp(urxStateSave, len(c.out.compiledPat))
+ c.out.compiledPat[saveStateLoc] = saveStateOp
+
+ case doNGOpt:
+ // Non-greedy ?? quantifier
+ // compiles to
+ // 1. jmp 4
+ // 2. body of optional block
+ // 3 jmp 5
+ // 4. state save 2
+ // 5 ...
+ // This code is less than ideal, with two jmps instead of one, because we can only
+ // insert one instruction at the top of the block being iterated.
+ jmp1Loc := c.blockTopLoc(true)
+ jmp2Loc := len(c.out.compiledPat)
+
+ jmp1Op := c.buildOp(urxJmp, jmp2Loc+1)
+ c.out.compiledPat[jmp1Loc] = jmp1Op
+
+ c.appendOp(urxJmp, jmp2Loc+2)
+ c.appendOp(urxStateSave, jmp1Loc+1)
+
+ case doStar:
+ // Normal (greedy) * quantifier.
+ // Compiles to
+ // 1. STATE_SAVE 4
+ // 2. body of stuff being iterated over
+ // 3. JMP_SAV 2
+ // 4. ...
+ //
+ // Or, if the body is a simple [Set],
+ // 1. LOOP_SR_I set number
+ // 2. LOOP_C stack location
+ // ...
+ //
+ // Or if this is a .*
+ // 1. LOOP_DOT_I (. matches all mode flag)
+ // 2. LOOP_C stack location
+ //
+ // Or, if the body can match a zero-length string, to inhibit infinite loops,
+ // 1. STATE_SAVE 5
+ // 2. STO_INP_LOC data-loc
+ // 3. body of stuff
+ // 4. JMP_SAV_X 2
+ // 5. ...
+ // location of item #1, the STATE_SAVE
+ topLoc := c.blockTopLoc(false)
+
+ // Check for simple *, where the construct being repeated
+ // compiled to single opcode, and might be optimizable.
+ if topLoc == len(c.out.compiledPat)-1 {
+ repeatedOp := c.out.compiledPat[topLoc]
+
+ if repeatedOp.typ() == urxSetref {
+ // Emit optimized code for a [char set]*
+ loopOpI := c.buildOp(urxLoopSrI, repeatedOp.value())
+ c.out.compiledPat[topLoc] = loopOpI
+ dataLoc := c.allocateStackData(1)
+ c.appendOp(urxLoopC, dataLoc)
+ break
+ }
+
+ if repeatedOp.typ() == urxDotany || repeatedOp.typ() == urxDotanyAll || repeatedOp.typ() == urxDotanyUnix {
+ // Emit Optimized code for .* operations.
+ loopOpI := c.buildOp(urxLoopDotI, 0)
+ if repeatedOp.typ() == urxDotanyAll {
+ // URX_LOOP_DOT_I operand is a flag indicating . matches any mode.
+ loopOpI |= 1
+ }
+ if (c.modeFlags & UnixLines) != 0 {
+ loopOpI |= 2
+ }
+ c.out.compiledPat[topLoc] = loopOpI
+ dataLoc := c.allocateStackData(1)
+ c.appendOp(urxLoopC, dataLoc)
+ break
+ }
+ }
+
+ // Emit general case code for this *
+ // The optimizations did not apply.
+
+ saveStateLoc := c.blockTopLoc(true)
+ jmpOp := c.buildOp(urxJmpSav, saveStateLoc+1)
+
+ // Check for minimum match length of zero, which requires
+ // extra loop-breaking code.
+ if c.minMatchLength(saveStateLoc, len(c.out.compiledPat)-1) == 0 {
+ c.insertOp(saveStateLoc)
+ dataLoc := c.allocateStackData(1)
+
+ op := c.buildOp(urxStoInpLoc, dataLoc)
+ c.out.compiledPat[saveStateLoc+1] = op
+ jmpOp = c.buildOp(urxJmpSavX, saveStateLoc+2)
+ }
+
+ // Locate the position in the compiled pattern where the match will continue
+ // after completing the *. (4 or 5 in the comment above)
+ continueLoc := len(c.out.compiledPat) + 1
+
+ // Put together the save state op and store it into the compiled code.
+ saveStateOp := c.buildOp(urxStateSave, continueLoc)
+ c.out.compiledPat[saveStateLoc] = saveStateOp
+
+ // Append the URX_JMP_SAV or URX_JMPX operation to the compiled pattern.
+ c.appendIns(jmpOp)
+
+ case doNGStar:
+ // Non-greedy *? quantifier
+ // compiles to
+ // 1. JMP 3
+ // 2. body of stuff being iterated over
+ // 3. STATE_SAVE 2
+ // 4 ...
+ jmpLoc := c.blockTopLoc(true) // loc 1.
+ saveLoc := len(c.out.compiledPat) // loc 3.
+ jmpOp := c.buildOp(urxJmp, saveLoc)
+ c.out.compiledPat[jmpLoc] = jmpOp
+ c.appendOp(urxStateSave, jmpLoc+1)
+
+ case doIntervalInit:
+ // The '{' opening an interval quantifier was just scanned.
+ // Init the counter varaiables that will accumulate the values as the digits
+ // are scanned.
+ c.intervalLow = 0
+ c.intervalUpper = -1
+
+ case doIntevalLowerDigit:
+ // Scanned a digit from the lower value of an {lower,upper} interval
+ digitValue := uCharDigitValue(c.c.char)
+ val := int64(c.intervalLow)*10 + digitValue
+ if val > math.MaxInt32 {
+ c.error(NumberTooBig)
+ } else {
+ c.intervalLow = int(val)
+ }
+
+ case doIntervalUpperDigit:
+ // Scanned a digit from the upper value of an {lower,upper} interval
+ if c.intervalUpper < 0 {
+ c.intervalUpper = 0
+ }
+ digitValue := uCharDigitValue(c.c.char)
+ val := int64(c.intervalUpper)*10 + digitValue
+ if val > math.MaxInt32 {
+ c.error(NumberTooBig)
+ } else {
+ c.intervalUpper = int(val)
+ }
+
+ case doIntervalSame:
+ // Scanned a single value interval like {27}. Upper = Lower.
+ c.intervalUpper = c.intervalLow
+
+ case doInterval:
+ // Finished scanning a normal {lower,upper} interval. Generate the code for it.
+ if !c.compileInlineInterval() {
+ c.compileInterval(urxCtrInit, utxCtrLoop)
+ }
+
+ case doPossessiveInterval:
+ // Finished scanning a Possessive {lower,upper}+ interval. Generate the code for it.
+
+ // Remember the loc for the top of the block being looped over.
+ // (Can not reserve a slot in the compiled pattern at this time, because
+ // compileInterval needs to reserve also, and blockTopLoc can only reserve
+ // once per block.)
+ topLoc := c.blockTopLoc(false)
+
+ // Produce normal looping code.
+ c.compileInterval(urxCtrInit, utxCtrLoop)
+
+ // Surround the just-emitted normal looping code with a STO_SP ... LD_SP
+ // just as if the loop was inclosed in atomic parentheses.
+
+ // First the STO_SP before the start of the loop
+ c.insertOp(topLoc)
+
+ varLoc := c.allocateData(1) // Reserve a data location for saving the
+ op := c.buildOp(urxStoSp, varLoc)
+ c.out.compiledPat[topLoc] = op
+
+ var loopOp instruction
+ loopOp, c.out.compiledPat = stackPop(c.out.compiledPat)
+ if loopOp.typ() != utxCtrLoop || loopOp.value() != topLoc {
+ panic("bad instruction at the end of compiled pattern")
+ }
+
+ loopOp++ // point LoopOp after the just-inserted STO_SP
+ c.appendIns(loopOp)
+
+ // Then the LD_SP after the end of the loop
+ c.appendOp(urxLdSp, varLoc)
+
+ case doNGInterval:
+ // Finished scanning a non-greedy {lower,upper}? interval. Generate the code for it.
+ c.compileInterval(urxCtrInitNg, urxCtrLoopNg)
+
+ case doIntervalError:
+ c.error(BadInterval)
+
+ case doLiteralChar:
+ // We've just scanned a "normal" character from the pattern,
+ c.literalChar(c.c.char)
+
+ case doEscapedLiteralChar:
+ // We've just scanned an backslashed escaped character with no
+ // special meaning. It represents itself.
+ if (c.modeFlags&ErrorOnUnknownEscapes) != 0 && ((c.c.char >= 0x41 && c.c.char <= 0x5A) || /* in [A-Z] */ (c.c.char >= 0x61 && c.c.char <= 0x7a)) { // in [a-z]
+ c.error(BadEscapeSequence)
+ }
+ c.literalChar(c.c.char)
+
+ case doDotAny:
+ // scanned a ".", match any single character.
+ c.fixLiterals(false)
+ if (c.modeFlags & DotAll) != 0 {
+ c.appendOp(urxDotanyAll, 0)
+ } else if (c.modeFlags & UnixLines) != 0 {
+ c.appendOp(urxDotanyUnix, 0)
+ } else {
+ c.appendOp(urxDotany, 0)
+ }
+
+ case doCaret:
+ c.fixLiterals(false)
+ if (c.modeFlags&Multiline) == 0 && (c.modeFlags&UnixLines) == 0 {
+ c.appendOp(urxCaret, 0)
+ } else if (c.modeFlags&Multiline) != 0 && (c.modeFlags&UnixLines) == 0 {
+ c.appendOp(urxCaretM, 0)
+ } else if (c.modeFlags&Multiline) == 0 && (c.modeFlags&UnixLines) != 0 {
+ c.appendOp(urxCaret, 0) // Only testing true start of input.
+ } else if (c.modeFlags&Multiline) != 0 && (c.modeFlags&UnixLines) != 0 {
+ c.appendOp(urxCaretMUnix, 0)
+ }
+
+ case doDollar:
+ c.fixLiterals(false)
+ if (c.modeFlags&Multiline) == 0 && (c.modeFlags&UnixLines) == 0 {
+ c.appendOp(urxDollar, 0)
+ } else if (c.modeFlags&Multiline) != 0 && (c.modeFlags&UnixLines) == 0 {
+ c.appendOp(urxDollarM, 0)
+ } else if (c.modeFlags&Multiline) == 0 && (c.modeFlags&UnixLines) != 0 {
+ c.appendOp(urxDollarD, 0)
+ } else if (c.modeFlags&Multiline) != 0 && (c.modeFlags&UnixLines) != 0 {
+ c.appendOp(urxDollarMd, 0)
+ }
+
+ case doBackslashA:
+ c.fixLiterals(false)
+ c.appendOp(urxCaret, 0)
+
+ case doBackslashB:
+ if !BreakIteration {
+ if (c.modeFlags & UWord) != 0 {
+ c.error(Unimplemented)
+ }
+ }
+ c.fixLiterals(false)
+ if c.modeFlags&UWord != 0 {
+ c.appendOp(urxBackslashBu, 1)
+ } else {
+ c.appendOp(urxBackslashB, 1)
+ }
+
+ case doBackslashb:
+ if !BreakIteration {
+ if (c.modeFlags & UWord) != 0 {
+ c.error(Unimplemented)
+ }
+ }
+ c.fixLiterals(false)
+ if c.modeFlags&UWord != 0 {
+ c.appendOp(urxBackslashBu, 0)
+ } else {
+ c.appendOp(urxBackslashB, 0)
+ }
+
+ case doBackslashD:
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashD, 1)
+
+ case doBackslashd:
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashD, 0)
+
+ case doBackslashG:
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashG, 0)
+
+ case doBackslashH:
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashH, 1)
+
+ case doBackslashh:
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashH, 0)
+
+ case doBackslashR:
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashR, 0)
+
+ case doBackslashS:
+ c.fixLiterals(false)
+ c.appendOp(urxStatSetrefN, urxIsspaceSet)
+
+ case doBackslashs:
+ c.fixLiterals(false)
+ c.appendOp(urxStaticSetref, urxIsspaceSet)
+
+ case doBackslashV:
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashV, 1)
+
+ case doBackslashv:
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashV, 0)
+
+ case doBackslashW:
+ c.fixLiterals(false)
+ c.appendOp(urxStatSetrefN, urxIswordSet)
+
+ case doBackslashw:
+ c.fixLiterals(false)
+ c.appendOp(urxStaticSetref, urxIswordSet)
+
+ case doBackslashX:
+ if !BreakIteration {
+ // Grapheme Cluster Boundary requires ICU break iteration.
+ c.error(Unimplemented)
+ }
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashX, 0)
+
+ case doBackslashZ:
+ c.fixLiterals(false)
+ c.appendOp(urxDollar, 0)
+
+ case doBackslashz:
+ c.fixLiterals(false)
+ c.appendOp(urxBackslashZ, 0)
+
+ case doEscapeError:
+ c.error(BadEscapeSequence)
+
+ case doExit:
+ c.fixLiterals(false)
+ return false
+
+ case doProperty:
+ c.fixLiterals(false)
+ theSet := c.scanProp()
+ c.compileSet(theSet)
+
+ case doNamedChar:
+ ch := c.scanNamedChar()
+ c.literalChar(ch)
+
+ case doBackRef:
+ // BackReference. Somewhat unusual in that the front-end can not completely parse
+ // the regular expression, because the number of digits to be consumed
+ // depends on the number of capture groups that have been defined. So
+ // we have to do it here instead.
+ numCaptureGroups := len(c.out.groupMap)
+ groupNum := int64(0)
+ ch := c.c.char
+
+ for {
+ // Loop once per digit, for max allowed number of digits in a back reference.
+ digit := uCharDigitValue(ch)
+ groupNum = groupNum*10 + digit
+ if groupNum >= int64(numCaptureGroups) {
+ break
+ }
+ ch = c.peekCharLL()
+ if !staticRuleSet[ruleSetDigitChar-128].ContainsRune(ch) {
+ break
+ }
+ c.nextCharLL()
+ }
+
+ // Scan of the back reference in the source regexp is complete. Now generate
+ // the compiled code for it.
+ // Because capture groups can be forward-referenced by back-references,
+ // we fill the operand with the capture group number. At the end
+ // of compilation, it will be changed to the variable's location.
+ if groupNum == 0 {
+ panic("\\0 begins an octal escape sequence, and shouldn't enter this code path at all")
+ }
+ c.fixLiterals(false)
+ if (c.modeFlags & CaseInsensitive) != 0 {
+ c.appendOp(urxBackrefI, int(groupNum))
+ } else {
+ c.appendOp(urxBackref, int(groupNum))
+ }
+
+ case doBeginNamedBackRef:
+ if c.captureName != nil {
+ panic("should not replace capture name")
+ }
+ c.captureName = &strings.Builder{}
+
+ case doContinueNamedBackRef:
+ c.captureName.WriteRune(c.c.char)
+
+ case doCompleteNamedBackRef:
+ {
+ groupNumber := c.out.namedCaptureMap[c.captureName.String()]
+ if groupNumber == 0 {
+ // Group name has not been defined.
+ // Could be a forward reference. If we choose to support them at some
+ // future time, extra mechanism will be required at this point.
+ c.error(InvalidCaptureGroupName)
+ } else {
+ // Given the number, handle identically to a \n numbered back reference.
+ // See comments above, under doBackRef
+ c.fixLiterals(false)
+ if (c.modeFlags & CaseInsensitive) != 0 {
+ c.appendOp(urxBackrefI, groupNumber)
+ } else {
+ c.appendOp(urxBackref, groupNumber)
+ }
+ }
+ c.captureName = nil
+ }
+
+ case doPossessivePlus:
+ // Possessive ++ quantifier.
+ // Compiles to
+ // 1. STO_SP
+ // 2. body of stuff being iterated over
+ // 3. STATE_SAVE 5
+ // 4. JMP 2
+ // 5. LD_SP
+ // 6. ...
+ //
+ // Note: TODO: This is pretty inefficient. A mass of saved state is built up
+ // then unconditionally discarded. Perhaps introduce a new opcode. Ticket 6056
+ //
+ // Emit the STO_SP
+ topLoc := c.blockTopLoc(true)
+ stoLoc := c.allocateData(1) // Reserve the data location for storing save stack ptr.
+ op := c.buildOp(urxStoSp, stoLoc)
+ c.out.compiledPat[topLoc] = op
+
+ // Emit the STATE_SAVE
+ c.appendOp(urxStateSave, len(c.out.compiledPat)+2)
+
+ // Emit the JMP
+ c.appendOp(urxJmp, topLoc+1)
+
+ // Emit the LD_SP
+ c.appendOp(urxLdSp, stoLoc)
+
+ case doPossessiveStar:
+ // Possessive *+ quantifier.
+ // Compiles to
+ // 1. STO_SP loc
+ // 2. STATE_SAVE 5
+ // 3. body of stuff being iterated over
+ // 4. JMP 2
+ // 5. LD_SP loc
+ // 6 ...
+ // TODO: do something to cut back the state stack each time through the loop.
+ // Reserve two slots at the top of the block.
+ topLoc := c.blockTopLoc(true)
+ c.insertOp(topLoc)
+
+ // emit STO_SP loc
+ stoLoc := c.allocateData(1) // Reserve the data location for storing save stack ptr.
+ op := c.buildOp(urxStoSp, stoLoc)
+ c.out.compiledPat[topLoc] = op
+
+ // Emit the SAVE_STATE 5
+ L7 := len(c.out.compiledPat) + 1
+ op = c.buildOp(urxStateSave, L7)
+ c.out.compiledPat[topLoc+1] = op
+
+ // Append the JMP operation.
+ c.appendOp(urxJmp, topLoc+1)
+
+ // Emit the LD_SP loc
+ c.appendOp(urxLdSp, stoLoc)
+
+ case doPossessiveOpt:
+ // Possessive ?+ quantifier.
+ // Compiles to
+ // 1. STO_SP loc
+ // 2. SAVE_STATE 5
+ // 3. body of optional block
+ // 4. LD_SP loc
+ // 5. ...
+ //
+ // Reserve two slots at the top of the block.
+ topLoc := c.blockTopLoc(true)
+ c.insertOp(topLoc)
+
+ // Emit the STO_SP
+ stoLoc := c.allocateData(1) // Reserve the data location for storing save stack ptr.
+ op := c.buildOp(urxStoSp, stoLoc)
+ c.out.compiledPat[topLoc] = op
+
+ // Emit the SAVE_STATE
+ continueLoc := len(c.out.compiledPat) + 1
+ op = c.buildOp(urxStateSave, continueLoc)
+ c.out.compiledPat[topLoc+1] = op
+
+ // Emit the LD_SP
+ c.appendOp(urxLdSp, stoLoc)
+
+ case doBeginMatchMode:
+ c.newModeFlags = c.modeFlags
+ c.setModeFlag = true
+ case doMatchMode: // (?i) and similar
+ var bit RegexpFlag
+ switch c.c.char {
+ case 0x69: /* 'i' */
+ bit = CaseInsensitive
+ case 0x64: /* 'd' */
+ bit = UnixLines
+ case 0x6d: /* 'm' */
+ bit = Multiline
+ case 0x73: /* 's' */
+ bit = DotAll
+ case 0x75: /* 'u' */
+ bit = 0 /* Unicode casing */
+ case 0x77: /* 'w' */
+ bit = UWord
+ case 0x78: /* 'x' */
+ bit = Comments
+ case 0x2d: /* '-' */
+ c.setModeFlag = false
+ default:
+ // Should never happen. Other chars are filtered out by the scanner.
+ panic("unreachable")
+ }
+ if c.setModeFlag {
+ c.newModeFlags |= bit
+ } else {
+ c.newModeFlags &= ^bit
+ }
+
+ case doSetMatchMode:
+ // Emit code to match any pending literals, using the not-yet changed match mode.
+ c.fixLiterals(false)
+
+ // We've got a (?i) or similar. The match mode is being changed, but
+ // the change is not scoped to a parenthesized block.
+ if c.newModeFlags >= 0 {
+ panic("cNewModeFlags not properly initialized")
+ }
+ c.modeFlags = c.newModeFlags
+
+ case doMatchModeParen:
+ // We've got a (?i: or similar. Begin a parenthesized block, save old
+ // mode flags so they can be restored at the close of the block.
+ //
+ // Compile to a
+ // - NOP, which later may be replaced by a save-state if the
+ // parenthesized group gets a * quantifier, followed by
+ // - NOP, which may later be replaced by a save-state if there
+ // is an '|' alternation within the parens.
+ c.fixLiterals(false)
+ c.appendOp(urxNop, 0)
+ c.appendOp(urxNop, 0)
+
+ // On the Parentheses stack, start a new frame and add the postions
+ // of the two NOPs (a normal non-capturing () frame, except for the
+ // saving of the orignal mode flags.)
+ c.parenStack = append(c.parenStack, int(c.modeFlags))
+ c.parenStack = append(c.parenStack, parenFlags)
+ c.parenStack = append(c.parenStack, len(c.out.compiledPat)-2)
+ c.parenStack = append(c.parenStack, len(c.out.compiledPat)-1)
+
+ // Set the current mode flags to the new values.
+ if c.newModeFlags >= 0 {
+ panic("cNewModeFlags not properly initialized")
+ }
+ c.modeFlags = c.newModeFlags
+
+ case doBadModeFlag:
+ c.error(InvalidFlag)
+
+ case doSuppressComments:
+ // We have just scanned a '(?'. We now need to prevent the character scanner from
+ // treating a '#' as a to-the-end-of-line comment.
+ // (This Perl compatibility just gets uglier and uglier to do...)
+ c.eolComments = false
+
+ case doSetAddAmp:
+ set := c.setStack[len(c.setStack)-1]
+ set.AddRune(chAmp)
+
+ case doSetAddDash:
+ set := c.setStack[len(c.setStack)-1]
+ set.AddRune(chDash)
+
+ case doSetBackslashs:
+ set := c.setStack[len(c.setStack)-1]
+ set.AddAll(staticPropertySets[urxIsspaceSet])
+
+ case doSetBackslashS:
+ sset := uset.New()
+ sset.AddAll(staticPropertySets[urxIsspaceSet]) // TODO: add latin1 spaces
+ sset.Complement()
+
+ set := c.setStack[len(c.setStack)-1]
+ set.AddAll(sset)
+
+ case doSetBackslashd:
+ set := c.setStack[len(c.setStack)-1]
+ c.err = uprops.AddCategory(set, uchar.GcNdMask)
+
+ case doSetBackslashD:
+ digits := uset.New()
+ c.err = uprops.ApplyIntPropertyValue(digits, uprops.UCharGeneralCategoryMask, int32(uchar.GcNdMask))
+ digits.Complement()
+ set := c.setStack[len(c.setStack)-1]
+ set.AddAll(digits)
+
+ case doSetBackslashh:
+ h := uset.New()
+ c.err = uprops.ApplyIntPropertyValue(h, uprops.UCharGeneralCategoryMask, int32(uchar.GcZsMask))
+ h.AddRune(9) // Tab
+
+ set := c.setStack[len(c.setStack)-1]
+ set.AddAll(h)
+
+ case doSetBackslashH:
+ h := uset.New()
+ c.err = uprops.ApplyIntPropertyValue(h, uprops.UCharGeneralCategoryMask, int32(uchar.GcZsMask))
+ h.AddRune(9) // Tab
+ h.Complement()
+
+ set := c.setStack[len(c.setStack)-1]
+ set.AddAll(h)
+
+ case doSetBackslashv:
+ set := c.setStack[len(c.setStack)-1]
+ set.AddRuneRange(0x0a, 0x0d) // add range
+ set.AddRune(0x85)
+ set.AddRuneRange(0x2028, 0x2029)
+
+ case doSetBackslashV:
+ v := uset.New()
+ v.AddRuneRange(0x0a, 0x0d) // add range
+ v.AddRune(0x85)
+ v.AddRuneRange(0x2028, 0x2029)
+ v.Complement()
+
+ set := c.setStack[len(c.setStack)-1]
+ set.AddAll(v)
+
+ case doSetBackslashw:
+ set := c.setStack[len(c.setStack)-1]
+ set.AddAll(staticPropertySets[urxIswordSet])
+
+ case doSetBackslashW:
+ sset := uset.New()
+ sset.AddAll(staticPropertySets[urxIswordSet])
+ sset.Complement()
+
+ set := c.setStack[len(c.setStack)-1]
+ set.AddAll(sset)
+
+ case doSetBegin:
+ c.fixLiterals(false)
+ c.setStack = append(c.setStack, uset.New())
+ c.setOpStack = append(c.setOpStack, setStart)
+ if (c.modeFlags & CaseInsensitive) != 0 {
+ c.setOpStack = append(c.setOpStack, setCaseClose)
+ }
+
+ case doSetBeginDifference1:
+ // We have scanned something like [[abc]-[
+ // Set up a new UnicodeSet for the set beginning with the just-scanned '['
+ // Push a Difference operator, which will cause the new set to be subtracted from what
+ // went before once it is created.
+ c.setPushOp(setDifference1)
+ c.setOpStack = append(c.setOpStack, setStart)
+ if (c.modeFlags & CaseInsensitive) != 0 {
+ c.setOpStack = append(c.setOpStack, setCaseClose)
+ }
+
+ case doSetBeginIntersection1:
+ // We have scanned something like [[abc]&[
+ // Need both the '&' operator and the open '[' operator.
+ c.setPushOp(setIntersection1)
+ c.setOpStack = append(c.setOpStack, setStart)
+ if (c.modeFlags & CaseInsensitive) != 0 {
+ c.setOpStack = append(c.setOpStack, setCaseClose)
+ }
+
+ case doSetBeginUnion:
+ // We have scanned something like [[abc][
+ // Need to handle the union operation explicitly [[abc] | [
+ c.setPushOp(setUnion)
+ c.setOpStack = append(c.setOpStack, setStart)
+ if (c.modeFlags & CaseInsensitive) != 0 {
+ c.setOpStack = append(c.setOpStack, setCaseClose)
+ }
+
+ case doSetDifference2:
+ // We have scanned something like [abc--
+ // Consider this to unambiguously be a set difference operator.
+ c.setPushOp(setDifference2)
+
+ case doSetEnd:
+ // Have encountered the ']' that closes a set.
+ // Force the evaluation of any pending operations within this set,
+ // leave the completed set on the top of the set stack.
+ c.setEval(setEnd)
+ var start setOperation
+ start, c.setOpStack = stackPop(c.setOpStack)
+ if start != setStart {
+ panic("bad set operation in stack")
+ }
+
+ case doSetFinish:
+ // Finished a complete set expression, including all nested sets.
+ // The close bracket has already triggered clearing out pending set operators,
+ // the operator stack should be empty and the operand stack should have just
+ // one entry, the result set.
+ if len(c.setOpStack) > 0 {
+ panic("expected setOpStack to be empty")
+ }
+ var set *uset.UnicodeSet
+ set, c.setStack = stackPop(c.setStack)
+ c.compileSet(set)
+
+ case doSetIntersection2:
+ // Have scanned something like [abc&&
+ c.setPushOp(setIntersection2)
+
+ case doSetLiteral:
+ // Union the just-scanned literal character into the set being built.
+ // This operation is the highest precedence set operation, so we can always do
+ // it immediately, without waiting to see what follows. It is necessary to perform
+ // any pending '-' or '&' operation first, because these have the same precedence
+ // as union-ing in a literal'
+ c.setEval(setUnion)
+ set := c.setStack[len(c.setStack)-1]
+ set.AddRune(c.c.char)
+ c.lastSetLiteral = c.c.char
+
+ case doSetLiteralEscaped:
+ // A back-slash escaped literal character was encountered.
+ // Processing is the same as with setLiteral, above, with the addition of
+ // the optional check for errors on escaped ASCII letters.
+ if (c.modeFlags&ErrorOnUnknownEscapes) != 0 &&
+ ((c.c.char >= 0x41 && c.c.char <= 0x5A) || // in [A-Z]
+ (c.c.char >= 0x61 && c.c.char <= 0x7a)) { // in [a-z]
+ c.error(BadEscapeSequence)
+ }
+ c.setEval(setUnion)
+ set := c.setStack[len(c.setStack)-1]
+ set.AddRune(c.c.char)
+ c.lastSetLiteral = c.c.char
+
+ case doSetNamedChar:
+ // Scanning a \N{UNICODE CHARACTER NAME}
+ // Aside from the source of the character, the processing is identical to doSetLiteral,
+ // above.
+ ch := c.scanNamedChar()
+ c.setEval(setUnion)
+ set := c.setStack[len(c.setStack)-1]
+ set.AddRune(ch)
+ c.lastSetLiteral = ch
+
+ case doSetNamedRange:
+ // We have scanned literal-\N{CHAR NAME}. Add the range to the set.
+ // The left character is already in the set, and is saved in fLastSetLiteral.
+ // The right side needs to be picked up, the scan is at the 'N'.
+ // Lower Limit > Upper limit being an error matches both Java
+ // and ICU UnicodeSet behavior.
+ ch := c.scanNamedChar()
+ if c.err == nil && (c.lastSetLiteral == -1 || c.lastSetLiteral > ch) {
+ c.error(InvalidRange)
+ }
+ set := c.setStack[len(c.setStack)-1]
+ set.AddRuneRange(c.lastSetLiteral, ch)
+ c.lastSetLiteral = ch
+
+ case doSetNegate:
+ // Scanned a '^' at the start of a set.
+ // Push the negation operator onto the set op stack.
+ // A twist for case-insensitive matching:
+ // the case closure operation must happen _before_ negation.
+ // But the case closure operation will already be on the stack if it's required.
+ // This requires checking for case closure, and swapping the stack order
+ // if it is present.
+ tosOp := c.setOpStack[len(c.setOpStack)-1]
+ if tosOp == setCaseClose {
+ _, c.setOpStack = stackPop(c.setOpStack)
+ c.setOpStack = append(c.setOpStack, setNegation)
+ c.setOpStack = append(c.setOpStack, setCaseClose)
+ } else {
+ c.setOpStack = append(c.setOpStack, setNegation)
+ }
+
+ case doSetNoCloseError:
+ c.error(MissingCloseBracket)
+
+ case doSetOpError:
+ c.error(RuleSyntax) // -- or && at the end of a set. Illegal.
+
+ case doSetPosixProp:
+ if set := c.scanPosixProp(); set != nil {
+ c.setStack[len(c.setStack)-1].AddAll(set)
+ }
+
+ case doSetProp:
+ // Scanned a \p \P within [brackets].
+ if set := c.scanProp(); set != nil {
+ c.setStack[len(c.setStack)-1].AddAll(set)
+ }
+
+ case doSetRange:
+ // We have scanned literal-literal. Add the range to the set.
+ // The left character is already in the set, and is saved in fLastSetLiteral.
+ // The right side is the current character.
+ // Lower Limit > Upper limit being an error matches both Java
+ // and ICU UnicodeSet behavior.
+
+ if c.lastSetLiteral == -1 || c.lastSetLiteral > c.c.char {
+ c.error(InvalidRange)
+ }
+ c.setStack[len(c.setStack)-1].AddRuneRange(c.lastSetLiteral, c.c.char)
+
+ default:
+ panic("unexpected OP in parser")
+ }
+
+ return c.err == nil
+}
+
+func uCharDigitValue(char rune) int64 {
+ if char >= '0' && char <= '9' {
+ return int64(char - '0')
+ }
+ return -1
+}
+
+func stackPop[T any](stack []T) (T, []T) {
+ var out T
+ if len(stack) > 0 {
+ out = stack[len(stack)-1]
+ stack = stack[:len(stack)-1]
+ }
+ return out, stack
+}
+
+func (c *compiler) error(e CompileErrorCode) {
+ c.err = &CompileError{
+ Code: e,
+ Line: c.lineNum,
+ Offset: c.charNum,
+ Context: c.out.pattern,
+ }
+}
+
+func (c *compiler) stripNOPs() {
+ if c.err != nil {
+ return
+ }
+
+ end := len(c.out.compiledPat)
+ deltas := make([]int, 0, end)
+
+ // Make a first pass over the code, computing the amount that things
+ // will be offset at each location in the original code.
+ var loc, d int
+ for loc = 0; loc < end; loc++ {
+ deltas = append(deltas, d)
+ op := c.out.compiledPat[loc]
+ if op.typ() == urxNop {
+ d++
+ }
+ }
+
+ // Make a second pass over the code, removing the NOPs by moving following
+ // code up, and patching operands that refer to code locations that
+ // are being moved. The array of offsets from the first step is used
+ // to compute the new operand values.
+ var src, dst int
+ for src = 0; src < end; src++ {
+ op := c.out.compiledPat[src]
+ opType := op.typ()
+
+ switch opType {
+ case urxNop:
+ // skip
+
+ case urxStateSave,
+ urxJmp,
+ utxCtrLoop,
+ urxCtrLoopNg,
+ urxRelocOprnd,
+ urxJmpx,
+ urxJmpSav,
+ urxJmpSavX:
+ // These are instructions with operands that refer to code locations.
+ operandAddress := op.value()
+ fixedOperandAddress := operandAddress - deltas[operandAddress]
+ op = c.buildOp(opType, fixedOperandAddress)
+ c.out.compiledPat[dst] = op
+ dst++
+
+ case urxBackref, urxBackrefI:
+ where := op.value()
+ if where > len(c.out.groupMap) {
+ c.error(InvalidBackRef)
+ break
+ }
+
+ where = int(c.out.groupMap[where-1])
+ op = c.buildOp(opType, where)
+ c.out.compiledPat[dst] = op
+ dst++
+ c.out.needsAltInput = true
+
+ case urxReservedOp,
+ urxReservedOpN,
+ urxBacktrack,
+ urxEnd,
+ urxOnechar,
+ urxString,
+ urxStringLen,
+ urxStartCapture,
+ urxEndCapture,
+ urxStaticSetref,
+ urxStatSetrefN,
+ urxSetref,
+ urxDotany,
+ urxFail,
+ urxBackslashB,
+ urxBackslashBu,
+ urxBackslashG,
+ urxBackslashX,
+ urxBackslashZ,
+ urxDotanyAll,
+ urxBackslashD,
+ urxCaret,
+ urxDollar,
+ urxCtrInit,
+ urxCtrInitNg,
+ urxDotanyUnix,
+ urxStoSp,
+ urxLdSp,
+ urxStoInpLoc,
+ urxLaStart,
+ urxLaEnd,
+ urcOnecharI,
+ urxStringI,
+ urxDollarM,
+ urxCaretM,
+ urxCaretMUnix,
+ urxLbStart,
+ urxLbCont,
+ urxLbEnd,
+ urxLbnCount,
+ urxLbnEnd,
+ urxLoopSrI,
+ urxLoopDotI,
+ urxLoopC,
+ urxDollarD,
+ urxDollarMd,
+ urxBackslashH,
+ urxBackslashR,
+ urxBackslashV:
+ // These instructions are unaltered by the relocation.
+ c.out.compiledPat[dst] = op
+ dst++
+
+ default:
+ // Some op is unaccounted for.
+ panic("unreachable")
+ }
+ }
+
+ c.out.compiledPat = c.out.compiledPat[:dst]
+}
+
+func (c *compiler) matchStartType() {
+ var loc int // Location in the pattern of the current op being processed.
+ var currentLen int32 // Minimum length of a match to this point (loc) in the pattern
+ var numInitialStrings int // Number of strings encountered that could match at start.
+ var atStart = true // True if no part of the pattern yet encountered
+ // could have advanced the position in a match.
+ // (Maximum match length so far == 0)
+
+ // forwardedLength is a vector holding minimum-match-length values that
+ // are propagated forward in the pattern by JMP or STATE_SAVE operations.
+ // It must be one longer than the pattern being checked because some ops
+ // will jmp to a end-of-block+1 location from within a block, and we must
+ // count those when checking the block.
+ end := len(c.out.compiledPat)
+ forwardedLength := make([]int32, end+1)
+
+ for loc = 3; loc < end; loc++ {
+ forwardedLength[loc] = math.MaxInt32
+ }
+
+ for loc = 3; loc < end; loc++ {
+ op := c.out.compiledPat[loc]
+ opType := op.typ()
+
+ // The loop is advancing linearly through the pattern.
+ // If the op we are now at was the destination of a branch in the pattern,
+ // and that path has a shorter minimum length than the current accumulated value,
+ // replace the current accumulated value.
+ if forwardedLength[loc] < currentLen {
+ currentLen = forwardedLength[loc]
+ }
+
+ switch opType {
+ // Ops that don't change the total length matched
+ case urxReservedOp,
+ urxEnd,
+ urxFail,
+ urxStringLen,
+ urxNop,
+ urxStartCapture,
+ urxEndCapture,
+ urxBackslashB,
+ urxBackslashBu,
+ urxBackslashG,
+ urxBackslashZ,
+ urxDollar,
+ urxDollarM,
+ urxDollarD,
+ urxDollarMd,
+ urxRelocOprnd,
+ urxStoInpLoc,
+ urxBackref, // BackRef. Must assume that it might be a zero length match
+ urxBackrefI,
+ urxStoSp, // Setup for atomic or possessive blocks. Doesn't change what can match.
+ urxLdSp:
+ // skip
+
+ case urxCaret:
+ if atStart {
+ c.out.startType = startStart
+ }
+
+ case urxCaretM, urxCaretMUnix:
+ if atStart {
+ c.out.startType = startLine
+ }
+
+ case urxOnechar:
+ if currentLen == 0 {
+ // This character could appear at the start of a match.
+ // Add it to the set of possible starting characters.
+ c.out.initialChars.AddRune(op.value32())
+ numInitialStrings += 2
+ }
+ currentLen = safeIncrement(currentLen, 1)
+ atStart = false
+
+ case urxSetref:
+ if currentLen == 0 {
+ sn := op.value()
+ set := c.out.sets[sn]
+ c.out.initialChars.AddAll(set)
+ numInitialStrings += 2
+ }
+ currentLen = safeIncrement(currentLen, 1)
+ atStart = false
+
+ case urxLoopSrI:
+ // [Set]*, like a SETREF, above, in what it can match,
+ // but may not match at all, so currentLen is not incremented.
+ if currentLen == 0 {
+ sn := op.value()
+ set := c.out.sets[sn]
+ c.out.initialChars.AddAll(set)
+ numInitialStrings += 2
+ }
+ atStart = false
+
+ case urxLoopDotI:
+ if currentLen == 0 {
+ // .* at the start of a pattern.
+ // Any character can begin the match.
+ c.out.initialChars.Clear()
+ c.out.initialChars.Complement()
+ numInitialStrings += 2
+ }
+ atStart = false
+
+ case urxStaticSetref:
+ if currentLen == 0 {
+ sn := op.value()
+ c.out.initialChars.AddAll(staticPropertySets[sn])
+ numInitialStrings += 2
+ }
+ currentLen = safeIncrement(currentLen, 1)
+ atStart = false
+
+ case urxStatSetrefN:
+ if currentLen == 0 {
+ sn := op.value()
+ sc := uset.New()
+ sc.AddAll(staticPropertySets[sn])
+ sc.Complement()
+
+ c.out.initialChars.AddAll(sc)
+ numInitialStrings += 2
+ }
+ currentLen = safeIncrement(currentLen, 1)
+ atStart = false
+
+ case urxBackslashD:
+ // Digit Char
+ if currentLen == 0 {
+ s := uset.New()
+ c.err = uprops.ApplyIntPropertyValue(s, uprops.UCharGeneralCategoryMask, int32(uchar.GcNdMask))
+ if op.value() != 0 {
+ s.Complement()
+ }
+ c.out.initialChars.AddAll(s)
+ numInitialStrings += 2
+ }
+ currentLen = safeIncrement(currentLen, 1)
+ atStart = false
+
+ case urxBackslashH:
+ // Horiz white space
+ if currentLen == 0 {
+ s := uset.New()
+ c.err = uprops.ApplyIntPropertyValue(s, uprops.UCharGeneralCategoryMask, int32(uchar.GcZsMask))
+ s.AddRune(9) // Tab
+ if op.value() != 0 {
+ s.Complement()
+ }
+ c.out.initialChars.AddAll(s)
+ numInitialStrings += 2
+ }
+ currentLen = safeIncrement(currentLen, 1)
+ atStart = false
+
+ case urxBackslashR, // Any line ending sequence
+ urxBackslashV: // Any line ending code point, with optional negation
+ if currentLen == 0 {
+ s := uset.New()
+ s.AddRuneRange(0x0a, 0x0d) // add range
+ s.AddRune(0x85)
+ s.AddRuneRange(0x2028, 0x2029)
+ if op.value() != 0 {
+ // Complement option applies to URX_BACKSLASH_V only.
+ s.Complement()
+ }
+ c.out.initialChars.AddAll(s)
+ numInitialStrings += 2
+ }
+ currentLen = safeIncrement(currentLen, 1)
+ atStart = false
+
+ case urcOnecharI:
+ // Case Insensitive Single Character.
+ if currentLen == 0 {
+ ch := op.value32()
+ if uprops.HasBinaryProperty(ch, uprops.UCharCaseSensitive) {
+ starters := uset.New()
+ starters.AddRuneRange(ch, ch)
+ starters.CloseOver(uset.CaseInsensitive)
+ // findCaseInsensitiveStarters(c, &starters);
+ // For ONECHAR_I, no need to worry about text chars that expand on folding into
+ // strings. The expanded folding can't match the pattern.
+ c.out.initialChars.AddAll(starters)
+ } else {
+ // Char has no case variants. Just add it as-is to the
+ // set of possible starting chars.
+ c.out.initialChars.AddRune(ch)
+ }
+ numInitialStrings += 2
+ }
+ currentLen = safeIncrement(currentLen, 1)
+ atStart = false
+
+ case urxBackslashX, // Grapheme Cluster. Minimum is 1, max unbounded.
+ urxDotanyAll, // . matches one or two.
+ urxDotany,
+ urxDotanyUnix:
+ if currentLen == 0 {
+ // These constructs are all bad news when they appear at the start
+ // of a match. Any character can begin the match.
+ c.out.initialChars.Clear()
+ c.out.initialChars.Complement()
+ numInitialStrings += 2
+ }
+ currentLen = safeIncrement(currentLen, 1)
+ atStart = false
+
+ case urxJmpx:
+ loc++ // Except for extra operand on URX_JMPX, same as URX_JMP.
+ fallthrough
+
+ case urxJmp:
+ jmpDest := op.value()
+ if jmpDest < loc {
+ // Loop of some kind. Can safely ignore, the worst that will happen
+ // is that we understate the true minimum length
+ currentLen = forwardedLength[loc+1]
+ } else {
+ // Forward jump. Propagate the current min length to the target loc of the jump.
+ if forwardedLength[jmpDest] > currentLen {
+ forwardedLength[jmpDest] = currentLen
+ }
+ }
+ atStart = false
+
+ case urxJmpSav,
+ urxJmpSavX:
+ // Combo of state save to the next loc, + jmp backwards.
+ // Net effect on min. length computation is nothing.
+ atStart = false
+
+ case urxBacktrack:
+ // Fails are kind of like a branch, except that the min length was
+ // propagated already, by the state save.
+ currentLen = forwardedLength[loc+1]
+ atStart = false
+
+ case urxStateSave:
+ // State Save, for forward jumps, propagate the current minimum.
+ // of the state save.
+ jmpDest := op.value()
+ if jmpDest > loc {
+ if currentLen < forwardedLength[jmpDest] {
+ forwardedLength[jmpDest] = (currentLen)
+ }
+ }
+ atStart = false
+
+ case urxString:
+ loc++
+ stringLenOp := c.out.compiledPat[loc]
+ stringLen := stringLenOp.value()
+ if currentLen == 0 {
+ // Add the starting character of this string to the set of possible starting
+ // characters for this pattern.
+ stringStartIdx := op.value()
+ ch := c.out.literalText[stringStartIdx]
+ c.out.initialChars.AddRune(ch)
+
+ // Remember this string. After the entire pattern has been checked,
+ // if nothing else is identified that can start a match, we'll use it.
+ numInitialStrings++
+ c.out.initialStringIdx = stringStartIdx
+ c.out.initialStringLen = stringLen
+ }
+
+ currentLen = safeIncrement(currentLen, stringLen)
+ atStart = false
+
+ case urxStringI:
+ // Case-insensitive string. Unlike exact-match strings, we won't
+ // attempt a string search for possible match positions. But we
+ // do update the set of possible starting characters.
+ loc++
+ stringLenOp := c.out.compiledPat[loc]
+ stringLen := stringLenOp.value()
+ if currentLen == 0 {
+ // Add the starting character of this string to the set of possible starting
+ // characters for this pattern.
+ stringStartIdx := op.value()
+ ch := c.out.literalText[stringStartIdx]
+ s := uset.New()
+ c.findCaseInsensitiveStarters(ch, s)
+ c.out.initialChars.AddAll(s)
+ numInitialStrings += 2 // Matching on an initial string not possible.
+ }
+ currentLen = safeIncrement(currentLen, stringLen)
+ atStart = false
+
+ case urxCtrInit,
+ urxCtrInitNg:
+ // Loop Init Ops. These don't change the min length, but they are 4 word ops
+ // so location must be updated accordingly.
+ // Loop Init Ops.
+ // If the min loop count == 0
+ // move loc forwards to the end of the loop, skipping over the body.
+ // If the min count is > 0,
+ // continue normal processing of the body of the loop.
+ loopEndLoc := c.out.compiledPat[loc+1].value()
+ minLoopCount := int(c.out.compiledPat[loc+2])
+ if minLoopCount == 0 {
+ // Min Loop Count of 0, treat like a forward branch and
+ // move the current minimum length up to the target
+ // (end of loop) location.
+ if forwardedLength[loopEndLoc] > currentLen {
+ forwardedLength[loopEndLoc] = currentLen
+ }
+ }
+ loc += 3 // Skips over operands of CTR_INIT
+ atStart = false
+
+ case utxCtrLoop,
+ urxCtrLoopNg:
+ // Loop ops.
+ // The jump is conditional, backwards only.
+ atStart = false
+
+ case urxLoopC:
+ // More loop ops. These state-save to themselves.
+ // don't change the minimum match
+ atStart = false
+
+ case urxLaStart,
+ urxLbStart:
+ // Look-around. Scan forward until the matching look-ahead end,
+ // without processing the look-around block. This is overly pessimistic.
+
+ // Keep track of the nesting depth of look-around blocks. Boilerplate code for
+ // lookahead contains two LA_END instructions, so count goes up by two
+ // for each LA_START.
+ var depth int
+ if opType == urxLaStart {
+ depth = 2
+ } else {
+ depth = 1
+ }
+ for {
+ loc++
+ op = c.out.compiledPat[loc]
+ if op.typ() == urxLaStart {
+ depth += 2
+ }
+ if op.typ() == urxLbStart {
+ depth++
+ }
+ if op.typ() == urxLaEnd || op.typ() == urxLbnEnd {
+ depth--
+ if depth == 0 {
+ break
+ }
+ }
+ if op.typ() == urxStateSave {
+ // Need this because neg lookahead blocks will FAIL to outside
+ // of the block.
+ jmpDest := op.value()
+ if jmpDest > loc {
+ if currentLen < forwardedLength[jmpDest] {
+ forwardedLength[jmpDest] = (currentLen)
+ }
+ }
+ }
+ }
+
+ case urxLaEnd,
+ urxLbCont,
+ urxLbEnd,
+ urxLbnCount,
+ urxLbnEnd:
+ panic("should be consumed in URX_LA_START")
+
+ default:
+ panic("unreachable")
+ }
+ }
+
+ // Sort out what we should check for when looking for candidate match start positions.
+ // In order of preference,
+ // 1. Start of input text buffer.
+ // 2. A literal string.
+ // 3. Start of line in multi-line mode.
+ // 4. A single literal character.
+ // 5. A character from a set of characters.
+ //
+ if c.out.startType == startStart {
+ // Match only at the start of an input text string.
+ // start type is already set. We're done.
+ } else if numInitialStrings == 1 && c.out.minMatchLen > 0 {
+ // Match beginning only with a literal string.
+ ch := c.out.literalText[c.out.initialStringIdx]
+ c.out.startType = startString
+ c.out.initialChar = ch
+ } else if c.out.startType == startLine {
+ // Match at start of line in Multi-Line mode.
+ // Nothing to do here; everything is already set.
+ } else if c.out.minMatchLen == 0 {
+ // Zero length match possible. We could start anywhere.
+ c.out.startType = startNoInfo
+ } else if c.out.initialChars.Len() == 1 {
+ // All matches begin with the same char.
+ c.out.startType = startChar
+ c.out.initialChar = c.out.initialChars.RuneAt(0)
+ } else if !c.out.initialChars.ContainsRuneRange(0, 0x10ffff) && c.out.minMatchLen > 0 {
+ // Matches start with a set of character smaller than the set of all chars.
+ c.out.startType = startSet
+ } else {
+ // Matches can start with anything
+ c.out.startType = startNoInfo
+ }
+}
+
+func (c *compiler) appendOp(typ opcode, arg int) {
+ c.appendIns(c.buildOp(typ, arg))
+}
+
+func (c *compiler) appendIns(ins instruction) {
+ if c.err != nil {
+ return
+ }
+ c.out.compiledPat = append(c.out.compiledPat, ins)
+}
+
+func (c *compiler) buildOp(typ opcode, val int) instruction {
+ if c.err != nil {
+ return 0
+ }
+ if val > 0x00ffffff {
+ panic("bad argument to buildOp")
+ }
+ if val < 0 {
+ if !(typ == urxReservedOpN || typ == urxReservedOp) {
+ panic("bad value to buildOp")
+ }
+ typ = urxReservedOpN
+ }
+ return instruction(int32(typ)<<24 | int32(val))
+}
+
+func (c *compiler) handleCloseParen() {
+ if len(c.parenStack) == 0 {
+ c.error(MismatchedParen)
+ return
+ }
+
+ c.fixLiterals(false)
+
+ var patIdx int
+ var patOp instruction
+
+ for {
+ patIdx, c.parenStack = stackPop(c.parenStack)
+ if patIdx < 0 {
+ break
+ }
+
+ patOp = c.out.compiledPat[patIdx]
+ if patOp.value() != 0 {
+ panic("branch target for JMP should not be set")
+ }
+ patOp |= instruction(len(c.out.compiledPat))
+ c.out.compiledPat[patIdx] = patOp
+ c.matchOpenParen = patIdx
+ }
+
+ var modeFlags int
+ modeFlags, c.parenStack = stackPop(c.parenStack)
+ if modeFlags >= 0 {
+ panic("modeFlags in paren stack was not negated")
+ }
+
+ c.modeFlags = RegexpFlag(modeFlags)
+
+ switch patIdx {
+ case parenPlain, parenFlags:
+ // No additional fixups required.
+ // (Grouping-only parentheses)
+ case parenCapturing:
+ // Capturing Parentheses.
+ // Insert a End Capture op into the pattern.
+ // The frame offset of the variables for this cg is obtained from the
+ // start capture op and put it into the end-capture op.
+
+ captureOp := c.out.compiledPat[c.matchOpenParen+1]
+ if captureOp.typ() != urxStartCapture {
+ panic("bad type in capture op (expected URX_START_CAPTURE)")
+ }
+ frameVarLocation := captureOp.value()
+ c.appendOp(urxEndCapture, frameVarLocation)
+
+ case parenAtomic:
+ // Atomic Parenthesis.
+ // Insert a LD_SP operation to restore the state stack to the position
+ // it was when the atomic parens were entered.
+ stoOp := c.out.compiledPat[c.matchOpenParen+1]
+ if stoOp.typ() != urxStoSp {
+ panic("bad type in capture op (expected URX_STO_SP)")
+ }
+ stoLoc := stoOp.value()
+ c.appendOp(urxLdSp, stoLoc)
+
+ case parenLookahead:
+ startOp := c.out.compiledPat[c.matchOpenParen-5]
+ if startOp.typ() != urxLaStart {
+ panic("bad type in capture op (expected URX_LA_START)")
+ }
+ dataLoc := startOp.value()
+ c.appendOp(urxLaEnd, dataLoc)
+
+ case parenNegLookahead:
+ startOp := c.out.compiledPat[c.matchOpenParen-1]
+ if startOp.typ() != urxLaStart {
+ panic("bad type in capture op (expected URX_LA_START)")
+ }
+ dataLoc := startOp.value()
+ c.appendOp(urxLaEnd, dataLoc)
+ c.appendOp(urxBacktrack, 0)
+ c.appendOp(urxLaEnd, dataLoc)
+
+ // Patch the URX_SAVE near the top of the block.
+ // The destination of the SAVE is the final LA_END that was just added.
+ saveOp := c.out.compiledPat[c.matchOpenParen]
+ if saveOp.typ() != urxStateSave {
+ panic("bad type in capture op (expected URX_STATE_SAVE)")
+ }
+ saveOp = c.buildOp(urxStateSave, len(c.out.compiledPat)-1)
+ c.out.compiledPat[c.matchOpenParen] = saveOp
+
+ case parenLookBehind:
+ startOp := c.out.compiledPat[c.matchOpenParen-4]
+ if startOp.typ() != urxLbStart {
+ panic("bad type in capture op (expected URX_LB_START)")
+ }
+ dataLoc := startOp.value()
+ c.appendOp(urxLbEnd, dataLoc)
+ c.appendOp(urxLaEnd, dataLoc)
+
+ // Determine the min and max bounds for the length of the
+ // string that the pattern can match.
+ // An unbounded upper limit is an error.
+ patEnd := len(c.out.compiledPat) - 1
+ minML := c.minMatchLength(c.matchOpenParen, patEnd)
+ maxML := c.maxMatchLength(c.matchOpenParen, patEnd)
+
+ if maxML == math.MaxInt32 {
+ c.error(LookBehindLimit)
+ break
+ }
+ if minML == math.MaxInt32 {
+ // This condition happens when no match is possible, such as with a
+ // [set] expression containing no elements.
+ // In principle, the generated code to evaluate the expression could be deleted,
+ // but it's probably not worth the complication.
+ minML = 0
+ }
+
+ c.out.compiledPat[c.matchOpenParen-2] = instruction(minML)
+ c.out.compiledPat[c.matchOpenParen-1] = instruction(maxML)
+
+ case parenLookBehindN:
+ startOp := c.out.compiledPat[c.matchOpenParen-5]
+ if startOp.typ() != urxLbStart {
+ panic("bad type in capture op (expected URX_LB_START)")
+ }
+ dataLoc := startOp.value()
+ c.appendOp(urxLbnEnd, dataLoc)
+
+ // Determine the min and max bounds for the length of the
+ // string that the pattern can match.
+ // An unbounded upper limit is an error.
+ patEnd := len(c.out.compiledPat) - 1
+ minML := c.minMatchLength(c.matchOpenParen, patEnd)
+ maxML := c.maxMatchLength(c.matchOpenParen, patEnd)
+
+ if instruction(maxML).typ() != 0 {
+ c.error(LookBehindLimit)
+ break
+ }
+ if maxML == math.MaxInt32 {
+ c.error(LookBehindLimit)
+ break
+ }
+ if minML == math.MaxInt32 {
+ // This condition happens when no match is possible, such as with a
+ // [set] expression containing no elements.
+ // In principle, the generated code to evaluate the expression could be deleted,
+ // but it's probably not worth the complication.
+ minML = 0
+ }
+
+ c.out.compiledPat[c.matchOpenParen-3] = instruction(minML)
+ c.out.compiledPat[c.matchOpenParen-2] = instruction(maxML)
+
+ op := c.buildOp(urxRelocOprnd, len(c.out.compiledPat))
+ c.out.compiledPat[c.matchOpenParen-1] = op
+
+ default:
+ panic("unexpected opcode in parenStack")
+ }
+
+ c.matchCloseParen = len(c.out.compiledPat)
+}
+
+func (c *compiler) fixLiterals(split bool) {
+ if len(c.literalChars) == 0 {
+ return
+ }
+
+ lastCodePoint := c.literalChars[len(c.literalChars)-1]
+
+ // Split: We need to ensure that the last item in the compiled pattern
+ // refers only to the last literal scanned in the pattern, so that
+ // quantifiers (*, +, etc.) affect only it, and not a longer string.
+ // Split before case folding for case insensitive matches.
+ if split {
+ c.literalChars = c.literalChars[:len(c.literalChars)-1]
+ c.fixLiterals(false)
+
+ c.literalChar(lastCodePoint)
+ c.fixLiterals(false)
+ return
+ }
+
+ if c.modeFlags&CaseInsensitive != 0 {
+ c.literalChars = ucase.FoldRunes(c.literalChars)
+ lastCodePoint = c.literalChars[len(c.literalChars)-1]
+ }
+
+ if len(c.literalChars) == 1 {
+ if c.modeFlags&CaseInsensitive != 0 && uprops.HasBinaryProperty(lastCodePoint, uprops.UCharCaseSensitive) {
+ c.appendOp(urcOnecharI, int(lastCodePoint))
+ } else {
+ c.appendOp(urxOnechar, int(lastCodePoint))
+ }
+ } else {
+ if len(c.literalChars) > 0x00ffffff || len(c.out.literalText) > 0x00ffffff {
+ c.error(PatternTooBig)
+ }
+ if c.modeFlags&CaseInsensitive != 0 {
+ c.appendOp(urxStringI, len(c.out.literalText))
+ } else {
+ c.appendOp(urxString, len(c.out.literalText))
+ }
+ c.appendOp(urxStringLen, len(c.literalChars))
+ c.out.literalText = append(c.out.literalText, c.literalChars...)
+ }
+
+ c.literalChars = c.literalChars[:0]
+}
+
+func (c *compiler) literalChar(point rune) {
+ c.literalChars = append(c.literalChars, point)
+}
+
+func (c *compiler) allocateData(size int) int {
+ if c.err != nil {
+ return 0
+ }
+ if size <= 0 || size > 0x100 || c.out.dataSize < 0 {
+ c.error(InternalError)
+ return 0
+ }
+
+ dataIndex := c.out.dataSize
+ c.out.dataSize += size
+ if c.out.dataSize >= 0x00fffff0 {
+ c.error(InternalError)
+ }
+ return dataIndex
+}
+
+func (c *compiler) allocateStackData(size int) int {
+ if c.err != nil {
+ return 0
+ }
+ if size <= 0 || size > 0x100 || c.out.frameSize < 0 {
+ c.error(InternalError)
+ return 0
+ }
+ dataIndex := c.out.frameSize
+ c.out.frameSize += size
+ if c.out.frameSize >= 0x00fffff0 {
+ c.error(InternalError)
+ }
+ return dataIndex
+}
+
+func (c *compiler) insertOp(where int) {
+ if where < 0 || where >= len(c.out.compiledPat) {
+ panic("insertOp: out of bounds")
+ }
+
+ nop := c.buildOp(urxNop, 0)
+ c.out.compiledPat = slices.Insert(c.out.compiledPat, where, nop)
+
+ // Walk through the pattern, looking for any ops with targets that
+ // were moved down by the insert. Fix them.
+ for loc, op := range c.out.compiledPat {
+ switch op.typ() {
+ case urxJmp, urxJmpx, urxStateSave, utxCtrLoop, urxCtrLoopNg, urxJmpSav, urxJmpSavX, urxRelocOprnd:
+ if op.value() > where {
+ op = c.buildOp(op.typ(), op.value()+1)
+ c.out.compiledPat[loc] = op
+ }
+ }
+ }
+
+ // Now fix up the parentheses stack. All positive values in it are locations in
+ // the compiled pattern. (Negative values are frame boundaries, and don't need fixing.)
+ for loc, x := range c.parenStack {
+ if x > where {
+ c.parenStack[loc] = x + 1
+ }
+ }
+
+ if c.matchCloseParen > where {
+ c.matchCloseParen++
+ }
+ if c.matchOpenParen > where {
+ c.matchOpenParen++
+ }
+}
+
+func (c *compiler) blockTopLoc(reserve bool) int {
+ var loc int
+ c.fixLiterals(true)
+
+ if len(c.out.compiledPat) == c.matchCloseParen {
+ // The item just processed is a parenthesized block.
+ loc = c.matchOpenParen
+ } else {
+ // Item just compiled is a single thing, a ".", or a single char, a string or a set reference.
+ // No slot for STATE_SAVE was pre-reserved in the compiled code.
+ // We need to make space now.
+ loc = len(c.out.compiledPat) - 1
+ op := c.out.compiledPat[loc]
+ if op.typ() == urxStringLen {
+ // Strings take two opcode, we want the position of the first one.
+ // We can have a string at this point if a single character case-folded to two.
+ loc--
+ }
+ if reserve {
+ nop := c.buildOp(urxNop, 0)
+ c.out.compiledPat = slices.Insert(c.out.compiledPat, loc, nop)
+ }
+ }
+ return loc
+}
+
+func (c *compiler) compileInlineInterval() bool {
+ if c.intervalUpper > 10 || c.intervalUpper < c.intervalLow {
+ return false
+ }
+
+ topOfBlock := c.blockTopLoc(false)
+ if c.intervalUpper == 0 {
+ // Pathological case. Attempt no matches, as if the block doesn't exist.
+ // Discard the generated code for the block.
+ // If the block included parens, discard the info pertaining to them as well.
+ c.out.compiledPat = c.out.compiledPat[:topOfBlock]
+ if c.matchOpenParen >= topOfBlock {
+ c.matchOpenParen = -1
+ }
+ if c.matchCloseParen >= topOfBlock {
+ c.matchCloseParen = -1
+ }
+ return true
+ }
+
+ if topOfBlock != len(c.out.compiledPat)-1 && c.intervalUpper != 1 {
+ // The thing being repeated is not a single op, but some
+ // more complex block. Do it as a loop, not inlines.
+ // Note that things "repeated" a max of once are handled as inline, because
+ // the one copy of the code already generated is just fine.
+ return false
+ }
+
+ // Pick up the opcode that is to be repeated
+ //
+ op := c.out.compiledPat[topOfBlock]
+
+ // Compute the pattern location where the inline sequence
+ // will end, and set up the state save op that will be needed.
+ //
+ endOfSequenceLoc := len(c.out.compiledPat) - 1 + c.intervalUpper + (c.intervalUpper - c.intervalLow)
+
+ saveOp := c.buildOp(urxStateSave, endOfSequenceLoc)
+ if c.intervalLow == 0 {
+ c.insertOp(topOfBlock)
+ c.out.compiledPat[topOfBlock] = saveOp
+ }
+
+ // Loop, emitting the op for the thing being repeated each time.
+ // Loop starts at 1 because one instance of the op already exists in the pattern,
+ // it was put there when it was originally encountered.
+ for i := 1; i < c.intervalUpper; i++ {
+ if i >= c.intervalLow {
+ c.appendIns(saveOp)
+ }
+ c.appendIns(op)
+ }
+ return true
+}
+
+func (c *compiler) compileInterval(init opcode, loop opcode) {
+ // The CTR_INIT op at the top of the block with the {n,m} quantifier takes
+ // four slots in the compiled code. Reserve them.
+ topOfBlock := c.blockTopLoc(true)
+ c.insertOp(topOfBlock)
+ c.insertOp(topOfBlock)
+ c.insertOp(topOfBlock)
+
+ // The operands for the CTR_INIT opcode include the index in the matcher data
+ // of the counter. Allocate it now. There are two data items
+ // counterLoc --> Loop counter
+ // +1 --> Input index (for breaking non-progressing loops)
+ // (Only present if unbounded upper limit on loop)
+ var dataSize int
+ if c.intervalUpper < 0 {
+ dataSize = 2
+ } else {
+ dataSize = 1
+ }
+ counterLoc := c.allocateStackData(dataSize)
+
+ op := c.buildOp(init, counterLoc)
+ c.out.compiledPat[topOfBlock] = op
+
+ // The second operand of CTR_INIT is the location following the end of the loop.
+ // Must put in as a URX_RELOC_OPRND so that the value will be adjusted if the
+ // compilation of something later on causes the code to grow and the target
+ // position to move.
+ loopEnd := len(c.out.compiledPat)
+ op = c.buildOp(urxRelocOprnd, loopEnd)
+ c.out.compiledPat[topOfBlock+1] = op
+
+ // Followed by the min and max counts.
+ c.out.compiledPat[topOfBlock+2] = instruction(c.intervalLow)
+ c.out.compiledPat[topOfBlock+3] = instruction(c.intervalUpper)
+
+ // Append the CTR_LOOP op. The operand is the location of the CTR_INIT op.
+ // Goes at end of the block being looped over, so just append to the code so far.
+ c.appendOp(loop, topOfBlock)
+
+ if (c.intervalLow&0xff000000) != 0 || (c.intervalUpper > 0 && (c.intervalUpper&0xff000000) != 0) {
+ c.error(NumberTooBig)
+ }
+
+ if c.intervalLow > c.intervalUpper && c.intervalUpper != -1 {
+ c.error(MaxLtMin)
+ }
+}
+
+func (c *compiler) scanNamedChar() rune {
+ c.nextChar(&c.c)
+ if c.c.char != chLBrace {
+ c.error(PropertySyntax)
+ return 0
+ }
+
+ var charName []rune
+ for {
+ c.nextChar(&c.c)
+ if c.c.char == chRBrace {
+ break
+ }
+ if c.c.char == -1 {
+ c.error(PropertySyntax)
+ return 0
+ }
+ charName = append(charName, c.c.char)
+ }
+
+ if !isInvariantUString(charName) {
+ // All Unicode character names have only invariant characters.
+ // The API to get a character, given a name, accepts only char *, forcing us to convert,
+ // which requires this error check
+ c.error(PropertySyntax)
+ return 0
+ }
+
+ theChar := unames.CharForName(unames.UnicodeCharName, string(charName))
+ if c.err != nil {
+ c.error(PropertySyntax)
+ }
+
+ c.nextChar(&c.c) // Continue overall regex pattern processing with char after the '}'
+ return theChar
+}
+
+func isInvariantUString(name []rune) bool {
+ for _, c := range name {
+ /*
+ * no assertions here because these functions are legitimately called
+ * for strings with variant characters
+ */
+ if !ucharIsInvariant(c) {
+ return false /* found a variant char */
+ }
+ }
+ return true
+}
+
+var invariantChars = [...]uint32{
+ 0xfffffbff, /* 00..1f but not 0a */
+ 0xffffffe5, /* 20..3f but not 21 23 24 */
+ 0x87fffffe, /* 40..5f but not 40 5b..5e */
+ 0x87fffffe, /* 60..7f but not 60 7b..7e */
+}
+
+func ucharIsInvariant(c rune) bool {
+ return c <= 0x7f && (invariantChars[(c)>>5]&(uint32(1)<<(c&0x1f))) != 0
+}
+
+func (c *compiler) setPushOp(op setOperation) {
+ c.setEval(op)
+ c.setOpStack = append(c.setOpStack, op)
+ c.setStack = append(c.setStack, uset.New())
+}
+
+func (c *compiler) setEval(nextOp setOperation) {
+ var rightOperand *uset.UnicodeSet
+ var leftOperand *uset.UnicodeSet
+
+ for {
+ pendingSetOp := c.setOpStack[len(c.setOpStack)-1]
+ if (pendingSetOp & 0xffff0000) < (nextOp & 0xffff0000) {
+ break
+ }
+
+ c.setOpStack = c.setOpStack[:len(c.setOpStack)-1]
+ rightOperand = c.setStack[len(c.setStack)-1]
+
+ switch pendingSetOp {
+ case setNegation:
+ rightOperand.Complement()
+
+ case setCaseClose:
+ rightOperand.CloseOver(uset.CaseInsensitive)
+
+ case setDifference1, setDifference2:
+ c.setStack = c.setStack[:len(c.setStack)-1]
+ leftOperand = c.setStack[len(c.setStack)-1]
+ leftOperand.RemoveAll(rightOperand)
+
+ case setIntersection1, setIntersection2:
+ c.setStack = c.setStack[:len(c.setStack)-1]
+ leftOperand = c.setStack[len(c.setStack)-1]
+ leftOperand.RetainAll(rightOperand)
+
+ case setUnion:
+ c.setStack = c.setStack[:len(c.setStack)-1]
+ leftOperand = c.setStack[len(c.setStack)-1]
+ leftOperand.AddAll(rightOperand)
+
+ default:
+ panic("unreachable")
+ }
+ }
+}
+
+func safeIncrement(val int32, delta int) int32 {
+ if delta <= math.MaxInt32 && math.MaxInt32-val > int32(delta) {
+ return val + int32(delta)
+ }
+ return math.MaxInt32
+}
+
+func (c *compiler) minMatchLength(start, end int) int32 {
+ if c.err != nil {
+ return 0
+ }
+
+ var loc int
+ var currentLen int32
+
+ // forwardedLength is a vector holding minimum-match-length values that
+ // are propagated forward in the pattern by JMP or STATE_SAVE operations.
+ // It must be one longer than the pattern being checked because some ops
+ // will jmp to a end-of-block+1 location from within a block, and we must
+ // count those when checking the block.
+ forwardedLength := make([]int32, end+2)
+ for i := range forwardedLength {
+ forwardedLength[i] = math.MaxInt32
+ }
+
+ for loc = start; loc <= end; loc++ {
+ op := c.out.compiledPat[loc]
+ opType := op.typ()
+
+ // The loop is advancing linearly through the pattern.
+ // If the op we are now at was the destination of a branch in the pattern,
+ // and that path has a shorter minimum length than the current accumulated value,
+ // replace the current accumulated value.
+ // no-match-possible cases.
+ if forwardedLength[loc] < currentLen {
+ currentLen = forwardedLength[loc]
+ }
+
+ switch opType {
+ // Ops that don't change the total length matched
+ case urxReservedOp,
+ urxEnd,
+ urxStringLen,
+ urxNop,
+ urxStartCapture,
+ urxEndCapture,
+ urxBackslashB,
+ urxBackslashBu,
+ urxBackslashG,
+ urxBackslashZ,
+ urxCaret,
+ urxDollar,
+ urxDollarM,
+ urxDollarD,
+ urxDollarMd,
+ urxRelocOprnd,
+ urxStoInpLoc,
+ urxCaretM,
+ urxCaretMUnix,
+ urxBackref, // BackRef. Must assume that it might be a zero length match
+ urxBackrefI,
+ urxStoSp, // Setup for atomic or possessive blocks. Doesn't change what can match.
+ urxLdSp,
+ urxJmpSav,
+ urxJmpSavX:
+ // no-op
+
+ // Ops that match a minimum of one character (one or two 16 bit code units.)
+ //
+ case urxOnechar,
+ urxStaticSetref,
+ urxStatSetrefN,
+ urxSetref,
+ urxBackslashD,
+ urxBackslashH,
+ urxBackslashR,
+ urxBackslashV,
+ urcOnecharI,
+ urxBackslashX, // Grapheme Cluster. Minimum is 1, max unbounded.
+ urxDotanyAll, // . matches one or two.
+ urxDotany,
+ urxDotanyUnix:
+ currentLen = safeIncrement(currentLen, 1)
+
+ case urxJmpx:
+ loc++ // URX_JMPX has an extra operand, ignored here, otherwise processed identically to URX_JMP.
+ fallthrough
+
+ case urxJmp:
+ jmpDest := op.value()
+ if jmpDest < loc {
+ // Loop of some kind. Can safely ignore, the worst that will happen
+ // is that we understate the true minimum length
+ currentLen = forwardedLength[loc+1]
+ } else {
+ // Forward jump. Propagate the current min length to the target loc of the jump.
+ if forwardedLength[jmpDest] > currentLen {
+ forwardedLength[jmpDest] = currentLen
+ }
+ }
+
+ case urxBacktrack:
+ // Back-tracks are kind of like a branch, except that the min length was
+ // propagated already, by the state save.
+ currentLen = forwardedLength[loc+1]
+
+ case urxStateSave:
+ // State Save, for forward jumps, propagate the current minimum.
+ // of the state save.
+ jmpDest := op.value()
+ if jmpDest > loc {
+ if currentLen < forwardedLength[jmpDest] {
+ forwardedLength[jmpDest] = currentLen
+ }
+ }
+
+ case urxString:
+ loc++
+ stringLenOp := c.out.compiledPat[loc]
+ currentLen = safeIncrement(currentLen, stringLenOp.value())
+
+ case urxStringI:
+ loc++
+ // TODO: with full case folding, matching input text may be shorter than
+ // the string we have here. More smarts could put some bounds on it.
+ // Assume a min length of one for now. A min length of zero causes
+ // optimization failures for a pattern like "string"+
+ // currentLen += URX_VAL(stringLenOp);
+ currentLen = safeIncrement(currentLen, 1)
+
+ case urxCtrInit, urxCtrInitNg:
+ // Loop Init Ops.
+ // If the min loop count == 0
+ // move loc forwards to the end of the loop, skipping over the body.
+ // If the min count is > 0,
+ // continue normal processing of the body of the loop.
+ loopEndOp := c.out.compiledPat[loc+1]
+ loopEndLoc := loopEndOp.value()
+ minLoopCount := c.out.compiledPat[loc+2]
+ if minLoopCount == 0 {
+ loc = loopEndLoc
+ } else {
+ loc += 3 // Skips over operands of CTR_INIT
+ }
+
+ case utxCtrLoop, urxCtrLoopNg:
+ // Loop ops. The jump is conditional, backwards only.
+
+ case urxLoopSrI, urxLoopDotI, urxLoopC:
+ // More loop ops. These state-save to themselves. don't change the minimum match - could match nothing at all.
+
+ case urxLaStart, urxLbStart:
+ // Look-around. Scan forward until the matching look-ahead end,
+ // without processing the look-around block. This is overly pessimistic for look-ahead,
+ // it assumes that the look-ahead match might be zero-length.
+ // TODO: Positive lookahead could recursively do the block, then continue
+ // with the longer of the block or the value coming in. Ticket 6060
+ var depth int32
+ if opType == urxLaStart {
+ depth = 2
+ } else {
+ depth = 1
+ }
+
+ for {
+ loc++
+ op = c.out.compiledPat[loc]
+ if op.typ() == urxLaStart {
+ // The boilerplate for look-ahead includes two LA_END instructions,
+ // Depth will be decremented by each one when it is seen.
+ depth += 2
+ }
+ if op.typ() == urxLbStart {
+ depth++
+ }
+ if op.typ() == urxLaEnd {
+ depth--
+ if depth == 0 {
+ break
+ }
+ }
+ if op.typ() == urxLbnEnd {
+ depth--
+ if depth == 0 {
+ break
+ }
+ }
+ if op.typ() == urxStateSave {
+ // Need this because neg lookahead blocks will FAIL to outside of the block.
+ jmpDest := op.value()
+ if jmpDest > loc {
+ if currentLen < forwardedLength[jmpDest] {
+ forwardedLength[jmpDest] = currentLen
+ }
+ }
+ }
+ }
+
+ case urxLaEnd, urxLbCont, urxLbEnd, urxLbnCount, urxLbnEnd:
+ // Only come here if the matching URX_LA_START or URX_LB_START was not in the
+ // range being sized, which happens when measuring size of look-behind blocks.
+
+ default:
+ panic("unreachable")
+ }
+ }
+
+ // We have finished walking through the ops. Check whether some forward jump
+ // propagated a shorter length to location end+1.
+ if forwardedLength[end+1] < currentLen {
+ currentLen = forwardedLength[end+1]
+ }
+
+ return currentLen
+}
+
+func (c *compiler) maxMatchLength(start, end int) int32 {
+ if c.err != nil {
+ return 0
+ }
+ var loc int
+ var currentLen int32
+
+ forwardedLength := make([]int32, end+1)
+
+ for loc = start; loc <= end; loc++ {
+ op := c.out.compiledPat[loc]
+ opType := op.typ()
+
+ // The loop is advancing linearly through the pattern.
+ // If the op we are now at was the destination of a branch in the pattern,
+ // and that path has a longer maximum length than the current accumulated value,
+ // replace the current accumulated value.
+ if forwardedLength[loc] > currentLen {
+ currentLen = forwardedLength[loc]
+ }
+
+ switch opType {
+ // Ops that don't change the total length matched
+ case urxReservedOp,
+ urxEnd,
+ urxStringLen,
+ urxNop,
+ urxStartCapture,
+ urxEndCapture,
+ urxBackslashB,
+ urxBackslashBu,
+ urxBackslashG,
+ urxBackslashZ,
+ urxCaret,
+ urxDollar,
+ urxDollarM,
+ urxDollarD,
+ urxDollarMd,
+ urxRelocOprnd,
+ urxStoInpLoc,
+ urxCaretM,
+ urxCaretMUnix,
+ urxStoSp, // Setup for atomic or possessive blocks. Doesn't change what can match.
+ urxLdSp,
+ urxLbEnd,
+ urxLbCont,
+ urxLbnCount,
+ urxLbnEnd:
+ // no-op
+
+ // Ops that increase that cause an unbounded increase in the length
+ // of a matched string, or that increase it a hard to characterize way.
+ // Call the max length unbounded, and stop further checking.
+ case urxBackref, // BackRef. Must assume that it might be a zero length match
+ urxBackrefI,
+ urxBackslashX: // Grapheme Cluster. Minimum is 1, max unbounded.
+ currentLen = math.MaxInt32
+
+ // Ops that match a max of one character (possibly two 16 bit code units.)
+ //
+ case urxStaticSetref,
+ urxStatSetrefN,
+ urxSetref,
+ urxBackslashD,
+ urxBackslashH,
+ urxBackslashR,
+ urxBackslashV,
+ urcOnecharI,
+ urxDotanyAll,
+ urxDotany,
+ urxDotanyUnix:
+ currentLen = safeIncrement(currentLen, 2)
+
+ // Single literal character. Increase current max length by one or two,
+ // depending on whether the char is in the supplementary range.
+ case urxOnechar:
+ currentLen = safeIncrement(currentLen, 1)
+ if op.value() > 0x10000 {
+ currentLen = safeIncrement(currentLen, 1)
+ }
+
+ // Jumps.
+ //
+ case urxJmp, urxJmpx, urxJmpSav, urxJmpSavX:
+ jmpDest := op.value()
+ if jmpDest < loc {
+ // Loop of some kind. Max match length is unbounded.
+ currentLen = math.MaxInt32
+ } else {
+ // Forward jump. Propagate the current min length to the target loc of the jump.
+ if forwardedLength[jmpDest] < currentLen {
+ forwardedLength[jmpDest] = currentLen
+ }
+ currentLen = 0
+ }
+
+ case urxBacktrack:
+ // back-tracks are kind of like a branch, except that the max length was
+ // propagated already, by the state save.
+ currentLen = forwardedLength[loc+1]
+
+ case urxStateSave:
+ // State Save, for forward jumps, propagate the current minimum.
+ // of the state save.
+ // For backwards jumps, they create a loop, maximum
+ // match length is unbounded.
+ jmpDest := op.value()
+ if jmpDest > loc {
+ if currentLen > forwardedLength[jmpDest] {
+ forwardedLength[jmpDest] = currentLen
+ }
+ } else {
+ currentLen = math.MaxInt32
+ }
+
+ case urxString:
+ loc++
+ stringLenOp := c.out.compiledPat[loc]
+ currentLen = safeIncrement(currentLen, stringLenOp.value())
+
+ case urxStringI:
+ // TODO: This code assumes that any user string that matches will be no longer
+ // than our compiled string, with case insensitive matching.
+ // Our compiled string has been case-folded already.
+ //
+ // Any matching user string will have no more code points than our
+ // compiled (folded) string. Folding may add code points, but
+ // not remove them.
+ //
+ // There is a potential problem if a supplemental code point
+ // case-folds to a BMP code point. In this case our compiled string
+ // could be shorter (in code units) than a matching user string.
+ //
+ // At this time (Unicode 6.1) there are no such characters, and this case
+ // is not being handled. A test, intltest regex/Bug9283, will fail if
+ // any problematic characters are added to Unicode.
+ //
+ // If this happens, we can make a set of the BMP chars that the
+ // troublesome supplementals fold to, scan our string, and bump the
+ // currentLen one extra for each that is found.
+ //
+ loc++
+ stringLenOp := c.out.compiledPat[loc]
+ currentLen = safeIncrement(currentLen, stringLenOp.value())
+
+ case urxCtrInit, urxCtrInitNg:
+ // For Loops, recursively call this function on the pattern for the loop body,
+ // then multiply the result by the maximum loop count.
+ loopEndLoc := c.out.compiledPat[loc+1].value()
+ if loopEndLoc == loc+4 {
+ // Loop has an empty body. No affect on max match length.
+ // Continue processing with code after the loop end.
+ loc = loopEndLoc
+ break
+ }
+
+ maxLoopCount := int(c.out.compiledPat[loc+3])
+ if maxLoopCount == -1 {
+ // Unbounded Loop. No upper bound on match length.
+ currentLen = math.MaxInt32
+ break
+ }
+
+ blockLen := c.maxMatchLength(loc+4, loopEndLoc-1) // Recursive call.
+ updatedLen := int(currentLen) + int(blockLen)*maxLoopCount
+ if updatedLen >= math.MaxInt32 {
+ currentLen = math.MaxInt32
+ break
+ }
+ currentLen = int32(updatedLen)
+ loc = loopEndLoc
+
+ case utxCtrLoop, urxCtrLoopNg:
+ panic("should not encounter this opcode")
+
+ case urxLoopSrI, urxLoopDotI, urxLoopC:
+ // For anything to do with loops, make the match length unbounded.
+ currentLen = math.MaxInt32
+
+ case urxLaStart, urxLaEnd:
+ // Look-ahead. Just ignore, treat the look-ahead block as if
+ // it were normal pattern. Gives a too-long match length,
+ // but good enough for now.
+
+ case urxLbStart:
+ // Look-behind. Scan forward until the matching look-around end,
+ // without processing the look-behind block.
+ dataLoc := op.value()
+ for loc = loc + 1; loc <= end; loc++ {
+ op = c.out.compiledPat[loc]
+ if (op.typ() == urxLaEnd || op.typ() == urxLbnEnd) && (op.value() == dataLoc) {
+ break
+ }
+ }
+
+ default:
+ panic("unreachable")
+ }
+
+ if currentLen == math.MaxInt32 {
+ // The maximum length is unbounded.
+ // Stop further processing of the pattern.
+ break
+ }
+ }
+
+ return currentLen
+}
+
+// Machine Generated below.
+// It may need updating with new versions of Unicode.
+// Intltest test RegexTest::TestCaseInsensitiveStarters will fail if an update is needed.
+// The update tool is here:
+// svn+ssh://source.icu-project.org/repos/icu/tools/trunk/unicode/c/genregexcasing
+
+// Machine Generated Data. Do not hand edit.
+var reCaseFixCodePoints = [...]rune{
+ 0x61, 0x66, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x77, 0x79, 0x2bc,
+ 0x3ac, 0x3ae, 0x3b1, 0x3b7, 0x3b9, 0x3c1, 0x3c5, 0x3c9, 0x3ce, 0x565,
+ 0x574, 0x57e, 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
+ 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27, 0x1f60, 0x1f61,
+ 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67, 0x1f70, 0x1f74, 0x1f7c, 0x110000}
+
+var reCaseFixStringOffsets = [...]int16{
+ 0x0, 0x1, 0x6, 0x7, 0x8, 0x9, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13,
+ 0x17, 0x1b, 0x20, 0x21, 0x2a, 0x2e, 0x2f, 0x30, 0x34, 0x35, 0x37, 0x39, 0x3b,
+ 0x3d, 0x3f, 0x41, 0x43, 0x45, 0x47, 0x49, 0x4b, 0x4d, 0x4f, 0x51, 0x53, 0x55,
+ 0x57, 0x59, 0x5b, 0x5d, 0x5f, 0x61, 0x63, 0x65, 0x66, 0x67, 0}
+
+var reCaseFixCounts = [...]int16{
+ 0x1, 0x5, 0x1, 0x1, 0x1, 0x4, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x4, 0x4, 0x5, 0x1, 0x9,
+ 0x4, 0x1, 0x1, 0x4, 0x1, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2,
+ 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0}
+
+var reCaseFixData = [...]uint16{
+ 0x1e9a, 0xfb00, 0xfb01, 0xfb02, 0xfb03, 0xfb04, 0x1e96, 0x130, 0x1f0, 0xdf, 0x1e9e, 0xfb05,
+ 0xfb06, 0x1e97, 0x1e98, 0x1e99, 0x149, 0x1fb4, 0x1fc4, 0x1fb3, 0x1fb6, 0x1fb7, 0x1fbc, 0x1fc3,
+ 0x1fc6, 0x1fc7, 0x1fcc, 0x390, 0x1fd2, 0x1fd3, 0x1fd6, 0x1fd7, 0x1fe4, 0x3b0, 0x1f50, 0x1f52,
+ 0x1f54, 0x1f56, 0x1fe2, 0x1fe3, 0x1fe6, 0x1fe7, 0x1ff3, 0x1ff6, 0x1ff7, 0x1ffc, 0x1ff4, 0x587,
+ 0xfb13, 0xfb14, 0xfb15, 0xfb17, 0xfb16, 0x1f80, 0x1f88, 0x1f81, 0x1f89, 0x1f82, 0x1f8a, 0x1f83,
+ 0x1f8b, 0x1f84, 0x1f8c, 0x1f85, 0x1f8d, 0x1f86, 0x1f8e, 0x1f87, 0x1f8f, 0x1f90, 0x1f98, 0x1f91,
+ 0x1f99, 0x1f92, 0x1f9a, 0x1f93, 0x1f9b, 0x1f94, 0x1f9c, 0x1f95, 0x1f9d, 0x1f96, 0x1f9e, 0x1f97,
+ 0x1f9f, 0x1fa0, 0x1fa8, 0x1fa1, 0x1fa9, 0x1fa2, 0x1faa, 0x1fa3, 0x1fab, 0x1fa4, 0x1fac, 0x1fa5,
+ 0x1fad, 0x1fa6, 0x1fae, 0x1fa7, 0x1faf, 0x1fb2, 0x1fc2, 0x1ff2, 0}
+
+func (c *compiler) findCaseInsensitiveStarters(ch rune, starterChars *uset.UnicodeSet) {
+ if uprops.HasBinaryProperty(ch, uprops.UCharCaseSensitive) {
+ caseFoldedC := ucase.Fold(ch)
+ starterChars.Clear()
+ starterChars.AddRune(caseFoldedC)
+
+ var i int
+ for i = 0; reCaseFixCodePoints[i] < ch; i++ {
+ // Simple linear search through the sorted list of interesting code points.
+ }
+
+ if reCaseFixCodePoints[i] == ch {
+ data := reCaseFixData[reCaseFixStringOffsets[i]:]
+ numCharsToAdd := reCaseFixCounts[i]
+ for j := int16(0); j < numCharsToAdd; j++ {
+ var cpToAdd rune
+ cpToAdd, data = utf16.NextUnsafe(data)
+ starterChars.AddRune(cpToAdd)
+ }
+ }
+
+ starterChars.CloseOver(uset.CaseInsensitive)
+ } else {
+ // Not a cased character. Just return it alone.
+ starterChars.Clear()
+ starterChars.AddRune(ch)
+ }
+}
+
+func (c *compiler) scanProp() *uset.UnicodeSet {
+ if c.err != nil {
+ return nil
+ }
+ negated := c.c.char == chP
+
+ c.nextChar(&c.c)
+ if c.c.char != chLBrace {
+ c.error(PropertySyntax)
+ return nil
+ }
+
+ var propertyName strings.Builder
+ for {
+ c.nextChar(&c.c)
+ if c.c.char == chRBrace {
+ break
+ }
+ if c.c.char == -1 {
+ c.error(PropertySyntax)
+ return nil
+ }
+ propertyName.WriteRune(c.c.char)
+ }
+
+ ss := c.createSetForProperty(propertyName.String(), negated)
+ c.nextChar(&c.c)
+ return ss
+}
+
+func (c *compiler) createSetForProperty(propName string, negated bool) *uset.UnicodeSet {
+ if c.err != nil {
+ return nil
+ }
+
+ var set *uset.UnicodeSet
+
+ var usetFlags uset.USet
+ if c.modeFlags&CaseInsensitive != 0 {
+ usetFlags |= uset.CaseInsensitive
+ }
+
+ var err error
+ set, err = uprops.NewUnicodeSetFomPattern("\\p{"+propName+"}", usetFlags)
+ if err == nil {
+ goto done
+ }
+
+ //
+ // The incoming property wasn't directly recognized by ICU.
+
+ // Check [:word:] and [:all:]. These are not recognized as a properties by ICU UnicodeSet.
+ // Java accepts 'word' with mixed case.
+ // Java accepts 'all' only in all lower case.
+ if strings.EqualFold(propName, "word") {
+ set = staticPropertySets[urxIswordSet].Clone()
+ goto done
+ }
+ if propName == "all" {
+ set = uset.New()
+ set.AddRuneRange(0, 0x10ffff)
+ goto done
+ }
+
+ // Do Java InBlock expressions
+ //
+ if strings.HasPrefix(propName, "In") && len(propName) >= 3 {
+ set = uset.New()
+ if uprops.ApplyPropertyAlias(set, "Block", propName[2:]) != nil {
+ c.error(PropertySyntax)
+ }
+ goto done
+ }
+
+ // Check for the Java form "IsBooleanPropertyValue", which we will recast
+ // as "BooleanPropertyValue". The property value can be either a
+ // a General Category or a Script Name.
+ if strings.HasPrefix(propName, "Is") && len(propName) >= 3 {
+ mPropName := propName[2:]
+ if strings.IndexByte(mPropName, '=') >= 0 {
+ c.error(PropertySyntax)
+ goto done
+ }
+
+ if strings.EqualFold(mPropName, "assigned") {
+ mPropName = "unassigned"
+ negated = !negated
+ } else if strings.EqualFold(mPropName, "TitleCase") {
+ mPropName = "Titlecase_Letter"
+ }
+
+ set, err = uprops.NewUnicodeSetFomPattern("\\p{"+mPropName+"}", 0)
+ if err != nil {
+ c.error(PropertySyntax)
+ } else if !set.IsEmpty() && (usetFlags&uset.CaseInsensitive) != 0 {
+ set.CloseOver(uset.CaseInsensitive)
+ }
+ goto done
+ }
+
+ if strings.HasPrefix(propName, "java") {
+ set = uset.New()
+
+ //
+ // Try the various Java specific properties.
+ // These all begin with "java"
+ //
+ if propName == "javaDefined" {
+ c.err = uprops.AddCategory(set, uchar.GcCnMask)
+ set.Complement()
+ } else if propName == "javaDigit" {
+ c.err = uprops.AddCategory(set, uchar.GcNdMask)
+ } else if propName == "javaIdentifierIgnorable" {
+ c.err = addIdentifierIgnorable(set)
+ } else if propName == "javaISOControl" {
+ set.AddRuneRange(0, 0x1F)
+ set.AddRuneRange(0x7F, 0x9F)
+ } else if propName == "javaJavaIdentifierPart" {
+ c.err = uprops.AddCategory(set, uchar.GcLMask)
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcScMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcPcMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcNdMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcNlMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcMcMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcMnMask)
+ }
+ if c.err == nil {
+ c.err = addIdentifierIgnorable(set)
+ }
+ } else if propName == "javaJavaIdentifierStart" {
+ c.err = uprops.AddCategory(set, uchar.GcLMask)
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcNlMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcScMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcPcMask)
+ }
+ } else if propName == "javaLetter" {
+ c.err = uprops.AddCategory(set, uchar.GcLMask)
+ } else if propName == "javaLetterOrDigit" {
+ c.err = uprops.AddCategory(set, uchar.GcLMask)
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcNdMask)
+ }
+ } else if propName == "javaLowerCase" {
+ c.err = uprops.AddCategory(set, uchar.GcLlMask)
+ } else if propName == "javaMirrored" {
+ c.err = uprops.ApplyIntPropertyValue(set, uprops.UCharBidiMirrored, 1)
+ } else if propName == "javaSpaceChar" {
+ c.err = uprops.AddCategory(set, uchar.GcZMask)
+ } else if propName == "javaSupplementaryCodePoint" {
+ set.AddRuneRange(0x10000, uset.MaxValue)
+ } else if propName == "javaTitleCase" {
+ c.err = uprops.AddCategory(set, uchar.GcLtMask)
+ } else if propName == "javaUnicodeIdentifierStart" {
+ c.err = uprops.AddCategory(set, uchar.GcLMask)
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcNlMask)
+ }
+ } else if propName == "javaUnicodeIdentifierPart" {
+ c.err = uprops.AddCategory(set, uchar.GcLMask)
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcPcMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcNdMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcNlMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcMcMask)
+ }
+ if c.err == nil {
+ c.err = uprops.AddCategory(set, uchar.GcMnMask)
+ }
+ if c.err == nil {
+ c.err = addIdentifierIgnorable(set)
+ }
+ } else if propName == "javaUpperCase" {
+ c.err = uprops.AddCategory(set, uchar.GcLuMask)
+ } else if propName == "javaValidCodePoint" {
+ set.AddRuneRange(0, uset.MaxValue)
+ } else if propName == "javaWhitespace" {
+ c.err = uprops.AddCategory(set, uchar.GcZMask)
+ excl := uset.New()
+ excl.AddRune(0x0a)
+ excl.AddRune(0x2007)
+ excl.AddRune(0x202f)
+ set.RemoveAll(excl)
+ set.AddRuneRange(9, 0x0d)
+ set.AddRuneRange(0x1c, 0x1f)
+ } else {
+ c.error(PropertySyntax)
+ }
+
+ if c.err == nil && !set.IsEmpty() && (usetFlags&uset.CaseInsensitive) != 0 {
+ set.CloseOver(uset.CaseInsensitive)
+ }
+ goto done
+ }
+
+ // Unrecognized property. ICU didn't like it as it was, and none of the Java compatibility
+ // extensions matched it.
+ c.error(PropertySyntax)
+
+done:
+ if c.err != nil {
+ return nil
+ }
+ if negated {
+ set.Complement()
+ }
+ return set
+}
+
+func addIdentifierIgnorable(set *uset.UnicodeSet) error {
+ set.AddRuneRange(0, 8)
+ set.AddRuneRange(0x0e, 0x1b)
+ set.AddRuneRange(0x7f, 0x9f)
+
+ return uprops.AddCategory(set, uchar.GcCfMask)
+}
+
+func (c *compiler) scanPosixProp() *uset.UnicodeSet {
+ var set *uset.UnicodeSet
+
+ if !(c.c.char == chColon) {
+ panic("assertion failed: c.lastChar == ':'")
+ }
+
+ savedScanIndex := c.scanIndex
+ savedScanPattern := c.p
+ savedQuoteMode := c.quoteMode
+ savedInBackslashQuote := c.inBackslashQuote
+ savedEOLComments := c.eolComments
+ savedLineNum := c.lineNum
+ savedCharNum := c.charNum
+ savedLastChar := c.lastChar
+ savedPeekChar := c.peekChar
+ savedC := c.c
+
+ // Scan for a closing ]. A little tricky because there are some perverse
+ // edge cases possible. "[:abc\Qdef:] \E]" is a valid non-property expression,
+ // ending on the second closing ].
+ var propName []rune
+ negated := false
+
+ // Check for and consume the '^' in a negated POSIX property, e.g. [:^Letter:]
+ c.nextChar(&c.c)
+ if c.c.char == chUp {
+ negated = true
+ c.nextChar(&c.c)
+ }
+
+ // Scan for the closing ":]", collecting the property name along the way.
+ sawPropSetTerminator := false
+ for {
+ propName = append(propName, c.c.char)
+ c.nextChar(&c.c)
+ if c.c.quoted || c.c.char == -1 {
+ // Escaped characters or end of input - either says this isn't a [:Property:]
+ break
+ }
+ if c.c.char == chColon {
+ c.nextChar(&c.c)
+ if c.c.char == chRBracket {
+ sawPropSetTerminator = true
+ break
+ }
+ }
+ }
+
+ if sawPropSetTerminator {
+ set = c.createSetForProperty(string(propName), negated)
+ } else {
+ // No closing ']' - not a [:Property:]
+ // Restore the original scan position.
+ // The main scanner will retry the input as a normal set expression,
+ // not a [:Property:] expression.
+ c.scanIndex = savedScanIndex
+ c.p = savedScanPattern
+ c.quoteMode = savedQuoteMode
+ c.inBackslashQuote = savedInBackslashQuote
+ c.eolComments = savedEOLComments
+ c.lineNum = savedLineNum
+ c.charNum = savedCharNum
+ c.lastChar = savedLastChar
+ c.peekChar = savedPeekChar
+ c.c = savedC
+ }
+
+ return set
+}
+
+func (c *compiler) compileSet(set *uset.UnicodeSet) {
+ if set == nil {
+ return
+ }
+ // Remove any strings from the set.
+ // There shoudn't be any, but just in case.
+ // (Case Closure can add them; if we had a simple case closure available that
+ // ignored strings, that would be better.)
+ setSize := set.Len()
+
+ switch setSize {
+ case 0:
+ // Set of no elements. Always fails to match.
+ c.appendOp(urxBacktrack, 0)
+
+ case 1:
+ // The set contains only a single code point. Put it into
+ // the compiled pattern as a single char operation rather
+ // than a set, and discard the set itself.
+ c.literalChar(set.RuneAt(0))
+
+ default:
+ // The set contains two or more chars. (the normal case)
+ // Put it into the compiled pattern as a set.
+ // theSet->freeze();
+ setNumber := len(c.out.sets)
+ c.out.sets = append(c.out.sets, set)
+ c.appendOp(urxSetref, setNumber)
+ }
+}
diff --git a/go/mysql/icuregex/compiler_table.go b/go/mysql/icuregex/compiler_table.go
new file mode 100644
index 00000000000..e8cfe0d5e55
--- /dev/null
+++ b/go/mysql/icuregex/compiler_table.go
@@ -0,0 +1,357 @@
+/*
+© 2016 and later: Unicode, Inc. and others.
+Copyright (C) 2004-2015, International Business Machines Corporation and others.
+Copyright 2023 The Vitess Authors.
+
+This file contains code derived from the Unicode Project's ICU library.
+License & terms of use for the original code: http://www.unicode.org/copyright.html
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package icuregex
+
+type patternParseAction uint8
+
+const (
+ doSetBackslashD patternParseAction = iota
+ doBackslashh
+ doBackslashH
+ doSetLiteralEscaped
+ doOpenLookAheadNeg
+ doCompleteNamedBackRef
+ doPatStart
+ doBackslashS
+ doBackslashD
+ doNGStar
+ doNOP
+ doBackslashX
+ doSetLiteral
+ doContinueNamedCapture
+ doBackslashG
+ doBackslashR
+ doSetBegin
+ doSetBackslashv
+ doPossessivePlus
+ doPerlInline
+ doBackslashZ
+ doSetAddAmp
+ doSetBeginDifference1
+ doIntervalError
+ doSetNegate
+ doIntervalInit
+ doSetIntersection2
+ doPossessiveInterval
+ doRuleError
+ doBackslashW
+ doContinueNamedBackRef
+ doOpenNonCaptureParen
+ doExit
+ doSetNamedChar
+ doSetBackslashV
+ doConditionalExpr
+ doEscapeError
+ doBadOpenParenType
+ doPossessiveStar
+ doSetAddDash
+ doEscapedLiteralChar
+ doSetBackslashw
+ doIntervalUpperDigit
+ doBackslashv
+ doSetBackslashS
+ doSetNoCloseError
+ doSetProp
+ doBackslashB
+ doSetEnd
+ doSetRange
+ doMatchModeParen
+ doPlus
+ doBackslashV
+ doSetMatchMode
+ doBackslashz
+ doSetNamedRange
+ doOpenLookBehindNeg
+ doInterval
+ doBadNamedCapture
+ doBeginMatchMode
+ doBackslashd
+ doPatFinish
+ doNamedChar
+ doNGPlus
+ doSetDifference2
+ doSetBackslashH
+ doCloseParen
+ doDotAny
+ doOpenCaptureParen
+ doEnterQuoteMode
+ doOpenAtomicParen
+ doBadModeFlag
+ doSetBackslashd
+ doSetFinish
+ doProperty
+ doBeginNamedBackRef
+ doBackRef
+ doOpt
+ doDollar
+ doBeginNamedCapture
+ doNGInterval
+ doSetOpError
+ doSetPosixProp
+ doSetBeginIntersection1
+ doBackslashb
+ doSetBeginUnion
+ doIntevalLowerDigit
+ doSetBackslashh
+ doStar
+ doMatchMode
+ doBackslashA
+ doOpenLookBehind
+ doPossessiveOpt
+ doOrOperator
+ doBackslashw
+ doBackslashs
+ doLiteralChar
+ doSuppressComments
+ doCaret
+ doIntervalSame
+ doNGOpt
+ doOpenLookAhead
+ doSetBackslashW
+ doMismatchedParenErr
+ doSetBackslashs
+ rbbiLastAction
+)
+
+// -------------------------------------------------------------------------------
+//
+// RegexTableEl represents the structure of a row in the transition table
+// for the pattern parser state machine.
+//
+// -------------------------------------------------------------------------------
+type regexTableEl struct {
+ action patternParseAction
+ charClass uint8
+ nextState uint8
+ pushState uint8
+ nextChar bool
+}
+
+var parseStateTable = []regexTableEl{
+ {doNOP, 0, 0, 0, true},
+ {doPatStart, 255, 2, 0, false}, // 1 start
+ {doLiteralChar, 254, 14, 0, true}, // 2 term
+ {doLiteralChar, 130, 14, 0, true}, // 3
+ {doSetBegin, 91 /* [ */, 123, 205, true}, // 4
+ {doNOP, 40 /* ( */, 27, 0, true}, // 5
+ {doDotAny, 46 /* . */, 14, 0, true}, // 6
+ {doCaret, 94 /* ^ */, 14, 0, true}, // 7
+ {doDollar, 36 /* $ */, 14, 0, true}, // 8
+ {doNOP, 92 /* \ */, 89, 0, true}, // 9
+ {doOrOperator, 124 /* | */, 2, 0, true}, // 10
+ {doCloseParen, 41 /* ) */, 255, 0, true}, // 11
+ {doPatFinish, 253, 2, 0, false}, // 12
+ {doRuleError, 255, 206, 0, false}, // 13
+ {doNOP, 42 /* * */, 68, 0, true}, // 14 expr-quant
+ {doNOP, 43 /* + */, 71, 0, true}, // 15
+ {doNOP, 63 /* ? */, 74, 0, true}, // 16
+ {doIntervalInit, 123 /* { */, 77, 0, true}, // 17
+ {doNOP, 40 /* ( */, 23, 0, true}, // 18
+ {doNOP, 255, 20, 0, false}, // 19
+ {doOrOperator, 124 /* | */, 2, 0, true}, // 20 expr-cont
+ {doCloseParen, 41 /* ) */, 255, 0, true}, // 21
+ {doNOP, 255, 2, 0, false}, // 22
+ {doSuppressComments, 63 /* ? */, 25, 0, true}, // 23 open-paren-quant
+ {doNOP, 255, 27, 0, false}, // 24
+ {doNOP, 35 /* # */, 50, 14, true}, // 25 open-paren-quant2
+ {doNOP, 255, 29, 0, false}, // 26
+ {doSuppressComments, 63 /* ? */, 29, 0, true}, // 27 open-paren
+ {doOpenCaptureParen, 255, 2, 14, false}, // 28
+ {doOpenNonCaptureParen, 58 /* : */, 2, 14, true}, // 29 open-paren-extended
+ {doOpenAtomicParen, 62 /* > */, 2, 14, true}, // 30
+ {doOpenLookAhead, 61 /* = */, 2, 20, true}, // 31
+ {doOpenLookAheadNeg, 33 /* ! */, 2, 20, true}, // 32
+ {doNOP, 60 /* < */, 46, 0, true}, // 33
+ {doNOP, 35 /* # */, 50, 2, true}, // 34
+ {doBeginMatchMode, 105 /* i */, 53, 0, false}, // 35
+ {doBeginMatchMode, 100 /* d */, 53, 0, false}, // 36
+ {doBeginMatchMode, 109 /* m */, 53, 0, false}, // 37
+ {doBeginMatchMode, 115 /* s */, 53, 0, false}, // 38
+ {doBeginMatchMode, 117 /* u */, 53, 0, false}, // 39
+ {doBeginMatchMode, 119 /* w */, 53, 0, false}, // 40
+ {doBeginMatchMode, 120 /* x */, 53, 0, false}, // 41
+ {doBeginMatchMode, 45 /* - */, 53, 0, false}, // 42
+ {doConditionalExpr, 40 /* ( */, 206, 0, true}, // 43
+ {doPerlInline, 123 /* { */, 206, 0, true}, // 44
+ {doBadOpenParenType, 255, 206, 0, false}, // 45
+ {doOpenLookBehind, 61 /* = */, 2, 20, true}, // 46 open-paren-lookbehind
+ {doOpenLookBehindNeg, 33 /* ! */, 2, 20, true}, // 47
+ {doBeginNamedCapture, 129, 64, 0, false}, // 48
+ {doBadOpenParenType, 255, 206, 0, false}, // 49
+ {doNOP, 41 /* ) */, 255, 0, true}, // 50 paren-comment
+ {doMismatchedParenErr, 253, 206, 0, false}, // 51
+ {doNOP, 255, 50, 0, true}, // 52
+ {doMatchMode, 105 /* i */, 53, 0, true}, // 53 paren-flag
+ {doMatchMode, 100 /* d */, 53, 0, true}, // 54
+ {doMatchMode, 109 /* m */, 53, 0, true}, // 55
+ {doMatchMode, 115 /* s */, 53, 0, true}, // 56
+ {doMatchMode, 117 /* u */, 53, 0, true}, // 57
+ {doMatchMode, 119 /* w */, 53, 0, true}, // 58
+ {doMatchMode, 120 /* x */, 53, 0, true}, // 59
+ {doMatchMode, 45 /* - */, 53, 0, true}, // 60
+ {doSetMatchMode, 41 /* ) */, 2, 0, true}, // 61
+ {doMatchModeParen, 58 /* : */, 2, 14, true}, // 62
+ {doBadModeFlag, 255, 206, 0, false}, // 63
+ {doContinueNamedCapture, 129, 64, 0, true}, // 64 named-capture
+ {doContinueNamedCapture, 128, 64, 0, true}, // 65
+ {doOpenCaptureParen, 62 /* > */, 2, 14, true}, // 66
+ {doBadNamedCapture, 255, 206, 0, false}, // 67
+ {doNGStar, 63 /* ? */, 20, 0, true}, // 68 quant-star
+ {doPossessiveStar, 43 /* + */, 20, 0, true}, // 69
+ {doStar, 255, 20, 0, false}, // 70
+ {doNGPlus, 63 /* ? */, 20, 0, true}, // 71 quant-plus
+ {doPossessivePlus, 43 /* + */, 20, 0, true}, // 72
+ {doPlus, 255, 20, 0, false}, // 73
+ {doNGOpt, 63 /* ? */, 20, 0, true}, // 74 quant-opt
+ {doPossessiveOpt, 43 /* + */, 20, 0, true}, // 75
+ {doOpt, 255, 20, 0, false}, // 76
+ {doNOP, 128, 79, 0, false}, // 77 interval-open
+ {doIntervalError, 255, 206, 0, false}, // 78
+ {doIntevalLowerDigit, 128, 79, 0, true}, // 79 interval-lower
+ {doNOP, 44 /* , */, 83, 0, true}, // 80
+ {doIntervalSame, 125 /* } */, 86, 0, true}, // 81
+ {doIntervalError, 255, 206, 0, false}, // 82
+ {doIntervalUpperDigit, 128, 83, 0, true}, // 83 interval-upper
+ {doNOP, 125 /* } */, 86, 0, true}, // 84
+ {doIntervalError, 255, 206, 0, false}, // 85
+ {doNGInterval, 63 /* ? */, 20, 0, true}, // 86 interval-type
+ {doPossessiveInterval, 43 /* + */, 20, 0, true}, // 87
+ {doInterval, 255, 20, 0, false}, // 88
+ {doBackslashA, 65 /* A */, 2, 0, true}, // 89 backslash
+ {doBackslashB, 66 /* B */, 2, 0, true}, // 90
+ {doBackslashb, 98 /* b */, 2, 0, true}, // 91
+ {doBackslashd, 100 /* d */, 14, 0, true}, // 92
+ {doBackslashD, 68 /* D */, 14, 0, true}, // 93
+ {doBackslashG, 71 /* G */, 2, 0, true}, // 94
+ {doBackslashh, 104 /* h */, 14, 0, true}, // 95
+ {doBackslashH, 72 /* H */, 14, 0, true}, // 96
+ {doNOP, 107 /* k */, 115, 0, true}, // 97
+ {doNamedChar, 78 /* N */, 14, 0, false}, // 98
+ {doProperty, 112 /* p */, 14, 0, false}, // 99
+ {doProperty, 80 /* P */, 14, 0, false}, // 100
+ {doBackslashR, 82 /* R */, 14, 0, true}, // 101
+ {doEnterQuoteMode, 81 /* Q */, 2, 0, true}, // 102
+ {doBackslashS, 83 /* S */, 14, 0, true}, // 103
+ {doBackslashs, 115 /* s */, 14, 0, true}, // 104
+ {doBackslashv, 118 /* v */, 14, 0, true}, // 105
+ {doBackslashV, 86 /* V */, 14, 0, true}, // 106
+ {doBackslashW, 87 /* W */, 14, 0, true}, // 107
+ {doBackslashw, 119 /* w */, 14, 0, true}, // 108
+ {doBackslashX, 88 /* X */, 14, 0, true}, // 109
+ {doBackslashZ, 90 /* Z */, 2, 0, true}, // 110
+ {doBackslashz, 122 /* z */, 2, 0, true}, // 111
+ {doBackRef, 128, 14, 0, true}, // 112
+ {doEscapeError, 253, 206, 0, false}, // 113
+ {doEscapedLiteralChar, 255, 14, 0, true}, // 114
+ {doBeginNamedBackRef, 60 /* < */, 117, 0, true}, // 115 named-backref
+ {doBadNamedCapture, 255, 206, 0, false}, // 116
+ {doContinueNamedBackRef, 129, 119, 0, true}, // 117 named-backref-2
+ {doBadNamedCapture, 255, 206, 0, false}, // 118
+ {doContinueNamedBackRef, 129, 119, 0, true}, // 119 named-backref-3
+ {doContinueNamedBackRef, 128, 119, 0, true}, // 120
+ {doCompleteNamedBackRef, 62 /* > */, 14, 0, true}, // 121
+ {doBadNamedCapture, 255, 206, 0, false}, // 122
+ {doSetNegate, 94 /* ^ */, 126, 0, true}, // 123 set-open
+ {doSetPosixProp, 58 /* : */, 128, 0, false}, // 124
+ {doNOP, 255, 126, 0, false}, // 125
+ {doSetLiteral, 93 /* ] */, 141, 0, true}, // 126 set-open2
+ {doNOP, 255, 131, 0, false}, // 127
+ {doSetEnd, 93 /* ] */, 255, 0, true}, // 128 set-posix
+ {doNOP, 58 /* : */, 131, 0, false}, // 129
+ {doRuleError, 255, 206, 0, false}, // 130
+ {doSetEnd, 93 /* ] */, 255, 0, true}, // 131 set-start
+ {doSetBeginUnion, 91 /* [ */, 123, 148, true}, // 132
+ {doNOP, 92 /* \ */, 191, 0, true}, // 133
+ {doNOP, 45 /* - */, 137, 0, true}, // 134
+ {doNOP, 38 /* & */, 139, 0, true}, // 135
+ {doSetLiteral, 255, 141, 0, true}, // 136
+ {doRuleError, 45 /* - */, 206, 0, false}, // 137 set-start-dash
+ {doSetAddDash, 255, 141, 0, false}, // 138
+ {doRuleError, 38 /* & */, 206, 0, false}, // 139 set-start-amp
+ {doSetAddAmp, 255, 141, 0, false}, // 140
+ {doSetEnd, 93 /* ] */, 255, 0, true}, // 141 set-after-lit
+ {doSetBeginUnion, 91 /* [ */, 123, 148, true}, // 142
+ {doNOP, 45 /* - */, 178, 0, true}, // 143
+ {doNOP, 38 /* & */, 169, 0, true}, // 144
+ {doNOP, 92 /* \ */, 191, 0, true}, // 145
+ {doSetNoCloseError, 253, 206, 0, false}, // 146
+ {doSetLiteral, 255, 141, 0, true}, // 147
+ {doSetEnd, 93 /* ] */, 255, 0, true}, // 148 set-after-set
+ {doSetBeginUnion, 91 /* [ */, 123, 148, true}, // 149
+ {doNOP, 45 /* - */, 171, 0, true}, // 150
+ {doNOP, 38 /* & */, 166, 0, true}, // 151
+ {doNOP, 92 /* \ */, 191, 0, true}, // 152
+ {doSetNoCloseError, 253, 206, 0, false}, // 153
+ {doSetLiteral, 255, 141, 0, true}, // 154
+ {doSetEnd, 93 /* ] */, 255, 0, true}, // 155 set-after-range
+ {doSetBeginUnion, 91 /* [ */, 123, 148, true}, // 156
+ {doNOP, 45 /* - */, 174, 0, true}, // 157
+ {doNOP, 38 /* & */, 176, 0, true}, // 158
+ {doNOP, 92 /* \ */, 191, 0, true}, // 159
+ {doSetNoCloseError, 253, 206, 0, false}, // 160
+ {doSetLiteral, 255, 141, 0, true}, // 161
+ {doSetBeginUnion, 91 /* [ */, 123, 148, true}, // 162 set-after-op
+ {doSetOpError, 93 /* ] */, 206, 0, false}, // 163
+ {doNOP, 92 /* \ */, 191, 0, true}, // 164
+ {doSetLiteral, 255, 141, 0, true}, // 165
+ {doSetBeginIntersection1, 91 /* [ */, 123, 148, true}, // 166 set-set-amp
+ {doSetIntersection2, 38 /* & */, 162, 0, true}, // 167
+ {doSetAddAmp, 255, 141, 0, false}, // 168
+ {doSetIntersection2, 38 /* & */, 162, 0, true}, // 169 set-lit-amp
+ {doSetAddAmp, 255, 141, 0, false}, // 170
+ {doSetBeginDifference1, 91 /* [ */, 123, 148, true}, // 171 set-set-dash
+ {doSetDifference2, 45 /* - */, 162, 0, true}, // 172
+ {doSetAddDash, 255, 141, 0, false}, // 173
+ {doSetDifference2, 45 /* - */, 162, 0, true}, // 174 set-range-dash
+ {doSetAddDash, 255, 141, 0, false}, // 175
+ {doSetIntersection2, 38 /* & */, 162, 0, true}, // 176 set-range-amp
+ {doSetAddAmp, 255, 141, 0, false}, // 177
+ {doSetDifference2, 45 /* - */, 162, 0, true}, // 178 set-lit-dash
+ {doSetAddDash, 91 /* [ */, 141, 0, false}, // 179
+ {doSetAddDash, 93 /* ] */, 141, 0, false}, // 180
+ {doNOP, 92 /* \ */, 183, 0, true}, // 181
+ {doSetRange, 255, 155, 0, true}, // 182
+ {doSetOpError, 115 /* s */, 206, 0, false}, // 183 set-lit-dash-escape
+ {doSetOpError, 83 /* S */, 206, 0, false}, // 184
+ {doSetOpError, 119 /* w */, 206, 0, false}, // 185
+ {doSetOpError, 87 /* W */, 206, 0, false}, // 186
+ {doSetOpError, 100 /* d */, 206, 0, false}, // 187
+ {doSetOpError, 68 /* D */, 206, 0, false}, // 188
+ {doSetNamedRange, 78 /* N */, 155, 0, false}, // 189
+ {doSetRange, 255, 155, 0, true}, // 190
+ {doSetProp, 112 /* p */, 148, 0, false}, // 191 set-escape
+ {doSetProp, 80 /* P */, 148, 0, false}, // 192
+ {doSetNamedChar, 78 /* N */, 141, 0, false}, // 193
+ {doSetBackslashs, 115 /* s */, 155, 0, true}, // 194
+ {doSetBackslashS, 83 /* S */, 155, 0, true}, // 195
+ {doSetBackslashw, 119 /* w */, 155, 0, true}, // 196
+ {doSetBackslashW, 87 /* W */, 155, 0, true}, // 197
+ {doSetBackslashd, 100 /* d */, 155, 0, true}, // 198
+ {doSetBackslashD, 68 /* D */, 155, 0, true}, // 199
+ {doSetBackslashh, 104 /* h */, 155, 0, true}, // 200
+ {doSetBackslashH, 72 /* H */, 155, 0, true}, // 201
+ {doSetBackslashv, 118 /* v */, 155, 0, true}, // 202
+ {doSetBackslashV, 86 /* V */, 155, 0, true}, // 203
+ {doSetLiteralEscaped, 255, 141, 0, true}, // 204
+ {doSetFinish, 255, 14, 0, false}, // 205 set-finish
+ {doExit, 255, 206, 0, true}, // 206 errorDeath
+}
diff --git a/go/mysql/icuregex/debug.go b/go/mysql/icuregex/debug.go
new file mode 100644
index 00000000000..92c43e704d7
--- /dev/null
+++ b/go/mysql/icuregex/debug.go
@@ -0,0 +1,151 @@
+/*
+© 2016 and later: Unicode, Inc. and others.
+Copyright (C) 2004-2015, International Business Machines Corporation and others.
+Copyright 2023 The Vitess Authors.
+
+This file contains code derived from the Unicode Project's ICU library.
+License & terms of use for the original code: http://www.unicode.org/copyright.html
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package icuregex
+
+import (
+ "fmt"
+ "io"
+)
+
+func (pat *Pattern) Dump(w io.Writer) {
+ fmt.Fprintf(w, "Original Pattern: \"%s\"\n", pat.pattern)
+ fmt.Fprintf(w, " Min Match Length: %d\n", pat.minMatchLen)
+ fmt.Fprintf(w, " Match Start Type: %v\n", pat.startType)
+ if pat.startType == startString {
+ fmt.Fprintf(w, " Initial match string: \"%s\"\n", string(pat.literalText[pat.initialStringIdx:pat.initialStringIdx+pat.initialStringLen]))
+ } else if pat.startType == startSet {
+ fmt.Fprintf(w, " Match First Chars: %s\n", pat.initialChars.String())
+ } else if pat.startType == startChar {
+ fmt.Fprintf(w, " First char of Match: ")
+ if pat.initialChar > 0x20 {
+ fmt.Fprintf(w, "'%c'\n", pat.initialChar)
+ } else {
+ fmt.Fprintf(w, "%#x\n", pat.initialChar)
+ }
+ }
+
+ fmt.Fprintf(w, "Named Capture Groups:\n")
+ if len(pat.namedCaptureMap) == 0 {
+ fmt.Fprintf(w, " None\n")
+ } else {
+ for name, number := range pat.namedCaptureMap {
+ fmt.Fprintf(w, " %d\t%s\n", number, name)
+ }
+ }
+
+ fmt.Fprintf(w, "\nIndex Binary Type Operand\n-------------------------------------------\n")
+ for idx := range pat.compiledPat {
+ pat.dumpOp(w, idx)
+ }
+ fmt.Fprintf(w, "\n\n")
+}
+
+func (pat *Pattern) dumpOp(w io.Writer, index int) {
+ op := pat.compiledPat[index]
+ val := op.value()
+ opType := op.typ()
+ pinnedType := opType
+ if int(pinnedType) >= len(urxOpcodeNames) {
+ pinnedType = 0
+ }
+
+ fmt.Fprintf(w, "%4d %08x %-15s ", index, op, urxOpcodeNames[pinnedType])
+
+ switch opType {
+ case urxNop,
+ urxDotany,
+ urxDotanyAll,
+ urxFail,
+ urxCaret,
+ urxDollar,
+ urxBackslashG,
+ urxBackslashX,
+ urxEnd,
+ urxDollarM,
+ urxCaretM:
+ // Types with no operand field of interest.
+
+ case urxReservedOp,
+ urxStartCapture,
+ urxEndCapture,
+ urxStateSave,
+ urxJmp,
+ urxJmpSav,
+ urxJmpSavX,
+ urxBackslashB,
+ urxBackslashBu,
+ urxBackslashD,
+ urxBackslashZ,
+ urxStringLen,
+ urxCtrInit,
+ urxCtrInitNg,
+ utxCtrLoop,
+ urxCtrLoopNg,
+ urxRelocOprnd,
+ urxStoSp,
+ urxLdSp,
+ urxBackref,
+ urxStoInpLoc,
+ urxJmpx,
+ urxLaStart,
+ urxLaEnd,
+ urxBackrefI,
+ urxLbStart,
+ urxLbCont,
+ urxLbEnd,
+ urxLbnCount,
+ urxLbnEnd,
+ urxLoopC,
+ urxLoopDotI,
+ urxBackslashH,
+ urxBackslashR,
+ urxBackslashV:
+ // types with an integer operand field.
+ fmt.Fprintf(w, "%d", val)
+
+ case urxOnechar, urcOnecharI:
+ if val < 0x20 {
+ fmt.Fprintf(w, "%#x", val)
+ } else {
+ fmt.Fprintf(w, "'%c'", rune(val))
+ }
+
+ case urxString, urxStringI:
+ lengthOp := pat.compiledPat[index+1]
+ length := lengthOp.value()
+ fmt.Fprintf(w, "%q", string(pat.literalText[val:val+length]))
+
+ case urxSetref, urxLoopSrI:
+ fmt.Fprintf(w, "%s", pat.sets[val].String())
+
+ case urxStaticSetref, urxStatSetrefN:
+ if (val & urxNegSet) != 0 {
+ fmt.Fprintf(w, "NOT ")
+ val &= ^urxNegSet
+ }
+ fmt.Fprintf(w, "%s", staticPropertySets[val].String())
+
+ default:
+ fmt.Fprintf(w, "??????")
+ }
+ fmt.Fprintf(w, "\n")
+}
diff --git a/go/mysql/icuregex/error.go b/go/mysql/icuregex/error.go
new file mode 100644
index 00000000000..39c92399aa9
--- /dev/null
+++ b/go/mysql/icuregex/error.go
@@ -0,0 +1,152 @@
+/*
+© 2016 and later: Unicode, Inc. and others.
+Copyright (C) 2004-2015, International Business Machines Corporation and others.
+Copyright 2023 The Vitess Authors.
+
+This file contains code derived from the Unicode Project's ICU library.
+License & terms of use for the original code: http://www.unicode.org/copyright.html
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package icuregex
+
+import (
+ "fmt"
+ "strings"
+)
+
+type CompileError struct {
+ Code CompileErrorCode
+ Line int
+ Offset int
+ Context string
+}
+
+func (e *CompileError) Error() string {
+ var out strings.Builder
+ switch e.Code {
+ case InternalError:
+ out.WriteString("Internal error")
+ case RuleSyntax:
+ out.WriteString("Syntax error")
+ case BadEscapeSequence:
+ out.WriteString("Bad escape sequence")
+ case PropertySyntax:
+ out.WriteString("Property syntax error")
+ case Unimplemented:
+ out.WriteString("Unimplemented")
+ case MismatchedParen:
+ out.WriteString("Mismatched parentheses")
+ case NumberTooBig:
+ out.WriteString("Number too big")
+ case BadInterval:
+ out.WriteString("Bad interval")
+ case MaxLtMin:
+ out.WriteString("Max less than min")
+ case InvalidBackRef:
+ out.WriteString("Invalid back reference")
+ case InvalidFlag:
+ out.WriteString("Invalid flag")
+ case LookBehindLimit:
+ out.WriteString("Look behind limit")
+ case MissingCloseBracket:
+ out.WriteString("Missing closing ]")
+ case InvalidRange:
+ out.WriteString("Invalid range")
+ case PatternTooBig:
+ out.WriteString("Pattern too big")
+ case InvalidCaptureGroupName:
+ out.WriteString("Invalid capture group name")
+ }
+ _, _ = fmt.Fprintf(&out, " in regular expression on line %d, character %d: `%s`", e.Line, e.Offset, e.Context)
+
+ return out.String()
+}
+
+type MatchError struct {
+ Code MatchErrorCode
+ Pattern string
+ Position int
+ Input []rune
+}
+
+const maxMatchInputLength = 20
+
+func (e *MatchError) Error() string {
+ var out strings.Builder
+ switch e.Code {
+ case StackOverflow:
+ out.WriteString("Stack overflow")
+ case TimeOut:
+ out.WriteString("Timeout")
+ case InternalMatchError:
+ out.WriteString("Internal error")
+ }
+
+ input := e.Input
+ if len(input) > maxMatchInputLength {
+ var b []rune
+ start := e.Position - maxMatchInputLength/2
+ if start < 0 {
+ start = 0
+ } else {
+ b = append(b, '.', '.', '.')
+ }
+ end := start + maxMatchInputLength
+ trailing := true
+ if end > len(input) {
+ end = len(input)
+ trailing = false
+ }
+ b = append(b, input[start:end]...)
+ if trailing {
+ b = append(b, '.', '.', '.')
+ }
+ input = b
+ }
+ _, _ = fmt.Fprintf(&out, " for expression `%s` at position %d in: %q", e.Pattern, e.Position, string(input))
+
+ return out.String()
+}
+
+type Code int32
+
+type CompileErrorCode int32
+
+const (
+ InternalError CompileErrorCode = iota + 1 /**< An internal error (bug) was detected. */
+ RuleSyntax /**< Syntax error in regexp pattern. */
+ BadEscapeSequence /**< Unrecognized backslash escape sequence in pattern */
+ PropertySyntax /**< Incorrect Unicode property */
+ Unimplemented /**< Use of regexp feature that is not yet implemented. */
+ MismatchedParen /**< Incorrectly nested parentheses in regexp pattern. */
+ NumberTooBig /**< Decimal number is too large. */
+ BadInterval /**< Error in {min,max} interval */
+ MaxLtMin /**< In {min,max}, max is less than min. */
+ InvalidBackRef /**< Back-reference to a non-existent capture group. */
+ InvalidFlag /**< Invalid value for match mode flags. */
+ LookBehindLimit /**< Look-Behind pattern matches must have a bounded maximum length. */
+ MissingCloseBracket /**< Missing closing bracket on a bracket expression. */
+ InvalidRange /**< In a character range [x-y], x is greater than y. */
+ PatternTooBig /**< Pattern exceeds limits on size or complexity. @stable ICU 55 */
+ InvalidCaptureGroupName /**< Invalid capture group name. @stable ICU 55 */
+)
+
+type MatchErrorCode int32
+
+const (
+ StackOverflow MatchErrorCode = iota /**< Regular expression backtrack stack overflow. */
+ TimeOut /**< Maximum allowed match time exceeded */
+ InternalMatchError /**< Internal error (bug) was detected. */
+)
diff --git a/go/vt/vtgr/controller/error.go b/go/mysql/icuregex/errors/error.go
similarity index 55%
rename from go/vt/vtgr/controller/error.go
rename to go/mysql/icuregex/errors/error.go
index 5613c802524..f03a5157acf 100644
--- a/go/vt/vtgr/controller/error.go
+++ b/go/mysql/icuregex/errors/error.go
@@ -1,5 +1,10 @@
/*
-Copyright 2021 The Vitess Authors.
+© 2016 and later: Unicode, Inc. and others.
+Copyright (C) 2004-2015, International Business Machines Corporation and others.
+Copyright 2023 The Vitess Authors.
+
+This file contains code derived from the Unicode Project's ICU library.
+License & terms of use for the original code: http://www.unicode.org/copyright.html
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,12 +19,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controller
+package errors
import "errors"
-var (
- errMissingPrimaryTablet = errors.New("no primary tablet available")
- errMissingGroup = errors.New("no mysql group")
- errForceAbortBootstrap = errors.New("force abort bootstrap")
-)
+var ErrIllegalArgument = errors.New("illegal argument")
+var ErrUnsupported = errors.New("unsupported")
diff --git a/go/mysql/icuregex/icu_test.go b/go/mysql/icuregex/icu_test.go
new file mode 100644
index 00000000000..9e9be505df7
--- /dev/null
+++ b/go/mysql/icuregex/icu_test.go
@@ -0,0 +1,415 @@
+/*
+© 2016 and later: Unicode, Inc. and others.
+Copyright (C) 2004-2015, International Business Machines Corporation and others.
+Copyright 2023 The Vitess Authors.
+
+This file contains code derived from the Unicode Project's ICU library.
+License & terms of use for the original code: http://www.unicode.org/copyright.html
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package icuregex_test
+
+import (
+ "bufio"
+ "errors"
+ "fmt"
+ "io"
+ "os"
+ "regexp"
+ "strconv"
+ "strings"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "vitess.io/vitess/go/mysql/icuregex"
+ "vitess.io/vitess/go/mysql/icuregex/internal/pattern"
+)
+
+var ErrSkip = errors.New("ignored test")
+
+type Matcher int8
+
+const (
+ FuncFind Matcher = iota
+ FuncMatches
+ FuncLookingAt
+)
+
+type Expectation int8
+
+const (
+ Unknown Expectation = iota
+ Expected
+ NotExpected
+)
+
+type TestPattern struct {
+ Line string
+ Lineno int
+
+ Pattern string
+ Flags icuregex.RegexpFlag
+ Options struct {
+ MatchFunc Matcher
+ FindCount int
+ MatchOnly bool
+ MustError bool
+ Dump bool
+ HitEnd Expectation
+ RequireEnd Expectation
+ }
+ Input string
+ Groups []TestGroup
+}
+
+type TestGroup struct {
+ Start, End int
+}
+
+var parsePattern = regexp.MustCompile(`<(/?)(r|[0-9]+)>`)
+
+func (tp *TestPattern) parseFlags(line string) (string, error) {
+ for len(line) > 0 {
+ switch line[0] {
+ case '"', '\'', '/':
+ return line, nil
+ case ' ', '\t':
+ case 'i':
+ tp.Flags |= icuregex.CaseInsensitive
+ case 'x':
+ tp.Flags |= icuregex.Comments
+ case 's':
+ tp.Flags |= icuregex.DotAll
+ case 'm':
+ tp.Flags |= icuregex.Multiline
+ case 'e':
+ tp.Flags |= icuregex.ErrorOnUnknownEscapes
+ case 'D':
+ tp.Flags |= icuregex.UnixLines
+ case 'Q':
+ tp.Flags |= icuregex.Literal
+ case '2', '3', '4', '5', '6', '7', '8', '9':
+ tp.Options.FindCount = int(line[0] - '0')
+ case 'G':
+ tp.Options.MatchOnly = true
+ case 'E':
+ tp.Options.MustError = true
+ case 'd':
+ tp.Options.Dump = true
+ case 'L':
+ tp.Options.MatchFunc = FuncLookingAt
+ case 'M':
+ tp.Options.MatchFunc = FuncMatches
+ case 'v':
+ tp.Options.MustError = !icuregex.BreakIteration
+ case 'a', 'b':
+ return "", ErrSkip
+ case 'z':
+ tp.Options.HitEnd = Expected
+ case 'Z':
+ tp.Options.HitEnd = NotExpected
+ case 'y':
+ tp.Options.RequireEnd = Expected
+ case 'Y':
+ tp.Options.RequireEnd = NotExpected
+ default:
+ return "", fmt.Errorf("unexpected modifier '%c'", line[0])
+ }
+ line = line[1:]
+ }
+ return "", io.ErrUnexpectedEOF
+}
+
+func (tp *TestPattern) parseMatch(orig string) error {
+ input, ok := pattern.Unescape(orig)
+ if !ok {
+ return fmt.Errorf("failed to unquote input: %s", orig)
+ }
+
+ var detagged []rune
+ var last int
+
+ m := parsePattern.FindAllStringSubmatchIndex(input, -1)
+ for _, g := range m {
+ detagged = append(detagged, []rune(input[last:g[0]])...)
+ last = g[1]
+
+ closing := input[g[2]:g[3]] == "/"
+ groupNum := input[g[4]:g[5]]
+ if groupNum == "r" {
+ return ErrSkip
+ }
+ num, err := strconv.Atoi(groupNum)
+ if err != nil {
+ return fmt.Errorf("bad group number %q: %w", groupNum, err)
+ }
+
+ if num >= len(tp.Groups) {
+ grp := make([]TestGroup, num+1)
+ for i := range grp {
+ grp[i].Start = -1
+ grp[i].End = -1
+ }
+ copy(grp, tp.Groups)
+ tp.Groups = grp
+ }
+
+ if closing {
+ tp.Groups[num].End = len(detagged)
+ } else {
+ tp.Groups[num].Start = len(detagged)
+ }
+ }
+
+ detagged = append(detagged, []rune(input[last:])...)
+ tp.Input = string(detagged)
+ return nil
+}
+
+func ParseTestFile(t testing.TB, filename string) []TestPattern {
+ f, err := os.Open(filename)
+ require.NoError(t, err)
+
+ defer f.Close()
+ scanner := bufio.NewScanner(f)
+ var lineno int
+ var patterns []TestPattern
+
+ errFunc := func(err error) {
+ if err == ErrSkip {
+ return
+ }
+ t.Errorf("Parse error: %v\n%03d: %s", err, lineno, scanner.Text())
+ }
+
+ for scanner.Scan() {
+ lineno++
+ line := scanner.Text()
+ line = strings.TrimSpace(line)
+
+ if len(line) == 0 || line[0] == '#' {
+ continue
+ }
+
+ var tp TestPattern
+ tp.Line = line
+ tp.Lineno = lineno
+
+ idx := strings.IndexByte(line[1:], line[0])
+
+ tp.Pattern = line[1 : idx+1]
+ line, err = tp.parseFlags(line[idx+2:])
+ if err != nil {
+ errFunc(err)
+ continue
+ }
+
+ idx = strings.IndexByte(line[1:], line[0])
+ err = tp.parseMatch(line[1 : idx+1])
+ if err != nil {
+ errFunc(err)
+ continue
+ }
+
+ patterns = append(patterns, tp)
+ }
+
+ err = scanner.Err()
+ require.NoError(t, err)
+ return patterns
+}
+
+func (tp *TestPattern) fail(t testing.TB, msg string, args ...any) bool {
+ t.Helper()
+ msg = fmt.Sprintf(msg, args...)
+ t.Errorf("%s (in line %d)\nregexp: %s\ninput: %q\noriginal: %s", msg, tp.Lineno, tp.Pattern, tp.Input, tp.Line)
+ return false
+}
+
+func (tp *TestPattern) Test(t testing.TB) bool {
+ re, err := func() (re *icuregex.Pattern, err error) {
+ defer func() {
+ if r := recover(); r != nil {
+ err = fmt.Errorf("PANIC: %v", r)
+ }
+ }()
+ re, err = icuregex.CompileString(tp.Pattern, tp.Flags)
+ return
+ }()
+ if err != nil {
+ if tp.Options.MustError {
+ return true
+ }
+
+ return tp.fail(t, "unexpected parser failure: %v", err)
+ }
+ if tp.Options.MustError {
+ return tp.fail(t, "parse failure expected")
+ }
+
+ matcher := re.Match(tp.Input)
+ var isMatch bool
+ var findCount = tp.Options.FindCount
+ if findCount == 0 {
+ findCount = 1
+ }
+
+ for i := 0; i < findCount; i++ {
+ isMatch, err = func() (bool, error) {
+ defer func() {
+ if r := recover(); r != nil {
+ tp.fail(t, "unexpected match failure: %v", r)
+ }
+ }()
+ switch tp.Options.MatchFunc {
+ case FuncMatches:
+ return matcher.Matches()
+ case FuncLookingAt:
+ return matcher.LookingAt()
+ case FuncFind:
+ return matcher.Find()
+ default:
+ panic("invalid MatchFunc")
+ }
+ }()
+ }
+
+ require.NoError(t, err)
+
+ if !isMatch && len(tp.Groups) > 0 {
+ return tp.fail(t, "Match expected, but none found.")
+ }
+ if isMatch && len(tp.Groups) == 0 {
+ return tp.fail(t, "No match expected, but found one at position %d", matcher.Start())
+ }
+ if tp.Options.MatchOnly {
+ return true
+ }
+
+ for i := 0; i < matcher.GroupCount(); i++ {
+ expectedStart := -1
+ expectedEnd := -1
+
+ if i < len(tp.Groups) {
+ expectedStart = tp.Groups[i].Start
+ expectedEnd = tp.Groups[i].End
+ }
+ if gotStart := matcher.StartForGroup(i); gotStart != expectedStart {
+ return tp.fail(t, "Incorrect start position for group %d. Expected %d, got %d", i, expectedStart, gotStart)
+ }
+ if gotEnd := matcher.EndForGroup(i); gotEnd != expectedEnd {
+ return tp.fail(t, "Incorrect end position for group %d. Expected %d, got %d", i, expectedEnd, gotEnd)
+ }
+ }
+
+ if matcher.GroupCount()+1 < len(tp.Groups) {
+ return tp.fail(t, "Expected %d capture groups, found %d", len(tp.Groups)-1, matcher.GroupCount())
+ }
+
+ if tp.Options.HitEnd == Expected && !matcher.HitEnd() {
+ return tp.fail(t, "HitEnd() returned false. Expected true")
+ }
+ if tp.Options.HitEnd == NotExpected && matcher.HitEnd() {
+ return tp.fail(t, "HitEnd() returned true. Expected false")
+ }
+
+ if tp.Options.RequireEnd == Expected && !matcher.RequireEnd() {
+ return tp.fail(t, "RequireEnd() returned false. Expected true")
+ }
+ if tp.Options.RequireEnd == NotExpected && matcher.RequireEnd() {
+ return tp.fail(t, "RequireEnd() returned true. Expected false")
+ }
+
+ return true
+}
+
+func TestICU(t *testing.T) {
+ pats := ParseTestFile(t, "testdata/regextst.txt")
+
+ var valid int
+
+ for _, p := range pats {
+ if p.Test(t) {
+ valid++
+ }
+ }
+
+ t.Logf("%d/%d (%.02f)", valid, len(pats), float64(valid)/float64(len(pats)))
+}
+
+func TestICUExtended(t *testing.T) {
+ // This tests additional cases that aren't covered in the
+ // copied ICU test suite.
+ pats := ParseTestFile(t, "testdata/regextst_extended.txt")
+
+ var valid int
+
+ for _, p := range pats {
+ if p.Test(t) {
+ valid++
+ }
+ }
+
+ t.Logf("%d/%d (%.02f)", valid, len(pats), float64(valid)/float64(len(pats)))
+}
+
+func TestCornerCases(t *testing.T) {
+ var cases = []struct {
+ Pattern string
+ Input string
+ Flags icuregex.RegexpFlag
+ Match bool
+ }{
+ {`xyz$`, "xyz\n", 0, true},
+ {`a*+`, "abbxx", 0, true},
+ {`(ABC){1,2}+ABC`, "ABCABCABC", 0, true},
+ {`(ABC){2,3}+ABC`, "ABCABCABC", 0, false},
+ {`(abc)*+a`, "abcabcabc", 0, false},
+ {`(abc)*+a`, "abcabcab", 0, true},
+ {`a\N{LATIN SMALL LETTER B}c`, "abc", 0, true},
+ {`a.b`, "a\rb", icuregex.UnixLines, true},
+ {`a.b`, "a\rb", 0, false},
+ {`(?d)abc$`, "abc\r", 0, false},
+ {`[ \b]`, "b", 0, true},
+ {`[abcd-\N{LATIN SMALL LETTER G}]+`, "xyz-abcdefghij-", 0, true},
+ {`[[abcd]&&[ac]]+`, "bacacd", 0, true},
+ }
+
+ for _, tc := range cases {
+ t.Run(tc.Pattern, func(t *testing.T) {
+ _, err := icuregex.CompileString(tc.Pattern, tc.Flags)
+ require.NoError(t, err)
+ })
+ }
+}
+
+func TestOne(t *testing.T) {
+ const Pattern = `\p{CaseIgnorable}`
+ const Input = "foo.bar"
+ const Flags = 0
+
+ re, err := icuregex.CompileString(Pattern, Flags)
+ require.NoError(t, err)
+
+ re.Dump(os.Stderr)
+
+ m := icuregex.NewMatcher(re)
+ m.Dumper(os.Stderr)
+ m.ResetString(Input)
+ found, err := m.Find()
+ require.NoError(t, err)
+ t.Logf("match = %v", found)
+}
diff --git a/go/mysql/icuregex/internal/bytestrie/bytes_trie.go b/go/mysql/icuregex/internal/bytestrie/bytes_trie.go
new file mode 100644
index 00000000000..aff80dc3e69
--- /dev/null
+++ b/go/mysql/icuregex/internal/bytestrie/bytes_trie.go
@@ -0,0 +1,354 @@
+/*
+© 2016 and later: Unicode, Inc. and others.
+Copyright (C) 2004-2015, International Business Machines Corporation and others.
+Copyright 2023 The Vitess Authors.
+
+This file contains code derived from the Unicode Project's ICU library.
+License & terms of use for the original code: http://www.unicode.org/copyright.html
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package bytestrie
+
+type BytesTrie struct {
+ pos []byte
+ original []byte
+ remainingMatchLength int32
+}
+
+func New(pos []byte) BytesTrie {
+ return BytesTrie{pos: pos, original: pos, remainingMatchLength: -1}
+}
+
+type result int32
+
+const ( /**
+ * The input unit(s) did not continue a matching string.
+ * Once current()/next() return NO_MATCH,
+ * all further calls to current()/next() will also return NO_MATCH,
+ * until the trie is reset to its original state or to a saved state.
+ * @stable ICU 4.8
+ */
+ noMatch result = iota
+ /**
+ * The input unit(s) continued a matching string
+ * but there is no value for the string so far.
+ * (It is a prefix of a longer string.)
+ * @stable ICU 4.8
+ */
+ noValue
+ /**
+ * The input unit(s) continued a matching string
+ * and there is a value for the string so far.
+ * This value will be returned by getValue().
+ * No further input byte/unit can continue a matching string.
+ * @stable ICU 4.8
+ */
+ finalValue
+ /**
+ * The input unit(s) continued a matching string
+ * and there is a value for the string so far.
+ * This value will be returned by getValue().
+ * Another input byte/unit can continue a matching string.
+ * @stable ICU 4.8
+ */
+ intermediateValue
+)
+
+const (
+ maxBranchLinearSubNodeLength = 5
+
+ // 10..1f: Linear-match node, match 1..16 bytes and continue reading the next node.
+ minLinearMatch = 0x10
+ maxLinearMatchLength = 0x10
+
+ // 20..ff: Variable-length value node.
+ // If odd, the value is final. (Otherwise, intermediate value or jump delta.)
+ // Then shift-right by 1 bit.
+ // The remaining lead byte value indicates the number of following bytes (0..4)
+ // and contains the value's top bits.
+ minValueLead = minLinearMatch + maxLinearMatchLength // 0x20
+ // It is a final value if bit 0 is set.
+ valueIsFinal = 1
+
+ // Compact value: After testing bit 0, shift right by 1 and then use the following thresholds.
+ minOneByteValueLead = minValueLead / 2 // 0x10
+ maxOneByteValue = 0x40 // At least 6 bits in the first byte.
+
+ minTwoByteValueLead = minOneByteValueLead + maxOneByteValue + 1 // 0x51
+ maxTwoByteValue = 0x1aff
+ minThreeByteValueLead = minTwoByteValueLead + (maxTwoByteValue >> 8) + 1 // 0x6c
+ fourByteValueLead = 0x7e
+
+ // Compact delta integers.
+ maxOneByteDelta = 0xbf
+ minTwoByteDeltaLead = maxOneByteDelta + 1 // 0xc0
+ minThreeByteDeltaLead = 0xf0
+ fourByteDeltaLead = 0xfe
+)
+
+func (bt *BytesTrie) ContainsName(name string) bool {
+ result := noValue
+ for _, c := range []byte(name) {
+ if 'A' <= c && c <= 'Z' {
+ c += 'a' - 'A'
+ }
+ if c == 0x2d || c == 0x5f || c == 0x20 || (0x09 <= c && c <= 0x0d) {
+ continue
+ }
+ if result&1 == 0 {
+ return false
+ }
+ result = bt.next(int32(c))
+ }
+ return result >= finalValue
+}
+
+func (bt *BytesTrie) next(inByte int32) result {
+ pos := bt.pos
+ if pos == nil {
+ return noMatch
+ }
+ if inByte < 0 {
+ inByte += 0x100
+ }
+ length := bt.remainingMatchLength // Actual remaining match length minus 1.
+ if length >= 0 {
+ match := inByte == int32(pos[0])
+ pos = pos[1:]
+ // Remaining part of a linear-match node.
+ if match {
+ length = length - 1
+ bt.remainingMatchLength = length
+ bt.pos = pos
+ if length < 0 {
+ node := int32(pos[0])
+ if node >= minValueLead {
+ return bt.valueResult(node)
+ }
+ }
+ return noValue
+ }
+ bt.stop()
+ return noMatch
+ }
+ return bt.nextImpl(pos, inByte)
+}
+
+func (bt *BytesTrie) nextImpl(pos []byte, inByte int32) result {
+ for {
+ node := int32(pos[0])
+ pos = pos[1:]
+ if node < minLinearMatch {
+ return bt.branchNext(pos, node, inByte)
+ } else if node < minValueLead {
+ // Match the first of length+1 bytes.
+ length := node - minLinearMatch // Actual match length minus 1.
+ match := inByte == int32(pos[0])
+ pos = pos[1:]
+ if match {
+ length = length - 1
+ bt.remainingMatchLength = length
+ bt.pos = pos
+ if length < 0 {
+ node = int32(pos[0])
+ if node >= minValueLead {
+ return bt.valueResult(node)
+ }
+ }
+ return noValue
+ }
+ // No match.
+ break
+ } else if (node & valueIsFinal) != 0 {
+ // No further matching bytes.
+ break
+ } else {
+ // Skip intermediate value.
+ pos = bt.skipValue2(pos, node)
+ // The next node must not also be a value node.
+ }
+ }
+ bt.stop()
+ return noMatch
+}
+
+func (bt *BytesTrie) stop() {
+ bt.pos = nil
+}
+
+func (bt *BytesTrie) valueResult(node int32) result {
+ return intermediateValue - result(node&valueIsFinal)
+}
+
+func (bt *BytesTrie) branchNext(pos []byte, length int32, inByte int32) result {
+ // Branch according to the current unit.
+ if length == 0 {
+ length = int32(pos[0])
+ pos = pos[1:]
+ }
+ length++
+ // The length of the branch is the number of units to select from.
+ // The data structure encodes a binary search.
+ for length > maxBranchLinearSubNodeLength {
+ p := int32(pos[0])
+ pos = pos[1:]
+ if inByte < p {
+ length >>= 1
+ pos = bt.jumpByDelta(pos)
+ } else {
+ length = length - (length >> 1)
+ pos = bt.skipDelta(pos)
+ }
+ }
+ // Drop down to linear search for the last few bytes.
+ // length>=2 because the loop body above sees length>kMaxBranchLinearSubNodeLength>=3
+ // and divides length by 2.
+ for {
+ p := int32(pos[0])
+ pos = pos[1:]
+ if inByte == p {
+ var result result
+ node := int32(pos[0])
+ if (node & valueIsFinal) != 0 {
+ // Leave the final value for getValue() to read.
+ result = finalValue
+ } else {
+ // Use the non-final value as the jump delta.
+ pos = pos[1:]
+ // int32_t delta=readValue(pos, node>>1);
+ node >>= 1
+ var delta int32
+ if node < minTwoByteValueLead {
+ delta = node - minOneByteValueLead
+ } else if node < minThreeByteValueLead {
+ delta = ((node - minTwoByteValueLead) << 8) | int32(pos[0])
+ pos = pos[1:]
+ } else if node < fourByteValueLead {
+ delta = ((node - minThreeByteValueLead) << 16) | (int32(pos[0]) << 8) | int32(pos[1])
+ pos = pos[2:]
+ } else if node == fourByteValueLead {
+ delta = (int32(pos[0]) << 16) | (int32(pos[1]) << 8) | int32(pos[2])
+ pos = pos[3:]
+ } else {
+ delta = (int32(pos[0]) << 24) | (int32(pos[1]) << 16) | (int32(pos[2]) << 8) | int32(pos[3])
+ pos = pos[4:]
+ }
+ // end readValue()
+ pos = pos[delta:]
+ node = int32(pos[0])
+ if node >= minValueLead {
+ result = bt.valueResult(node)
+ } else {
+ result = noValue
+ }
+ }
+ bt.pos = pos
+ return result
+ }
+ length--
+ pos = bt.skipValue1(pos)
+ if length <= 1 {
+ break
+ }
+ }
+ p := int32(pos[0])
+ pos = pos[1:]
+ if inByte == p {
+ bt.pos = pos
+ node := int32(pos[0])
+ if node >= minValueLead {
+ return bt.valueResult(node)
+ }
+ return noValue
+ }
+ bt.stop()
+ return noMatch
+}
+
+func (bt *BytesTrie) skipValue1(pos []byte) []byte {
+ leadByte := int32(pos[0])
+ return bt.skipValue2(pos[1:], leadByte)
+}
+
+func (bt *BytesTrie) skipValue2(pos []byte, leadByte int32) []byte {
+ if leadByte >= (minTwoByteValueLead << 1) {
+ if leadByte < (minThreeByteValueLead << 1) {
+ pos = pos[1:]
+ } else if leadByte < (fourByteValueLead << 1) {
+ pos = pos[2:]
+ } else {
+ pos = pos[3+((leadByte>>1)&1):]
+ }
+ }
+ return pos
+}
+
+func (bt *BytesTrie) skipDelta(pos []byte) []byte {
+ delta := int32(pos[0])
+ pos = pos[1:]
+ if delta >= minTwoByteDeltaLead {
+ if delta < minThreeByteDeltaLead {
+ pos = pos[1:]
+ } else if delta < fourByteDeltaLead {
+ pos = pos[2:]
+ } else {
+ pos = pos[3+(delta&1):]
+ }
+ }
+ return pos
+}
+
+func (bt *BytesTrie) jumpByDelta(pos []byte) []byte {
+ delta := int32(pos[0])
+ pos = pos[1:]
+ if delta < minTwoByteDeltaLead {
+ // nothing to do
+ } else if delta < minThreeByteDeltaLead {
+ delta = ((delta - minTwoByteDeltaLead) << 8) | int32(pos[0])
+ pos = pos[1:]
+ } else if delta < fourByteDeltaLead {
+ delta = ((delta - minThreeByteDeltaLead) << 16) | (int32(pos[0]) << 8) | int32(pos[1])
+ pos = pos[2:]
+ } else if delta == fourByteDeltaLead {
+ delta = (int32(pos[0]) << 16) | (int32(pos[1]) << 8) | int32(pos[2])
+ pos = pos[3:]
+ } else {
+ delta = (int32(pos[0]) << 24) | (int32(pos[1]) << 16) | (int32(pos[2]) << 8) | int32(pos[3])
+ pos = pos[4:]
+ }
+ return pos[delta:]
+}
+
+func (bt *BytesTrie) GetValue() int32 {
+ pos := bt.pos
+ leadByte := int32(pos[0])
+ return bt.readValue(pos[1:], leadByte>>1)
+}
+
+func (bt *BytesTrie) readValue(pos []byte, leadByte int32) int32 {
+ var value int32
+ if leadByte < minTwoByteValueLead {
+ value = leadByte - minOneByteValueLead
+ } else if leadByte < minThreeByteValueLead {
+ value = ((leadByte - minTwoByteValueLead) << 8) | int32(pos[0])
+ } else if leadByte < fourByteValueLead {
+ value = ((leadByte - minThreeByteValueLead) << 16) | (int32(pos[0]) << 8) | int32(pos[1])
+ } else if leadByte == fourByteValueLead {
+ value = (int32(pos[0]) << 16) | (int32(pos[1]) << 8) | int32(pos[2])
+ } else {
+ value = (int32(pos[0]) << 24) | (int32(pos[1]) << 16) | (int32(pos[2]) << 8) | int32(pos[3])
+ }
+ return value
+}
diff --git a/go/mysql/icuregex/internal/icudata/README.md b/go/mysql/icuregex/internal/icudata/README.md
new file mode 100644
index 00000000000..070633b555e
--- /dev/null
+++ b/go/mysql/icuregex/internal/icudata/README.md
@@ -0,0 +1,46 @@
+# ICU data files
+
+These are files copied from the ICU project that contain various types
+of data, like character properties.
+
+## How to update
+
+Not all data files are immediately available in the source code, but
+need to be built first. This applies to the character / word break
+tables.
+
+### Copy from source data
+
+The `icu4c/source/data/in` directory in the source distribution contains
+the following ICU data files we use:
+
+```
+pnames.icu
+ubidi.icu
+ucase.icu
+unames.icu
+ulayout.icu
+uprops.icu
+nfc.nrm
+nfkc.nrm
+nfkc_cf.nrm
+```
+
+The character and word break table need to be compiled before they can
+be copied.
+
+In `icu4c/source` run:
+
+```bash
+./configure --with-data-packaging=files
+make
+```
+
+This will compile the character and word break data into a binary file
+that we can use. Once built, the following files we use are available in
+`icu4c/source/data/out/build/icudt |