#2593

db: add the storage class column to snapshot storage locations

Openshehan-pplxwants to merge intofrom

Summary

Add the storage class column to snapshot storage locations.

This is the schema half of recording a verified storage class, split out so the migration lands apart from runtime code.

  • Add a nullable storage_class text column to snapshot_storage_locations. It records the class of the location, which holds every object of the snapshot at that route, so the name does not say disk.
  • Add a named NOT VALID check that permits hot, cold, or NULL. Existing rows stay NULL; there is no scan or backfill.
  • Keep this change schema-only. The down migration drops the column and its check, discarding any recorded classes.

Validation

  • Passed scripts/check-postgres-migrations-isolated.sh, scripts/check-migration-versions.sh, and scripts/check-postgres-migrations-squawk.sh against main. Squawk reported zero issues.

Severity and risk

Low. The change is additive and existing writers can omit the column. PostgreSQL still takes a brief table lock; the migration bounds lock and statement waits. Apply this migration before introducing the writer, and roll back the writer before dropping the column.

AI assistance: Perplexity contributed the migration and this description.

Created with Perplexity

Activity

2
coderabbitai[bot]21h ago

Automatic approval withheld

Automatic approval is disabled by the configured approval policy for this pull request. Review comments and requests for changes continue normally.

Commit: 2cfbcb8822ca.

No actionable comments were generated in the recent review.

Walkthrough

The up migration adds a nullable storage_class column to snapshot_storage_locations and constrains its values to hot or cold with a NOT VALID check. The down migration drops the column. Both migrations set local lock and statement timeouts.

Merge Risk: Low · up to 2cfbc

This adds an optional hot or cold storage class to snapshot locations without changing existing rows. The risk is low. Apply the migration before introducing the writer, and roll the writer back before dropping the column.

Architecture risk: Low · up to 2cfbc

The persisted snapshot-location contract adds an optional hot-or-cold storage classification, with a down migration that removes the field.

Changed areas: db

Review details

Systems and components

  • observed — 2 changed files mapped to db.
Pre-merge checks: 7

Check nameStatusExplanation
Title checkThe title "db: add the storage class column to snapshot storage locations" follows the required format: a lowercase area ("db") followed by a colon, then a summary starting with a lowercase word ("add…
Description Follows The Pr TemplateThe PR description contains all four required items, each with real content: 1. "## Summary": present. It states that merging adds a nullable storage_class column to snapshot_storage_locations…
Bug Fixes Name A Regression TestThe check applies only when the PR fixes a defect in application behavior under crates/, shim/, or ui/. The PR (#2593, shehan-pplx, main <- loki/location-class-migration) adds a nullable storage_class…
Weakened Safeguards Are JustifiedThe PR range adds two files and changes nothing else: db/postgres/20261201204354_snapshot_location_storage_class.up.sql and .down.sql. Both are new (status A). The diff removes or edits no test, a…
Agent Tooling Runs No New CommandsThe check covers agent plugin manifests, SKILL.md files, command/skill files, and guideline files. The PR changes only two files: db/postgres/20261201204354_snapshot_location_storage_class.up.sql an…
External Code Sources Need A PersonThe check applies only to external code sources: Cargo.toml dependency sources, container image references, downloaded binaries or archives in Dockerfiles or scripts, and external Helm chart dependenc…
Public-Safe ContentThe public-safe content check passes. The PR adds two migration files: an up migration that adds a nullable storage_class column with a NOT VALID check (hot/cold), and a down migration that dr…
Full details: Title check

Explanation

The title "db: add the storage class column to snapshot storage locations" follows the required format: a lowercase area ("db") followed by a colon, then a summary starting with a lowercase word ("add"). It has no trailing period, ticket ID, or internal link. It matches the main change, which adds a nullable storage_class column to snapshot_storage_locations.

Full details: Description Follows The Pr Template

Explanation

The PR description contains all four required items, each with real content: 1. "## Summary": present. It states that merging adds a nullable storage_class column to snapshot_storage_locations and a named NOT VALID check. 2. "## Validation": present. It names scripts/check-postgres-migrations-isolated.sh, scripts/check-migration-versions.sh, and scripts/check-postgres-migrations-squawk.sh, and reports that they passed against main with zero Squawk issues. 3. "## Severity and risk": present. It gives "Low" as the severity and describes the risk: a brief table lock, bounded by the lock and statement timeouts. 4. "AI assistance:" line: present. It reads "AI assistance: Perplexity contributed the migration and this description," which names the tool and the parts it drafted. The check judges presence only, so the content quality is not assessed.

Full details: Bug Fixes Name A Regression Test

Explanation

The check applies only when the PR fixes a defect in application behavior under crates/, shim/, or ui/. The PR (#2593, shehan-pplx, main <- loki/location-class-migration) adds a nullable storage_class column and a NOT VALID check to snapshot_storage_locations. The changed-file inventory shows only two added files under db/postgres/: an up and a down migration. No file under crates/, shim/, or ui/ changes. The PR is a schema addition, not an application bug fix, so the check does not apply and passes.

Full details: Weakened Safeguards Are Justified

Explanation

The PR range adds two files and changes nothing else: db/postgres/20261201204354_snapshot_location_storage_class.up.sql and .down.sql. Both are new (status A). The diff removes or edits no test, assertion, lint, CI step, allowlist, baseline, exception, or guideline file, so none of the listed weakening patterns applies. The up migration adds a nullable storage_class TEXT column and a named NOT VALID check that permits hot or cold. It also sets lock_timeout to 1s and statement_timeout to 5s. These settings bound waits and add no relaxation. The down migration drops the column. Nothing in the diff disables or narrows an existing safeguard. Primary PR: perplexityai/SPACE #2593, author shehan-pplx. The author identity does not affect this check.

Full details: Agent Tooling Runs No New Commands

Explanation

The check covers agent plugin manifests, SKILL.md files, command/skill files, and guideline files. The PR changes only two files: db/postgres/20261201204354_snapshot_location_storage_class.up.sql and .down.sql. The changed-file inventory (git diff --name-status) lists no plugin manifest, skill, command, or guideline file. The SQL diffs contain only SET LOCAL timeouts and ALTER TABLE statements, with no hooks, MCP/LSP server entries, SKILL.md frontmatter, inline shell substitutions, or other content that agent tools would run. The check does not apply to this diff, so it passes.

Full details: External Code Sources Need A Person

Explanation

The check applies only to external code sources: Cargo.toml dependency sources, container image references, downloaded binaries or archives in Dockerfiles or scripts, and external Helm chart dependencies. The PR changes two files, both new SQL migrations: db/postgres/20261201204354_snapshot_location_storage_class.up.sql and .down.sql. Neither file matches a failure condition. The up migration adds a nullable storage_class TEXT column and a NOT VALID check constraint allowing 'hot' and 'cold'. The down migration drops the column. No Cargo.toml, Dockerfile, image reference, download URL or checksum, or Helm chart file is added or changed.

Full details: Public-Safe Content

Explanation

The public-safe content check passes. The PR adds two migration files: an up migration that adds a nullable storage_class column with a NOT VALID check (hot/cold), and a down migration that drops it. Neither file contains credentials, tokens, keys, internal hostnames or URLs, cloud account IDs or ARNs, cluster or environment names, personal absolute paths, production logs or measurements, incident details, or undisclosed vulnerability descriptions. The title and description contain no such values either. Repo-relative script paths (scripts/check-*.sh) are not personal workstation paths. The only link is the closing "Created with Perplexity" credit, which points to perplexity.ai, the AI tool's own site, so it is allowed under the check's exception.

Recent review info

Automatic approval policy

Commit: 2cfbcb8822ca.

SettingEffective valueSource
Automatic approvalsDisabledOverride 3
Merge riskModerateGlobal configuration
Security riskNot setGlobal configuration

Matching overrides (numbered as in the resolved configuration):

  • Override 3 — any author; paths: .coderabbit.yaml, .coderabbit.yml, coderabbit.yaml, coderabbit.yml, .coderabbit.config.ts, .github/**, ci/scripts/ci-image.sh, ci/scripts/mirror-images.sh, ci/scripts/lib/test-deps.sh, ci/scripts/run-space-bundle-builds.py, ci/scripts/ensure-uv.sh, ci/scripts/tfswitch-lite.sh, ci/scripts/notify-main-ci-failure.sh, templates/firecracker/kernel/ci.sh, ci/Dockerfile.ci, ci/mirrored-images.txt, ci/scripts/pull-ci-reuse.py, .claude/settings*.json, **/.mcp.json, **/hooks.json, .agents/plugins/**/hooks/**, .agents/plugins/**/scripts/**, .agents/plugins/**/commands/**, .agents/plugins/**/agents/**, **/skills/**/hooks/**, **/skills/**/scripts/**, **/skills/**/commands/**, **/skills/**/agents/**, .claude/commands/**, .claude/agents/**, **/marketplace.json, .pre-commit-config.yaml, lefthook.yaml, .cargo/**, rust-toolchain.toml, supply-chain/**, **/pyproject.toml, **/uv.lock, **/package.json, **/package-lock.json, **/go.mod, **/go.sum, **/requirements*.txt, **/requirements*.in, db/**, !db/README.md, proto/**, docs/versioning.md, ci/guest-update-required-since, crates/l40_api/api/src/auth.rs, crates/l40_api/api/src/auth/**, crates/l40_api/api/src/middleware/auth*, crates/l40_api/api/src/middleware/auth/**, crates/l40_api/api/src/routes/authz.rs, crates/l10_foundation/bearer/**, crates/l10_foundation/rustls/**, crates/l10_foundation/guest/**, crates/l10_foundation/pii/**, infra/space/aws/**, infra/space/cluster/**, infra/space/identity/**, infra/space/observability/**, infra/space/packer/**, LICENSE, SECURITY.md; automatic approvals: disabled.

Any matching disabled override withholds approval, regardless of risk. Otherwise, the strictest explicitly set limit wins for each score. Limits omitted by all matching overrides inherit the global configuration.

Not set means no limit was configured after inheritance. Use @coderabbitai configuration to inspect the resolved settings and their sources.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c08192bb95886999d8c4b09f37db6f63a9dc1d2b and 2cfbcb8822cabc4076c46d1b8ab68674213d4d3e.

Files selected for processing: 2

  • db/postgres/20261201204354_snapshot_location_storage_class.down.sql
  • db/postgres/20261201204354_snapshot_location_storage_class.up.sql

Included review availability: This review used your included allowance. 6 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.