From f52a3449c63a8b762a12f25d2f5e8e91d8a50ab9 Mon Sep 17 00:00:00 2001 From: Haylan Date: Wed, 8 Jul 2026 06:49:28 +0200 Subject: [PATCH] chore(TODO): mark completed tasks and update contribution store details --- TODO.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index 0da9570..d55a09f 100644 --- a/TODO.md +++ b/TODO.md @@ -6,17 +6,19 @@ Order matters — later steps assume earlier ones are done. ## 1. Audit cleanup -- [ ] **Remove `eightpoints/guzzle-bundle` + `idci/graphql-client-bundle`.** +- [x] **Remove `eightpoints/guzzle-bundle` + `idci/graphql-client-bundle`.** They exist only to build one near-static GitHub GraphQL query string (`GitHubProvider.php:59-74`); the bundle's own HTTP transport is already - bypassed (comment at `GitHubProvider.php:76-77`). Replace + bypassed (comment at `GitHubProvider.php:76-77`). + - [ ] Replace `$graphqlClient->buildQuery(...)->getGraphQLQuery()` with a plain `sprintf`/heredoc query string. Delete the two packages from `composer.json`, `config/bundles.php`, and delete `config/packages/eight_points_guzzle.yaml` + `config/packages/idci_graphql_client.yaml`. Run `composer update` and commit the regenerated `composer.lock`. -- [ ] **Dedupe `baseUrl` normalization.** `GitLabProvider.php` (lines 41, + +- [x] **Dedupe `baseUrl` normalization.** `GitLabProvider.php` (lines 41, 53) and `GiteaProvider.php` (lines 42, 54) each call `rtrim($this->baseUrl..., '/')` twice — once in `ping()`, once in `fetch()`. Compute it once as a `private readonly string $baseUrl` in @@ -35,16 +37,16 @@ Order matters — later steps assume earlier ones are done. ## 3. `ContributionStore` (SQLite via native PDO) -- [ ] New `src/Service/ContributionStore.php`. PDO SQLite, DB file at +- [x] New `src/Service/ContributionStore.php`. PDO SQLite, DB file at `%kernel.project_dir%/var/data/contributions.db` (configurable constructor arg), table created lazily: ```sql CREATE TABLE IF NOT EXISTS contributions ( provider TEXT NOT NULL, date TEXT NOT NULL, - count INTEGER NOT NULL, + count INTEGER NOT NULL CHECK (count >= 0), PRIMARY KEY (provider, date) - ); + ) WITHOUT ROWID, STRICT; ``` - [ ] `latestDate(string $provider): ?string` — `SELECT MAX(date) WHERE provider = ?`. - [ ] `merge(string $provider, array $dateCounts): void` — upsert via