Skip to content

Resolve dev database URLs after AppSpec analysis - #5066

Closed
infomiho wants to merge 4 commits into
mainfrom
prototype/dev-db-runtime-url
Closed

infomiho wants to merge 4 commits into
mainfrom
prototype/dev-db-runtime-url

Conversation

@infomiho

@infomiho infomiho commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Description

This PR takes the devDatabaseUrl out of app spec, so we can reuse AppSpec in #4914 and not run the analysis twice.

Agreement

  • This is a small, obvious fix (typo, docs corrections, clear small bug with a test).
  • A maintainer agreed on the approach beforehand: Discord discussion on October 8 about removing the development database URL from AppSpec.

Type of change

  • 🔧 Just code/docs improvement
  • 🐞 Bug fix
  • 🚀 New/improved feature
  • 💥 Breaking change

Checklist

  • I tested my change in a Wasp app to verify that it works as intended.

  • 🧪 Tests and apps:

    • I added unit tests for my change. Existing server .env tests were updated. This is a throwaway prototype, with runtime smoke tests described below.
    • (if you fixed a bug) I added a regression test for the bug I fixed.
    • (if you added/updated a feature) I added/updated e2e tests in examples/kitchen-sink/e2e-tests.
    • (if you added/updated a feature) I updated the starter templates in waspc/data/Cli/templates, as needed.
    • (if you added/updated a feature) I updated the example apps in examples/, as needed.
      • (if you updated examples/tutorials) I updated the tutorial in the docs (and vice versa).
  • 📜 Documentation:

    • (if you added/updated a feature) I added/updated the documentation in web/docs/.
  • 🆕 Changelog: (if change is more than just code/docs improvement)

    • I updated waspc/ChangeLog.md with a user-friendly description of the change.
    • (if you did a breaking change) I added a step to the current migration guide in web/docs/migration-guides/.
    • I bumped the version in waspc/waspc.cabal to reflect the changes I introduced.

Prototype scope

Remove the resolved development database URL from AppSpec. Analysis no longer discovers the running Docker database.

Project compilation resolves a Generator.DevEnvironment after analysis. It currently contains only the managed development database URL. The generator receives AppSpec and DevEnvironment as separate inputs, and produces the server .env through its existing genApp, genServer, and genDotEnv path. All file drafts come from the generator.

DevEnvironment describes facts resolved for the current development run. RunConfigs describe how to launch processes and remain separate. This prototype moves only the database URL.

The existing generation and setup step is exposed as generateCode. The intended flow is:

  1. Analyze the project once.
  2. Start or reuse the development database.
  3. Compile the same AppSpec, resolving DevEnvironment and passing it into generation.

The .env contents, user overrides, database connection requirements, and Prisma interfaces retain their behavior. Production builds generate no .env.

The diff touches 9 files. This branch starts from main. The auto-start stack still needs to call generateCode to use this flow.

Validation

  • The CLI builds.
  • All 54 CLI tests and 633 compiler tests passed.
  • All 11 existing migration, reset, seed, and project-lock end-to-end tests passed.
  • A PostgreSQL check analyzed the app before the database existed, started a disposable database on port 15445, then compiled the same AppSpec and verified the correct URL in the generated .env.
  • Formatting and HLint checks passed.

@infomiho
infomiho temporarily deployed to railway-deploy-test October 19, 2026 15:27 — with GitHub Actions Inactive
@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@wasp.sh/spec

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/spec@5066

@wasp.sh/wasp-cli

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli@5066

@wasp.sh/wasp-cli-darwin-arm64-unknown

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-darwin-arm64-unknown@5066

@wasp.sh/wasp-cli-darwin-x64-unknown

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-darwin-x64-unknown@5066

@wasp.sh/wasp-cli-linux-arm64-glibc

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-linux-arm64-glibc@5066

@wasp.sh/wasp-cli-linux-x64-glibc

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-linux-x64-glibc@5066

@wasp.sh/wasp-cli-linux-x64-musl

npx https://pkg.pr.new/wasp-lang/wasp/@wasp.sh/wasp-cli-linux-x64-musl@5066

commit: dd86329

@infomiho infomiho changed the title Prototype: pass development database URLs at runtime Prototype: resolve development database URLs after AppSpec analysis Oct 19, 2026
@infomiho
infomiho temporarily deployed to railway-deploy-test October 19, 2026 16:56 — with GitHub Actions Inactive
@infomiho
infomiho temporarily deployed to railway-deploy-test October 20, 2026 08:45 — with GitHub Actions Inactive
@infomiho infomiho changed the title Prototype: resolve development database URLs after AppSpec analysis Resolve dev database URLs after AppSpec analysis Oct 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request is now stale.
That means that it hasn't seen any activity for a while, and needs to be updated or addressed before it can be merged.

Next steps if the PR is still relevant, and you are able to devote time to it:

  • If you received any questions or feedback, please address them.
  • Merge the latest main into your branch to ensure that you are up to date.
  • If you are still working on the changes, please leave a comment telling us so.
  • Otherwise, just leave a comment explaining why the PR is still relevant.

If no action is taken, this PR will be automatically closed in 7 days.

@github-actions github-actions Bot added the Stale label Oct 28, 2026
@infomiho

Copy link
Copy Markdown
Member Author

Closing in favor of #5130

@infomiho infomiho closed this Oct 28, 2026

This branch was previously deployed

2 inactive deployments
fly-deploy-test — dd86329e Deployed Oct 20, 2026 by infomiho via deploy-test / Test Fly deployment #13448
railway-deploy-test — dd86329e Deployed Oct 20, 2026 by infomiho via deploy-test / Test Railway deployment #13448
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant