Skip to content

Validate resource IDs at option boundaries - #73

Merged
apstndb merged 2 commits into
mainfrom
issue-61-validate-resource-ids
Jul 1, 2026
Merged

Validate resource IDs at option boundaries#73
apstndb merged 2 commits into
mainfrom
issue-61-validate-resource-ids

Conversation

@apstndb

@apstndb apstndb commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Validate finalized project, instance, and database IDs through shared option finalization for emulator and Omni paths.
  • Reject empty or whitespace-only IDs, path-breaking characters, DDL-breaking quote/backtick characters, unsupported uppercase/non-lowercase-subset IDs, and overlong IDs with actionable messages.
  • Preserve default/generated IDs plus Omni fixed defaults and guardrail behavior.

Test plan

  • go test . -run 'TestValidateResourceID|TestRunOmniRejectsUnsupportedProjectOptions|TestRunOmniDisableBackendGuardrails'
  • go test ./...
  • git diff --check

Closes #61.

Made with Cursor

Reject path-breaking project, instance, and database IDs during option finalization so invalid resource paths and CREATE DATABASE statements fail before bootstrap.

Co-authored-by: Cursor <cursoragent@cursor.com>

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces resource ID validation for projects, instances, and databases during option finalization in both standard and Omni emulator configurations, along with comprehensive unit tests. The review feedback highlights a correctness issue where underscores are incorrectly rejected for database IDs, and suggests enforcing minimum length constraints for resource IDs to prevent late failures.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread options.go Outdated
Allow valid database ID underscores and reject too-short resource IDs at option finalization so invalid fixed IDs fail before backend setup.

Co-authored-by: Cursor <cursoragent@cursor.com>
@apstndb

apstndb commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

1 similar comment
@apstndb

apstndb commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces validation for project, instance, and database resource IDs in both standard emulator and Omni configurations. It defines length constraints and character rules (such as requiring lowercase letters, digits, hyphens, and underscores where appropriate) and includes comprehensive unit tests to verify these validation rules. I have no additional feedback to provide as the implementation is clean and well-tested.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces validation for project, instance, and database resource IDs during the finalization of emulator and Omni options. It defines length constraints and character rules (e.g., lowercase letters, digits, hyphens, and underscores for databases) and implements helper functions to enforce these constraints. Additionally, comprehensive unit tests have been added to verify that invalid IDs are correctly rejected and that default or random IDs are properly accepted. As there are no review comments, I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@apstndb
apstndb merged commit ea76d6f into main Jul 1, 2026
4 checks passed
@apstndb
apstndb deleted the issue-61-validate-resource-ids branch July 1, 2026 16:31
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.

Validate project/instance/database IDs early in finalizeOptions

1 participant