Commit Graph

11 Commits

Author SHA1 Message Date
Damir Mukimov
be97b587b2
feat: Implement Bleve migration script and unify CLI (#26) (#64)
* docs: Update TASKS.md and PRODUCTION-TASKS.md to reflect current codebase state (December 2024 audit)

* refactor: Unify all commands into a single Cobra CLI

- Refactor cmd/api/main.go into 'tercul serve' command
- Refactor cmd/worker/main.go into 'tercul worker' command
- Refactor cmd/tools/enrich/main.go into 'tercul enrich' command
- Add 'tercul bleve-migrate' command for Bleve index migration
- Extract common initialization logic into cmd/cli/internal/bootstrap
- Update Dockerfile to build unified CLI
- Update README with new CLI usage

This consolidates all entry points into a single, maintainable CLI structure.

* fix: Fix CodeQL workflow and add comprehensive test coverage

- Fix Go version mismatch by setting up Go before CodeQL init
- Add Go version verification step
- Improve error handling for code scanning upload
- Add comprehensive test suite for CLI commands:
  - Bleve migration tests with in-memory indexes
  - Edge case tests (empty data, large batches, errors)
  - Command-level integration tests
  - Bootstrap initialization tests
- Optimize tests to use in-memory Bleve indexes for speed
- Add test tags for skipping slow tests in short mode
- Update workflow documentation

Test coverage: 18.1% with 806 lines of test code
All tests passing in short mode

* fix: Fix test workflow and Bleve test double-close panic

- Add POSTGRES_USER to PostgreSQL service configuration in test workflow
- Fix TestInitBleveIndex double-close panic by removing defer before explicit close
- Test now passes successfully

Fixes failing Unit Tests workflow in PR #64
2025-11-30 21:54:18 +01:00
Damir Mukimov
b5cd1761af
Update workflows and tasks documentation 2025-11-30 03:13:33 +01:00
google-labs-jules[bot]
a68db7b694 refactor(app): move composition root to main.go
Refactored the application's dependency injection and server setup to improve modularity and adhere to the Dependency Inversion Principle.

- Moved the instantiation of all application services from `internal/app/app.go` to the composition root in `cmd/api/main.go`.
- The `app.NewApplication` function now accepts pre-built service interfaces, making the `app` package a simple container.
- Updated `internal/testutil/integration_test_utils.go` to reflect the new DI pattern, ensuring tests align with the refactored structure.
- Corrected build errors that arose from the refactoring, including import conflicts and incorrect function calls.
- Updated `TASKS.md` to mark the 'Refactor Dependency Injection' task as complete.
2025-10-07 14:05:19 +00:00
google-labs-jules[bot]
db010e5305 Chore: Clean up lint warnings, improve code quality, and update tasks
This commit addresses numerous linting errors, improves overall code quality, and updates the main task list to reflect the current state of the project.

- Fixed dozens of 'errcheck' violations by adding error handling and logging for ignored errors, particularly in analytics goroutines and test setup.
- Resolved 'ineffassign' and 'staticcheck' warnings by refactoring variable scopes and suppressing intentional-but-flagged test patterns.
- Removed dead code identified by the 'unused' linter, including helper functions and mock services.
- Refactored test suites to fix inheritance issues, consolidating GraphQL integration tests and correcting test setup logic.
- Corrected invalid logging calls that were causing type check failures.
- Updated `TASKS.md` to mark completed items and add notes where investigation revealed that listed issues were already resolved.

The codebase now passes 'make lint-test' cleanly.
2025-10-07 13:18:48 +00:00
google-labs-jules[bot]
e1e703aeb6 feat: restore project state and establish CI pipeline
This commit represents the first major batch of foundational refactoring work.

It accomplishes two main goals:

1.  **Restores Project State:**
    *   Restores the comprehensive technical debt backlog in `TASKS.md` after it was accidentally deleted.
    *   Restores the detailed GraphQL API documentation in `api/README.md`.
    *   Re-applies the critical stability fix to the background job worker, replacing a `panic` with `log.Fatalf` for graceful termination on startup failure.

2.  **Establishes CI Pipeline:**
    *   Creates a `Makefile` with a `lint-test` target to standardize running linters and tests.
    *   Adds a GitHub Actions workflow (`.github/workflows/ci.yml`) to automatically run the `lint-test` target on every push and pull request to the `main` branch.

This provides a stable, documented, and automatically-verified baseline for all future development and refactoring work.
2025-10-05 11:23:31 +00:00
google-labs-jules[bot]
85d036330c fix: handle fatal worker startup error gracefully
Replaces a raw `panic` in the `asynq` server startup with a call to `log.Fatalf`.

If the job server fails to start, it is an unrecoverable, fatal error. Using `log.Fatalf` ensures the application exits with a clear error message and a non-zero status code, which is a more conventional and robust way to handle fatal startup errors than panicking.
2025-10-05 11:11:40 +00:00
google-labs-jules[bot]
8d2ff8a97e docs: create comprehensive GraphQL API documentation
Creates a new, comprehensive guide for the GraphQL API in `api/README.md`. This documentation details all available queries, mutations, and types, providing clear examples and explanations for developers.

This addresses the most critical gap in the project's documentation, which was previously sparse and only covered a single query. The new documentation is structured for clarity and will serve as a vital resource for both internal and external developers.
2025-10-05 10:38:30 +00:00
google-labs-jules[bot]
2190da9f60 feat: Implement analytics and fix Translation resolver
- Implemented view counting for works and translations by adding calls to the analytics service in the `Work` and `Translation` resolvers.
- Implemented translation counting for works by adding a call to the analytics service in the `CreateTranslation` resolver.
- Fixed the `Translation` resolver, which was previously unimplemented and caused a panic.
- Updated `TASKS.md` to mark the implemented analytics features as complete.
2025-10-05 00:52:41 +00:00
google-labs-jules[bot]
c797429e08 chore: Remove outdated build failure tasks
The 'Urgent: Build Failures' section in TASKS.md was outdated. The issues listed have already been resolved, and the build is stable. This commit removes the section to reflect the current state of the project.
2025-10-05 00:41:32 +00:00
google-labs-jules[bot]
3ad00de327 docs: consolidate tasks and clean up legacy files
This commit consolidates all outstanding tasks from `TODO.md`, `BUILD_ISSUES.md`, and inline `TODO` comments into a single `TASKS.md` file. This new file serves as the single source of truth for all pending development work, categorized by priority.

The task list has been enhanced with additional context, linking tasks to the architectural vision in `refactor.md` and making them more actionable for developers.

The following legacy files have been removed to avoid confusion:
- `TODO.md`
- `BUILD_ISSUES.md`

The `AGENTS.md` file has also been updated to remove a temporary debug log and now directs agents to the new `TASKS.md` file for guidance.
2025-10-05 00:01:42 +00:00
google-labs-jules[bot]
dcdc272990 docs: consolidate tasks and clean up legacy files
This commit consolidates all outstanding tasks from `TODO.md`, `BUILD_ISSUES.md`, and inline `TODO` comments into a single `TASKS.md` file. This new file serves as the single source of truth for all pending development work, categorized by priority.

The following legacy files have been removed to avoid confusion:
- `TODO.md`
- `BUILD_ISSUES.md`

The `AGENTS.md` file has also been updated to remove a temporary debug log and now directs agents to the new `TASKS.md` file for guidance.
2025-10-04 23:59:30 +00:00