Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2026, Oracle and/or its affiliates.
# Temporary default owners for every path. Replace this wildcard with
# path-specific teams as the external committer model rolls out.
* @seemasundara @gopshank
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2026, Oracle and/or its affiliates.
name: Bug report
description: Report incorrect or unexpected server behavior
labels: ["bug", "needs-triage"]
body:
- type: markdown
attributes:
value: |
Security vulnerabilities must **not** be filed here. Report them through
<https://www.oracle.com/corporate/security-practices/assurance/vulnerability/>.
- type: input
id: version
attributes:
label: MySQL version / commit
placeholder: "9.x trunk @ <sha>, or 8.4.x"
validations: { required: true }
- type: textarea
id: repro
attributes:
label: Steps to reproduce
description: Minimal SQL or MTR case if possible.
placeholder: |
CREATE TABLE t (...);
...
validations: { required: true }
- type: textarea
id: expected
attributes:
label: Expected vs actual result
validations: { required: true }
- type: input
id: platform
attributes:
label: Platform / compiler
placeholder: "Ubuntu 24.04, gcc 13"
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2026, Oracle and/or its affiliates.
name: Feature request
description: Propose an enhancement
labels: ["feature-request", "needs-triage"]
body:
- type: textarea
id: problem
attributes:
label: Problem / use case
validations: { required: true }
- type: textarea
id: proposal
attributes:
label: Proposed behavior
validations: { required: true }
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2026, Oracle and/or its affiliates.
<!-- Thanks for contributing to MySQL Server! The prompts below are the few
things reviewers always need. Delete any that don't apply. -->

### What does this change do?

<!-- One or two sentences. Link the issue/bug it fixes: "Fixes #1234" or
"BUG#XXXXXXXX". -->

### Why is it needed?

### How was it tested?

- [ ] Added/updated MTR tests under `mysql-test/`
- [ ] `scripts/ci/mtr.sh` passes locally
- [ ] Ran the relevant full suite (name it): ______

### Contributor checklist

- [ ] I have signed the [OCA](https://oca.opensource.oracle.com) with the email on these commits
- [ ] Code is formatted (`scripts/ci/format.sh`)
- [ ] Commits are focused with descriptive messages

### AI assistance

- [ ] I did not use AI assistance for this contribution
- [ ] I used AI assistance for this contribution

If AI assistance was used, describe the tool(s) and extent of use:

<!-- e.g. brainstorming, code generation, test generation, refactoring, review.
Also mention which parts were human-reviewed or manually verified. -->

### Areas touched

<!-- e.g. innodb, optimizer, replication, client, build. Helps auto-routing. -->
55 changes: 55 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) 2026, Oracle and/or its affiliates.
# Area auto-labels, driven by the paths a PR touches. Keeps triage cheap and
# routes reviews to the right owners (see CODEOWNERS).
#
# Format note: actions/labeler@v5 requires the `changed-files` /
# `any-glob-to-any-file` structure below. The older flat "label: [globs]"
# layout (v4) is NOT compatible with v5 and fails to parse.

"innodb":
- changed-files:
- any-glob-to-any-file: ["storage/innobase/**"]

"optimizer":
- changed-files:
- any-glob-to-any-file:
- "sql/join_optimizer/**"
- "sql/sql_optimizer*"
- "sql/range_optimizer/**"

"replication":
- changed-files:
- any-glob-to-any-file:
- "sql/rpl_*"
- "libbinlogevents/**"
- "plugin/group_replication/**"

"client":
- changed-files:
- any-glob-to-any-file:
- "client/**"
- "libmysql/**"

"pluggable":
- changed-files:
- any-glob-to-any-file:
- "plugin/**"
- "components/**"

"build":
- changed-files:
- any-glob-to-any-file:
- "cmake/**"
- "CMakeLists.txt"
- "scripts/ci/**"
- ".github/**"

"tests":
- changed-files:
- any-glob-to-any-file: ["mysql-test/**"]

"docs":
- changed-files:
- any-glob-to-any-file:
- "docs/**"
- "**/*.md"
116 changes: 116 additions & 0 deletions .github/workflows/assign-codeowners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Copyright (c) 2026, Oracle and/or its affiliates.
name: Assign Code Owners

on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review, labeled]
branches: [trunk]

permissions:
contents: read
issues: write
pull-requests: write

concurrency:
group: assign-codeowners-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
assign:
if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'OCA Verified') }}
runs-on: ubuntu-24.04
steps:
- name: Request review from code owners
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
const codeownersRef = pr.base.sha;
const path = '.github/CODEOWNERS';
const response = await github.rest.repos.getContent({
...context.repo,
path,
ref: codeownersRef,
});
if (Array.isArray(response.data) || response.data.type !== 'file' || !response.data.content) {
throw new Error(`${path} at ${codeownersRef} is not a readable file`);
}
const codeowners = Buffer.from(response.data.content, 'base64').toString('utf8');
const defaultLine = codeowners
.split(/\r?\n/)
.map((line) => line.replace(/\s+#.*$/, '').trim())
.find((line) => line && !line.startsWith('#') && line.split(/\s+/)[0] === '*');
if (!defaultLine) {
throw new Error(`No wildcard owner rule found in ${path} at ${codeownersRef}`);
}
const owners = [...new Set(
defaultLine
.split(/\s+/)
.slice(1)
.filter((owner) => owner.startsWith('@'))
.map((owner) => owner.slice(1))
.filter(Boolean),
)];
if (owners.length === 0) {
throw new Error(`Wildcard rule in ${path} has no GitHub user owners`);
}
const current = await github.rest.pulls.get({
...context.repo,
pull_number: pr.number,
});
const author = pr.user.login.toLowerCase();
const existing = new Set(
current.data.requested_reviewers.map((reviewer) => reviewer.login.toLowerCase()),
);
const eligible = owners.filter((owner) => owner.toLowerCase() !== author);
if (eligible.length === 0) {
throw new Error('No eligible code owners remain after excluding the pull request author');
}
const reviewers = eligible.filter((owner) => !existing.has(owner.toLowerCase()));
let reviewRequestSucceeded = reviewers.length === 0;
if (reviewers.length > 0) {
try {
await github.rest.pulls.requestReviewers({
...context.repo,
pull_number: pr.number,
reviewers,
});
reviewRequestSucceeded = true;
} catch (error) {
// Forks can retain upstream owners that are not collaborators.
// Keep the automation informational in that case.
if (error.status !== 422) throw error;
core.warning(`Could not request reviews: ${error.message}`);
}
}
if (!reviewRequestSucceeded) {
core.info('Skipping the review-request label because no reviewer was assigned.');
return;
}
const label = {
name: 'Review Requested',
color: '1D76DB',
description: 'Review requested from code owners',
};
try {
await github.rest.issues.getLabel({ ...context.repo, name: label.name });
await github.rest.issues.updateLabel({ ...context.repo, ...label });
} catch (error) {
if (error.status !== 404) throw error;
await github.rest.issues.createLabel({ ...context.repo, ...label });
}
await github.rest.issues.addLabels({
...context.repo,
issue_number: pr.number,
labels: [label.name],
});
const assigned = reviewers.length > 0 ? reviewers : eligible;
core.info(`Review requested from ${assigned.map((owner) => `@${owner}`).join(', ')}.`);
72 changes: 72 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copyright (c) 2026, Oracle and/or its affiliates.
name: Format Check
on:
pull_request_target:
branches: [trunk]
paths: ["**/*.c", "**/*.cc", "**/*.cpp", "**/*.h", "**/*.hpp"]

permissions: {}

concurrency:
group: format-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
clang-format:
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Check out PR merge commit
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
fetch-depth: 2
persist-credentials: false
path: source
- name: Verify PR merge commit
working-directory: source
env:
EXPECTED_BASE: ${{ github.event.pull_request.base.sha }}
EXPECTED_HEAD: ${{ github.event.pull_request.head.sha }}
run: |
test "$(git rev-parse HEAD^1)" = "$EXPECTED_BASE"
test "$(git rev-parse HEAD^2)" = "$EXPECTED_HEAD"
- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format-18
# Uses the repository's existing .clang-format — no style is redefined here.
- name: Check formatting of changed files
working-directory: source
run: |
changed=$(git diff --name-only HEAD^1 HEAD | grep -E '\.(c|cc|cpp|h|hpp)$' || true)
[ -z "$changed" ] && { echo "No C/C++ changes."; exit 0; }
fail=0
for f in $changed; do
[ -f "$f" ] || continue
if ! clang-format-18 --style=file --dry-run --Werror "$f"; then fail=1; fi
done
if [ "$fail" -ne 0 ]; then
echo "::error::Run scripts/ci/format.sh to fix formatting."; exit 1
fi

report:
name: Report format result
if: ${{ always() && !cancelled() }}
needs: clang-format
runs-on: ubuntu-24.04
permissions:
statuses: write
steps:
- name: Publish format status on the PR head
uses: actions/github-script@v7
with:
script: |
const passed = '${{ needs.clang-format.result }}' === 'success';
await github.rest.repos.createCommitStatus({
...context.repo,
sha: context.payload.pull_request.head.sha,
state: passed ? 'success' : 'failure',
context: 'Format Check',
description: passed ? 'Formatting check passed' : 'Formatting check failed',
target_url: `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`,
});
Loading
Loading