Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
61578de
style: Rename MysqlError to SqlError as they are generic
Eragonfr Oct 29, 2024
5ca9ed1
feat: Add sqlite as a storage backend
Eragonfr Mar 10, 2024
4165165
feat: Better readme doc for sqlite
Eragonfr Mar 10, 2024
dd022d9
refactor: Shorter lines in markdown
Eragonfr Mar 10, 2024
b492e0c
ci: Add sqlite clippy to CI check
Eragonfr Mar 10, 2024
69e0b2a
docs: Use mysql as default example backend
Eragonfr Apr 6, 2024
63108d8
fix: Add missing Sqlite in Enum
Eragonfr Apr 6, 2024
3debccf
ci: Ignore libsqlite3-sys RUSTSEC-2022-0090 CVE
Eragonfr May 9, 2024
242d082
ci: Explain why RUSTSEC-2022-0090 is ignored
Eragonfr May 12, 2024
ce32ea1
refactor: Add shared crate for common code of SQL backends
Eragonfr Jul 5, 2024
29846b6
refactor: Run cargo fmt
Eragonfr Jul 5, 2024
ba86084
First attempts at getting SQLite + Docker working
bcspragu Aug 9, 2024
2e8ef7d
Seemingly functional SQLite?
bcspragu Aug 9, 2024
bc17c6e
Remove vestigial .dockerignore line
bcspragu Aug 9, 2024
39d508a
Remove unused import
bcspragu Aug 9, 2024
3f34fe6
fix: Error message should mention sqlite feature flag
Eragonfr Aug 11, 2024
6254162
ci: Set features for cargo build
Eragonfr Aug 11, 2024
73a6789
fix: Incorrect URL for tokenserver db pool init
Eragonfr Aug 15, 2024
3f16d47
Run cargo fmt
Eragonfr Aug 15, 2024
84a3007
ci: Enable the correct features in dockerfile
Eragonfr Aug 16, 2024
0c39891
ci: Add sqlite docker & e2e tests
Eragonfr Aug 16, 2024
e8d76dd
ci: Fix identation errors
Eragonfr Aug 16, 2024
e28c433
Remove editor config file
Eragonfr Aug 16, 2024
5703478
ci: I hate tab-based configuration files
Eragonfr Aug 16, 2024
05d2fd4
fix: Pass some SQLite tests for syncstorage
Eragonfr Sep 9, 2024
ce843f5
fix: Run cargo fmt
Eragonfr Sep 11, 2024
e623def
ci: Rename db for e2e tests
Eragonfr Sep 22, 2024
b623b45
refactor: Move tokenserver SQL strings into subcrates
Eragonfr Sep 22, 2024
4411bab
refactor: Add fixme to (some) queries
Eragonfr Oct 19, 2024
8810076
refactor: cargo fmt
Eragonfr Oct 19, 2024
bd33cfa
style: Better readability with spacing
Eragonfr Oct 29, 2024
289714e
refactor: Only include error.rs for sql backends.
Eragonfr Oct 29, 2024
6fa496d
fix: Remove static lifetime from &str
Eragonfr Nov 2, 2024
0fdff46
fix: The cfg check is true if more than one feature is enabled
Eragonfr Nov 2, 2024
f44c55c
feat: Only allow for one database feature to be used for tokenserver
Eragonfr Nov 2, 2024
dcfabd6
fix: Table id should be primary key integer
Eragonfr Nov 6, 2024
36cfcc0
fix: SQLite syntax for some more queries
Eragonfr Nov 6, 2024
4a76f79
fix: replace GREATEST with MAX
Eragonfr Nov 12, 2024
61c1622
fix: Use REMOVE_NODE_SYNC_QUERY to remove node
Eragonfr Nov 13, 2024
e28ad75
ci: Try to fix SQLite e2e tests by closing the db between each transa…
Eragonfr Nov 13, 2024
cff00d9
feat: Put MySQL and Sqlite test connexions behind flag
Eragonfr Nov 20, 2024
fa3c05f
test: Try to open/close database before each transaction
Eragonfr Dec 18, 2024
92e0249
Revert "test: Try to open/close database before each transaction"
Eragonfr Dec 18, 2024
325bcc9
ci: Minimum allowed time for Pool idle time is 1 sec
Eragonfr Jan 2, 2025
0064f01
ci: Add idle_timeout
Eragonfr Jan 2, 2025
b7b23d4
test: Try to open/close database before each transaction
Eragonfr Dec 18, 2024
17283d2
ci: Disable connection pooling for e2e tests
Eragonfr Jan 3, 2025
7ca46a2
feat: Enable WAL mode for SQLite
Eragonfr Feb 12, 2025
d5c0ec4
ci: Set correct URI for sqlite e2e tests
Eragonfr Feb 12, 2025
0e43453
meta: Add Pipfile to gitignore
Eragonfr Feb 12, 2025
35c2f28
test: Use WAL for SQLite e2e tests
Eragonfr Feb 12, 2025
2bad938
refactor: Cargo fmt
Eragonfr Feb 12, 2025
825f3ec
test: Use sqlalchemy.text to prepare query
Eragonfr Feb 12, 2025
ef607d9
test: refactor using black
Eragonfr Feb 12, 2025
b7d1753
test: Works better if you import the correct thing
Eragonfr Feb 12, 2025
cd51640
test: Idk something something use @ instead of :
Eragonfr Feb 12, 2025
edad48f
test: Reformat with lines max length at 80
Eragonfr Feb 12, 2025
1900bfa
feat: Add logging to show Sqlite db path
Eragonfr Mar 1, 2025
0624770
feat: remove third trailing slash in SQLite URIs
Eragonfr Mar 1, 2025
5aded27
refactor: Rename service_id to service in SQL queries
Eragonfr Mar 8, 2025
79390ae
fix: Last insert id for MySQL
Eragonfr Mar 8, 2025
b4e7751
ci: print debug
Eragonfr Mar 8, 2025
92aebbc
test: Replace arbitrary wait with log reading
Eragonfr Mar 9, 2025
fb7ceae
test(WIP): Use SQLalchemy's ORM features for db independant tests
Eragonfr Mar 10, 2025
d5ae91c
fix: Forgot that I replaced @ with : at some point
Eragonfr Mar 19, 2025
d12c315
test: Python formatting
Eragonfr May 1, 2025
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
1 change: 1 addition & 0 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ ignore = [
"RUSTSEC-2024-0365", # Bound by diesel 1.4 (4GB limit n/a to tokenserver)
"RUSTSEC-2024-0421", # Bound by diesel 1.4, `idna` < 0.1.5, Upgrade to >=1.0.0
"RUSTSEC-2024-0437", # Bound by grpcio 0.13,
"RUSTSEC-2022-0090", # Bound by diesel 1.4.8, diesel_migrations 1.4.0, diesel_logger 0.1.1
]
100 changes: 100 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ commands:
- run:
name: Rust Clippy MySQL
command: make clippy_mysql
rust-clippy-sqlite:
steps:
- run:
name: Rust Clippy SQLite
command: make clippy_sqlite
rust-clippy-spanner:
steps:
- run:
Expand Down Expand Up @@ -156,6 +161,20 @@ commands:
environment:
SYNCSTORAGE_RS_IMAGE: app:build

run-sqlite-tests:
steps:
- run:
name: e2e tests (syncstorage sqlite)
command: >
/usr/local/bin/docker-compose
-f docker-compose.sqlite.yaml
-f docker-compose.e2e.sqlite.yaml
up
--exit-code-from sqlite-e2e-tests
--abort-on-container-exit
environment:
SYNCSTORAGE_RS_IMAGE: app:build

run-spanner-tests:
steps:
- run:
Expand Down Expand Up @@ -347,6 +366,42 @@ jobs:
key: mysql-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}-{{ epoch }}
paths:
- /home/circleci/cache

build-sqlite-image:
docker:
- image: cimg/rust:1.86 # RUST_VER
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
resource_class: large
steps:
- setup_remote_docker:
docker_layer_caching: true
- checkout
- display-versions
- write-version
- run:
name: Build SQLite Docker image
command: docker build -t app:build --build-arg DATABASE_BACKEND=sqlite .
no_output_timeout: 30m
# save the built docker container into CircleCI's cache. This is
# required since Workflows do not have the same remote docker instance.
- run:
name: docker save app:build
command: |
mkdir -p /home/circleci/cache
docker save -o /home/circleci/cache/docker.tar "app:build"
- run:
name: Save docker-compose config
command: cp docker-compose*sqlite.yaml /home/circleci/cache
- run:
name: Save Makefile to cache
command: cp Makefile /home/circleci/cache
- save_cache:
key: sqlite-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}-{{ epoch }}
paths:
- /home/circleci/cache

build-spanner-image:
docker:
- image: cimg/rust:1.86 # RUST_VER
Expand Down Expand Up @@ -499,6 +554,36 @@ jobs:
destination: gs://ecosystem-test-eng-metrics/syncstorage-rs/junit
extension: xml

sqlite-e2e-tests:
docker:
- image: cimg/base:2025.04
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
steps:
- setup_remote_docker
- display-versions
- restore_cache:
key: sqlite-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Restore Docker image cache
command: docker load -i /home/circleci/cache/docker.tar
- run:
name: Restore Makefile from save_cache
command: cp /home/circleci/cache/Makefile .
- run:
name: Restore docker-compose config
command: cp /home/circleci/cache/docker-compose*.yaml .
- make-test-dir
- run-e2e-tests:
db: sqlite
- store-test-results
- gcs-configure-and-upload:
source: workflow/test-results
destination: gs://ecosystem-test-eng-metrics/syncstorage-rs/junit
extension: xml
- run-e2e-sqlite-tests

deploy:
docker:
- image: docker:18.02.0-ce
Expand Down Expand Up @@ -600,6 +685,12 @@ workflows:
filters:
tags:
only: /.*/
- build-sqlite-image:
requires:
- build-and-test
filters:
tags:
only: /.*/
- mysql-e2e-tests:
requires:
- build-mysql-image
Expand All @@ -612,10 +703,17 @@ workflows:
filters:
tags:
only: /.*/
- sqlite-e2e-tests:
requires:
- build-sqlite-image
filters:
tags:
only: /.*/
- deploy:
requires:
- mysql-e2e-tests
- spanner-e2e-tests
- sqlite-e2e-tests
filters:
tags:
only: /.*/
Expand All @@ -629,6 +727,7 @@ workflows:
requires:
- mysql-e2e-tests
- spanner-e2e-tests
- sqlite-e2e-tests
filters:
tags:
only: /.*/
Expand All @@ -638,6 +737,7 @@ workflows:
requires:
- mysql-e2e-tests
- spanner-e2e-tests
- sqlite-e2e-tests
filters:
tags:
only: /.*/
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ html_coverage
.hgignore
.idea
*.iml
Pipfile
Pipfile.lock
site-packages/*
lib-python/*
bin/*
Expand All @@ -31,11 +33,12 @@ target
service-account.json
.sentryclirc
.envrc
.env

config/local.toml
tools/tokenserver/loadtests/*.pem
tools/tokenserver/loadtests/*.pub
venv
venv/
.vscode/settings.json

# circleci
Expand Down
Loading