Skip to content

Fix neon setup/teardown scripts#223

Merged
saddlepaddle merged 1 commit intomainfrom
pearl-thunder-58
Dec 1, 2025
Merged

Fix neon setup/teardown scripts#223
saddlepaddle merged 1 commit intomainfrom
pearl-thunder-58

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Dec 1, 2025

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • Chores
    • Enhanced database connection setup with improved error handling and connection pooling support.
    • Refined resource identification and management in deployment operations for increased reliability and clarity.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The setup.sh script is enhanced to adopt stricter shell options, capture raw JSON output from neonctl, extract additional Neon fields (branch ID, database URL, pooler credentials, role), construct a pooled database URL, and persist NEON_BRANCH_ID to .env. The teardown.sh script switches to stricter options, reads NEON_BRANCH_ID from .env, and deletes branches by ID instead of workspace name.

Changes

Cohort / File(s) Summary
Neon Setup Script
\.superset/setup.sh``
Switches to set -euo pipefail, captures raw JSON from neonctl, extracts branch ID, database URL, pooler host, password, role, and database fields, constructs DATABASE_POOLED_URL, and writes NEON_BRANCH_ID to .env
Neon Teardown Script
\.superset/teardown.sh``
Switches to set -euo pipefail, reads and exports NEON_BRANCH_ID from .env with early failure if absent, replaces workspace name with branch ID in neonctl deletion command, and updates messaging to display branch ID

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • JSON field extraction logic—verify neonctl output format parsing and correct field mapping (branch.id, connection_uris[0] nested fields)
  • DATABASE_POOLED_URL construction—ensure role, password, pooler_host, and database are correctly interpolated into the connection string
  • Error handling under strict set -euo pipefail—confirm early exit behavior if NEON_BRANCH_ID is missing during teardown
  • .env file creation and reading—verify persistence and retrieval of environment variables across scripts

Possibly related PRs

Poem

🐰 Through JSON fields we hop and parse,
Branch IDs extracted, smooth as glass!
Pooled URLs woven tight and true,
Setup and teardown, all brand new!
Neon branches dance with glee,
Shell scripts flow so perfectly! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pearl-thunder-58

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec941d1 and aaa203d.

📒 Files selected for processing (2)
  • .superset/setup.sh (3 hunks)
  • .superset/teardown.sh (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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