117 Commits

Author SHA1 Message Date
Dries Peeters 768b0b5b6d fix(ci): harden security pytest lane and Safety report output
Security pytest:
- Run an explicit node list instead of -m security over the whole tests
  tree, so collection stays small and nothing is spuriously deselected.
- Use a writable pytest cache under INSTALLATION_CONFIG_DIR and filter
  the known Flask-SQLAlchemy SAWarning on metadata DROP ordering.
- Add scripts/ci/security-pytest.sh and wire Makefile, run-tests.sh/.bat,
  and ci-comprehensive to call it for a single source of truth.

Safety:
- Write JSON to .test_installation_config/safety-report.json (with the
  rest of local CI artifacts) instead of the repo root.
- Run scripts/ci/sanitize_safety_report.py after each scan so paths in
  the report are workspace-relative for artifacts and reviews.
- Capture Safety exit codes so failures still print where the report was
  written; use python -m safety in workflows where appropriate.

Release and legacy workflows pick up the new report path, sanitizer,
and a pinned Safety install where the CLI is invoked.
2026-05-13 12:46:35 +02:00
Dries Peeters d52266370f fix(desktop): use modern Node for Vite builds
Run desktop packaging workflows on Node 24 and load Vite through an ESM config so macOS, Linux, and Windows builds use a runtime compatible with Vite 7.
2026-04-25 17:56:33 +02:00
Dries Peeters 6e0010b28f docs(i18n): document Crowdin setup and add sync configuration
Add crowdin.yml mapping the English gettext catalog to per-locale messages.po paths, with an explicit nb→no mapping so Norwegian matches app/config.py.

Add a manual GitHub Action (Crowdin sync) to upload sources and download translations when CROWDIN_PROJECT_ID and CROWDIN_PERSONAL_TOKEN are configured.

Extend CONTRIBUTING_TRANSLATIONS with maintainer steps, cross-link TRANSLATION_SYSTEM and contributor guides, refresh TRANSLATION_SYSTEM metadata, and note the integration under [Unreleased] in CHANGELOG.md.
2026-04-15 08:03:48 +02:00
Dries Peeters 15ddabdffb feat(quotes): reorder form rows and improve quote view i18n docs
Add Move up / Move down controls and an Order column for quote line items, Costs, and Extra goods on create and edit pages (Issue #584). DOM row order matches POST field order so existing QuoteItem.position handling stays correct.

Fix the quote detail Valid until row by using quote.is_expired instead of an undefined Jinja now() (Issue #583). Submit a past valid_until in the web regression test so the view path is exercised.

Document translation contributions without Git: add docs/CONTRIBUTING_TRANSLATIONS.md, a Translation improvement issue template, links from CONTRIBUTING.md and TRANSLATION_SYSTEM.md, and a Translations subsection in docs/development/CONTRIBUTING.md. Refresh CHANGELOG [Unreleased] for these items.
2026-04-15 07:57:10 +02:00
Dries Peeters 507266fbbf docs: API v1 import, bulk, idempotency, rate limits; Linear guide; release tooling
- Document CSV import, bulk actions, Idempotency-Key, and token rate limits in REST_API and scopes.
- Clarify session vs token CSV import in import/export README; mobile offline idempotency note.
- Add docs/integrations/LINEAR.md; refresh CODE_BASED_ANALYSIS_REPORT (v5.3.0, 14 connectors).
- env.example: API_TOKEN_RATE_LIMIT_*; setup.py version; CD release workflow tweak; Zapier webhook sample.
2026-04-05 08:39:22 +02:00
Dries Peeters eaca5e346e fix(ci): drop --release for iOS simulator builds
Flutter rejects release mode with --simulator; use the default debug
simulator build so CI can compile and zip Runner.app. Document the
constraint in workflow comments.
2026-03-28 20:01:39 +01:00
Dries Peeters da85aedefb feat(mobile): add data layer, OTLP telemetry, and CI build fixes
Implement the missing Flutter data layer so release builds compile: Dio ApiClient for /api/v1 (timer, time entries, projects, tasks, finance, time-off, users/me), JSON models, Hive LocalStorage, and offline SyncService queue.

Add OpenTelemetry (opentelemetry package) with initMobileOpenTelemetry() reading OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_TOKEN via --dart-define, matching server OTLP base URL and Basic auth behavior. Instrument login token validation, timer start/stop, and sync pending.

Fix SyncUseCase to import storage SyncService, use trusted insecure hosts, and call syncAll().

GitHub Actions (build-mobile.yml, cd-release.yml): run flutter test; pass OTLP secrets into flutter build apk/appbundle/ios; switch iOS CI to release simulator builds and package build/ios/iphonesimulator/Runner.app to avoid requiring an Apple Development Team for generic device builds.

.gitignore: allow tracking mobile/lib/data/ despite the repo-wide data/ ignore rule.
2026-03-28 18:01:10 +01:00
Dries Peeters 905f6fbd37 feat(telemetry): migrate analytics pipeline from PostHog to OTLP
Switch product and installation telemetry to OTLP/Grafana across runtime config, CI injection, docs, and tests to unify telemetry transport and simplify privacy-focused opt-in behavior.
2026-03-26 17:01:55 +01:00
Dries Peeters 5e45bbd801 chore: update root config, Dockerfile, README, and GitHub workflows
- Update .gitignore, Dockerfile, INSTALLATION.md, README.md
- Update cd-development, cd-release, and migration-check workflows
2026-03-15 10:17:19 +01:00
Dries Peeters 97ca663e15 docs: add PR template and improve bug report template
- Add .github/PULL_REQUEST_TEMPLATE.md: description, type of change,
  checklist (tests, docs, CHANGELOG), links to CONTRIBUTING and CHANGELOG
- Enhance bug_report.md: add Environment section (TimeTracker version,
  deployment type, OS, browser) for easier triage
2026-03-11 08:19:21 +01:00
Dries Peeters 3641b277f5 Update tests 2026-03-08 06:50:42 +01:00
Dries Peeters a52289a20b chore: update CI workflow, pre-commit, Makefile, and docker-compose
- Adjust ci-comprehensive workflow and pre-commit hooks
- Makefile targets and docker-compose configuration updates
2026-03-06 15:46:01 +01:00
Dries Peeters 3f56a06ef0 feat(release): auto-trigger Render demo deploy after container push
Add trigger-demo-deploy job to cd-release workflow that POSTs to
Render deploy hook when TimeTrackerDemoRender org secret is set.
Runs after build-and-push; skips gracefully if secret is not
configured. Include demo deploy status in release summary.

Document in RENDER.md, CI_CD_DOCUMENTATION.md, and
GITHUB_ACTIONS_SETUP.md.
2026-02-17 20:23:46 +01:00
Dries Peeters 4ce27b9334 ci(docker): inject donate-hide public key from secret in release and develop workflows
- Add optional step before Docker build: write DONATE_HIDE_PUBLIC_KEY_PEM secret to donate_hide_public.pem
- Image then contains key at /app/donate_hide_public.pem when secret is set; build still succeeds if unset

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 14:00:39 +01:00
Dries Peeters 84a4508ace Update workflow 2026-02-01 17:03:07 +01:00
Dries Peeters 930740fd08 Update Workflows 2026-02-01 16:59:47 +01:00
Dries Peeters 94fc19f6f2 Build: add icon generation to CI and scripts, bump version to 4.16.0
- Run app icon and launcher icon generation in build-mobile workflow
- Add generate-mobile-icon scripts (Python/Pillow, ImageMagick, Inkscape)
- BUILD.md: document icon requirements and troubleshooting
- setup.py: version 4.16.0

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-01 16:51:13 +01:00
Dries Peeters 12074fc29b fix: resolve integration test failures (install config dir, settings flush)
- Make InstallationConfig config dir overridable via INSTALLATION_CONFIG_DIR
  so tests and CI use a writable path instead of /data (fixes PermissionError
  on redirect to /admin/settings after logo upload).
- Set INSTALLATION_CONFIG_DIR in conftest before app import and in
  ci-comprehensive.yml for integration-tests and full-test-suite jobs.
- In Settings.get_settings(), add _session_in_flush() and a re-entrancy
  guard to skip add+commit when called during another commit's flush,
  fixing ResourceClosedError in currency_display test setup.
- Update test_installation_config fixture to set INSTALLATION_CONFIG_DIR
  so it continues to use its temp dir with the new env-based behavior.
2026-01-25 10:09:29 +01:00
Dries Peeters dffcf04b24 fix(tests): resolve routes unit test failures in CI
- test_client_portal_dashboard_requires_access: expect 302 redirect to
  client portal login instead of 403. The client portal 403 handler
  redirects authenticated non-portal users to login by design.
- Run routes unit group with -n 0 in CI to avoid SQLite 'database is
  locked' errors from audit logging under pytest-xdist parallel workers;
  fixes client_portal and admin client-portal test failures.
2026-01-25 09:41:39 +01:00
Dries Peeters b44028c5b5 ci: Improve iOS build artifact handling
- Add iOS archive creation step to build-mobile.yml
- Enhance error handling and diagnostics in cd-release.yml
- Add file existence checks and directory listings for debugging
- Change artifact upload from 'ignore' to 'error' for better failure detection
2026-01-14 21:15:28 +01:00
Dries Peeters 936beff4c0 Update android & IOS app 2026-01-14 07:01:31 +01:00
Dries Peeters 6d6e67db97 Update Android & IOS builds 2026-01-14 06:53:06 +01:00
Dries Peeters 2180f7d539 ci: temporarily skip mobile app tests in build workflow
- Comment out mobile app tests as source code is incomplete
- Tests exist but lib/ source code is missing
- Allows CI/CD to continue building while mobile app is in development
2026-01-12 20:09:11 +01:00
Dries Peeters e6cc5609ec Update build-mobile.yml 2026-01-11 21:55:38 +01:00
Dries Peeters 00f1f18abb Improve build scripts and CI/CD workflows
- Enhance build scripts with better error handling and Windows support
- Add Windows-specific build scripts and PowerShell utilities
- Add asset preparation and verification scripts
- Update GitHub Actions workflows for desktop and mobile builds
- Add build configuration and troubleshooting utilities
- Improve cross-platform build compatibility
2026-01-11 20:51:13 +01:00
Dries Peeters d1d5b819a9 ci: Add CI/CD workflows for mobile and desktop app builds
- Add GitHub Actions workflow for building Flutter mobile apps
- Add GitHub Actions workflow for building Electron desktop apps
- Update release workflow to include mobile and desktop build jobs
- Support cross-platform builds (Android, iOS, Windows, macOS, Linux)
- Add artifact publishing for built applications
2026-01-11 08:37:37 +01:00
Dries Peeters dd4a5e2f21 Update cd-release.yml 2026-01-02 16:02:04 +01:00
Dries Peeters d89a3fcf45 Merge pull request #320 from DRYTRIX/RC
Rc
2025-11-29 09:26:51 +01:00
Dries Peeters 3e100ac4a0 fix(ci): use lowercase image names for Docker registry compatibility
Changes:

- Add step to convert image names to lowercase in CD workflow

- Update docker-compose.production.yml generation to use lowercase image names

- Enhance production deployment with nginx reverse proxy and certgen service

- Update CSRF configuration documentation with IP access guidance

- Improve deployment manifest generation with better service orchestration
2025-11-29 09:25:39 +01:00
Dries Peeters 7bd2728226 Merge pull request #308 from DRYTRIX/RC
Rc
2025-11-29 09:12:28 +01:00
Dries Peeters 02301e66ba Fix smoke test timeout: run tests in parallel and increase timeout limits 2025-11-29 08:08:24 +01:00
Dries Peeters 149a4bb4c8 Update CI workflow, app initialization, quotes route, and test files 2025-11-29 07:39:29 +01:00
Dries Peeters 90dde470da style: standardize code formatting and normalize line endings
- Normalize line endings from CRLF to LF across all files to match .editorconfig
- Standardize quote style from single quotes to double quotes
- Normalize whitespace and formatting throughout codebase
- Apply consistent code style across 372 files including:
  * Application code (models, routes, services, utils)
  * Test files
  * Configuration files
  * CI/CD workflows

This ensures consistency with the project's .editorconfig settings and
improves code maintainability.
2025-11-28 20:05:37 +01:00
Dries Peeters c93d420c46 Merge pull request #302 from DRYTRIX/RC
Rc
2025-11-26 08:05:00 +01:00
Dries Peeters 5f4ada1ed3 Update ci.yml 2025-11-24 21:04:18 +01:00
Dries Peeters 9d1ece5263 feat: Implement comprehensive architectural improvements and new features
This commit implements a complete architectural transformation of the TimeTracker
application, introducing modern design patterns and comprehensive feature set.

## Architecture Improvements

### Service Layer (18 Services)
- TimeTrackingService: Time entry management with timer functionality
- ProjectService: Project operations and lifecycle management
- InvoiceService: Invoice creation, management, and status tracking
- TaskService: Task management and workflow
- ExpenseService: Expense tracking and categorization
- ClientService: Client relationship management
- PaymentService: Payment processing and invoice reconciliation
- CommentService: Comment system for projects, tasks, and quotes
- UserService: User management and role operations
- NotificationService: Notification delivery system
- ReportingService: Report generation and analytics
- AnalyticsService: Event tracking and analytics
- ExportService: CSV export functionality
- ImportService: CSV import with validation
- EmailService: Email operations and invoice delivery
- PermissionService: Role-based permission management
- BackupService: Database backup operations
- HealthService: System health checks and monitoring

### Repository Layer (9 Repositories)
- BaseRepository: Generic CRUD operations
- TimeEntryRepository: Time entry data access
- ProjectRepository: Project data access with filtering
- InvoiceRepository: Invoice queries and status management
- TaskRepository: Task data access
- ExpenseRepository: Expense data access
- ClientRepository: Client data access
- UserRepository: User data access
- PaymentRepository: Payment data access
- CommentRepository: Comment data access

### Schema Layer (9 Schemas)
- Marshmallow schemas for validation and serialization
- Create, update, and full schemas for all entities
- Input validation and data transformation

### Utility Modules (15 Utilities)
- api_responses: Standardized API response helpers
- validation: Input validation utilities
- query_optimization: N+1 query prevention and eager loading
- error_handlers: Centralized error handling
- cache: Caching foundation (Redis-ready)
- transactions: Transaction management decorators
- event_bus: Domain event system
- performance: Performance monitoring decorators
- logger: Enhanced structured logging
- pagination: Pagination utilities
- file_upload: Secure file upload handling
- search: Full-text search utilities
- rate_limiting: Rate limiting helpers
- config_manager: Configuration management
- datetime_utils: Enhanced date/time utilities

## Database Improvements
- Performance indexes migration (15+ indexes)
- Query optimization utilities
- N+1 query prevention patterns

## Testing Infrastructure
- Comprehensive test fixtures (conftest.py)
- Service layer unit tests
- Repository layer unit tests
- Integration test examples

## CI/CD Pipeline
- GitHub Actions workflow
- Automated linting (Black, Flake8, Pylint)
- Security scanning (Bandit, Safety, Semgrep)
- Automated testing with coverage
- Docker image builds

## Documentation
- Architecture migration guide
- Quick start guide
- API enhancements documentation
- Implementation summaries
- Refactored route examples

## Key Benefits
- Separation of concerns: Business logic decoupled from routes
- Testability: Services and repositories can be tested in isolation
- Maintainability: Consistent patterns across codebase
- Performance: Database indexes and query optimization
- Security: Input validation and security scanning
- Scalability: Event-driven architecture and health checks

## Statistics
- 70+ new files created
- 8,000+ lines of code
- 18 services, 9 repositories, 9 schemas
- 15 utility modules
- 5 test files with examples

This transformation establishes a solid foundation for future development
and follows industry best practices for maintainable, scalable applications.
2025-11-23 20:00:10 +01:00
Dries Peeters 4c4e04fc25 Merge pull request #199 from DRYTRIX/RC
Rc
2025-11-01 12:01:33 +01:00
Dries Peeters 47ebf9989c Update ci-comprehensive.yml 2025-11-01 11:12:46 +01:00
Dries Peeters 7a28f0665b Update tests. 2025-10-31 19:24:47 +01:00
Dries Peeters f74c814114 Update issue templates 2025-10-27 13:47:59 +01:00
Dries Peeters 7dd39ef55a feat(ci): enhance PostHog credential injection visibility in release builds
Improved the Release Build workflow to clearly show that PostHog and Sentry
credentials are being injected from the GitHub Secret Store, providing better
transparency and auditability.

Changes:
- Enhanced workflow step name to explicitly mention "GitHub Secrets"
- Added comprehensive logging with visual separators and clear sections
- Added before/after file content display showing placeholder replacement
- Added secret availability verification with format validation
- Added detailed error messages with step-by-step fix instructions
- Enhanced release summary to highlight successful credential injection
- Updated build configuration documentation with cross-references

Benefits:
- Developers can immediately see credentials come from GitHub Secret Store
- Security teams have clear audit trail of credential injection process
- Better troubleshooting with detailed error messages
- Secrets remain protected with proper redaction (first 8 + last 4 chars)
- Multiple validation steps ensure correct injection

The workflow now outputs 50+ lines of structured logging showing:
- Secret store location (Settings → Secrets and variables → Actions)
- Target file being modified (app/config/analytics_defaults.py)
- Verification that secrets are available
- Format validation (phc_* pattern for PostHog)
- Confirmation of successful placeholder replacement
- Summary with redacted credential previews

Workflow: .github/workflows/cd-release.yml
Documentation: docs/cicd/README_BUILD_CONFIGURATION.md

Fully backward compatible - no breaking changes.
2025-10-23 15:32:57 +02:00
Dries Peeters e418c77590 Update cd-release.yml 2025-10-23 13:43:31 +02:00
Dries Peeters 81532fcd55 ci: implement RC branch-based release workflow
Refactor GitHub Actions workflows to support a release candidate (RC)
branch workflow instead of direct develop->main flow.

Changes:
- cd-development.yml: Trigger on PRs to RC branches (not push to develop)
  * Updated summary to show PR context (source/target branches)
  * Build development images when code is promoted to RC

- cd-release.yml: Trigger on PRs from RC to main/master
  * Added path filters for code changes only
  * Enables release validation before merge to main

- ci-comprehensive.yml: Run tests on PRs to RC branches
  * Full test suite now runs for PRs to main, master, and RC branches
  * Ensures code quality before RC promotion

New workflow:
  develop (push) -> no actions
  develop -> rc (PR) -> run tests + development build
  rc -> main (PR) -> run tests + release build

Supports both single RC branch (rc) and versioned RC branches (rc/*)

Breaking change: Development builds no longer trigger on push to develop.
They now require a PR to an RC branch.
2025-10-22 10:17:15 +02:00
Dries Peeters e02dab56ff Update cd-development.yml 2025-10-22 09:45:08 +02:00
Dries Peeters 0fe6dcf25d Update cd-development.yml 2025-10-22 09:41:03 +02:00
Dries Peeters 84e2096602 feat: enhance CI/CD workflows and improve UX features
This commit improves the testing workflow, CI/CD documentation, and user experience:

## CI/CD Improvements:
- Add comprehensive testing strategy documentation to CD release workflow
- Document workflow triggers and testing approach in ci-comprehensive.yml
- Update CI/CD documentation with testing workflow details

## UX Enhancements:
- Add localStorage persistence for PWA install prompt dismissal
- Prevent repeated PWA install prompts after user dismisses
- Add dismiss button (×) to PWA install toast notification

## Dashboard Features:
- Add edit and delete actions to recent time entries table
- Include delete confirmation dialogs for time entries
- Add notes field to "Start Timer" modal
- Improve table layout with actions column

## Documentation:
- Create TESTING_WORKFLOW_STRATEGY.md for comprehensive testing guidelines
- Add QUICK_REFERENCE_TESTING.md for quick testing reference
- Document changes in CHANGES_SUMMARY_TESTING_WORKFLOW.md
- Update README_CI_CD_SECTION.md with workflow details

## Other Changes:
- Update setup.py configuration
- Enhance task templates (create/edit/view) with improved UI

These changes improve developer experience with better testing documentation
and enhance user experience with smarter PWA prompts and dashboard functionality.
2025-10-22 07:28:39 +02:00
Dries Peeters 60e10d2c48 ci: ensure DB schema exists before tests (flask db upgrade) 2025-10-21 08:14:12 +02:00
Dries Peeters 3b73cb5534 ci: restore v3.0.0 workflows; keep PostHog/Sentry injection in release build 2025-10-21 07:47:44 +02:00
Dries Peeters 7a4354d1fb update cert 2025-10-20 22:07:14 +02:00
Dries Peeters 8b5d7af40f Update build-and-publish.yml 2025-10-20 21:31:59 +02:00