name: CI # main only receives what the merge queue already tested at the same commit, # so the merge_group run is the gate and nothing reruns it after the merge. on: pull_request: branches: [main] merge_group: types: [checks_requested] # Default token only gets `contents: read` on PRs from forks; the # dorny/paths-filter action needs to list PR files via the GitHub # API, which requires `pull-requests: read`. Without this the # "Detect Changes" job dies with "Bad credentials" and every # downstream language CI is skipped. permissions: contents: read pull-requests: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: changes: name: Detect Changes runs-on: ubuntu-latest outputs: go-services: ${{ steps.filter.outputs.go-services }} migrations: ${{ steps.filter.outputs.migrations }} aws-deployment: ${{ steps.filter.outputs.aws-deployment }} tracking: ${{ steps.filter.outputs.tracking }} realtime: ${{ steps.filter.outputs.realtime }} web: ${{ steps.filter.outputs.web }} admin: ${{ steps.filter.outputs.admin }} site: ${{ steps.filter.outputs.site }} docs: ${{ steps.filter.outputs.docs }} forms: ${{ steps.filter.outputs.forms }} portal: ${{ steps.filter.outputs.portal }} qa: ${{ steps.filter.outputs.qa }} make: ${{ steps.filter.outputs.make }} ios: ${{ steps.filter.outputs.ios }} installer: ${{ steps.filter.outputs.installer }} cli-installer: ${{ steps.filter.outputs.cli-installer }} pages: ${{ steps.filter.outputs.pages }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 id: filter with: filters: | go-services: - '.github/workflows/ci.yml' - 'go.mod' - 'go.sum' - 'internal/**' - 'cmd/**' # make lint runs the join-script checks, so a change to the # checker itself has to trigger the job that runs it. - 'scripts/check-join-script.sh' # make lint also checks that every Dockerfile COPY names a path # that exists. Nothing else does: build-push.yml runs only on # push to main, so a COPY of a file the same PR deleted is green # here and breaks main on merge. Both halves of that have to # trigger the job: the Dockerfiles, and the trees they copy from. - 'scripts/**' - 'deploy/docker/**' migrations: - 'internal/infrastructure/db/migrations/**' - 'scripts/check-migrations.sh' aws-deployment: - '.github/workflows/ci.yml' - '.github/workflows/deploy-aws.yml' - '.github/workflows/configure-backend-aws.yml' - '.github/workflows/rotate-keys.yml' - '.github/scripts/aws-deploy*.cjs' - '.github/scripts/aws-backend-config*.cjs' - '.github/scripts/aws-rotate*.cjs' - '.github/aws-deploy/**' - 'deploy/terraform/aws/runtime/rotate/**' tracking: - 'tracking/**' realtime: - 'realtime/**' - 'deploy/docker/realtime.Dockerfile' web: - 'web/**' admin: - 'admin/**' site: - 'site/**' docs: - 'docs/**' forms: - 'forms/**' # The mirrored design engine has a copy in web/; editing only # that side must still run the drift check below. - 'web/src/components/app/forms/designCore.ts' - 'web/src/components/app/forms/form-theme.css' - 'scripts/check-forms-mirror.sh' portal: - 'portal/**' - 'deploy/cloudflare/portal/**' - 'deploy/docker/portal.Dockerfile' - 'deploy/docker/portal/**' qa: - 'qa/**' make: - 'integrations/make/**' ios: - 'ios/**' installer: - 'site/public/install.sh' - 'site/public/install.sh.sha256' - 'scripts/check-installer.sh' cli-installer: - 'site/public/cli.sh' - 'site/public/cli.sh.sha256' - 'site/public/cli.ps1' - 'scripts/check-cli-installer.sh' - 'scripts/build-cli.sh' pages: - '.github/workflows/static-assets.yml' - 'deploy/cloudflare/**' - '.github/scripts/pages-*' - '.github/workflows/release.yml' - '.github/workflows/ci.yml' - 'web/docker-entrypoint.sh' - 'admin/docker-entrypoint.sh' - 'web/package.json' - 'admin/package.json' - 'site/package.json' - 'docs/package.json' - 'docs/next.config.mjs' pages-ci: name: Pages release configuration needs: changes if: needs.changes.outputs.pages == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "22" - name: Check production configuration import run: node --test .github/scripts/pages-*.test.mjs deploy/cloudflare/*.test.mjs migrations-ci: name: Migrations needs: changes if: needs.changes.outputs.migrations == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Check migration versions # Runs on the PR's merge commit, so it sees main's versions too. That # only holds while the branch is current, so this needs "Require # branches to be up to date before merging" in branch protection. run: ./scripts/check-migrations.sh go-ci: name: Go CI (${{ matrix.suite }}) needs: changes if: needs.changes.outputs.go-services == 'true' runs-on: ubuntu-latest strategy: fail-fast: false matrix: suite: [lint, unit, live-1, live-2, live-3] services: postgres: image: postgres:16 env: POSTGRES_USER: warmbly POSTGRES_PASSWORD: warmbly POSTGRES_DB: warmbly_test ports: - 5432:5432 options: >- --health-cmd "pg_isready -U warmbly -d warmbly_test" --health-interval 10s --health-timeout 5s --health-retries 5 redis: image: redis:7-alpine ports: - 6379:6379 options: >- --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true # A cached protoc skips the download; one whose digest no longer matches is fetched again below. - name: Restore protoc if: matrix.suite == 'lint' uses: actions/cache@v4 with: path: ${{ runner.temp }}/protoc key: protoc-33.6-linux-x86_64-bdf948836dcd45f5 # A pinned release verified by digest; resolving "latest" lists every protobuf release and fails when that listing is cut short. # Maven Central publishes the same binary, so a GitHub release-download outage falls back to it instead of failing lint. - name: Set up protoc if: matrix.suite == 'lint' env: PROTOC_VERSION: "33.6" PROTOC_BIN_SHA256: bdf948836dcd45f5595eb45e0824867965ac1227cc430e957b0482b4fe876d01 run: | set -eu dir="$RUNNER_TEMP/protoc/bin" bin="$dir/protoc" if ! echo "${PROTOC_BIN_SHA256} ${bin}" | sha256sum -c --status - 2>/dev/null; then mkdir -p "$dir" archive="$RUNNER_TEMP/protoc.zip" # A capped attempt: a hung download falls back instead of holding the job until its timeout. if curl -fsSL --connect-timeout 10 --max-time 30 --retry 1 --retry-all-errors -o "$archive" \ "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip" \ && unzip -q -o -j "$archive" bin/protoc -d "$dir"; then echo "protoc from GitHub releases" else echo "GitHub release download failed; fetching protoc ${PROTOC_VERSION} from Maven Central" curl -fsSL --connect-timeout 10 --max-time 120 --retry 5 --retry-all-errors -o "$bin" \ "https://repo1.maven.org/maven2/com/google/protobuf/protoc/4.${PROTOC_VERSION}/protoc-4.${PROTOC_VERSION}-linux-x86_64.exe" fi echo "${PROTOC_BIN_SHA256} ${bin}" | sha256sum -c - chmod +x "$bin" fi echo "$dir" >> "$GITHUB_PATH" "$bin" --version - name: Install required Go tools if: matrix.suite == 'lint' run: make setup-tools - name: Run golangci-lint if: matrix.suite == 'lint' run: make lint - name: Verify protobuf files are up to date if: matrix.suite == 'lint' run: make check-proto # The Kafka backend sits behind a build tag, so the default build never # compiles it and it can rot unnoticed. Build rather than vet: vet does # not link, and a CGO backend's characteristic failure is a link error. - name: Verify the Kafka build still compiles and links if: matrix.suite == 'lint' run: go build -tags kafka ./... - name: Run tests if: matrix.suite == 'unit' run: go test -race ./... - name: Prepare regression database if: startsWith(matrix.suite, 'live-') env: PRIMARY_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: go run ./cmd/migrate - name: Linked-mailbox batching regressions (PostgreSQL) if: matrix.suite == 'live-2' env: PRIMARY_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/repository ./internal/app/analytics -run '^TestLive(WarmupPartnerCountsMatchIndividualCandidates|WarmupSummariesMatchIndividualReads|LinkedMailboxStatusBatchPreservesDetails|WarmupPartnerWeekCacheMatchesExactReadAndKeepsTheCapLive|WarmupPartnerWeekCacheRefreshesDetachedAndServesStale|WarmupPartnerCandidatesCarryReciprocityAndHonourTheCap|AccountStatusPageMatchesSingleReadsInBoundedQueries|WarmupOffMailboxReceivesNothing|WarmupPauseRetiresIncomingWork|WarmupReservationHoldsEachTierToItsShare|WarmupReplyIsAdmittedToAFullInbox|WarmupRepliesLeaveTheNewThreadCapUntouched|OwedRepliesContinueTheDeepestConversationFirst)$' -count=1 | tee linked-mailbox-batch.log for test in TestLiveWarmupPartnerCountsMatchIndividualCandidates TestLiveWarmupSummariesMatchIndividualReads TestLiveLinkedMailboxStatusBatchPreservesDetails TestLiveWarmupPartnerWeekCacheMatchesExactReadAndKeepsTheCapLive TestLiveWarmupPartnerWeekCacheRefreshesDetachedAndServesStale TestLiveWarmupPartnerCandidatesCarryReciprocityAndHonourTheCap TestLiveAccountStatusPageMatchesSingleReadsInBoundedQueries TestLiveWarmupOffMailboxReceivesNothing TestLiveWarmupPauseRetiresIncomingWork TestLiveWarmupReservationHoldsEachTierToItsShare TestLiveWarmupReplyIsAdmittedToAFullInbox TestLiveWarmupRepliesLeaveTheNewThreadCapUntouched TestLiveOwedRepliesContinueTheDeepestConversationFirst; do grep -q -- "--- PASS: $test " linked-mailbox-batch.log done if grep -q -- '--- SKIP:' linked-mailbox-batch.log; then exit 1; fi - name: Campaign mailbox reconnect retry regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/app/consumer ./internal/repository -run '^TestLiveCampaign(MailboxLoadingDefersWithoutSpendingAttempts|LoadingLogsKeepHistoryWithoutCustomerAlerts)$' -count=1 | tee campaign-reconnect.log grep -q '^--- PASS: TestLiveCampaignMailboxLoadingDefersWithoutSpendingAttempts ' campaign-reconnect.log grep -q '^--- PASS: TestLiveCampaignLoadingLogsKeepHistoryWithoutCustomerAlerts ' campaign-reconnect.log if grep -q -- '--- SKIP:' campaign-reconnect.log; then exit 1; fi - name: Mailbox push channels and fleet usage (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/repository ./internal/app/fleetmetrics -run '^TestLive(MailboxPushChannelsRoundTripAndScopeToTheOwner|WakeTargetsSkipWorkersThatCannotActOnAWake|ReadTakesMemoryFromHeartbeats)$' -count=1 | tee mailbox-push.log for test in TestLiveMailboxPushChannelsRoundTripAndScopeToTheOwner TestLiveWakeTargetsSkipWorkersThatCannotActOnAWake TestLiveReadTakesMemoryFromHeartbeats; do grep -q -- "--- PASS: $test " mailbox-push.log done if grep -q -- '--- SKIP:' mailbox-push.log; then exit 1; fi - name: Contact campaign empty-step regression (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v ./internal/repository -run '^TestLiveContactCampaignStateEmptySteps$' -count=1 | tee contact-campaign-steps.log grep -q -- '--- PASS: TestLiveContactCampaignStateEmptySteps ' contact-campaign-steps.log - name: Form submission paging across equal timestamps (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v ./internal/repository -run '^TestLiveFormSubmissionsPageAcrossEqualAndCloseTimestamps$' -count=1 | tee form-submission-paging.log grep -q -- '--- PASS: TestLiveFormSubmissionsPageAcrossEqualAndCloseTimestamps ' form-submission-paging.log - name: Campaign send admission regressions (PostgreSQL) if: matrix.suite == 'live-2' env: PRIMARY_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go run ./cmd/migrate go test -race ./internal/app/behavior ./internal/repository ./internal/tasks -run 'TestDefaultPlan|TestLiveMailboxPlan|TestLiveCampaignAdmission|TestLiveSharedAdmission|TestLiveDeferredTicksDoNotSpendTheDailyBudget|TestLiveCampaignAtDailyCapWaitsForTomorrow' -count=1 - name: Shared mailbox pool pacing and send claim regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -p 1 ./internal/repository ./internal/scheduler ./internal/tasks -run '^TestLive(MailboxSendClaim(AdmitsOnePerGap|WaitsOutAReservedSend)|BookedSendsLeaveOutCampaignWakeups|ParkedCampaignDoesNotThrottleItsPoolMate|BookedSendsStillSpaceTheCampaign|ClaimedMailboxIsPassedOver|CampaignsSharingAMailboxSendOncePerGap|LostMailboxClaimReschedulesWithoutSending)$' -count=1 # A real pg_dump and psql against the same major the self-host compose ships. - name: Instance backup and restore round trip (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail if [ ! -x /usr/lib/postgresql/16/bin/pg_dump ]; then sudo apt-get update -q && sudo apt-get install -y -q postgresql-client-16 fi go test -race -v ./cmd/warmblyctl -run '^TestLiveBackupRestoreRoundTrip$' -count=1 | tee backup-restore.log grep -q -- '--- PASS: TestLiveBackupRestoreRoundTrip ' backup-restore.log - name: Postgres queue claim regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -p 1 ./internal/repository -run '^TestLive(ConcurrentDispatchersNeverClaimTheSameTask|SendResultEffectsBatchClaimsDeliverEachEffectOnce|CRMClaimTakesDueAndLapsedJobsOnce)$' -count=1 - name: Scheduled email cancel and claim regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/tasks -run '^TestLive(CancelledScheduledEmailIsNeverAdmitted|ClaimedScheduledEmailRefusesCancel|ScheduledEmailCancelAndExecutionNeverBothWin|UniboxSendRefusalIsRecordedNotDeadLettered|UnrecordedUniboxRefusalIsRetried)$' -count=1 | tee scheduled-cancel.log for t in CancelledScheduledEmailIsNeverAdmitted ClaimedScheduledEmailRefusesCancel ScheduledEmailCancelAndExecutionNeverBothWin UniboxSendRefusalIsRecordedNotDeadLettered UnrecordedUniboxRefusalIsRetried; do grep -q -- "--- PASS: TestLive$t " scheduled-cancel.log done - name: Invited signup atomic provisioning regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: go test -race ./internal/repository -run '^TestLiveInvitedSignup$' -count=1 - name: Notification preference save regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v ./internal/repository -run '^TestLiveNotificationPreferencesKeepKeysASaveOmits$' -count=1 | tee notification-preferences.log grep -q '^--- PASS: TestLiveNotificationPreferencesKeepKeysASaveOmits ' notification-preferences.log - name: Tester initial password and sample data regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/repository -run '^TestLive(InitialPasswordLifecycle|ResetPasswordClearsAnIssuedExpiry|ReissueTesterPassword|TesterSampleData(IsSafeAndPreservesEdits|RollsBackAndSerializesRetries|RejectsNonTestAndInactiveWorkspaces|SurvivesInitialPasswordReplacement|ListsTheSeedableWorkspace))$' -count=1 | tee tester-lifecycle.log for test in TestLiveInitialPasswordLifecycle TestLiveResetPasswordClearsAnIssuedExpiry TestLiveReissueTesterPassword TestLiveTesterSampleDataIsSafeAndPreservesEdits TestLiveTesterSampleDataRollsBackAndSerializesRetries TestLiveTesterSampleDataRejectsNonTestAndInactiveWorkspaces TestLiveTesterSampleDataSurvivesInitialPasswordReplacement TestLiveTesterSampleDataListsTheSeedableWorkspace; do grep -q -- "--- PASS: $test " tester-lifecycle.log done if grep -q -- '--- SKIP:' tester-lifecycle.log; then exit 1; fi - name: Mailbox batch and folder identity regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: go test -race -v -p 1 ./internal/repository -run '^TestLive(MessageMapBatch|FolderGenerationLookup|MailboxLookupIndexes)' -count=1 - name: CPU query pressure and accounting parity regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/repository -run '^TestLive(TaskLedgerRangesAndClocksMatchLegacy|TaskLedgerDayRangePreservesDST|TaskQueryPressureUsesBoundedHistory|WarmupHealthCountsShareScansWithoutChangingSignals|DashboardOverallBoundsHistoryAndPreservesScopedCounts|VerificationBacklogFollowsShelfLives|VerificationReopenOnProviderConnect|SegmentCampaignLinks|PoolLinkTouchIsThrottledButKeepsTheVersion)$' -count=1 | tee cpu-query-pressure.log if grep -q -- '--- SKIP:' cpu-query-pressure.log; then exit 1; fi for test in TestLiveTaskLedgerRangesAndClocksMatchLegacy TestLiveTaskLedgerDayRangePreservesDST TestLiveTaskQueryPressureUsesBoundedHistory TestLiveWarmupHealthCountsShareScansWithoutChangingSignals TestLiveDashboardOverallBoundsHistoryAndPreservesScopedCounts TestLiveVerificationBacklogFollowsShelfLives TestLiveVerificationReopenOnProviderConnect TestLiveSegmentCampaignLinks TestLivePoolLinkTouchIsThrottledButKeepsTheVersion; do grep -q "^--- PASS: $test " cpu-query-pressure.log done - name: Campaign pool query batching regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/repository ./internal/scheduler -run '^TestLive(FindRoutedPairs|CampaignPool|LeadHold|PlanCampaignDay|WarmupHealthCountsShareScansWithoutChangingSignals|TaskLedgerRangesAndClocksMatchLegacy)' -count=1 | tee campaign-pool-batch.log if grep -q -- '--- SKIP:' campaign-pool-batch.log; then exit 1; fi for test in TestLiveFindRoutedPairsPriorityMatchesLegacyOrdering TestLiveCampaignPoolReadsStayBatched TestLiveCampaignPoolBatchFailuresKeepSafety TestLiveCampaignPoolStandalonePlacementIsBatched; do grep -q -- "--- PASS: $test " campaign-pool-batch.log done - name: Cloud standing and missing-evidence holds (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/repository ./internal/app/poollink -run '^TestLiveCloud' -count=1 | tee cloud-standing.log if grep -q -- '--- SKIP:' cloud-standing.log; then exit 1; fi for test in TestLiveCloudStandingFreshnessIsBoundedWithoutInventingAProviderBlock TestLiveCloudUnknownEvidenceDoesNotHideARealHold TestLiveCloudStaleLiveHoldStaysKnown TestLiveCloudPendingEnrollmentAndDisconnectAreUnknown TestLiveCloudDetachedLinkWarmupStopsOnce; do grep -q -- "--- PASS: $test " cloud-standing.log done - name: Scheduled-job retirement regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -p 1 ./internal/repository -run '^TestLiveJobRun' -count=1 go test -race -p 1 ./internal/infrastructure/db -run '^TestLiveScheduledJobRetirementUpgradePreservesExecutionHistory$' -count=1 - name: Idempotency-Key identity and completion regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/app/idempotency ./internal/api/middleware -run '^TestLiveIdempotency' -count=1 | tee idempotency.log for test in TestLiveIdempotencyConcurrentBeginsClaimOnce TestLiveIdempotencyOutcomes TestLiveIdempotencyPreviousReleaseRecordsNeverMatch TestLiveIdempotencyKeepsIdentityAndCompletion; do grep -q -- "--- PASS: $test " idempotency.log done - name: Warmup dispatch, upgrade and admin-send regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race ./internal/repository -run '^TestLive(Monitoring|LastWarmupSendFailure|PersistentMailboxLoadingFailure|DispatchRetry|LineageQueueRevisions|ReplyShare|AdminPlatformOverview|WarmupRecoversOldPreparation|WarmupPreparationRecoveryRetains|WarmupFilingRequiresAcknowledgement|WarmupFilingAuthority|WarmupTimeWindow|WarmupInvalidWindow|StoppedRecipientIsNeverAddressed)' -count=1 go test -race -v ./internal/tasks -run '^Test(LiveWarmup(SafetyHoldReschedules|Recovery|UnknownRetirement|TaskDoesNotApplyResults|DispatchDefersInvalidHours|ReplyShare)|WarmupSenderDistinguishes)' -count=1 | tee warmup-recovery.log if grep -q -- '--- SKIP: TestLiveWarmupUnknownRetirement' warmup-recovery.log; then exit 1; fi for test in TestLiveWarmupUnknownRetirementPreservesEvidenceAndFencesReplayOnce TestLiveWarmupUnknownRetirementAllowsDistinctNewSendAndKeepsCooldown TestLiveWarmupUnknownRetirementAndDefinitiveResultSerialize TestLiveWarmupUnknownRetirementSkipsProtectedRowsWithoutStarvingLaterMailboxes TestLiveWarmupUnknownRetirementReconcilerSeedsOnceAndClearsActiveWarnings; do grep -q -- "--- PASS: $test " warmup-recovery.log || exit 1 done go test -race -v ./internal/infrastructure/db -run '^TestLiveWarmupUnknownRetirementUpgrade' -count=1 | tee warmup-retirement-upgrade.log grep -q -- '--- PASS: TestLiveWarmupUnknownRetirementUpgrade ' warmup-retirement-upgrade.log go test -race ./internal/app/consumer -run '^TestLiveStoredSendResult' -count=1 - name: Warmup database query-pressure regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v ./internal/repository -run '^TestLive(WarmupDispatchUsagePreservesBudgetAndLastSend|WarmupDispatchQueryPlansUseMailboxAndMessageIndexes|OwnConversationIgnoresEmptyIDsWithoutLosingTaskOrThreadOwnership|ReplyInboxOwns)' -count=1 | tee warmup-query-pressure.log if grep -q -- '--- SKIP:' warmup-query-pressure.log; then echo "Warmup database query-pressure regressions must execute without skips" exit 1 fi for test in TestLiveWarmupDispatchUsagePreservesBudgetAndLastSend \ TestLiveWarmupDispatchQueryPlansUseMailboxAndMessageIndexes \ TestLiveOwnConversationIgnoresEmptyIDsWithoutLosingTaskOrThreadOwnership; do grep -q -- "--- PASS: $test " warmup-query-pressure.log || { echo "Missing regression: $test"; exit 1; } done go test -race -v ./internal/infrastructure/db -run '^TestLiveWarmupDispatchUsageIndexUpgradePreservesEvidenceAndHolds$' -count=1 | tee warmup-query-upgrade.log if grep -q -- '--- SKIP:' warmup-query-upgrade.log; then exit 1; fi grep -q -- '--- PASS: TestLiveWarmupDispatchUsageIndexUpgradePreservesEvidenceAndHolds ' warmup-query-upgrade.log - name: Workspace isolation regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -euo pipefail go test -race -v -p 1 ./internal/api/handler ./internal/app/email ./internal/app/contact ./internal/app/contactimport ./internal/app/orgtransfer ./internal/app/form ./internal/app/websitetracking ./internal/repository ./internal/scheduler -run '^TestLive(SharedCampaignAccess|ContactTimelineAccess|TrackingDomain(WriteIsOrgScoped|VerifyRoundTrip|Sweep|BelongsToOneOrganization)|ImportLeavesAnotherWorkspaceAlone|ContactImportIsScopedToItsWorkspace|ImportRefuses(RowsOwnedByAnotherWorkspace|ReferencesIntoAnotherWorkspace)|ArchiveCarriesIntegrationCredentialsAndDirectMailLinks|TenantFamiliesRefuseAnotherOrganization|CampaignChildrenRefuseAnotherWorkspace|CRMSyncIntegrationsRefuseAnotherOrganization|FormLinkTokenIsBoundToItsForm|IdentifyTicketStaysInItsWorkspace|TenantMatrixRefusesAnotherOrganization|SenderResolutionStaysInsideTheCampaignOrg|SenderSchedulerNeverPicksAnotherOrgMailbox|SenderScopeWithoutAnOrganizationReachesNothing|ActiveCampaignLookupIsOrgScoped|OwnConversationDoesNotCrossWorkspaces|UniboxGetBySenderIsScopedToTheOrganization|UniboxMoveFolderIsOrgScoped|UniboxScopeMoveThreadsIsOrgScoped|ScheduledSendsAreScopedToTheMailboxOrganization|NoLabelIsReferencedAcrossWorkspaces|CampaignAudienceIsScoped)$' -count=1 | tee workspace-isolation.log if grep -q -- '--- SKIP:' workspace-isolation.log; then echo "Workspace isolation regressions must execute without skips" exit 1 fi for test in TestLiveSharedCampaignAccess \ TestLiveTenantFamiliesRefuseAnotherOrganization \ TestLiveCampaignChildrenRefuseAnotherWorkspace \ TestLiveCRMSyncIntegrationsRefuseAnotherOrganization \ TestLiveFormLinkTokenIsBoundToItsForm \ TestLiveIdentifyTicketStaysInItsWorkspace \ TestLiveTenantMatrixRefusesAnotherOrganization \ TestLiveImportRefusesReferencesIntoAnotherWorkspace \ TestLiveArchiveCarriesIntegrationCredentialsAndDirectMailLinks \ TestLiveSenderSchedulerNeverPicksAnotherOrgMailbox \ TestLiveTrackingDomainWriteIsOrgScoped; do grep -q "^--- PASS: $test " workspace-isolation.log done - name: Integration inbound secret sealing (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/app/integration ./internal/app/orgtransfer -run '^TestLive(InboundSecretSealedAcrossWriteBackfillAndRead|InboundSecretUnsealedRowStillResolves|ArchiveCarriesInboundSecretsOnlySealed|ImportFlagsEachIntegrationOnceAndClosesItsInboundURL|ReconnectFlagClearsSealedInboundSecret|PreviousReleaseArchiveKeepsInboundURLs|OverwriteImportFlagsUncarriedInboundURL)$' -count=1 | tee inbound-secret.log if grep -q -- '--- SKIP:' inbound-secret.log; then exit 1; fi for test in TestLiveInboundSecretSealedAcrossWriteBackfillAndRead TestLiveInboundSecretUnsealedRowStillResolves TestLiveArchiveCarriesInboundSecretsOnlySealed TestLiveImportFlagsEachIntegrationOnceAndClosesItsInboundURL TestLiveReconnectFlagClearsSealedInboundSecret TestLivePreviousReleaseArchiveKeepsInboundURLs TestLiveOverwriteImportFlagsUncarriedInboundURL; do grep -q "^--- PASS: $test " inbound-secret.log done - name: Monitoring database observation regressions (PostgreSQL) if: matrix.suite == 'live-2' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -euo pipefail go test -race -v ./internal/repository -run '^TestLiveMonitoringDatabaseClock' -count=1 | tee monitoring-clock.log if grep -q -- '--- SKIP:' monitoring-clock.log; then echo "Monitoring database observation regressions must execute without skips" exit 1 fi for test in TestLiveMonitoringDatabaseClockAfterRequestStart \ TestLiveMonitoringDatabaseClockWarningSemantics \ TestLiveMonitoringDatabaseClockPredicateBoundaries \ TestLiveMonitoringDatabaseClockSingleSnapshot; do grep -q "^--- PASS: $test " monitoring-clock.log done - name: Approved warmup content and queued source regressions (PostgreSQL) if: matrix.suite == 'live-2' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -euo pipefail go test -race -v ./internal/repository -run '^TestLiveContentPool' -count=1 | tee content-pool.log go test -race -v ./internal/tasks -run '^TestLiveWarmupDispatchRechecksOpeningSourceAndExactRecipient$' -count=1 | tee -a content-pool.log if grep -q -- '--- SKIP:' content-pool.log; then echo "Warmup content and queued source regressions must execute without skips" exit 1 fi for test in TestLiveContentPoolRejectsDuplicateBatchContentUnderConcurrency \ TestLiveContentPoolRetryReservesOnceAndReplenishesForExposedMailboxes \ TestLiveContentPoolPreservesPlansForFutureDistinctMailboxes \ TestLiveContentPoolConcurrentPairsAlwaysReceiveContent \ TestLiveContentPoolPrefersLessUsedEligiblePlans \ TestLiveContentPoolPrefersWhatNeitherMailboxSawRecently \ TestLiveContentPoolExhaustedPairRepeatsTheLeastRecentlySeen \ TestLiveContentPoolTokenCleanupKeepsExposure \ TestLiveContentPoolStaticRowsOnlyFromTheCurrentLibrary \ TestLiveContentPoolDemandCountsPlansRatherThanReplies \ TestLiveWarmupDispatchRechecksOpeningSourceAndExactRecipient; do grep -q "^--- PASS: $test " content-pool.log done - name: Warmup generic execution authority regressions (PostgreSQL) if: matrix.suite == 'live-2' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -v -p 1 ./internal/api/handler -run '^TestLiveWarmupGeneric' -count=1 | tee warmup-generic-execution.log if grep -q -- '--- SKIP:' warmup-generic-execution.log; then echo "Warmup generic execution regressions must execute without skips" exit 1 fi for test in TestLiveWarmupGenericStartAfterPartialImport \ TestLiveWarmupGenericCancellationPreservesOtherHolds \ TestLiveWarmupGenericStartAndLateResult \ TestLiveWarmupGenericStartAfterCompatibleOverwrite \ TestLiveWarmupGenericCannotRepeatStartedWarmupClaim \ TestLiveWarmupGenericDeniesHistoricalDiagnosticContent; do grep -q "^--- PASS: $test " warmup-generic-execution.log done - name: Warmup charge and authoritative result regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -v -p 1 ./internal/repository ./internal/app/consumer ./internal/tasks ./internal/app/orgtransfer -run '^TestLive(Warmup(ReservationPreservesOriginalChargeDay|RefundCASProtectsConcurrentAndRestampedTasks|RefundAndResultRollbackTogether|ReplyRefundUsesChargedShapeAfterParentDeletion|ChargeAndRefundUseUTCInNonUTCSession|ChargeProofRollsBackWhenCounterWriteFails|CancellationPathsRefundOnlyProvenCharge|GenericCompletionDoesNotProveChargedAccounting|SendFailureGivesTheDayBack|SendGiveBackIsIdempotent|SafetyHoldReschedulesInsteadOfBlockingTheDispatcher|Recovery(RetiresExistingUnstartedDispatchOnce|HandlesPartialReservations|PreservesExecutionAndReceiptEvidence|KeepsOtherUnknownAndRestrictiveHolds|AndBeginCannotBothWin))|AppliedWarmupFailureRepairsOnlyRefundedChargeDeadLetters|GiveBackDailySend(ReversesADispatchedWarmupSend|LeavesOtherDaysAlone)|AccountDailyUsage(CountsWarmupTasksNotTheStatisticsRow|ScopesWarmupToTypeAndDay)|ImportWarmupStatisticsCannotGrantChargeRefundAuthority|Legacy(FailedStatusCannotProveNonExecution|JSONAndAvroFailurePersistConservativeAdmission)|AuthoritativeDeadLetterResultsReconcileWithoutReplay|DeadLetterResultEffectsAndSettlementRollBackTogether|Campaign(DeadLetterWorkerResultReleasesReservationOnce|ForeignKeyCleanupDoesNotProveWakeupOnly)|UserEmailDeadLetterUsesUnderlyingSendTaskType|UnknownSendOperatorResolutionReconcilesAndAudits|RecordedWorkerOutcomeSurvivesLostEvent|UnreservedLegacyFailedTaskRetainsUnknownHold|UnknownResolutionRejectsMissingEvidenceAndLiveExecution|SendRecoveryResolutionRequiresEvidenceAndRetainsUnknown|UnstartedDispatchRetainsDeferredOutcomeConflict)$' -count=1 go test -race -v -p 1 ./internal/infrastructure/db -run '^TestLiveWarmupChargeUpgradeKeepsLegacyUnverifiedAndPreservesEvidence$' -count=1 - name: Manual send recovery regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/tasks ./internal/repository -run '^TestLive(ManualSendWithUnknownHandOffIsReleasedUnsent|UnansweredManualSendIsReleasedUnsent|ManualSendInterruptedBeforeReservationRunsOnce|StaleOrUnrunnableInterruptedManualSendFails|UnstartedCampaignSendReleasesMailboxAndCannotStartLater|StartedManualSendLiftsHoldWithoutRunningAgain|HoldOnMissingTaskIsCleared)$' -count=1 | tee manual-send-recovery.log for test in TestLiveManualSendWithUnknownHandOffIsReleasedUnsent TestLiveUnansweredManualSendIsReleasedUnsent TestLiveManualSendInterruptedBeforeReservationRunsOnce TestLiveStaleOrUnrunnableInterruptedManualSendFails TestLiveUnstartedCampaignSendReleasesMailboxAndCannotStartLater TestLiveStartedManualSendLiftsHoldWithoutRunningAgain TestLiveHoldOnMissingTaskIsCleared; do grep -q -- "--- PASS: $test " manual-send-recovery.log done if grep -q -- '--- SKIP:' manual-send-recovery.log; then exit 1; fi - name: Mailbox placement health recovery (PostgreSQL) if: matrix.suite == 'live-2' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v ./internal/app/warmup -run '^TestLiveHealthPlacementRecoveryUsesTheDisplayedUTCWindow$' -count=1 | tee placement-health-recovery.log grep -q -- '^--- PASS: TestLiveHealthPlacementRecoveryUsesTheDisplayedUTCWindow ' placement-health-recovery.log - name: Linked warmup scheduling regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -v -p 1 ./internal/repository -run '^TestLiveMailboxBehavior(CreationRespectsGatewayWarmup|FirstCustomerWriteIsNotInherited)$' -count=1 go test -race -v -p 1 ./internal/infrastructure/db -run '^TestLiveLinkedWarmupScheduleUpgradePreservesExplicitProfilesAndTasks$' -count=1 - name: Warmup filing provider-floor regressions (PostgreSQL) if: matrix.suite == 'live-2' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -v -p 1 ./internal/repository -run '^TestLiveWarmupFiling(ClaimProviderFloor|DeferralIsScopedCommittedAndMonotonic|DeferralRefusesStaleAndForeignWork|ProviderFloorSurvivesReassignment|ProviderFloorDoesNotShortenClaimLease|DeferralDatabaseErrorIsNotProof|DeferralLostHTTPResponseRetriesIdempotently)$' -count=1 go test -race -v -p 1 ./internal/repository -run '^TestLiveWarmupFilingAdmission(DeniesMissingOwnedRow|KeepsUntrackedLegacyAction)$' -count=1 go test -race -v -p 1 ./internal/infrastructure/db -run '^TestLiveWarmupFilingProviderFloorUpgradePreservesLegacyLeasesAndRollback$' -count=1 - name: Authoritative send-conflict and historical-origin regressions (PostgreSQL) if: matrix.suite == 'live-2' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -v -p 1 ./internal/infrastructure/db -run '^TestLiveSendRecoveryConflict(CLIStartup|UpgradePreservesHistoricalEvidence|Production284UpgradePreservesHistoricalEvidence|HistoricalOnlyDownRefuses|EmptyDownUp)$' -count=1 go test -race -v -p 1 ./internal/repository ./internal/app/orgtransfer -run '^TestLive(DefinitiveConflictDirectionsDuplicatesAndRestrictiveHolds|PriorDefinitiveConflictWithoutOperatorResolution|AuthenticationRepairRetainsUnresolvedOutcomeConflict|ConcurrentAuthenticationRepairRetainsNewOutcomeConflict|UnstartedDispatchRetainsDeferredOutcomeConflict|HistoricalConfirmationRequiresFreshOrIndependentAuthority|ExpandedConflictSchemaRequiresUpgradedReadersAndWriters|OrdinarySendResultsNeedNoRecoveryConfirmation|ImportSendRecoveryHistoryCannotReconcileUnknownOutcome|ArchiveSendRecoveryLocalOriginResets|ImportedHistoryDoesNotRepeatAuthoritativeWorkerResult)$' -count=1 go test -race -v -p 1 ./internal/app/consumer -run '^TestLiveDelayedPreparationDuplicateMustNotCreateDefinitiveConflict$' -count=1 go test -race -v -p 1 ./internal/app/consumer -run '^TestLiveAdvancedBounceReconciliationRollbackAndReplayWithOneConnection$' -count=1 - name: Workspace archive send-preservation regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/app/orgtransfer -run '^TestLive(ReviewSelectiveExport|ImportLocal|ImportFresh(WarmupReservationDuringMailboxImport|LegacyWarmupHistoryRetainsPayload)|ImportLegacy|ImportRefundedWarmup|ImportExistingReceiptExcluded|ArchiveSendRecoveryLocalOriginResets|ImportMailTransportWholeArchiveSendResultLockOrder|ImportSendRecoveryHistoryCannotReconcileUnknownOutcome|ImportedHistoryDoesNotRepeatAuthoritativeWorkerResult)' -count=1 | tee archive-send-preservation.log if grep -q -- '--- SKIP:' archive-send-preservation.log; then echo "Workspace archive send-preservation regressions must execute without skips" exit 1 fi for test in TestLiveReviewSelectiveExportMustPreserveLocalUnknownHold \ TestLiveReviewSelectiveExportLateLocalResultRemainsAccepted \ TestLiveReviewSelectiveExportNewImportIsHistoryNotAuthority \ TestLiveImportLocalSendIdentityPayloadAndUnrelated \ TestLiveImportLocalSendRollbackForeignAndRestrictiveConflicts \ TestLiveImportLocalWarmupChargeReplyReceiptAndLateAccounting \ TestLiveImportLocalResultPreservationLockOrder \ TestLiveImportLegacyUnknownPreservesOtherOutcome \ TestLiveImportLegacyAppliedResultRemainsIdempotent \ TestLiveImportLegacyStampedTaskAcceptsLaterResult \ TestLiveImportRefundedWarmupChargeWithoutNonces \ TestLiveImportLegacyWarmupAppliedAccountingWithoutNonces \ TestLiveImportLegacyWarmupAppliedMarkers \ TestLiveImportLegacyUnknownLockOrder \ TestLiveImportLegacyRestrictivePreservation \ TestLiveImportExistingReceiptExcluded \ TestLiveImportFreshWarmupReservationDuringMailboxImport \ TestLiveImportFreshLegacyWarmupHistoryRetainsPayload \ TestLiveArchiveSendRecoveryLocalOriginResets \ TestLiveImportMailTransportWholeArchiveSendResultLockOrder \ TestLiveImportSendRecoveryHistoryCannotReconcileUnknownOutcome \ TestLiveImportedHistoryDoesNotRepeatAuthoritativeWorkerResult; do grep -q "^--- PASS: $test " archive-send-preservation.log done - name: Typed mailbox history, archive checkpoint and real-driver upgrade regressions (PostgreSQL) if: matrix.suite == 'live-2' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | set -o pipefail go test -race -v -p 1 ./internal/infrastructure/db -run '^TestLiveMailTransport(CLIStartup|UpgradePreservesHistoryAndRollback)$' -count=1 | tee mailbox-transport-upgrade.log grep -q '^--- PASS: TestLiveMailTransportCLIStartup ' mailbox-transport-upgrade.log grep -q '^--- PASS: TestLiveMailTransportUpgradePreservesHistoryAndRollback ' mailbox-transport-upgrade.log if grep -q -- '--- SKIP:' mailbox-transport-upgrade.log; then exit 1; fi go test -race -v -p 1 ./internal/repository ./internal/app/orgtransfer ./internal/app/consumer ./internal/app/email -run '^TestLive(MailTransport.*|ImportMailTransport.*|WorkerMailboxLoadReadsOneGenerationWithSingleConnection)$' -count=1 | tee mailbox-transport-runtime.log for test in TestLiveMailTransportNativeDomainExcludesHistory TestLiveMailTransportImportSerializesWithConfirmedResult TestLiveImportMailTransportCheckpointCountsAndUnchangedRows TestLiveMailTransportConfirmedSendReconcilesOnlySend TestLiveMailTransportUnreadableSyncStateCannotAcquireRecovery TestLiveImportMailTransportLateAndSpanningSuccess TestLiveImportMailTransportCredentialOnlyWritesRotateFence TestLiveImportMailTransportExportOmitsGeneration TestLiveImportMailTransportWholeArchiveOmitsGeneration TestLiveMailTransportSnapshotKeepsConfigurationAndGenerationTogether TestLiveWorkerMailboxLoadReadsOneGenerationWithSingleConnection TestLiveMailTransportOperatorConfirmationDoesNotRecover TestLiveMailTransportOnlyCurrentWorkerObservationUpdatesConnectionReason TestLiveMailTransportConnectionReasonNotificationUsesRecordedEvidence; do grep -q "^--- PASS: $test " mailbox-transport-runtime.log done if grep -q -- '--- SKIP:' mailbox-transport-runtime.log; then exit 1; fi go test -race -v -p 1 ./internal/repository -run '^TestLiveAuthenticatorStepRequiresActiveEnrollment$' -count=1 | tee authenticator-verification.log grep -q '^--- PASS: TestLiveAuthenticatorStepRequiresActiveEnrollment ' authenticator-verification.log grep -q '^--- PASS: TestLiveImportMailTransportWholeArchiveSendResultLockOrder ' mailbox-transport-runtime.log for logfile in mailbox-transport-upgrade.log mailbox-transport-runtime.log; do test "$(grep -c '^=== RUN' "$logfile")" -gt 0 printf '%s RUN=%s PASS=%s SKIP=0\n' "$logfile" "$(grep -c '^=== RUN' "$logfile")" "$(grep -c -- '--- PASS:' "$logfile")" done go test -race -v -p 1 ./internal/app/worker/wmail ./internal/app/worker/mailmanager ./internal/app/consumer -run '^Test(MailTransportGeneration.*|SyncState.*)$' -count=1 | tee mailbox-transport-worker.log grep -q '^--- PASS: TestMailTransportGenerationRequiresFreshCompletedSyncPass ' mailbox-transport-worker.log grep -q '^--- PASS: TestMailTransportGenerationReplacesUnchangedCredentialsAndDrains ' mailbox-transport-worker.log if grep -q -- '--- SKIP:' mailbox-transport-worker.log; then exit 1; fi - name: Typed mailbox JSON and native Avro registry compatibility if: matrix.suite == 'live-3' env: SR_URL: http://127.0.0.1:18181 run: | set -o pipefail docker run -d --name mailbox-transport-registry -p 18181:8081 redpandadata/redpanda:v24.3.13 redpanda start --mode dev-container --smp 1 --memory 512M --reserve-memory 0M --node-id 0 --check=false trap 'docker rm -f mailbox-transport-registry' EXIT ready=false for attempt in $(seq 1 60); do if curl -fsS "$SR_URL/subjects" >/dev/null; then ready=true; break; fi sleep 1 done test "$ready" = true go test -tags kafka -race -v -p 1 ./internal/infrastructure/codec -run '^TestMailTransportCodec.*Compatibility$' -count=1 | tee mailbox-transport-codec.log grep -q '^--- PASS: TestMailTransportCodecJSONCompatibility ' mailbox-transport-codec.log grep -q '^--- PASS: TestMailTransportCodecRegistryCompatibility ' mailbox-transport-codec.log for testcase in add send sync error; do grep -q -- "--- PASS: TestMailTransportCodecRegistryCompatibility/$testcase " mailbox-transport-codec.log done if grep -q -- '--- SKIP:' mailbox-transport-codec.log; then exit 1; fi printf 'codec RUN=%s PASS=%s SKIP=0\n' "$(grep -c '^=== RUN' mailbox-transport-codec.log)" "$(grep -c -- '--- PASS:' mailbox-transport-codec.log)" - name: Mailbox sync admission, replay, truthful state and upgrade regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -p 1 ./internal/repository ./internal/app/consumer ./internal/app/orgtransfer ./internal/infrastructure/db -run '^TestLive(SyncArrival|SyncTruth|EmailErrorDedupe|EmailErrorResolveMethod)' -count=1 - name: Workspace archive spec against the live schema (PostgreSQL) if: matrix.suite == 'live-2' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: go test -race -v -p 1 ./internal/app/orgtransfer -run '^TestLive(EveryOrgTableIsRegistered|TablesAreInDependencyOrder|ResetColumnsHaveSomethingToFallBackOn)$' -count=1 - name: Payload-free arrival delivery diagnostics regressions (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: go test -race -v -p 1 ./internal/observability/arrivaldiag ./internal/repository ./internal/app/consumer -run '^Test(ArrivalDiagnostics|LiveArrivalDiagnostics)' -count=1 - name: Restricted member summary, inbox and notification regressions (PostgreSQL) if: matrix.suite == 'live-3' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: | go test -race -p 1 ./internal/repository -run '^TestLive(OrganizationScopedCounts|UniboxVisibility|EmailCursorVisibility|NotificationAudience)' -count=1 - name: Unibox indexed search, paging and interrupted reads (PostgreSQL) if: matrix.suite == 'live-1' env: WARMBLY_TEST_DB: postgres://warmbly:warmbly@127.0.0.1:5432/warmbly_test?sslmode=disable run: go test -race -v -p 1 ./internal/repository ./internal/infrastructure/db -run '^TestLiveUnibox(Search|ReadStream|SearchUpgrade|GetBySender|ScopeDraftsCount)' -count=1 - name: Notification digest authorization retries (Redis) if: matrix.suite == 'live-3' env: WARMBLY_TEST_REDIS: redis://127.0.0.1:6379/15 run: go test -race ./internal/app/notification -run '^TestLivePushDigestAudienceRetries$' -count=1 - name: Test the Kafka codec, failed-handler replay and client lifecycle if: matrix.suite == 'live-2' run: go test -race -tags kafka ./internal/infrastructure/codec/ ./internal/infrastructure/kafka/ ./internal/infrastructure/eventbus/ web-ci: name: Web CI needs: changes if: needs.changes.outputs.web == 'true' runs-on: ubuntu-latest defaults: run: working-directory: web steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-pnpm with: working-directory: web - name: Pages route and asset separation run: node scripts/check-pages-routing.mjs - name: Lint run: pnpm lint - name: Typecheck run: pnpm typecheck - name: Run tests run: pnpm test:run - name: Build run: pnpm build # The proof harness records against a live local stack, so CI only checks that it compiles and its flows load. qa-ci: name: QA harness CI needs: changes if: needs.changes.outputs.qa == 'true' runs-on: ubuntu-latest defaults: run: working-directory: qa steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-pnpm with: working-directory: qa node-version: "24" - name: Typecheck run: pnpm typecheck - name: Flows load run: pnpm exec playwright test --list admin-ci: name: Admin CI needs: changes if: needs.changes.outputs.admin == 'true' runs-on: ubuntu-latest defaults: run: working-directory: admin steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-pnpm with: working-directory: admin - name: Lint run: pnpm lint - name: Typecheck run: pnpm typecheck - name: Run tests run: pnpm test:run - name: Build run: pnpm build site-ci: name: Site CI needs: changes if: needs.changes.outputs.site == 'true' runs-on: ubuntu-latest defaults: run: working-directory: site steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-pnpm with: working-directory: site node-version: "22" - name: Exception filtering regressions run: pnpm test - name: Build # Astro project; build catches type errors, broken imports, # missing assets. No separate lint/typecheck script is wired # in package.json today. run: pnpm build docs-ci: name: Docs CI needs: changes if: needs.changes.outputs.docs == 'true' runs-on: ubuntu-latest defaults: run: working-directory: docs steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-pnpm with: working-directory: docs node-version: "22" - name: Typecheck run: pnpm types:check - name: Lint run: pnpm lint - name: Build # The release builds the same static export; a page whose frontmatter or MDX does not parse fails here first. run: pnpm build forms-ci: name: Forms CI needs: changes if: needs.changes.outputs.forms == 'true' runs-on: ubuntu-latest defaults: run: working-directory: forms steps: - uses: actions/checkout@v4 - name: Check forms mirror working-directory: . run: ./scripts/check-forms-mirror.sh - uses: ./.github/actions/setup-pnpm with: working-directory: forms - name: Lint run: pnpm lint - name: Typecheck run: pnpm typecheck - name: Build run: pnpm build # The portal service: the client page app, the service that serves it (portal/worker) and its Cloudflare config. portal-ci: name: Portal CI needs: changes if: needs.changes.outputs.portal == 'true' runs-on: ubuntu-latest defaults: run: working-directory: portal steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-pnpm with: working-directory: portal node-version: "22" - name: Lint run: pnpm lint - name: Typecheck run: pnpm typecheck - name: Service tests run: pnpm test - name: Build run: pnpm build - name: Cloudflare Worker configuration working-directory: . run: pnpm dlx wrangler@4.45.0 deploy --dry-run --config deploy/cloudflare/portal/wrangler.jsonc --outdir "$RUNNER_TEMP/portal-worker" # The self-host image runs the same modules on workerd; release.yml is the only other place it builds. - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build the self-host image (no push) uses: docker/build-push-action@v6 with: context: . file: deploy/docker/portal.Dockerfile push: false load: true tags: warmbly-portal:ci platforms: linux/amd64 cache-from: type=gha,scope=ci-portal cache-to: type=gha,mode=max,scope=ci-portal - name: Self-host image answers working-directory: . run: | set -euo pipefail docker run -d --name portal-ci -p 127.0.0.1:8095:8095 -e API_ORIGIN=http://127.0.0.1:9 \ -e PORTAL_DOMAIN=portal.ci.test -e PORTAL_EDGE_TOKEN=ci-portal-edge-token-0123456789abcdef warmbly-portal:ci for _ in $(seq 30); do docker exec portal-ci wget -q -O /dev/null http://127.0.0.1:8096/ && break; sleep 1; done curl -fsS -o /dev/null -H 'Host: portal.ci.test' http://127.0.0.1:8095/embed.js test "$(curl -s -o /dev/null -w '%{http_code}' -H 'Host: portal.ci.test' http://127.0.0.1:8095/)" = 404 # An unknown host needs a backend lookup, which fails here, so it is a 503 rather than a 404. test "$(curl -s -o /dev/null -w '%{http_code}' -H 'Host: other.ci.test' http://127.0.0.1:8095/)" = 503 docker rm -f portal-ci # The installer is served verbatim from site/public, so what CI checks is # exactly what a `curl | sh` executes. The checksum is published next to it # for anyone who would rather download, verify and read before running, and # it is only useful if it cannot drift. installer-ci: name: Installer CI needs: changes if: needs.changes.outputs.installer == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Check the installer run: ./scripts/check-installer.sh cli-installer-ci: name: CLI Installer CI needs: changes if: needs.changes.outputs.cli-installer == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # dash is what /bin/sh is on Debian and Ubuntu, which is what most people # will pipe this into. Ubuntu runners already have shellcheck and pwsh. - name: Install dash run: sudo apt-get update && sudo apt-get install -y dash - name: Check the CLI installer run: ./scripts/check-cli-installer.sh make-ci: name: Make App CI needs: changes if: needs.changes.outputs.make == 'true' runs-on: ubuntu-latest defaults: run: working-directory: integrations/make steps: - uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Validate Make app # IML is interpreted by Make (no compile step); validate.mjs checks the # manifest, JSON validity, code-file references, and component enums. run: node scripts/validate.mjs rust-ci: name: Rust CI needs: changes if: needs.changes.outputs.tracking == 'true' runs-on: ubuntu-latest defaults: run: working-directory: tracking steps: - uses: actions/checkout@v4 # The default tracking build is NATS-only (pure Rust, rustls TLS), so it # needs no librdkafka / libcurl / libsasl system headers. Those are only # required for the optional `--features kafka` build. # Pinned to whatever the image builds with, not to `stable`. A dependency # that raises its rust-version above the builder's is invisible to a # `stable` job and surfaces only when the release tries to build the # image, which is the worst place to find out. - name: Read the builder's Rust version id: rust-version run: echo "version=$(sed -n 's/^FROM rust:\([0-9.]*\)-alpine.*/\1/p' Dockerfile | head -1)" >> "$GITHUB_OUTPUT" - name: Set up Rust uses: dtolnay/rust-toolchain@master with: toolchain: ${{ steps.rust-version.outputs.version }} components: rustfmt, clippy - name: Cache Cargo uses: Swatinem/rust-cache@v2 with: workspaces: tracking - name: Check formatting run: cargo fmt --check - name: Run Clippy run: cargo clippy -- -D warnings - name: Run tests run: cargo test # The Kafka publisher is behind a cargo feature, so none of the steps # above compile it: `cargo clippy` on the default build never opens # kafka.rs. That file ships as the published tracking:*-kafka image, so a # break in it would otherwise surface at release time rather than here. # This is the Rust half of the `go build -tags kafka` step above. # The Debian equivalents of what tracking/Dockerfile installs on alpine # for this build. libcurl is needed even though rdkafka-sys configures # with -DWITH_CURL=0: librdkafka's rdkafka_conf.c includes curl/curl.h # unconditionally, so the build fails at the first object without it. - name: Install librdkafka build dependencies run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ cmake pkg-config libssl-dev libcurl4-openssl-dev libsasl2-dev zlib1g-dev - name: Run Clippy (kafka feature) run: cargo clippy --features kafka --all-targets -- -D warnings elixir-ci: name: Elixir CI needs: changes if: needs.changes.outputs.realtime == 'true' runs-on: ubuntu-latest defaults: run: working-directory: realtime env: MIX_ENV: test steps: - uses: actions/checkout@v4 - name: Set up Elixir # mix.exs requires `elixir: "~> 1.18"`. Bumped here to match. # Phoenix 1.8 + plug 1.19 also expect a recent OTP. uses: erlef/setup-beam@v1 with: elixir-version: "1.18" otp-version: "27" - name: Cache deps uses: actions/cache@v4 with: path: | realtime/deps realtime/_build key: ${{ runner.os }}-mix-${{ hashFiles('realtime/mix.lock') }} restore-keys: ${{ runner.os }}-mix- - name: Install dependencies run: mix deps.get - name: Check formatting run: mix format --check-formatted - name: Run Credo # credo isn't in mix.exs yet; skip when the binary isn't # available so CI doesn't false-fail. Re-enable once it's # added as a dev dep. run: mix help credo > /dev/null 2>&1 && mix credo --strict || echo "credo not installed; skipping" - name: Compile # Don't fail the build on transitive warnings — jose/CAStore # and a couple of our own files emit deprecation warnings on # Elixir 1.18 that aren't fixable without forking deps. # Real compile errors still fail the step. run: mix compile - name: Run tests run: mix test ios-ci: name: iOS CI needs: changes if: needs.changes.outputs.ios == 'true' # macOS minutes are 10x Linux; the paths filter keeps this off # non-iOS PRs. The app needs the iOS 26 SDK and the Icon Composer # .icon app icon, so it must be a macos-26 image. runs-on: macos-26 steps: - uses: actions/checkout@v4 - name: Select newest Xcode run: | sudo xcode-select -s "$(ls -d /Applications/Xcode*.app | sort -V | tail -1)" xcodebuild -version - name: Build (iOS Simulator, no signing) # arm64 only: the generic destination otherwise also builds the # x86_64 slice, doubling build time for a compile check. run: | set -o pipefail xcodebuild build \ -project ios/Warmbly.xcodeproj \ -scheme Warmbly \ -destination 'generic/platform=iOS Simulator' \ ARCHS=arm64 ONLY_ACTIVE_ARCH=YES \ CODE_SIGNING_ALLOWED=NO # Validate the web/admin production Dockerfiles (build + nginx config check) # without pushing, so a broken image can't reach a release tag unnoticed. The # release workflow is the only other place these build, and only on tags. frontend-images: name: Frontend Image (${{ matrix.service }}) needs: changes if: needs.changes.outputs.web == 'true' || needs.changes.outputs.admin == 'true' runs-on: ubuntu-latest strategy: fail-fast: false matrix: service: [web, admin] steps: - uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build image (no push) uses: docker/build-push-action@v6 with: context: ./${{ matrix.service }} file: ./${{ matrix.service }}/Dockerfile push: false platforms: linux/amd64 cache-from: type=gha,scope=ci-${{ matrix.service }} cache-to: type=gha,mode=max,scope=ci-${{ matrix.service }} # The one job to mark required in branch protection. Skipped jobs pass # (their tree did not change); anything failed or cancelled fails it. # Dependency scanning lives in security.yml, off the PR path on purpose. aws-deployment-ci: name: AWS deployment gates needs: changes if: needs.changes.outputs.aws-deployment == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "22" - name: Install deployment client run: npm ci --prefix .github/aws-deploy --omit=dev --ignore-scripts --no-audit --no-fund - name: Check deploy, rollback and rotation gates env: NODE_PATH: ${{ github.workspace }}/.github/aws-deploy/node_modules run: node --test .github/scripts/aws-deploy.test.cjs .github/scripts/aws-backend-config.test.cjs .github/scripts/aws-rotate.test.cjs deploy/terraform/aws/runtime/rotate/rotate.test.cjs ci-status: name: CI Status runs-on: ubuntu-latest needs: [changes, migrations-ci, go-ci, web-ci, qa-ci, admin-ci, site-ci, docs-ci, forms-ci, portal-ci, installer-ci, cli-installer-ci, make-ci, rust-ci, elixir-ci, ios-ci, frontend-images, pages-ci, aws-deployment-ci] if: always() steps: - name: Check CI status if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') run: exit 1