Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1f73f1a
chore: move backend-neutral store helpers into storesql
ricardonunez-io Oct 3, 2026
20d3452
chore: make the authz transaction handoff backend-neutral
ricardonunez-io Oct 3, 2026
5294eed
feat: add a mysql store backend compatible with planetscale vitess
ricardonunez-io Oct 3, 2026
bdaa49a
feat: select the postgres or mysql store backend in ateapi
ricardonunez-io Oct 3, 2026
3e4b8cf
feat: configure an external mysql store in ate-setup and the ateapi m…
ricardonunez-io Oct 3, 2026
8a6d421
chore: test and verify the mysql store in ci
ricardonunez-io Oct 3, 2026
ffbf180
fix: retry mysql deadlocks, make mysql migrations rerunnable, and mat…
ricardonunez-io Oct 3, 2026
1c4c378
fix: reject access policy members wider than the openfga mysql tuple …
ricardonunez-io Oct 3, 2026
4060e68
chore: run the access policy governance test on both store backends
ricardonunez-io Oct 3, 2026
23eb4ea
chore: document the mysql store backend
ricardonunez-io Oct 3, 2026
fddde67
fix: find the goose migration ledger on vitess and reject mariadb
ricardonunez-io Oct 3, 2026
37aa0e9
chore: set mysql read committed isolation once per session
ricardonunez-io Oct 3, 2026
cb91da8
chore: cover mysql-specific store behavior in atemy tests
ricardonunez-io Oct 3, 2026
89e6336
chore: test the mysql store through vitess in ci and document its limits
ricardonunez-io Oct 3, 2026
fce6001
fix: keep 512-character policy members on postgres and cap them at 25…
ricardonunez-io Oct 3, 2026
7a82b2c
feat: forward mysql tls file paths from ate-setup like postgres dsn c…
ricardonunez-io Oct 3, 2026
b9719ee
fix: stop serializing mysql worker writes by tracking outbox seq gaps…
ricardonunez-io Oct 3, 2026
04e08d8
fix: align mysql owner dsn, init lock, logging, and pool validation w…
ricardonunez-io Oct 3, 2026
322b59b
fix: match atepg outbox, retention, lock timeout, and schema guards m…
ricardonunez-io Oct 3, 2026
05e45d9
chore: document the mysql outbox, startup checks, and installer tls p…
ricardonunez-io Oct 3, 2026
7d8a82b
fix: probe rolled-back mysql outbox seqs before advancing the watch c…
ricardonunez-io Oct 3, 2026
e39f1f8
fix: run mysql session checks on the read/write pool that issues writes
ricardonunez-io Oct 3, 2026
c7134ce
chore: share the actor template validator and return mysql list error…
ricardonunez-io Oct 3, 2026
b06f4d3
chore: use one openfga transactional datastore for both backends and …
ricardonunez-io Oct 3, 2026
14d0ac8
chore: replace per-backend pool size flags with --store-pool-max-conn…
ricardonunez-io Oct 3, 2026
6002fc3
fix: fail the vitess ci step when TestVitess does not run
ricardonunez-io Oct 3, 2026
eff749e
fix: retry mysql deadlock victims up to 5 times with exponential backoff
ricardonunez-io Oct 3, 2026
a158cf1
fix: release mysql leases by expiring the row so acquirers take it ov…
ricardonunez-io Oct 3, 2026
19cbc6a
chore: wait on the mysql openfga init lock with one GET_LOCK call and…
ricardonunez-io Oct 3, 2026
44d699c
chore: share the migration runner and tidy mysql store helpers, error…
ricardonunez-io Oct 3, 2026
1e50dcc
chore: move duplicated store tests into the contract suite and drop l…
ricardonunez-io Oct 3, 2026
4871d3f
chore: log store connect retries with a database attribute and test c…
ricardonunez-io Oct 3, 2026
1c89e40
chore: tidy installer tests, migration verifier, ci step name, and my…
ricardonunez-io Oct 3, 2026
d4877bc
chore: align mysql doc edits with surrounding wrapping, commas, and l…
ricardonunez-io Oct 3, 2026
b63c431
chore: rename the schema evolution doc to match its backend-neutral t…
ricardonunez-io Oct 3, 2026
b3e2fac
chore: restore the cross-kind page token check as a live contract ass…
ricardonunez-io Oct 3, 2026
ad47615
chore: drop comments that restate the code in the mysql backend changes
ricardonunez-io Oct 4, 2026
fa61aa2
chore: merge the sql migration verifiers into one script
ricardonunez-io Oct 4, 2026
01e0c17
chore: simplify the mysql store connector, pools, and helpers
ricardonunez-io Oct 4, 2026
66c4df3
chore: simplify ate-setup server ca handling and trim low-value tests
ricardonunez-io Oct 4, 2026
f8b0d99
chore: drop the authz cross-backend tx guard and one-use helpers
ricardonunez-io Oct 4, 2026
97654ea
chore: shrink authz, contract, and storetest diffs against main
ricardonunez-io Oct 4, 2026
c4af013
chore: drop duplicate and low-value mysql store tests
ricardonunez-io Oct 4, 2026
01b4100
fix: widen the lease ttl in the mysql renewal test so loaded ci runne…
ricardonunez-io Oct 4, 2026
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
20 changes: 18 additions & 2 deletions .github/workflows/pr-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,29 @@ jobs:
go-version-file: 'go.mod'
# Unconditional: a released migration becoming permanent is exactly what
# this guards, and that happens on the push to main, not on the PR.
- name: Verify immutable PostgreSQL migrations
run: hack/verify/postgresql-migrations.sh
- name: Verify immutable SQL migrations
run: hack/verify/sql-migrations.sh
# gotestsum wraps go test to emit JUnit; the go test arguments are unchanged.
- name: unit tests
run: hack/run-tool.sh gotestsum --junitfile "${ARTIFACTS}/unit.xml"
--jsonfile "${ARTIFACTS}/unit.json" --format standard-verbose
-- -race -v ./...
# The unit tests above run the store-backed control plane suites on
# PostgreSQL; rerun them on MySQL. atemy's own tests already ran above.
- name: MySQL control plane tests
env:
ATE_TEST_STORE_BACKEND: mysql
run: hack/run-tool.sh gotestsum --junitfile "${ARTIFACTS}/unit-mysql.xml"
--jsonfile "${ARTIFACTS}/unit-mysql.json" --format standard-verbose
-- -race -v ./cmd/ateapi/internal/controlapi/... ./cmd/ateapi/internal/workerservice/...
# PlanetScale serves MySQL through Vitess, which rejects or rewrites some
# statements plain MySQL accepts. The vitess build tag keeps the large
# amd64-only vttestserver image out of the default test run.
- name: Vitess store tests
run: hack/run-tool.sh gotestsum --junitfile "${ARTIFACTS}/unit-vitess.xml"
--jsonfile "${ARTIFACTS}/unit-vitess.json" --format standard-verbose
-- -race -v -tags vitess -run '^TestVitess$' ./cmd/ateapi/internal/store/atemy/
&& grep -q '"Action":"pass".*"Test":"TestVitess"' "${ARTIFACTS}/unit-vitess.json"
# tools/apitool has its own module so we need to run it explicitly.
# run-tool.sh resolves the repo root itself, so it works from the subdir.
- name: apitool tests
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ See the [metric registry](docs/observability.md#the-metric-registry) section of
3. Run `make verify` locally before requesting a code review to catch common issues like missed copyright headers or formatting drift.
4. For end-to-end tests involving the actual infrastructure, ensure you have a running cluster (setup via `hack/ate-dev-env.sh.example` and `go run ./tools/setup-gcp bootstrap`).
5. A test that skips when a precondition is missing — Docker, a cluster, an artifact directory — must **fail** on it in CI, because a skip and a pass are the same exit code. Resolve strictness through a named predicate rather than an inline `os.Getenv("CI")`; `cmd/ateapi/internal/store/dockerenv.Required()` is the reference implementation. Prove the strict branch red before merging: a guard only ever observed passing is not known to guard anything. See `docs/dev/best-practices/ci-fail-closed.md`.
6. The store has a PostgreSQL backend (`cmd/ateapi/internal/store/atepg`) and a MySQL backend (`cmd/ateapi/internal/store/atemy`). Make every store or schema change in both, following `docs/dev/schema-evolution.md`. Store-backed suites use PostgreSQL by default; run them with `ATE_TEST_STORE_BACKEND=mysql` too, as CI does for `./cmd/ateapi/internal/controlapi/...` and `./cmd/ateapi/internal/workerservice/...`.

## Security Considerations

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ for this purpose.
All code changes should be accompanied by tests. We will not merge code that
does not have tests, and we will not merge code that causes tests to fail.

Follow the [PostgreSQL schema evolution rules](docs/dev/postgresql-schema-evolution.md) for each application schema change.
Follow the [schema evolution rules](docs/dev/schema-evolution.md) for each application schema change. Make each change in both the PostgreSQL and MySQL migrations.

Each pull request title becomes its line in the [release notes](docs/dev/release-notes.md).

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ go run ./tools/setup-gcp create bucket

To run the PostgreSQL store backend on Cloud SQL — with IAM database
authentication and no passwords — see [tools/setup-gcp/cloud-sql.md](tools/setup-gcp/cloud-sql.md).
To use an external MySQL 8.0+ or PlanetScale database instead, see [docs/mysql.md](docs/mysql.md).

Similarly, you can deploy or cleanup specific Agent Substrate components using the installation script. See `./hack/install-ate.sh --help` for all options.
```bash
Expand Down
27 changes: 27 additions & 0 deletions _LICENSES/filippo.io/edwards25519/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2009 The Go Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 changes: 23 additions & 0 deletions _LICENSES/github.com/go-sql-driver/mysql/.github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing Guidelines

## Reporting Issues

Before creating a new Issue, please check first if a similar Issue [already exists](https://github.com/go-sql-driver/mysql/issues?state=open) or was [recently closed](https://github.com/go-sql-driver/mysql/issues?direction=desc&page=1&sort=updated&state=closed).

## Contributing Code

By contributing to this project, you share your code under the Mozilla Public License 2, as specified in the LICENSE file.
Don't forget to add yourself to the AUTHORS file.

### Code Review

Everyone is invited to review and comment on pull requests.
If it looks fine to you, comment with "LGTM" (Looks good to me).

If changes are required, notice the reviewers with "PTAL" (Please take another look) after committing the fixes.

Before merging the Pull Request, at least one [team member](https://github.com/go-sql-driver?tab=members) must have commented with "LGTM".

## Development Ideas

If you are looking for ideas for code contributions, please check our [Development Ideas](https://github.com/go-sql-driver/mysql/wiki/Development-Ideas) Wiki page.
21 changes: 21 additions & 0 deletions _LICENSES/github.com/go-sql-driver/mysql/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### Issue description
Tell us what should happen and what happens instead

### Example code
```go
If possible, please enter some example code here to reproduce the issue.
```

### Error log
```
If you have an error log, please paste it here.
```

### Configuration
*Driver version (or git SHA):*

*Go version:* run `go version` in your console

*Server version:* E.g. MySQL 5.6, MariaDB 10.0.20

*Server OS:* E.g. Debian 8.1 (Jessie), Windows 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Description
Please explain the changes you made here.

### Checklist
- [ ] Code compiles correctly
- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the README / documentation, if necessary
- [ ] Added myself / the copyright holder to the AUTHORS file
24 changes: 24 additions & 0 deletions _LICENSES/github.com/go-sql-driver/mysql/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
groups:
all-dependencies:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
all-dependencies:
patterns:
- "*"
118 changes: 118 additions & 0 deletions _LICENSES/github.com/go-sql-driver/mysql/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: test
on:
pull_request:
push:
workflow_dispatch:

env:
MYSQL_TEST_USER: gotest
MYSQL_TEST_PASS: secret
MYSQL_TEST_ADDR: 127.0.0.1:3306
MYSQL_TEST_CONCURRENT: 1

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dominikh/staticcheck-action@9716614d4101e79b4340dd97b10e54d68234e431 # v1.4.1

list:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: list
id: set-matrix
run: |
import json
import os
go = [
# Keep the most recent production release at the top
'1.26',
# Older production releases
'1.25',
'1.24',
]
mysql = [
'9.0',
'8.4', # LTS
'8.0',
'5.7',
'mariadb-12.3', # LTS
'mariadb-11.8', # LTS
'mariadb-11.4', # LTS
'mariadb-10.11', # LTS
'mariadb-10.6', # LTS
'mariadb-10.5', # LTS
]

includes = []
# Go versions compatibility check
for v in go[1:]:
includes.append({'os': 'ubuntu-latest', 'go': v, 'mysql': mysql[0]})

matrix = {
# OS vs MySQL versions
'os': [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ],
'go': [ go[0] ],
'mysql': mysql,

'include': includes
}
output = json.dumps(matrix, separators=(',', ':'))
with open(os.environ["GITHUB_OUTPUT"], 'a', encoding="utf-8") as f:
print(f"matrix={output}", file=f)
shell: python
test:
needs: list
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.list.outputs.matrix) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ matrix.go }}
- uses: shogo82148/actions-setup-mysql@62da9377d83991fce27b6ed2a397d3306121e41d # v1.53.1
with:
mysql-version: ${{ matrix.mysql }}
user: ${{ env.MYSQL_TEST_USER }}
password: ${{ env.MYSQL_TEST_PASS }}
my-cnf: |
innodb_log_file_size=256MB
innodb_buffer_pool_size=512MB
max_allowed_packet=48MB
; TestConcurrent fails if max_connections is too large
max_connections=50
local_infile=1
performance_schema=on
- name: setup database
run: |
mysql --user 'root' --host '127.0.0.1' -e 'create database gotest;'

- name: test
run: |
go test -v '-race' '-covermode=atomic' '-coverprofile=coverage.out' -parallel 10

- name: benchmark
run: |
go test -run '^$' -bench .

- name: Send coverage
uses: shogo82148/actions-goveralls@8781f5dd05b691c4dd042d5e859c11c73e0104fa # v1.11.1
with:
path-to-profile: coverage.out
flag-name: ${{ runner.os }}-Go-${{ matrix.go }}-DB-${{ matrix.mysql }}
parallel: true

# notifies that all test jobs are finished.
finish:
needs: test
if: always()
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@8781f5dd05b691c4dd042d5e859c11c73e0104fa # v1.11.1
with:
parallel-finished: true
9 changes: 9 additions & 0 deletions _LICENSES/github.com/go-sql-driver/mysql/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
.idea
Loading
Loading