Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
types: [opened, synchronize, reopened, edited]
workflow_dispatch:

Expand Down Expand Up @@ -1060,19 +1059,45 @@ jobs:
id: checks
run: |
echo "::group::Run Module Validation"
if [[ "${{ matrix.module }}" == "account-service" || "${{ matrix.module }}" == "game-session-service" || "${{ matrix.module }}" == "game-design-service" ]]; then
if [[ "${{ matrix.module }}" == "account-service" || "${{ matrix.module }}" == "game-session-service" || "${{ matrix.module }}" == "game-design-service" || "${{ matrix.module }}" == "social-groups-service" || "${{ matrix.module }}" == "logging-admin-service" ]]; then
./gradlew :${{ matrix.module }}:check -PfullCheck --no-build-cache --no-configuration-cache
else
./gradlew :${{ matrix.module }}:check -PfullCheck
fi
echo "::endgroup::"

- name: 🔎 Verify Social Account UUID migration PostgreSQL proof
if: ${{ matrix.module == 'social-groups-service' }}
run: |
# Strict suite validation also requires every retained-table parameter to execute.
bash dev-tools/validation/inspect-test-results.sh \
--strict \
--require-suite net.firedevops.firemud.socialgroups.SocialAccountUuidMigrationIntegrationTest \
--require-case 'net.firedevops.firemud.socialgroups.SocialAccountUuidMigrationIntegrationTest#freshAndEmptyV9UpgradeConvergeAllAccountColumnsWithoutChangingOtherIdentityTypes()' \
--require-case 'net.firedevops.firemud.socialgroups.SocialAccountUuidMigrationIntegrationTest#concurrentWriterCommitsBeforeEmptyCheckAndItsEvidenceIsPreserved()' \
social-groups-service

- name: 🔎 Verify Logging Account UUID migration PostgreSQL proof
if: ${{ matrix.module == 'logging-admin-service' }}
run: |
bash dev-tools/validation/inspect-test-results.sh \
--strict \
--require-suite integration.net.firedevops.firemud.loggingadmin.LoggingAccountUuidMigrationIntegrationTest \
--require-case 'integration.net.firedevops.firemud.loggingadmin.LoggingAccountUuidMigrationIntegrationTest#freshSchemaMigratesWithCanonicalAccountUuidsAndNumericLocalIdentifiers()' \
--require-case 'integration.net.firedevops.firemud.loggingadmin.LoggingAccountUuidMigrationIntegrationTest#emptyAffectedTablesUpgradeFromV5AndGenericLogAccountIdRemainsNumeric()' \
--require-case 'integration.net.firedevops.firemud.loggingadmin.LoggingAccountUuidMigrationIntegrationTest#retainedModerationActionRefusesWithoutChangingRowsOrMigrationHistory()' \
--require-case 'integration.net.firedevops.firemud.loggingadmin.LoggingAccountUuidMigrationIntegrationTest#retainedPlayerReportRefusesWithoutChangingRowsOrMigrationHistory()' \
--require-case 'integration.net.firedevops.firemud.loggingadmin.LoggingAccountUuidMigrationIntegrationTest#migrationWaitsForConcurrentWriterAndRefusesAfterItsRowCommits()' \
logging-admin-service

- name: 🔎 Verify Account PostgreSQL proof cases
if: ${{ matrix.module == 'account-service' }}
run: |
bash dev-tools/validation/inspect-test-results.sh \
--strict \
--require-suite net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest \
--require-suite net.firedevops.firemud.accountservice.AccountJoinReconciliationPostgresIntegrationTest \
--require-suite integration.net.firedevops.firemud.accountservice.AccountConnectStorageUuidMigrationIntegrationTest \
--require-suite integration.net.firedevops.firemud.accountservice.AccountBareLoginExchangeRepositoryIntegrationTest \
--require-suite integration.net.firedevops.firemud.accountservice.repository.AccountConnectTokenIssuanceRepositoryIntegrationTest \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#positiveMembershipSnapshotRejectsScalarAndWrongTenantVersionMaps()' \
Expand All @@ -1086,6 +1111,12 @@ jobs:
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#contradictoryLatestEventDeniesLeftWithoutMembershipOrOutboxMutation()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#auditFailureRollsBackCompleteOwnerLeftTransaction()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#concurrentLeftAndReactivationSerializeAsCompleteAccountTransitions()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinPostgresIntegrationTest#membershipTransitionReceiptsRejectMutationAndStillAllowAppendAndStreamAdvance()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinReconciliationPostgresIntegrationTest#exactPersistedEvidenceRecoversExpiredScopeAndSameRequestRetryWithoutDuplicates()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinReconciliationPostgresIntegrationTest#twoWorkersRecoverThresholdPendingEvidenceWithoutDuplicatingMembershipOrAudit()' \
--require-case 'net.firedevops.firemud.accountservice.AccountJoinReconciliationPostgresIntegrationTest#retainedScopeDeletionAndExpiredScopeWithoutMembershipProofRemainPendingWithDiagnostics()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountConnectStorageUuidMigrationIntegrationTest#freshMigrationsAndEmptyV39UpgradeUseCanonicalUuidColumns()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountConnectStorageUuidMigrationIntegrationTest#migrationWaitsForConcurrentWriterThenRejectsItsCommittedEvidence()' \
--require-case 'integration.net.firedevops.firemud.accountservice.AccountBareLoginExchangeRepositoryIntegrationTest#claimOnlyTransactionRollsBackPendingExchange()' \
--require-case 'integration.net.firedevops.firemud.accountservice.repository.AccountConnectTokenIssuanceRepositoryIntegrationTest#concurrentExactIssuanceClaimsHaveOneTerminalFirstWriter()' \
--require-case 'integration.net.firedevops.firemud.accountservice.repository.AccountConnectTokenIssuanceRepositoryIntegrationTest#lostIssuanceResponseRecoversExactEncryptedResultFromDurableReadback(Path)' \
Expand Down Expand Up @@ -1256,7 +1287,7 @@ jobs:
contents: read
pull-requests: write
needs: [buf-check, docker-lint, shellcheck, python-script-validation, dev-tool-contract-checks, dev-tools-readme-contract, yaml-lint, metrics-cardinality-check, flyway-migration-sanity-checks, grpc-transport-config-sanity-checks, workflow-lint, helm-lint, helm-render-validation, helm-transaction-proof, docs-check, frontend-checks, build-and-test, validation-gate]
if: ${{ always() && github.event_name == 'pull_request' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
steps:
- name: Harden runner
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-pr-runtime-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ jobs:
fail("source workflow run API id does not match the event")
if source_run.get("workflow_id") != int(workflow_id_text):
fail("source workflow identity changed between event and API")
if source_run.get("name") != source_title:
fail("source workflow API name differs from its exact run title")
if source_run.get("name") not in {"Build Runtime Images", source_title}:
fail("source workflow API name is neither its owning name nor exact run title")
if source_run.get("path") != SOURCE_WORKFLOW_PATH:
fail("source workflow API path is not the trusted runtime-images workflow")
if source_run.get("event") != source_event:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ jobs:
uses: ./.github/actions/setup-trivy

- name: 🔍 Run Trivy and Save Report
shell: bash
run: |
echo "::group::Run Trivy"
trivy fs --config config/security/trivy.yaml . | tee trivy-report.txt
Expand Down Expand Up @@ -207,7 +208,7 @@ jobs:
contents: read
pull-requests: write # Publishes the consolidated security result on the PR.
needs: [changes, trivy-scan, secret-compliance, security-gate]
if: ${{ always() && github.event_name == 'pull_request' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
steps:
- name: Harden runner
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5
Expand Down
51 changes: 48 additions & 3 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
".github/actions/load-workflow-tool-versions/",
".github/actions/setup-python/",
"dev-tools/smoke/",
"dev-tools/minio/",
];
const fullRelevantFiles = new Set([
"build.gradle.kts",
Expand Down Expand Up @@ -145,7 +146,7 @@ jobs:
contents: read
pull-requests: write
needs: [changes]
if: ${{ always() && github.event_name == 'pull_request' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
steps:
- name: Harden runner
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5
Expand Down Expand Up @@ -198,6 +199,26 @@ jobs:
`- ${statusIcon(fullResult)} PR Full-Stack Smoke: \`${fullResult}\``,
].join("\n");

const expectedHeadSha = context.payload.pull_request.head.sha;
const expectedBaseRef = context.payload.pull_request.base.ref;
const expectedBaseSha = context.payload.pull_request.base.sha;
const { data: currentPullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.issue.number,
});
if (
currentPullRequest.state !== "open" ||
currentPullRequest.head.sha !== expectedHeadSha ||
currentPullRequest.base.ref !== expectedBaseRef ||
currentPullRequest.base.sha !== expectedBaseSha
) {
core.info(
`Skipping stale smoke summary for ${expectedBaseRef}@${expectedBaseSha}...${expectedHeadSha}; ` +
`current PR state/base/head is ${currentPullRequest.state}/${currentPullRequest.base.ref}@${currentPullRequest.base.sha}/${currentPullRequest.head.sha}`
);
return;
}

const comments = await github.paginate(
github.rest.issues.listComments,
{
Expand Down Expand Up @@ -277,7 +298,7 @@ jobs:
contents: read
pull-requests: write
needs: [changes, smoke-gate, smoke-summary-pending]
if: ${{ always() && github.event_name == 'pull_request' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}
steps:
- name: Harden runner
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5
Expand Down Expand Up @@ -334,6 +355,26 @@ jobs:
`- ${statusIcon(fullResult)} PR Full-Stack Smoke: \`${fullResult}\``,
].join("\n");

const expectedHeadSha = context.payload.pull_request.head.sha;
const expectedBaseRef = context.payload.pull_request.base.ref;
const expectedBaseSha = context.payload.pull_request.base.sha;
const { data: currentPullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.issue.number,
});
if (
currentPullRequest.state !== "open" ||
currentPullRequest.head.sha !== expectedHeadSha ||
currentPullRequest.base.ref !== expectedBaseRef ||
currentPullRequest.base.sha !== expectedBaseSha
) {
core.info(
`Skipping stale smoke summary for ${expectedBaseRef}@${expectedBaseSha}...${expectedHeadSha}; ` +
`current PR state/base/head is ${currentPullRequest.state}/${currentPullRequest.base.ref}@${currentPullRequest.base.sha}/${currentPullRequest.head.sha}`
);
return;
}

const comments = await github.paginate(
github.rest.issues.listComments,
{
Expand Down Expand Up @@ -476,7 +517,11 @@ jobs:
const eventMergeSha = context.sha;
const prNumber = String(context.payload.pull_request.number);
const started = Date.now();
const timeoutMs = 25 * 60 * 1000;
// Contract-checked against pr-local-smoke; bounded overhead covers metadata,
// runner scheduling and API convergence, not unbounded queue delays.
const producerTimeoutMinutes = 45;
const prerequisiteAndQueueAllowanceMinutes = 45;
const timeoutMs = (producerTimeoutMinutes + prerequisiteAndQueueAllowanceMinutes) * 60 * 1000;
const cancelledReplacementTimeoutMs = 5 * 60 * 1000;
const sleepMs = 15000;
const pullRequestCheckInterval = 4;
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/static-analysis-summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ jobs:
if (
currentPullRequest.state !== "open" ||
!sourceWorkflowName ||
context.payload.workflow_run.name !== expectedSourceTitle ||
(context.payload.workflow_run.name !== sourceWorkflowName &&
context.payload.workflow_run.name !== expectedSourceTitle) ||
context.payload.workflow_run.display_title !== expectedSourceTitle
) {
core.info("The source run is not bound to the current open pull-request base and head.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ grpcurl -cacert "$FIREMUD_GRPC_CA_CERT_PATH" \
-cert "$FIREMUD_GRPC_CERT_CHAIN_PATH" \
-key "$FIREMUD_GRPC_PRIVATE_KEY_PATH" \
-H 'Authorization: Bearer <disposable non-production internal-service JWT>' \
-d '{"tenant_id":"1","reporter_account_id":"1","target_account_id":"2","type":"BUG","description":"example"}' \
-d '{"tenant_id":"1","reporter_account_id":"550e8400-e29b-41d4-a716-446655440000","target_account_id":"6ba7b810-9dad-41d1-80b4-00c04fd430c8","type":"BUG","description":"example"}' \
"$FIREMUD_LOGGING_ADMIN_GRPC_TARGET" \
logging_admin.v1.ReportService/CreateReport
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ For plugin operations, Automation remains the activation/lifecycle owner and Gam

## Data Model

Account subjects in moderation-policy reads and report references are canonical non-nil UUIDs, distinct from tenant and private row selectors. Forward migration V6 converts the Account columns in `moderation_actions` and `player_reports` only after locking both tables and proving both empty; any retained row refuses the transaction unchanged and requires Account-owned authoritative recovery. Published V1–V5 remain unchanged. This storage/caller correction does not enable moderation or report mutation, and the startup seeder must not fabricate Account subjects for sample rows. The generic `log_events.account_id` and separate audit/recovery contracts are not converted by this migration.

- `log_events` is the current service-owned PostgreSQL domain table and also holds the Account audit projection defined in [Account Audit Ingress and Receipt](./api-contracts.md#account-audit-ingress-and-receipt). Audit projections retain explicit `platform` or `tenant` scope; platform rows have no `tenantId` and are excluded from tenant queries. `LogQueryServiceImpl` queries tenant-scope rows by exact `tenantId` and case-insensitive message containment and returns only stored messages. No current implementation mirrors this table into Elasticsearch or proves the profile-aware emitter-to-query path; selected-profile indexed, compatible-backend, or console/journal querying remains target-state under [Logging & Monitoring](../../system-architecture-logging-monitoring.md#log-pipeline-queryability-contract).
- `moderation_actions` is the target durable record for accepted moderation policy intent and audit evidence, with the fixed category, normalized explicit scope, actor/case/source request, safe notice/reason, local intent-reference redemption outcome, separate owner command/result linkage when a later enforcement command exists, and the idempotency identity, digest, and timestamps. A linked owner-result revision is recorded only when that result supplies it; the local policy-intent commit never synthesizes owner revision or enforcement epoch. Raw authorization references are never persisted. The legacy `POST /moderation/actions` and `ApplyModerationAction` transport stubs now hard fail closed after narrow checks without persisting their generic legacy row; they are unsupported/nonconformant and not target fixed-category proof. Owner restriction tables and owner-command redemption are separate; Logging & Admin does not mutate them.
- `moderation_appeal_cases` and bounded `moderation_appeal_evidence_refs` are target Logging & Admin records for the `SUBMITTED -> UNDER_REVIEW -> DECIDED` lifecycle, exact appealed owner revision/digest, jurisdiction, eligibility policy, safe submission/decision, bounded evidence references, retention/legal-hold/export state, and resulting owner command identity. No complete appeal table or workflow is currently implemented.
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/hosted/preview/resolve-preview-image-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runtime_relevant() {
.github/workflows/runtime-images.yml | .github/workflows/publish-pr-runtime-images.yml | .github/workflows/smoke.yml | .github/workflows/smoke-full.yml | .dockerignore)
return 0
;;
.github/actions/setup-python/* | .github/actions/load-workflow-tool-versions/* | buildSrc/* | gradle/* | protos/* | docker/* | services/* | dev-tools/smoke/*)
.github/actions/setup-python/* | .github/actions/load-workflow-tool-versions/* | buildSrc/* | gradle/* | protos/* | docker/* | services/* | dev-tools/smoke/* | dev-tools/minio/*)
return 0
;;
config/python/smoke-requirements.txt | config/python/smoke-requirements.in | \
Expand Down
12 changes: 12 additions & 0 deletions dev-tools/tests/ci-validation-summary-contract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ if script.index("github.rest.pulls.get") > script.index("github.paginate(github.
raise SystemExit("validation-summary must verify the current PR before listing comments")
PY

python3 - "$ROOT_DIR/.github/workflows/ci.yml" <<'PYTHON'
from pathlib import Path
import sys
import yaml

workflow = yaml.load(Path(sys.argv[1]).read_text(), Loader=yaml.BaseLoader)
condition = workflow["jobs"]["validation-summary"]["if"]
expected = "${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && (github.event.action != 'edited' || github.event.changes.base.ref != null) }}"
if condition != expected:
raise SystemExit("Optional summary must preserve cancellation, native-PR trust and substantive-event predicates")
PYTHON

script_b64="$({
python3 - "$CI_WORKFLOW" <<'PY'
import base64
Expand Down
Loading
Loading