Repository navigation
ci: test ardent branch workflow - #5
VikramChennai wants to merge 16 commits into
Conversation
Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d894d50. Configure here.
Made-with: Cursor
Made-with: Cursor
…ctions Made-with: Cursor
Made-with: Cursor
… prod data Made-with: Cursor
Made-with: Cursor
…Claude snippet Made-with: Cursor
…gres server Made-with: Cursor
Made-with: Cursor
# Conflicts: # workflows/ci-cd.mdx
Greptile SummaryThis PR introduces a GitHub Actions workflow that provisions an Ardent database branch per PR, runs a Vitest/pg migration lifecycle test against it, and tears the branch down — along with matching docs and a minimal Node test harness. Previous review rounds addressed credential masking, CLI pinning, URL validation, and test structure; this iteration resolves all of those.
Confidence Score: 4/5The workflow is safe to merge for the stated CI-validation goal, but the cleanup step will incorrectly fail the job on transient network errors and orphan branches with no recovery path. The delete step has no
Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant CLI as ardent-cli@0.0.46
participant Ardent as Ardent Service
participant DB as Branch Database
participant Test as Vitest / pg
GH->>CLI: "npm install -g ardent-cli@0.0.46"
GH->>CLI: ardent login --token $ARDENT_TOKEN
CLI->>Ardent: authenticate
Ardent-->>CLI: session established
GH->>CLI: ardent project switch + connector switch
GH->>CLI: "ardent branch create pr-{N}-{run_id} --print-url"
CLI->>Ardent: provision branch
Ardent->>DB: clone from source
DB-->>Ardent: branch ready
Ardent-->>CLI: DATABASE_URL
CLI-->>GH: stdout captured into shell var
Note over GH: validate postgres:// prefix, mask, write to GITHUB_ENV
GH->>Test: npm test (DATABASE_URL in env)
Test->>DB: connect, CREATE TABLE, INSERT, ALTER, DROP
DB-->>Test: results
Test-->>GH: pass / fail
alt "always() and ARDENT_BRANCH_CREATED == true"
GH->>CLI: "ardent branch delete pr-{N}-{run_id}"
CLI->>Ardent: delete branch
Note over GH: no continue-on-error — failure here marks job failed
end
|

Summary
.github/workflows/ardent-branch.ymlto validate the CI flow end-to-endPrereq
ARDENT_TOKENmust be set as a repo secret.Made with Cursor
Note
Low Risk
Changes are limited to CI, dev test dependencies, and documentation; no production app or auth logic changes.
Overview
Adds a PR GitHub Actions workflow (
.github/workflows/ardent-branch.yml) that exercises the documented Ardent branch CI pattern: installardent-cli@0.0.44, log in withARDENT_TOKEN, create a per-PR branch, validate and mask the PostgresDATABASE_URL, runnpm test, and delete the branch only when creation succeeded (ARDENT_BRANCH_CREATED).Introduces a minimal Node test harness (
package.json,package-lock.json,tests/branch-moles/migration.test.jswith Vitest +pg) to run a full migration lifecycle against the branch URL from CI.Updates CI/CD docs (
workflows/ci-cd.mdx) to match the hardened workflow (explicit login, token scoped to CLI steps, URL scheme check,::add-mask::, job timeout, pinned CLI version). Regression testing (workflows/regression-testing.mdx) now points readers to the CI/CD page instead of duplicating inline CI notes.Reviewed by Cursor Bugbot for commit 0e1eaf7. Bugbot is set up for automated code reviews on this repo. Configure here.