Skip to content

feat(sis): Adding deployment_id and gpu_spec_id and index for them to instances table - #602

Open
dmikhaylovnv wants to merge 1 commit into
mainfrom
fix/sis_add_columns
Open

feat(sis): Adding deployment_id and gpu_spec_id and index for them to instances table#602
dmikhaylovnv wants to merge 1 commit into
mainfrom
fix/sis_add_columns

Conversation

@dmikhaylovnv

@dmikhaylovnv dmikhaylovnv commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Adding deployment_id and gpu_spec_id and their indexes for them to instances table

Issues

Resolves NVIDIA/nvcf#11152

Summary by CodeRabbit

  • New Features
    • Instances can now be associated with a deployment and GPU specification.
    • Added database indexes to improve lookup performance for these associations.

@dmikhaylovnv
dmikhaylovnv requested a review from a team as a code owner July 31, 2026 18:51
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Cassandra schema adds nullable deployment and GPU specification UUID columns to sis_api.instances. It also adds idempotent custom indexes for both columns.

Changes

Instance lookup schema

Layer / File(s) Summary
Instance columns and indexes
migrations/cassandra/keyspaces/sis_api/07_add_deployment_and_gpu_spec_id.up.sql, migrations/cassandra/keyspaces/sis_api/08_add_indexes_for_deployment_and_gpu_spec_id.up.sql
Adds nullable UUID columns to sis_api.instances and creates custom indexes for deployment and GPU specification lookups.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: sanjay-saxena

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required feat(sis): format and accurately describes the added instance columns and indexes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sis_add_columns

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@migrations/cassandra/keyspaces/sis_api/07_add_deployment_and_gpu_spec_id.up.sql`:
- Line 2: Extend migrations/cassandra/tests/test-execute-sqls.sh to cover
migrations 07 and 08: verify both UUID columns, both indexes, migration
ordering, and successful repeat application; the migration SQL files require no
direct changes. If coverage is intentionally omitted, document the reason in the
Pull Request description.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 82eab019-e4ef-4424-b25f-8a2d7e6adcc1

📥 Commits

Reviewing files that changed from the base of the PR and between 399964b and e394713.

📒 Files selected for processing (2)
  • migrations/cassandra/keyspaces/sis_api/07_add_deployment_and_gpu_spec_id.up.sql
  • migrations/cassandra/keyspaces/sis_api/08_add_indexes_for_deployment_and_gpu_spec_id.up.sql

@@ -0,0 +1,2 @@
-- Add deployment_id and gpu_specification_id UUID to instances table
ALTER TABLE sis_api.instances ADD IF NOT EXISTS (deployment_id uuid, gpu_specification_id uuid);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- migration files ---'
git ls-files 'migrations/cassandra/keyspaces/sis_api/*' | sort

printf '%s\n' '--- repository test and migration references ---'
rg -n -i --glob '!vendor' --glob '!node_modules' \
  'cassandra|migration|migrations|IF NOT EXISTS|StorageAttachedIndex' \
  .github Makefile* README* go.mod go.sum package.json pyproject.toml 2>/dev/null | head -n 250

printf '%s\n' '--- likely test files ---'
git ls-files | rg -i '(^|/)(test|tests|spec|specs)(/|$)|(_test|\.spec|\.test)\.' | head -n 250

Repository: NVIDIA/nvcf

Length of output: 17899


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- migration test script ---'
wc -l migrations/cassandra/tests/test-execute-sqls.sh
cat -n migrations/cassandra/tests/test-execute-sqls.sh

printf '%s\n' '--- Cassandra migration tree ---'
git ls-files 'migrations/cassandra/**' | sort

printf '%s\n' '--- relevant migration contents ---'
for f in \
  migrations/cassandra/keyspaces/sis_api/01_init_keyspace.up.sql \
  migrations/cassandra/keyspaces/sis_api/03_init_tables.up.sql \
  migrations/cassandra/keyspaces/sis_api/07_add_deployment_and_gpu_spec_id.up.sql \
  migrations/cassandra/keyspaces/sis_api/08_add_indexes_for_deployment_and_gpu_spec_id.up.sql
do
  echo "### $f"
  cat -n "$f"
done

printf '%s\n' '--- tracked change summary ---'
git diff --stat
git status --short

Repository: NVIDIA/nvcf

Length of output: 31709


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- migration documentation ---'
for f in migrations/cassandra/README.md migrations/cassandra/keyspaces/README.md; do
  echo "### $f"
  cat -n "$f"
done

printf '%s\n' '--- migration test references ---'
rg -n -C 4 \
  'test-execute-sqls|migrations/cassandra/tests|execute_sqls\.sh|migrations/cassandra' \
  .github Makefile* BUILD* WORKSPACE* WORKSPACE.bazel 2>/dev/null | head -n 300

printf '%s\n' '--- migration executor ---'
wc -l migrations/cassandra/execute_sqls.sh
cat -n migrations/cassandra/execute_sqls.sh

printf '%s\n' '--- migration ordering and idempotency markers ---'
python3 - <<'PY'
from pathlib import Path

root = Path("migrations/cassandra/keyspaces")
for keyspace in sorted(p.parent.name for p in root.glob("*/01_init_keyspace.up.sql")):
    files = sorted(p.name for p in (root / keyspace).glob("*.up.sql"))
    print(keyspace, ":", ", ".join(files))
    for name in files:
        text = (root / keyspace / name).read_text()
        print(f"  {name}: IF NOT EXISTS={text.upper().count('IF NOT EXISTS')}")
PY

Repository: NVIDIA/nvcf

Length of output: 22912


Add coverage for the new Cassandra migrations.

Extend migrations/cassandra/tests/test-execute-sqls.sh to check both UUID columns, both indexes, migration ordering, and repeat application. If tests are intentionally omitted, document the reason in the Pull Request description.

📍 Affects 2 files
  • migrations/cassandra/keyspaces/sis_api/07_add_deployment_and_gpu_spec_id.up.sql#L2-L2 (this comment)
  • migrations/cassandra/keyspaces/sis_api/08_add_indexes_for_deployment_and_gpu_spec_id.up.sql#L2-L3
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@migrations/cassandra/keyspaces/sis_api/07_add_deployment_and_gpu_spec_id.up.sql`
at line 2, Extend migrations/cassandra/tests/test-execute-sqls.sh to cover
migrations 07 and 08: verify both UUID columns, both indexes, migration
ordering, and successful repeat application; the migration SQL files require no
direct changes. If coverage is intentionally omitted, document the reason in the
Pull Request description.

Source: Coding guidelines

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.

1 participant