Commit Graph

36 Commits

Author SHA1 Message Date
haylan 38312f549c docs: add CHANGELOG for 0.1.0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:27:58 +02:00
haylan a8d5f205db docs: fix typos and reformat tables in CLAUDE.md
Fix "Prever" typo, add Windows WSL test runner command, and align
Markdown table columns for readability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:14:38 +02:00
haylan 85428826a0 test(provider): add unit tests for probe infrastructure and all providers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:14:06 +02:00
haylan 61b7735afc refactor(renderer): add strict_types declaration and make class final
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:13:51 +02:00
haylan c70d96c3aa feat(health): make /health report per-provider probe status
Introduce ProviderHealthChecker which probes each configured provider
via AutowireIterator. Wire it into GraphController so /health returns
detailed per-provider status and responds 503 when any provider is
in a degraded state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:13:24 +02:00
haylan d3b9463c57 feat(provider): implement ping and probe on GitHub, GitLab, and Gitea
Add getName() and ping() to each provider and wire ProbeTrait. Make
all classes final, add strict_types declarations, and replace generic
RuntimeException with typed HTTP exceptions so probe() can classify
auth failures and unreachable endpoints correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:13:14 +02:00
haylan 71bfb38028 feat(provider): add health-probe contract and supporting value objects
Add getName(), ping(), and probe() to ProviderInterface. Introduce
ProbeTrait to classify HTTP/transport exceptions into typed error codes,
ProviderStatus as the result value object, and ProviderStatusType /
ProviderErrorCode as backing enums.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 14:13:07 +02:00
haylan 225c614057 test(service): refactor SvgRendererTest to follow PHPUnit best practices
- Replace setUp() factory with direct instantiation (zero-param constructor)
- Add AAA blank-line separators to all test methods
- Consolidate theme + fallback tests behind a DataProvider
- Consolidate day-of-week label tests behind a DataProvider
- Split multi-assertion tests to one assertion per test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 12:58:23 +02:00
haylan c205fed14b refactor(controller): extract contribution aggregation into dedicated service
Move fetchAllContributions and merge logic from GraphController into a new
ContributionAggregator service. Replace deprecated TaggedIterator with
AutowireIterator throughout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 12:58:17 +02:00
haylan 3e3a6752af chore(dev): remove broken auto-run PHPUnit hook
The PostToolUse hook called php bin/phpunit directly, which does not
work inside the Docker-based dev setup. Remove it; tests should be
run via docker compose exec graph vendor/bin/phpunit as documented.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 12:39:39 +02:00
haylan 5b07eae672 docs: update installation guide to use pre-built image
Replace the clone-and-build workflow with a docker-compose snippet
that pulls the image directly from the Gitea container registry.
Add semver tag reference and rename steps to match the new flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 12:39:33 +02:00
haylan 235e63bfc0 fix(config): add default empty values for optional env vars
Declare empty-string defaults for all optional env vars as Symfony
parameters so the container compiles without errors when GITHUB_USER,
GITLAB_TOKEN, GITEA_URL, etc. are not set in the environment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 12:39:29 +02:00
haylan 92380e534a feat(docker): migrate base image from php-cli to FrankenPHP Alpine
Replace php:8.4-cli-alpine3.21 with dunglas/frankenphp:1-php8.4-alpine.
No Go toolchain required — the official image ships as a pre-compiled
Alpine binary.

- Drop docker-php-ext-install opcache (FrankenPHP enables it by default)
- Both dev and final stages run frankenphp run --config /etc/caddy/Caddyfile
- Dev stage bakes in Caddyfile.dev (no worker mode, Xdebug compatible)
- Final stage bakes in production Caddyfile

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 12:38:38 +02:00
haylan 4654a287a8 feat(app): add FrankenPHP worker script for Symfony
Boot the Symfony kernel once at startup, then loop with
frankenphp_handle_request() to handle every incoming request without
re-bootstrapping the framework. Supports MAX_REQUESTS env var for
graceful worker restarts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 12:38:27 +02:00
haylan 2427c07f4c feat(docker): add FrankenPHP Caddy configuration
Add production and dev Caddyfiles for FrankenPHP:
- Caddyfile: HTTP-only on :8080, auto_https off, worker mode
- Caddyfile.dev: same but without worker directive so Xdebug
  step-debugging remains functional; Caddy debug logging enabled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 12:38:23 +02:00
haylan 7c1b893e09 chore: update docker image to php 8.4 2026-05-29 23:20:53 +02:00
haylan 4993fdca00 Update .env 2026-05-29 23:04:39 +02:00
haylan c4803ea5cb fix: fixed labeling to make contaienr apper correctly in the repo 2026-05-29 22:43:53 +02:00
haylan 19bfa4cf28 Update README.md 2026-05-29 22:37:25 +02:00
haylan e70d035672 feat: change to use token 2026-05-29 19:42:10 +02:00
haylan d57320cb77 fix: changed pipline to use workflow token instead self made one 2026-05-29 19:32:36 +02:00
haylan 5feae97dd3 feat: fix manuel pipline. to create a release tag or replace exisiting release 2026-05-29 19:20:32 +02:00
haylan cceda8abf2 feat: integrate Monolog for enhanced logging across providers and controller 0.0.1 2026-05-29 18:57:25 +02:00
haylan 8b8ec9ab2f feat: add redirect from index route to graph.svg with query parameters 2026-05-29 18:28:56 +02:00
haylan b3e79de069 fix: php unit startup command 2026-05-29 18:23:36 +02:00
haylan f3770f1c2a docs: update README with token configuration and Docker development instructions 2026-05-29 16:09:07 +02:00
haylan 56035096c6 feat: implement multi-provider architecture for contribution fetching and add Docker support 2026-05-29 11:51:05 +02:00
haylan 381b8f4489 docs: add TDD conventions and testing guide to CLAUDE.md
Covers testing file conventions, Red→Green→Refactor cycle with
example prompts, common anti-patterns, test runner commands, and
the auto-run hook setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:09:44 +02:00
haylan fa035781fd fix(svg-renderer): correct date alignment and drop unused parameter
- modify('Sunday') → modify('last Sunday') so the grid start is
  reliably the prior Sunday when today is already Sunday
- Remove unused $totalW from renderLegend signature
- Remove unused GAP constant (value preserved inline as a comment on STEP)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:09:31 +02:00
haylan d1dce19832 refactor(github): migrate contribution query to GraphQL bundle
Use GraphQLApiClientRegistryInterface to build the query via the
bundle's query builder. Keep Symfony HttpClient for the actual POST
since GitHub requires application/json (the bundle's transport sends
form_params instead).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:09:25 +02:00
haylan 0c2a185927 test: add PHPUnit 11.5 unit test suite
- phpunit.xml.dist with unit suite and source coverage config
- .phpunit.cache excluded in .gitignore
- Initial SvgRendererTest as example test
- .claude/settings.json with PostToolUse hook to auto-run phpunit on edit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:09:17 +02:00
haylan ff44161a99 chore(deps): bump Symfony to 7.4 and add GraphQL client bundles
- symfony/* pinned to 7.4.* (was 7.1.*)
- eightpoints/guzzle-bundle ^8.6 and idci/graphql-client-bundle ^2.0 added
- phpunit/phpunit ^11.5 and symfony/phpunit-bridge ^7.4 added as dev deps
- Bundles registered in config/bundles.php
- Guzzle and GraphQL client configured via YAML package configs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:09:11 +02:00
haylan c1fde0aed3 Update environment configuration to development mode and add CLAUDE.md for project guidance 2026-05-28 20:15:12 +02:00
haylan 4ce551013e Update example graph image link in README 2026-05-28 20:07:20 +02:00
haylan 3a42bec2b7 Add environment variables for GitHub, GitLab, Gitea, and allowed hosts configuration 2026-05-28 19:53:33 +02:00
haylan 342490035b Initialize git-contribution-graph project with Docker setup, environment configuration, and core functionality for merging contributions from GitHub, GitLab, and Gitea into an SVG heatmap. 2026-05-28 19:35:44 +02:00