Skip to content

Dev to main#2

Merged
chendelin1982 merged 4 commits into
mainfrom
dev
May 7, 2026
Merged

Dev to main#2
chendelin1982 merged 4 commits into
mainfrom
dev

Conversation

@chendelin1982
Copy link
Copy Markdown
Contributor

Summary

Describe the change in 2-5 lines.

What Changed

fix test

Why

Explain the problem, requirement, or risk this PR addresses.

Validation

  • make lint
  • make test backend
  • make test web
  • make e2e
  • Other validation noted below

Additional validation notes:


Risk Review

  • User-facing impact:
  • Data or migration impact:
  • CI/release impact:
  • Rollback plan:

Contract Review

  • No API or schema contract changed
  • OpenAPI or generated contract artifacts were updated
  • Release notes or changelog impact was reviewed
  • No release/distribution behavior changed

AI Assistance

  • No AI assistance was used
  • AI helped draft code or tests
  • AI helped draft PR text or review notes
  • AI output was manually reviewed and corrected where needed

Notes on AI usage:


Reviewer Checklist

  • Scope is small enough to review safely
  • Validation is appropriate for the changed surface
  • New behavior is covered by tests or explicitly justified
  • Docs/workflows/contracts were updated if behavior changed
  • Rollback or follow-up risk is acceptable

Copilot AI review requested due to automatic review settings May 7, 2026 09:19
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Comprehensive Test Refactoring, Security Enhancements, and CI/CD Improvements

🧪 Tests ✨ Enhancement 📝 Documentation

Grey Divider

Walkthroughs

Description
  **Test Infrastructure Refactoring and Security Enhancements**
• Comprehensive test refactoring across backend packages to use shared test fixtures and baseline
  data directories, reducing test initialization overhead and improving performance
• Converted 15+ integration tests to unit tests by extracting testable functions and removing
  database dependencies
• Added WebSocket origin validation for CORS security and SSH host key verification with proper
  shell argument quoting
• Implemented shared test app fixtures with sync.Once pattern for efficient baseline reuse across
  multiple test packages
• Enhanced route coverage testing with matrix validation for OpenAPI spec completeness
• Added authentication middleware to Docker and operation log stream routes with superuser
  verification
• Extracted testable functions from core logic (certificate resolution, monitor status queries,
  agent bindings, software runtime bindings)
• Updated OpenAPI specifications with new endpoints (/tunnel/setup/{token},
  /api/monitor/servers/{id}/container-telemetry)
• Added gitleaks configuration and CodeQL security scanning workflow for automated secret and
  vulnerability detection
• Fixed async test queries across multiple frontend test files for proper async rendering handling
• Updated Go dependencies to version 1.26.2 and enhanced Makefile with actionlint, improved CI/CD
  targets, and better tooling support
• Comprehensive documentation updates for test infrastructure, CI/CD workflows, and branch
  protection strategy
Diagram
flowchart LR
  A["Test Fixtures<br/>Baseline Data"] -->|"Shared Reuse"| B["Optimized Tests<br/>Faster Execution"]
  C["Unit Test<br/>Extraction"] -->|"Remove DB<br/>Dependencies"| B
  D["WebSocket<br/>Origin Validation"] -->|"CORS Security"| E["Enhanced<br/>Security"]
  F["SSH Host Key<br/>Verification"] -->|"Shell Quoting"| E
  G["Gitleaks<br/>Config"] -->|"Secret Detection"| E
  H["CodeQL<br/>Workflow"] -->|"Vulnerability<br/>Scanning"| E
  I["OpenAPI<br/>Spec Updates"] -->|"New Endpoints"| J["API<br/>Documentation"]
  K["Auth Middleware<br/>Addition"] -->|"Route Protection"| J
  B -->|"Faster CI/CD"| L["Improved<br/>Development"]
  E -->|"Secure<br/>Codebase"| L
  J -->|"Clear API<br/>Contract"| L
Loading

Grey Divider

File Changes

1. web/src/pages/deploy/actions/action-utils.test.ts 🧪 Tests +39/-0

Add WebSocket URL builder unit tests

• Added new test file for buildActionWebSocketUrl function
• Tests verify correct WebSocket URL construction with browser host and protocol
• Tests verify auth token is preserved as query parameter for WebSocket routes

web/src/pages/deploy/actions/action-utils.test.ts


2. web/vitest.config.ts ⚙️ Configuration changes +1/-0

Increase Vitest timeout configuration

• Increased test timeout from default to 10000ms

web/vitest.config.ts


3. backend/infra/migrations/migrations_test.go 🧪 Tests +35/-171

Refactor migrations tests to use shared fixture

• Removed direct tests.NewTestApp() calls and replaced with newMigrationsTestApp(t) helper
• Removed unused import of github.com/pocketbase/pocketbase/tests
• Refactored 30+ test functions to use shared test app fixture

backend/infra/migrations/migrations_test.go


View more (85)
4. backend/domain/routes/routes_coverage_test.go 🧪 Tests +277/-4

Enhance route coverage testing with matrix validation

• Added regex patterns for inline group calls and function signatures
• Added new test TestAllMatrixExtSurfacesHaveGeneratedSpecAnchors to validate OpenAPI spec
 coverage
• Enhanced route extraction to support function seeds and inline route registration patterns
• Added helper functions for parsing matrix groups and matching surface patterns

backend/domain/routes/routes_coverage_test.go


5. backend/domain/certs/resolve_test.go 🧪 Tests +33/-71

Convert certificate resolution tests to unit tests

• Refactored from integration test to unit test by removing database dependency
• Replaced tests.NewTestApp() with in-memory mock records and functions
• Simplified test setup by using mock findCertificate and resolveSecret callbacks

backend/domain/certs/resolve_test.go


6. backend/domain/lifecycle/projection/updater_test.go 🧪 Tests +13/-71

Refactor projection tests to use in-memory records

• Removed database app initialization and replaced with in-memory record creation
• Simplified test helpers to create records without persistence
• Removed app.Save() calls throughout test functions

backend/domain/lifecycle/projection/updater_test.go


7. backend/domain/monitor/status/store/store_test.go 🧪 Tests +12/-41

Refactor monitor store tests for better isolation

• Replaced LoadResourceCheckSummary with BuildResourceCheckSummary for unit testing
• Removed database app initialization from first test
• Added newStoreTestApp helper for tests requiring persistence

backend/domain/monitor/status/store/store_test.go


8. backend/domain/monitor/signals/platform/observer_test.go 🧪 Tests +13/-15

Add resource function mock to platform observer tests

• Added SetResourceFunc mock to observer for resource info collection
• Replaced direct tests.NewTestApp() with newPlatformTestApp(t) helper
• Removed unused migrations import

backend/domain/monitor/signals/platform/observer_test.go


9. backend/domain/certs/hooks_test.go 🧪 Tests +22/-27

Convert certificate hooks tests to unit tests

• Converted from integration test to unit test using mock functions
• Removed database app initialization and replaced with in-memory records
• Added validatePrivateKeySecretRefWith helper accepting mock callbacks

backend/domain/certs/hooks_test.go


10. backend/infra/docker/ssh.go ✨ Enhancement +70/-3

Implement SSH host key verification and shell quoting

• Added buildShellCommand function to properly quote shell arguments
• Added shellQuote function to escape single quotes in arguments
• Added resolveHostKeyCallback function to resolve SSH known_hosts files
• Replaced ssh.InsecureIgnoreHostKey() with proper host key verification
• Added support for APPOS_SSH_KNOWN_HOSTS and APPOS_REQUIRE_SSH_HOST_KEY environment variables

backend/infra/docker/ssh.go


11. backend/domain/config/sharedenv/query_test.go 🧪 Tests +10/-26

Refactor shared environment tests with helper

• Replaced tests.NewTestApp() with newSharedEnvTestApp(t) helper
• Removed unused migrations import
• Simplified test setup for environment variable tests

backend/domain/config/sharedenv/query_test.go


12. backend/domain/routes/server.go ✨ Enhancement +79/-2

Implement WebSocket origin validation for CORS

• Added allowWebSocketOrigin function to validate WebSocket origin headers
• Added helper functions for resolving WebSocket HTTP scheme and host
• Added sameWebSocketOriginHost to compare origin and request hosts
• Added port extraction and comparison logic for proper CORS validation
• Replaced ssh.InsecureIgnoreHostKey() with proper origin validation

backend/domain/routes/server.go


13. backend/domain/worker/appos_agent_bindings_test.go 🧪 Tests +8/-52

Refactor agent bindings tests to unit tests

• Removed database app initialization from tests
• Replaced applyServerExecutionBindings calls with applyServerExecutionBindingsWithInputs
• Simplified tests to use direct function calls with mock inputs

backend/domain/worker/appos_agent_bindings_test.go


14. backend/domain/certs/hooks.go ✨ Enhancement +44/-7

Extract certificate validation and expiry logic

• Added validatePrivateKeySecretRefWith function accepting mock callbacks for testability
• Refactored expireDueCertificates to use markExpiredCertificates helper
• Added markExpiredCertificates function to filter and mark expired certificates
• Added certificateShouldExpire function to check expiration logic

backend/domain/certs/hooks.go


15. backend/domain/monitor/signals/agent/agent_test.go 🧪 Tests +4/-19

Refactor agent signal tests with helper

• Replaced tests.NewTestApp() with newAgentTestApp(t) helper
• Removed unused migrations import
• Simplified test app initialization across multiple tests

backend/domain/monitor/signals/agent/agent_test.go


16. backend/domain/monitor/status/query_internal_test.go 🧪 Tests +5/-23

Convert monitor status query tests to unit tests

• Converted from integration test to unit test using in-memory records
• Replaced synthesizeAppTargetStatus with synthesizeAppTargetStatusFromRecord
• Removed database app initialization

backend/domain/monitor/status/query_internal_test.go


17. backend/cmd/openapi/gen.go ✨ Enhancement +12/-1

Add tunnel setup route support to OpenAPI generator

• Added reRootRouterMethod regex pattern to match root router method calls
• Updated route detection to support /tunnel/setup paths alongside /api/ paths
• Added handling for root router method calls in route scanning

backend/cmd/openapi/gen.go


18. backend/domain/routes/resources_test.go 🧪 Tests +54/-8

Optimize routes tests with baseline data sharing

• Added TestMain to manage baseline test data directory cleanup
• Added routesTestBaselineDataDir function to create and reuse baseline database
• Refactored newTestEnv to use baseline data directory for faster test initialization
• Added superuser seeding to baseline for token generation

backend/domain/routes/resources_test.go


19. backend/domain/certs/hooks_expiry_test.go 🧪 Tests +13/-32

Convert certificate expiry tests to unit tests

• Converted from integration test to unit test using in-memory records
• Replaced expireDueCertificates with markExpiredCertificates for direct testing
• Removed database app initialization and app.Save() calls

backend/domain/certs/hooks_expiry_test.go


20. backend/domain/worker/test_fixture_test.go 🧪 Tests +102/-0

Add worker test fixture with shared app

• Added new test fixture file with shared test app initialization
• Implemented TestMain for cleanup of baseline and shared app resources
• Added workerTestBaselineDataDir and newWorkerTestApp helpers
• Added resetWorkerTestState to clear collections between tests

backend/domain/worker/test_fixture_test.go


21. backend/domain/worker/appos_agent_bindings.go ✨ Enhancement +24/-20

Extract agent bindings logic for testability

• Refactored applyServerExecutionBindings to extract applyServerExecutionBindingsWithInputs
• Added effectiveAppOSBaseURLFromValue function for testable URL resolution
• Simplified effectiveAppOSBaseURL to use new helper function

backend/domain/worker/appos_agent_bindings.go


22. backend/domain/routes/docker_test.go 🧪 Tests +71/-0

Add Docker routes authorization tests

• Added doDocker helper function to make Docker route requests
• Added createRegularUserToken helper to create non-superuser tokens
• Added TestDockerRoutesRequireSuperuser to verify authorization enforcement

backend/domain/routes/docker_test.go


23. backend/domain/monitor/status/query.go ✨ Enhancement +10/-2

Extract monitor status query logic for testing

• Extracted buildOverviewFromRecords function for testability
• Extracted synthesizeAppTargetStatusFromRecord function for unit testing
• Refactored synthesizeAppTargetStatus to use new helper

backend/domain/monitor/status/query.go


24. backend/domain/monitor/signals/checks/credential_sweep_test.go 🧪 Tests +3/-15

Refactor credential sweep tests with helper

• Replaced tests.NewTestApp() with newChecksTestApp(t) helper
• Removed unused migrations import
• Simplified test app initialization

backend/domain/monitor/signals/checks/credential_sweep_test.go


25. backend/domain/worker/software_delivery_test.go 🧪 Tests +5/-26

Refactor software delivery tests with helper

• Replaced tests.NewTestApp() with newWorkerTestApp(t) helper
• Removed unused migrations import
• Simplified test app initialization across five test functions

backend/domain/worker/software_delivery_test.go


26. backend/infra/docker/ssh_test.go 🧪 Tests +65/-0

Add SSH host key and shell quoting tests

• Added TestBuildShellCommandQuotesArguments to verify shell argument escaping
• Added TestResolveHostKeyCallbackStrictWithoutKnownHostsFails for strict mode validation
• Added TestResolveHostKeyCallbackUsesConfiguredKnownHosts to verify known_hosts loading

backend/infra/docker/ssh_test.go


27. backend/infra/persistence/test_fixture_test.go 🧪 Tests +85/-0

Add persistence test fixture with shared app

• Added new test fixture file with shared test app initialization
• Implemented TestMain for cleanup of baseline and shared app resources
• Added persistenceTestBaselineDataDir and newPersistenceTestApp helpers
• Added resetPersistenceTestState to clear connector and instance collections

backend/infra/persistence/test_fixture_test.go


28. backend/domain/worker/monitoring_checks_test.go 🧪 Tests +4/-23

Refactor monitoring checks tests with helper

• Replaced tests.NewTestApp() with newWorkerTestApp(t) helper
• Removed unused migrations import
• Simplified test app initialization across four test functions

backend/domain/worker/monitoring_checks_test.go


29. backend/domain/worker/worker_test.go 🧪 Tests +7/-23

Refactor worker tests with shared fixture

• Replaced tests.NewTestApp() with newWorkerTestApp(t) helper
• Removed unused migrations import
• Simplified test app initialization across four test functions

backend/domain/worker/worker_test.go


30. backend/infra/migrations/test_fixture_test.go 🧪 Tests +88/-0

Add migrations test fixture with shared app

• Added new test fixture file with shared test app initialization
• Implemented TestMain for cleanup of baseline and shared app resources
• Added migrationsTestBaselineDataDir and newMigrationsTestApp helpers
• Added newIsolatedMigrationsTestApp for tests requiring isolation

backend/infra/migrations/test_fixture_test.go


31. backend/domain/worker/lifecycle_operations_test.go 🧪 Tests +4/-23

Refactor lifecycle operations tests with helper

• Replaced tests.NewTestApp() with newWorkerTestApp(t) helper
• Removed unused migrations import
• Simplified test app initialization across four test functions

backend/domain/worker/lifecycle_operations_test.go


32. backend/domain/software/runtime_bindings_test.go 🧪 Tests +9/-25

Convert software runtime bindings tests to unit tests

• Converted from integration test to unit test using mock settings
• Removed database app initialization
• Replaced ApplyRuntimeBindings with direct function calls using mock defaults

backend/domain/software/runtime_bindings_test.go


33. backend/domain/routes/deploy_test.go 🧪 Tests +51/-0

Add deploy route authentication tests

• Added doRegisteredRoute helper to test registered routes with custom headers
• Added TestRegisterRejectsQueryTokenForPlainHTTPAPI to verify query token rejection
• Added TestOperationLogStreamAllowsQueryTokenAuth to verify query token auth for WebSocket

backend/domain/routes/deploy_test.go


34. backend/domain/certs/resolve.go ✨ Enhancement +13/-2

Extract certificate resolution logic for testing

• Extracted resolveCertificateWith function accepting mock callbacks for testability
• Refactored ResolveCertificate to use new helper function

backend/domain/certs/resolve.go


35. web/src/components/monitor/MonitorTargetPanel.test.tsx 🧪 Tests +6/-0

Mock TimeSeriesChart component in tests

• Added mock for TimeSeriesChart component to avoid rendering complex chart
• Mock returns simple div with aria-label for test assertions

web/src/components/monitor/MonitorTargetPanel.test.tsx


36. backend/domain/monitor/status/query_test.go 🧪 Tests +6/-20

Refactor status query test to use in-memory records

• Changed package from status_test to status for internal testing
• Refactored test to use in-memory records instead of database app
• Removed test app setup/cleanup and collection queries
• Replaced status.BuildOverview(app) with buildOverviewFromRecords(records)

backend/domain/monitor/status/query_test.go


37. backend/domain/routes/server_test.go 🧪 Tests +34/-0

Add WebSocket origin validation test coverage

• Added four new test functions for WebSocket origin validation
• Tests cover empty origin, same origin, cross-origin rejection, and forwarded proxy scenarios
• Validates allowWebSocketOrigin function behavior with various request headers

backend/domain/routes/server_test.go


38. backend/infra/persistence/connector_repository_test.go 🧪 Tests +5/-20

Consolidate test app initialization with helper function

• Replaced repetitive test app initialization with newPersistenceTestApp(t) helper
• Removed boilerplate error handling for app creation across multiple tests
• Simplified test setup in four test functions

backend/infra/persistence/connector_repository_test.go


39. backend/domain/monitor/signals/platform/observer.go ✨ Enhancement +9/-1

Add dependency injection for resource collection function

• Added resourceFn field to PlatformObserver struct for resource collection
• Initialized resourceFn with supervisor.GetProcessResources in constructor
• Added SetResourceFunc method to allow dependency injection of resource function
• Changed Collect method to use injected o.resourceFn instead of direct call

backend/domain/monitor/signals/platform/observer.go


40. backend/domain/config/sharedenv/test_fixture_test.go 🧪 Tests +56/-0

Add shared test fixture for sharedenv package

• New file with shared test baseline setup for sharedenv package tests
• Implements TestMain for cleanup and sharedEnvTestBaselineDataDir for baseline initialization
• Provides newSharedEnvTestApp helper using sync.Once for efficient test app reuse

backend/domain/config/sharedenv/test_fixture_test.go


41. backend/infra/persistence/provider_account_repository_test.go 🧪 Tests +4/-15

Consolidate test app initialization with helper function

• Replaced test app initialization boilerplate with newPersistenceTestApp(t) helper
• Removed error handling for app creation in three test functions
• Simplified test setup code

backend/infra/persistence/provider_account_repository_test.go


42. backend/domain/monitor/signals/checks/test_fixture_test.go 🧪 Tests +50/-0

Add shared test fixture for checks package

• New file with shared test baseline setup for checks package tests
• Implements TestMain for cleanup and newChecksTestApp helper
• Uses sync.Once pattern for efficient baseline initialization and reuse

backend/domain/monitor/signals/checks/test_fixture_test.go


43. backend/domain/monitor/signals/agent/test_fixture_test.go 🧪 Tests +50/-0

Add shared test fixture for agent package

• New file with shared test baseline setup for agent package tests
• Implements TestMain for cleanup and newAgentTestApp helper
• Uses sync.Once pattern for efficient baseline initialization and reuse

backend/domain/monitor/signals/agent/test_fixture_test.go


44. backend/domain/monitor/signals/platform/test_fixture_test.go 🧪 Tests +50/-0

Add shared test fixture for platform package

• New file with shared test baseline setup for platform package tests
• Implements TestMain for cleanup and newPlatformTestApp helper
• Uses sync.Once pattern for efficient baseline initialization and reuse

backend/domain/monitor/signals/platform/test_fixture_test.go


45. backend/domain/monitor/status/store/test_fixture_test.go 🧪 Tests +50/-0

Add shared test fixture for store package

• New file with shared test baseline setup for store package tests
• Implements TestMain for cleanup and newStoreTestApp helper
• Uses sync.Once pattern for efficient baseline initialization and reuse

backend/domain/monitor/status/store/test_fixture_test.go


46. backend/domain/lifecycle/orchestration/test_fixture_test.go 🧪 Tests +40/-0

Add shared test fixture for orchestration package

• New file with shared test baseline setup for orchestration package tests
• Implements TestMain for cleanup and orchestrationTestBaselineDataDir helper
• Uses sync.Once pattern for efficient baseline initialization

backend/domain/lifecycle/orchestration/test_fixture_test.go


47. backend/domain/routes/deploy.go ✨ Enhancement +5/-1

Reorganize operation log stream endpoint with auth middleware

• Moved operation log stream endpoint from operations group to new actions group
• Added WebSocket token authentication and superuser auth to actions group
• Reorganized route registration for better separation of concerns

backend/domain/routes/deploy.go


48. backend/domain/resource/connectors/test_fixture_test.go 🧪 Tests +40/-0

Add shared test fixture for connectors package

• New file with shared test baseline setup for connectors package tests
• Implements TestMain for cleanup and connectorsTestBaselineDataDir helper
• Uses sync.Once pattern for efficient baseline initialization

backend/domain/resource/connectors/test_fixture_test.go


49. backend/domain/routes/docker.go ✨ Enhancement +2/-0

Add superuser authentication to docker routes

• Added import for github.com/pocketbase/pocketbase/apis
• Added superuser authentication middleware binding to docker routes group

backend/domain/routes/docker.go


50. backend/infra/persistence/instance_repository_test.go 🧪 Tests +3/-10

Consolidate test app initialization with helper function

• Replaced test app initialization boilerplate with newPersistenceTestApp(t) helper
• Removed error handling for app creation in two test functions
• Simplified test setup code

backend/infra/persistence/instance_repository_test.go


51. backend/domain/monitor/status/store/projection.go ✨ Enhancement +5/-1

Extract resource check summary building logic

• Extracted BuildResourceCheckSummary function from LoadResourceCheckSummaryLoadResourceCheckSummary now delegates to BuildResourceCheckSummary
• Added CloneSummary call in new function to prevent mutation of existing summary

backend/domain/monitor/status/store/projection.go


52. backend/domain/routes/apps.go Formatting +1/-1

Fix code indentation in apps route

• Fixed indentation inconsistency in validateAppComposeConfig function
• Changed from tabs to spaces for proper alignment

backend/domain/routes/apps.go


53. backend/domain/monitor/signals/platform/model.go ✨ Enhancement +2/-0

Add resource function field to platform observer

• Added import for github.com/websoft9/appos/backend/infra/supervisor
• Added resourceFn field to PlatformObserver struct for resource collection function

backend/domain/monitor/signals/platform/model.go


54. backend/domain/resource/connectors/runtime_test.go 🧪 Tests +5/-1

Use baseline directory in connector runtime tests

• Modified newRuntimeTestApp to use baseline directory from connectorsTestBaselineDataDir()
• Changed from creating fresh test app to reusing baseline for efficiency

backend/domain/resource/connectors/runtime_test.go


55. backend/domain/lifecycle/orchestration/runner_test.go 🧪 Tests +6/-1

Use baseline directory in orchestration runner tests

• Modified newRunnerTestContext to use baseline directory from
 orchestrationTestBaselineDataDir()
• Changed from creating fresh test app to reusing baseline for efficiency

backend/domain/lifecycle/orchestration/runner_test.go


56. backend/domain/software/service/service_test.go 🐞 Bug fix +2/-0

Add return statements after fatal errors in tests

• Added return statements after t.Fatal calls in two test functions
• Prevents unreachable code execution after fatal errors

backend/domain/software/service/service_test.go


57. backend/domain/software/runtime_bindings.go ✨ Enhancement +4/-0

Extract agent installer URL resolution logic

• Extracted effectiveAppOSAgentInstallerURLFromGroup function from
 effectiveAppOSAgentInstallerURL
• New function accepts group and defaults as parameters for better testability
• Original function now delegates to extracted function

backend/domain/software/runtime_bindings.go


58. Makefile ⚙️ Configuration changes +396/-83

Enhance Makefile with actionlint, improved CI/CD, and better tooling

• Added actionlint tool installation and configuration
• Reorganized help text with new sections for OpenAPI and Security & Artifacts
• Enhanced test targets with E2E smoke and full suite options
• Improved lint, fmt, and sec targets with better error handling and logging
• Renamed scan and sbom targets to unified artifact-scan target
• Updated check target to include openapi-check and reordered quality checks
• Added support for qodo CLI tool installation

Makefile


59. web/src/pages/system/PlatformStatusPage.test.tsx 🧪 Tests +228/-207

Refactor platform status page tests for clarity

• Extracted mock response setup into mockPlatformStatusResponses function
• Split single large test into three focused tests for better clarity
• Added cleanup import and call in afterEach hook
• Added 10-second timeout to window-switching test

web/src/pages/system/PlatformStatusPage.test.tsx


60. backend/build/reports/gitleaks-report.json Miscellaneous +191/-0

Add gitleaks security scan report

• New file containing gitleaks security scan report
• Documents detected generic API keys and private keys with redacted values
• Includes findings from multiple test and configuration files

backend/build/reports/gitleaks-report.json


61. backend/go.sum Dependencies +8/-0

Update Go module dependencies

• Added new Go module versions for golang.org/x/image, golang.org/x/mod, golang.org/x/sync,
 golang.org/x/text, and golang.org/x/tools
• Updated dependency checksums for compatibility

backend/go.sum


62. backend/docs/openapi/api.yaml 📝 Documentation +67/-57

Update OpenAPI spec with new endpoints and descriptions

• Updated Monitoring tag description to include container telemetry
• Updated Resource tag description to remove cloud accounts and databases
• Updated System Cron tag description for clarity
• Added new /api/monitor/servers/{id}/container-telemetry endpoint
• Added new /tunnel/setup/{token} endpoint
• Simplified /api/crons/{jobId}/logs response schema

backend/docs/openapi/api.yaml


63. web/src/routes/_app/_auth/resources/-servers.test.tsx 🧪 Tests +78/-10

Add monitor and tunnel setup mocks to servers test

• Added mocks for getSystemdStatus, installMonitorAgent, and updateMonitorAgent functions
• Added mocks for MonitorTargetPanel, TunnelSetupWizard, and SecretForm components
• Updated test setup to initialize new mocks
• Increased test timeout from 15s to 25s for slower operations

web/src/routes/_app/_auth/resources/-servers.test.tsx


64. backend/docs/openapi/ext-api.yaml 📝 Documentation +80/-2

Update custom OpenAPI spec with new endpoints

• Updated Monitoring tag description to include container telemetry
• Updated Resource tag description to remove cloud accounts and databases
• Added System Cron tag with description
• Added new /api/crons/{jobId}/logs endpoint
• Added new /api/monitor/servers/{id}/container-telemetry endpoint
• Added new /tunnel/setup/{token} endpoint

backend/docs/openapi/ext-api.yaml


65. .github/branch-protection-guide.md 📝 Documentation +74/-11

Document CI/CD layers and branch protection strategy

• Added documentation for Dev Fast CI workflow for non-main branches
• Added CodeQL source security scanning layer documentation
• Updated required check recommendations with specific job names
• Clarified branch protection configuration best practices
• Added section on current code scanning state and Trivy integration

.github/branch-protection-guide.md


66. web/src/pages/apps/AppDetailPage.test.tsx 🧪 Tests +51/-4

Add component mocks and improve test assertions

• Added mocks for AppDetailDisplaySection, AppDetailActionHistoryTable, and TimeSeriesChart
 components
• Updated test assertions to use findByText with custom matcher for better reliability
• Added await to async queries for proper test timing

web/src/pages/apps/AppDetailPage.test.tsx


67. web/src/pages/deploy/CreateDeploymentPage.test.tsx 🧪 Tests +86/-0

Add orchestration section mock to deployment test

• Added mock for OrchestrationSection component with full form simulation
• Imported useEffect from React for mock implementation
• Mock handles compose content, environment variables, and file uploads

web/src/pages/deploy/CreateDeploymentPage.test.tsx


68. .github/workflows/dev-fast-ci.yml ⚙️ Configuration changes +85/-0

Add dev fast CI workflow for development branches

• New workflow for lightweight CI checks on non-main development branches
• Runs fast lint, backend tests, frontend tests, and security checks
• Uses concurrency to cancel previous runs on same branch
• Uploads gitleaks report as artifact

.github/workflows/dev-fast-ci.yml


69. web/src/pages/overview/OverviewPage.test.tsx 🧪 Tests +21/-13

Fix async test queries in OverviewPage test

• Replaced synchronous screen.getBy* calls with asynchronous await screen.findBy* calls to
 handle async rendering
• Updated screen.getAllByText() and screen.getAllByRole() to use await screen.findAllBy*() for
 consistency
• Reformatted multi-line assertions for better readability

web/src/pages/overview/OverviewPage.test.tsx


70. backend/docs/openapi/group-matrix.yaml 📝 Documentation +8/-8

Update OpenAPI group matrix for API surface changes

• Removed /api/ext/resources/cloud-accounts* and /api/ext/resources/databases* from Resource
 group extSurface
• Updated Resource group description to reflect scripts-only scope
• Added GET /api/monitor/servers/{id}/container-telemetry to Monitoring group extSurface
• Removed POST /api/monitor/netdata/write from Monitoring group extSurface
• Updated Monitoring group description to include container telemetry and remove Netdata reference
• Changed System Cron group from Native to Mixed apiType and added GET /api/crons/{jobId}/logs to
 extSurface
• Added crons.go to System Cron extRouteFiles

backend/docs/openapi/group-matrix.yaml


71. tests/README.md 📝 Documentation +46/-1

Add comprehensive test infrastructure documentation

• Expanded from single line to comprehensive testing documentation
• Added overview of test infrastructure including backend Go tests, frontend Vitest, and E2E
 coverage
• Documented PocketBase baseline fixture pattern for backend/domain/routes to optimize test
 performance
• Explained migration cost optimization and test isolation guardrails
• Added guidelines for adding new tests with fixture best practices

tests/README.md


72. .github/workflows/codeql.yml ⚙️ Configuration changes +71/-0

Add CodeQL security scanning workflow

• Created new CodeQL workflow for automated security analysis
• Added separate jobs for Go and JavaScript/TypeScript analysis
• Configured CodeQL initialization, language setup, and analysis steps
• Integrated with GitHub's security event reporting

.github/workflows/codeql.yml


73. .github/workflows/_quality-gate.yml ⚙️ Configuration changes +17/-2

Add OpenAPI validation to CI quality gate

• Added new openapi job to run OpenAPI sync check in CI pipeline
• Updated e2e job dependencies to include the new openapi job
• Changed E2E test command from make e2e to make test e2e fast

.github/workflows/_quality-gate.yml


74. .gitleaks.toml ⚙️ Configuration changes +46/-0

Add gitleaks configuration for secret scanning

• Created new gitleaks configuration file for secret detection
• Added allowlists for generated frontend build output, BMAD manifests, and skill docs
• Configured test fixture allowlists with specific regex patterns for non-production placeholders
• Added allowlist for development-only crypto fallback keys

.gitleaks.toml


75. tests/e2e/README.md 📝 Documentation +10/-3

Update E2E test documentation and entry points

• Updated entry points to clarify make test e2e fast as smoke suite and make test e2e as full
 entrypoint
• Changed terminology from "smoke test" to "smoke suite"
• Added planned layering section describing fast vs full E2E test coverage
• Clarified that make test in strict mode includes E2E fast tests

tests/e2e/README.md


76. web/src/routes/_app/_auth/resources/-service-instances.test.tsx 🧪 Tests +47/-0

Add SecretForm component mock for tests

• Added comprehensive mock for SecretForm component with template-based field rendering
• Implemented mock support for textarea and input field types with proper aria-labels
• Added payload change handler for form field updates

web/src/routes/_app/_auth/resources/-service-instances.test.tsx


77. specs/implementation-artifacts/story1.6-security-scanning.md 📝 Documentation +2/-3

Update security scanning acceptance criteria

• Updated make sec acceptance criteria to include trivy config scanning for source code
 configuration risks
• Renamed make scan to make artifact-scan and clarified SBOM generation before image scanning
• Reordered acceptance criteria to reflect updated tooling workflow

specs/implementation-artifacts/story1.6-security-scanning.md


78. web/src/pages/system/MonitorOverview.test.tsx 🧪 Tests +5/-5

Fix async test queries in MonitorOverview test

• Replaced synchronous screen.getBy* and screen.getAllByText() calls with asynchronous `await
 screen.findBy*` equivalents
• Updated button role queries to use async findByRole for consistency with async rendering

web/src/pages/system/MonitorOverview.test.tsx


79. backend/go.mod Dependencies +4/-4

Update Go version and dependencies

• Updated Go version from 1.26.0 to 1.26.2
• Updated golang.org/x/image from v0.35.0 to v0.39.0
• Updated golang.org/x/sync from v0.19.0 to v0.20.0
• Updated golang.org/x/text from v0.33.0 to v0.36.0

backend/go.mod


80. web/src/pages/system/TunnelsPage.test.tsx 🧪 Tests +3/-3

Fix async test queries in TunnelsPage test

• Replaced synchronous screen.getByText() calls with asynchronous await screen.findByText() for
 async rendering
• Updated one screen.getByRole() call to use await screen.findByRole() for consistency

web/src/pages/system/TunnelsPage.test.tsx


81. specs/implementation-artifacts/story1.2-makefile.md 📝 Documentation +3/-3

Update Makefile documentation for test command

• Updated make test description to clarify it runs strict tests including make test e2e fast
• Updated testing workflow documentation to reflect E2E fast tests in strict mode
• Clarified that make test includes E2E fast tests in both code cycle and testing sections

specs/implementation-artifacts/story1.2-makefile.md


82. backend/docs/openapi/README.md 📝 Documentation +3/-0

Document OpenAPI validation command

• Added documentation for make openapi-check command
• Explained validation of custom route anchors in route code against ext-api.yaml
• Documented validation that extSurface entries in group-matrix.yaml match generated paths

backend/docs/openapi/README.md


83. build/.env Security +1/-1

Replace hardcoded secret with placeholder

• Changed APPOS_SECRET_KEY from hardcoded base64 value to placeholder
 replace-with-a-random-base64-secret

build/.env


84. .github/pull_request_template.md 📝 Documentation +1/-1

Update PR template E2E test command

• Updated validation checklist to use make test e2e fast instead of make e2e

.github/pull_request_template.md


85. build/reports/gitleaks-report.json ⚙️ Configuration changes +1/-0

Add gitleaks report file

• Created new empty gitleaks report file with empty array

build/reports/gitleaks-report.json


86. backend/cmd/openapi/merge.go Additional files +0/-1

...

backend/cmd/openapi/merge.go


87. backend/domain/routes/routes.go Additional files +0/-1

...

backend/domain/routes/routes.go


88. backend/domain/worker/lifecycle_operations.go Additional files +0/-1

...

backend/domain/worker/lifecycle_operations.go


Grey Divider

Qodo Logo

Comment on lines +15 to +85
name: Fast Checks
runs-on: ubuntu-latest
env:
GITLEAKS_REPORT_PATH: build/reports/gitleaks-report.json
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: backend/go.mod
cache-dependency-path: backend/go.sum

- name: Prepare Go tool bin
run: |
mkdir -p "$RUNNER_TEMP/bin"
echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: web/package-lock.json

- name: Install frontend deps
run: cd web && npm ci

- name: Install fast-check tools
run: |
set -euo pipefail
GOBIN="$RUNNER_TEMP/bin" go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
GOBIN="$RUNNER_TEMP/bin" go install golang.org/x/vuln/cmd/govulncheck@latest

GL_VERSION="8.24.2"
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) GL_ARCH="x64" ;;
aarch64|arm64) GL_ARCH="arm64" ;;
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;;
esac
curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v${GL_VERSION}/gitleaks_${GL_VERSION}_linux_${GL_ARCH}.tar.gz" \
| tar -xz -C "$RUNNER_TEMP/bin" gitleaks

- name: Run fast lint
run: make lint fast
env:
GOLANGCI_LINT_BIN: ${{ runner.temp }}/bin/golangci-lint

- name: Run fast backend tests
run: make test backend fast

- name: Run frontend tests
run: make test web

- name: Run fast security checks
run: make sec fast
env:
GOVULNCHECK_BIN: ${{ runner.temp }}/bin/govulncheck
GITLEAKS_BIN: ${{ runner.temp }}/bin/gitleaks
GITLEAKS_REPORT_PATH: ${{ env.GITLEAKS_REPORT_PATH }}

- name: Upload fast CI gitleaks report
if: always()
uses: actions/upload-artifact@v4
with:
name: dev-fast-gitleaks-${{ github.sha }}
path: ${{ env.GITLEAKS_REPORT_PATH }}
if-no-files-found: ignore No newline at end of file
@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented May 7, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1)

Grey Divider


Action required

1. PocketBase named in OpenAPI 📘 Rule violation § Compliance
Description
The updated OpenAPI docs introduce PocketBase (a specific product name) in public-facing tag
descriptions instead of using generic technology terms. This conflicts with the documentation
requirement to avoid vendor/product specificity unless it is essential (e.g., explicit
migration/integration context).
Code

backend/docs/openapi/ext-api.yaml[R64-65]

+  - name: System Cron
+    description: "PocketBase scheduled tasks and cron management APIs."
Evidence
PR Compliance ID 517574 requires using generic technology terms in public-facing documentation
rather than specific product names. The PR adds/updates OpenAPI tag descriptions that explicitly
mention PocketBase, which is a product name, in backend/docs/openapi/ext-api.yaml and
backend/docs/openapi/api.yaml.

Rule 517574: Use generic technology terms in public-facing docs instead of specific product names
backend/docs/openapi/ext-api.yaml[64-65]
backend/docs/openapi/api.yaml[72-72]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
OpenAPI tag descriptions added/modified in this PR reference `PocketBase`, a specific product name, rather than using generic terms (e.g., “scheduled tasks” / “cron management”).

## Issue Context
The compliance rule requires generic technology terms in public-facing docs unless specificity is essential for an explicit migration/integration guide.

## Fix Focus Areas
- backend/docs/openapi/ext-api.yaml[64-65]
- backend/docs/openapi/api.yaml[72-72]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Expiry sweep misses certificates 🐞 Bug ≡ Correctness
Description
expireDueCertificates now queries an arbitrary first 200 "active" certificates with non-empty
expires_at (no expires_at <= now filter and no ordering) and only expires those returned, so due
certificates may remain unprocessed indefinitely. This can leave actually-expired certificates stuck
in active status, breaking certificate lifecycle enforcement.
Code

backend/domain/certs/hooks.go[R214-223]

func expireDueCertificates(app core.App) error {
-	now := time.Now().UTC().Format(time.RFC3339)
+	now := time.Now().UTC()
	records, err := app.FindRecordsByFilter(
		"certificates",
-		"status = 'active' && expires_at != '' && expires_at <= {:now}",
+		"status = 'active' && expires_at != ''",
		"",
		200,
		0,
-		map[string]any{"now": now},
+		nil,
	)
Evidence
The sweep fetches records with status = 'active' && expires_at != '' and a hard limit of 200, but
does not constrain the query to records already due for expiry or order by expires_at; therefore
the returned set can omit due certificates (e.g., when many future-expiry certs exist) and those
omitted due certs will not be marked expired. The loop runs periodically, but without a due-only
filter + ordering + paging there is no guarantee all due certs will be selected for processing.

backend/domain/certs/hooks.go[194-235]
backend/domain/certs/hooks.go[237-262]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`expireDueCertificates` fetches only the first 200 active certificates with a non-empty `expires_at`, without filtering for those actually due (`expires_at <= now`) and without ordering/pagination. This can prevent some due certificates from ever being marked expired.

### Issue Context
The sweep runs on a ticker and should reliably converge on expiring all due certificates. Relying on an unsorted, capped query over *all* active certs with `expires_at` set breaks that guarantee.

### Fix Focus Areas
- backend/domain/certs/hooks.go[214-235]
- backend/domain/certs/hooks.go[194-211]

### What to change
- Reintroduce a DB-level due filter (e.g. `expires_at <= {:now}`) using `now.Format(time.RFC3339)`.
- Add a deterministic sort (e.g. `expires_at` ascending).
- Page through results (offset += limit) until fewer than `limit` records are returned, expiring each due record.
- Keep `certificateShouldExpire` as a safety check (e.g., to handle parse failures) but don’t rely on it to compensate for an overly broad, capped query.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

}

func buildShellCommand(command string, args ...string) string {
parts := make([]string, 0, len(args)+1)
Comment on lines +64 to +65
- name: System Cron
description: "PocketBase scheduled tasks and cron management APIs."
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. pocketbase named in openapi 📘 Rule violation § Compliance

The updated OpenAPI docs introduce PocketBase (a specific product name) in public-facing tag
descriptions instead of using generic technology terms. This conflicts with the documentation
requirement to avoid vendor/product specificity unless it is essential (e.g., explicit
migration/integration context).
Agent Prompt
## Issue description
OpenAPI tag descriptions added/modified in this PR reference `PocketBase`, a specific product name, rather than using generic terms (e.g., “scheduled tasks” / “cron management”).

## Issue Context
The compliance rule requires generic technology terms in public-facing docs unless specificity is essential for an explicit migration/integration guide.

## Fix Focus Areas
- backend/docs/openapi/ext-api.yaml[64-65]
- backend/docs/openapi/api.yaml[72-72]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 214 to 223
func expireDueCertificates(app core.App) error {
now := time.Now().UTC().Format(time.RFC3339)
now := time.Now().UTC()
records, err := app.FindRecordsByFilter(
"certificates",
"status = 'active' && expires_at != '' && expires_at <= {:now}",
"status = 'active' && expires_at != ''",
"",
200,
0,
map[string]any{"now": now},
nil,
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Expiry sweep misses certificates 🐞 Bug ≡ Correctness

expireDueCertificates now queries an arbitrary first 200 "active" certificates with non-empty
expires_at (no expires_at <= now filter and no ordering) and only expires those returned, so due
certificates may remain unprocessed indefinitely. This can leave actually-expired certificates stuck
in active status, breaking certificate lifecycle enforcement.
Agent Prompt
### Issue description
`expireDueCertificates` fetches only the first 200 active certificates with a non-empty `expires_at`, without filtering for those actually due (`expires_at <= now`) and without ordering/pagination. This can prevent some due certificates from ever being marked expired.

### Issue Context
The sweep runs on a ticker and should reliably converge on expiring all due certificates. Relying on an unsorted, capped query over *all* active certs with `expires_at` set breaks that guarantee.

### Fix Focus Areas
- backend/domain/certs/hooks.go[214-235]
- backend/domain/certs/hooks.go[194-211]

### What to change
- Reintroduce a DB-level due filter (e.g. `expires_at <= {:now}`) using `now.Format(time.RFC3339)`.
- Add a deterministic sort (e.g. `expires_at` ascending).
- Page through results (offset += limit) until fewer than `limit` records are returned, expiring each due record.
- Keep `certificateShouldExpire` as a safety check (e.g., to handle parse failures) but don’t rely on it to compensate for an overly broad, capped query.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR significantly expands the project’s test/quality and security posture (beyond the PR description’s “fix test”), including stricter Makefile workflows, CI updates, additional unit tests/mocks, OpenAPI coverage validation, and hardening around SSH + WebSocket security.

Changes:

  • Stabilize/accelerate tests: raise Vitest timeouts, convert flaky assertions to async findBy*, add targeted mocks, and introduce shared PocketBase baseline fixtures in multiple backend test packages.
  • Tighten quality gates: expand make test/lint/sec/check behavior (OpenAPI checks, E2E smoke in strict mode, actionlint/typecheck in lint), add dev fast CI workflow, and refresh docs around testing/branch protection.
  • Security hardening: SSH host key verification support (known_hosts + strict mode), WebSocket Origin validation, Docker ext routes restricted to superusers, plus gitleaks/trivy config integration.

Reviewed changes

Copilot reviewed 86 out of 89 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
web/vitest.config.ts Increase Vitest timeout to reduce flaky web tests.
web/src/routes/_app/_auth/resources/-service-instances.test.tsx Add SecretForm mock to stabilize UI tests.
web/src/routes/_app/_auth/resources/-servers.test.tsx Add mocks + extend test timeouts to reduce flakiness in ServersPage tests.
web/src/pages/system/TunnelsPage.test.tsx Replace sync queries with async findByText to avoid race conditions.
web/src/pages/system/PlatformStatusPage.test.tsx Refactor mock setup + split into focused tests; add cleanup.
web/src/pages/system/MonitorOverview.test.tsx Convert assertions to async finds for stability.
web/src/pages/overview/OverviewPage.test.tsx Convert assertions to async finds for stability.
web/src/pages/deploy/CreateDeploymentPage.test.tsx Mock OrchestrationSection to decouple CreateDeploymentPage tests.
web/src/pages/deploy/actions/action-utils.test.ts New unit test for building action WebSocket URLs (including token query param).
web/src/pages/apps/AppDetailPage.test.tsx Add section mocks + make assertions more robust/async.
web/src/components/monitor/MonitorTargetPanel.test.tsx Mock TimeSeriesChart for deterministic rendering in tests.
tests/README.md Document test strategy + backend PocketBase baseline fixture rationale/guardrails.
tests/e2e/README.md Update E2E entrypoints and planned layering (make test e2e fast, etc.).
specs/implementation-artifacts/story1.6-security-scanning.md Update security scanning acceptance criteria (sec vs artifact scan).
specs/implementation-artifacts/story1.2-makefile.md Update docs to reflect make test now includes E2E smoke in strict mode.
Makefile Major updates: new test/lint/sec/check flows, OpenAPI validation, E2E integration, artifact scan, install tools, richer logging.
build/reports/gitleaks-report.json Added gitleaks output artifact (currently empty).
build/.env Replace committed secret key with placeholder text.
backend/infra/persistence/test_fixture_test.go Add baseline+shared PocketBase test fixture for persistence tests.
backend/infra/persistence/provider_account_repository_test.go Switch tests to shared baseline fixture.
backend/infra/persistence/instance_repository_test.go Switch tests to shared baseline fixture.
backend/infra/persistence/connector_repository_test.go Switch tests to shared baseline fixture.
backend/infra/migrations/test_fixture_test.go Add baseline+shared PocketBase fixture for migration tests.
backend/infra/migrations/migrations_test.go Switch migration tests to baseline fixture (and isolate where needed).
backend/infra/docker/ssh.go Add shell-quoting for SSH commands + known_hosts-based host key verification with env overrides.
backend/infra/docker/ssh_test.go Unit tests for quoting and host key callback behavior.
backend/go.mod Patch-level Go version bump + update x/* indirect deps.
backend/go.sum Corresponding module sum updates.
backend/domain/worker/worker_test.go Switch to worker baseline fixture.
backend/domain/worker/test_fixture_test.go New worker test baseline fixture + state reset helper.
backend/domain/worker/software_delivery_test.go Switch to worker baseline fixture.
backend/domain/worker/monitoring_checks_test.go Switch to worker baseline fixture.
backend/domain/worker/lifecycle_operations.go Remove stray blank line.
backend/domain/worker/lifecycle_operations_test.go Switch to worker baseline fixture.
backend/domain/worker/appos_agent_bindings.go Refactor to smaller pure helpers for base URL + env injection.
backend/domain/worker/appos_agent_bindings_test.go Update tests to use new pure helper functions.
backend/domain/software/service/service_test.go Minor test flow tweak (early return after fatal).
backend/domain/software/runtime_bindings.go Extract pure helper for installer URL resolution.
backend/domain/software/runtime_bindings_test.go Convert to pure-function style tests (no PocketBase app required).
backend/domain/routes/server.go Add WebSocket Origin validation (replaces CheckOrigin: true).
backend/domain/routes/server_test.go Add tests for WebSocket origin validation incl forwarded headers.
backend/domain/routes/routes.go Adjust auth middleware placement: remove query-token auth from general /api.
backend/domain/routes/routes_coverage_test.go Expand OpenAPI coverage checks + add matrix extSurface coverage validation.
backend/domain/routes/resources_test.go Introduce baseline PocketBase fixture for route tests + seed superuser once.
backend/domain/routes/docker.go Restrict /api/ext/docker/* routes to superusers.
backend/domain/routes/docker_test.go Add tests asserting superuser-only access for docker ext routes.
backend/domain/routes/deploy.go Move log stream endpoint under /api/actions/{id}/stream and bind ws token auth + superuser auth.
backend/domain/routes/deploy_test.go Add tests ensuring query-token auth works only for websocket stream route.
backend/domain/routes/apps.go Fix indentation in temp compose write path.
backend/domain/resource/connectors/test_fixture_test.go Add baseline fixture for connector runtime tests.
backend/domain/resource/connectors/runtime_test.go Use baseline fixture when creating test app.
backend/domain/monitor/status/store/test_fixture_test.go Add baseline fixture for status store tests.
backend/domain/monitor/status/store/store_test.go Reduce integration dependency; use pure helper for summary building + baseline fixture.
backend/domain/monitor/status/store/projection.go Extract BuildResourceCheckSummary for testability.
backend/domain/monitor/status/query.go Extract pure helpers to build overview/synthesize app status from records.
backend/domain/monitor/status/query_test.go Switch to pure-record unit test for overview building at scale.
backend/domain/monitor/status/query_internal_test.go Switch to pure-record unit test for app status synthesis.
backend/domain/monitor/signals/platform/test_fixture_test.go Add baseline fixture for platform observer tests.
backend/domain/monitor/signals/platform/observer.go Make process resource collection injectable for tests.
backend/domain/monitor/signals/platform/observer_test.go Use baseline fixture + inject resource function.
backend/domain/monitor/signals/platform/model.go Add injected resource function to observer model.
backend/domain/monitor/signals/checks/test_fixture_test.go Add baseline fixture for monitor checks tests.
backend/domain/monitor/signals/checks/credential_sweep_test.go Use baseline fixture for checks tests.
backend/domain/monitor/signals/agent/test_fixture_test.go Add baseline fixture for agent signal tests.
backend/domain/monitor/signals/agent/agent_test.go Use baseline fixture for agent tests.
backend/domain/lifecycle/projection/updater_test.go Convert to pure record tests (no PocketBase app required).
backend/domain/lifecycle/orchestration/test_fixture_test.go Add baseline fixture for orchestration tests.
backend/domain/lifecycle/orchestration/runner_test.go Use baseline fixture for runner context creation.
backend/domain/config/sharedenv/test_fixture_test.go Add baseline fixture for shared env tests.
backend/domain/config/sharedenv/query_test.go Use baseline fixture; minor refactors.
backend/domain/certs/resolve.go Extract injectable helper for testability (resolveCertificateWith).
backend/domain/certs/resolve_test.go Convert to pure unit tests using injected fns (no PocketBase app required).
backend/domain/certs/hooks.go Refactor expiry sweep to pure helpers and injection points.
backend/domain/certs/hooks_test.go Convert validation tests to pure helper-based tests (no PocketBase app required).
backend/domain/certs/hooks_expiry_test.go Convert expiry tests to pure helper-based tests (no PocketBase app required).
backend/docs/openapi/README.md Document expanded openapi-check guarantees.
backend/docs/openapi/group-matrix.yaml Update surfaces/descriptions + add cron logs/ext monitoring telemetry surfaces.
backend/docs/openapi/ext-api.yaml Add/adjust tags and paths (cron logs, telemetry, tunnel setup).
backend/docs/openapi/api.yaml Sync merged OpenAPI output with ext spec updates.
backend/cmd/openapi/merge.go Remove trailing whitespace/newline.
backend/cmd/openapi/gen.go Extend generator to capture root-router routes and tunnel setup paths.
backend/build/reports/gitleaks-report.json Added gitleaks output artifact with redacted findings.
.gitleaks.toml Add repo gitleaks configuration and allowlists for known fixtures/dev keys.
.github/workflows/dev-fast-ci.yml Add non-main “fast checks” workflow.
.github/workflows/codeql.yml Add CodeQL workflows for Go + JS/TS.
.github/workflows/_quality-gate.yml Add OpenAPI job and wire it into E2E job dependencies; switch E2E command to make test e2e fast.
.github/pull_request_template.md Update validation checklist to use make test e2e fast.
.github/branch-protection-guide.md Expand branch protection guidance + document workflow roles and CodeQL.
Files not reviewed (1)
  • web/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

build/reports/gitleaks-report.json:2

  • This looks like a generated CI artifact (gitleaks JSON report). Keeping it committed will make local runs/CI overwrite tracked files and can create noisy diffs. Consider removing it from the repo and adding this path to .gitignore, relying on CI artifacts for the uploaded report instead.

Comment on lines 214 to 223
func expireDueCertificates(app core.App) error {
now := time.Now().UTC().Format(time.RFC3339)
now := time.Now().UTC()
records, err := app.FindRecordsByFilter(
"certificates",
"status = 'active' && expires_at != '' && expires_at <= {:now}",
"status = 'active' && expires_at != ''",
"",
200,
0,
map[string]any{"now": now},
nil,
)
Comment thread Makefile
Comment on lines +140 to +149
@echo "Installing Node.js CLI tools..."
@# Qodo CLI is published on npm as @qodo/command (provides the `qodo` binary)
@if ! command -v qodo >/dev/null 2>&1; then \
echo "→ qodo..."; \
npm install -g @qodo/command; \
else \
echo "✓ qodo already installed"; \
fi
@echo "✓ Node.js CLI tools installed"
@echo ""
Comment thread Makefile
Comment on lines +501 to +504
echo "✗ actionlint is required for strict lint mode."; \
echo " Expected binary at $(DEFAULT_ACTIONLINT_BIN) or on PATH."; \
echo " Install it with 'make install' or run 'make lint fast' for advisory fallback mode."; \
exit 1; \
Comment thread Makefile
Comment on lines 540 to 571
fmt:
@echo "Formatting code ($(QUALITY_MODE))..."
@if [ -f "backend/go.mod" ]; then \
@set -e; advisory_failures=""; \
if [ -f "backend/go.mod" ]; then \
echo "→ gofmt..."; \
find backend -name "*.go" -exec gofmt -w {} +; \
log_file=$$(mktemp); \
set +e; find backend -name "*.go" -exec gofmt -w {} + >"$$log_file" 2>&1; status=$$?; set -e; \
cat "$$log_file"; \
if [ "$(QUALITY_MODE)" = "fast" ]; then \
if [ "$$status" -ne 0 ]; then advisory_failures="$$advisory_failures gofmt"; fi; \
else \
if [ "$$status" -ne 0 ]; then \
echo "✗ Format failed at: gofmt"; \
rm -f "$$log_file"; \
exit $$status; \
fi; \
fi; \
rm -f "$$log_file"; \
fi
ifeq ($(QUALITY_MODE),fast)
@if [ -f "web/node_modules/.bin/prettier" ]; then \
echo "→ prettier..."; \
cd web && npx prettier --write "src/**/*.{ts,tsx,css,json}" 2>/dev/null || true; \
log_file=$$(mktemp); \
set +e; cd web && npx prettier --write "src/**/*.{ts,tsx,css,json}" >"$$log_file" 2>&1; status=$$?; set -e; \
cat "$$log_file"; \
if [ "$$status" -ne 0 ]; then advisory_failures="$$advisory_failures prettier"; fi; \
rm -f "$$log_file"; \
fi
@if [ -n "$$advisory_failures" ]; then \
echo "⚠ Fast format completed with issues:"; \
for item in $$advisory_failures; do echo " - $$item"; done; \
fi
Comment on lines +1 to +5
[
{
"RuleID": "private-key",
"Description": "Identified a Private Key, which may compromise cryptographic security and sensitive data encryption.",
"StartLine": 72,
Comment thread Makefile
Comment on lines +2 to 5
.PHONY: help install tidy build run test test-strict test-fast lint lint-strict lint-fast fmt fmt-strict fmt-fast check check-fast sec sec-strict sec-fast artifact-scan \
backend web backend-targeted fast strict build-local latest dev \
image start stop restart logs stats delete rm kill-port redo \
openapi-gen openapi-merge openapi-check openapi-sync
@chendelin1982 chendelin1982 merged commit d0a7bec into main May 7, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants