Skip to content

fix: add auth to postgres's search_path#12

Merged
soedirgo merged 5 commits into
mainfrom
fix/auth-search-path
Apr 1, 2021
Merged

fix: add auth to postgres's search_path#12
soedirgo merged 5 commits into
mainfrom
fix/auth-search-path

Conversation

@soedirgo
Copy link
Copy Markdown
Member

@soedirgo soedirgo commented Apr 1, 2021

What kind of change does this PR introduce?

Bug fix.

What is the current behavior?

The auth schema isn't included in the postgres role's search_path.

What is the new behavior?

Include it in the search_path. Also:

  • update .supabase/README.md,
  • improve error handling.

Additional context

Closes #9.

@soedirgo soedirgo requested a review from kiwicopple April 1, 2021 11:51
@soedirgo soedirgo merged commit b0d028e into main Apr 1, 2021
@soedirgo soedirgo deleted the fix/auth-search-path branch April 1, 2021 15:03
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2021

🎉 This PR is included in version 0.3.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

dumko2001 pushed a commit to dumko2001/cli that referenced this pull request Mar 15, 2026
kallebysantos pushed a commit to kallebysantos/supabase-cli that referenced this pull request May 6, 2026
## Summary

This branch does two substantial things at once:

1. It standardizes how tests are discovered, grouped, and run across the
Bun/TypeScript workspaces.
2. It refactors local stack startup so asset preparation is a
first-class lifecycle phase, surfaces `Downloading` as a real service
state, and exposes stack mode selection in the CLI.

At a high level:

- Add package-level Vitest project configs for `unit`, `integration`,
and `e2e` across the internal workspaces.
- Add `test:core` scripts so unit and integration tests can be run
together consistently, separately from e2e.
- Split CI into dedicated jobs for code quality, core tests, and e2e
tests.
- Rename unit tests from `*.test.ts` to `*.unit.test.ts` while keeping
`*.integration.test.ts` and `*.e2e.test.ts` unchanged.
- Refactor `@supabase/stack` startup into explicit preparation, build,
and lifecycle coordination phases.
- Surface per-service `Downloading` during cold-cache startup before
normal runtime states like `Starting`, `Initializing`, and `Healthy`.
- Add `--mode <native|auto|docker>` to `supabase start`, with `auto`
still as the default.
- Tighten CLI exit handling so JSON-mode command failures that set an
exit code do not accidentally exit `0`.

## Stack Lifecycle Refactor

`@supabase/stack` no longer hides downloads inside stack construction.
Instead, startup is split into three focused responsibilities:

- `StackPreparation`
Resolves native-vs-Docker artifacts, downloads binaries, and pulls
Docker images.
- `StackBuilder`
Builds the process graph and service projection from resolved config
plus prepared artifacts only.
- `StackLifecycleCoordinator`
Owns startup/shutdown lifecycle, unified public state publication,
runtime creation, and cleanup metadata persistence.

This makes cold-cache startup observable and removes the previous
coupling between asset fetching and normal service health detection.

```mermaid
flowchart LR
    A["stack.start()"] --> B["StackPreparation"]
    B --> C["Downloading state events"]
    B --> D["PreparedStackArtifacts"]
    D --> E["StackBuilder"]
    E --> F["ResolvedGraph + cleanup targets + service projection"]
    F --> G["StackLifecycleCoordinator"]
    G --> H["process-compose Orchestrator"]
    H --> I["Starting / Initializing / Healthy"]
```

Notable stack behavior changes:

- `createStack()` / daemon boot stay lightweight; slow asset preparation
now happens at the start of `start()`.
- `StackServiceState` gains `Downloading`.
- `getAllStates()` and `allStateChanges()` work before runtime startup
and can emit preparation states.
- Docker cleanup metadata moves out of public `StackInfo`; exact cleanup
targets are persisted internally instead.
- `prefetch()` is now a thin wrapper over the same preparation
implementation used by `start()`.
- Fixed a preparation event bug so services leave `Downloading`
independently as their own binary/image fetch completes.

## CLI Changes

`apps/cli` picks up the stack lifecycle changes and exposes mode
selection more clearly.

- `supabase start` now supports `--mode native`, `--mode auto`, and
`--mode docker`.
- Foreground and detached start flows can render `Downloading` in the
same status pipeline as other service states.
- CLI docs and READMEs are updated to describe the preparation-aware
startup flow.
- JSON-mode error handling now correctly preserves non-zero exit codes
at the top-level CLI runner.

```mermaid
flowchart TD
    A["supabase start"] --> B["Resolve config + service versions"]
    B --> C["Choose mode: native / auto / docker"]
    C --> D["stack.start()"]
    D --> E["Downloading"]
    E --> F["Starting / Initializing"]
    F --> G["Healthy"]
```

## Test and CI Changes

This branch standardizes test structure and execution across the
monorepo.

- Each Bun/TypeScript workspace gets Vitest projects for `unit`,
`integration`, and `e2e`.
- Root scripts split `test:core` from `test:e2e`.
- CI now runs:
  - `check`
  - `test:core`
  - `test:e2e`
- Unit test files are renamed to `*.unit.test.ts`.
- Discovery/docs/Knip/test config are updated to match the new naming
convention.
- `packages/stack` keeps e2e-specific warmup for Docker images, since
plain `prefetch()` in `auto` mode does not guarantee Docker pulls.
- `apps/cli` keeps lighter e2e setup and relies on integration coverage
for non-default start mode behavior.

## Notable Changes

- `apps/cli`
  - Add `--mode` to `supabase start`
  - Render `Downloading` in the start UI
  - Fix logout JSON-mode exit-code handling
- `packages/stack`
- Add `StackPreparation`, `StackLifecycleCoordinator`,
`StackMetadataPersistence`, and `CleanupTargets`
  - Remove download work from eager stack construction
  - Persist cleanup targets separately from public stack info
  - Add warmup helpers and focused preparation tests
- Docs
- Update architecture and detach-mode docs to describe the new
preparation/build/lifecycle split
- Update package READMEs to reflect the current startup model and
package names
- Repo policy
- Strengthen the root `AGENTS.md` refactoring guidance to prefer cleaner
architecture over compatibility-preserving patch layers

## Testing

This branch was validated with the new split test model and targeted e2e
coverage.

- Root/CI-oriented changes:
  - `check`
  - `test:core`
  - `test:e2e`
- Stack-specific validation included:
  - core suite
  - targeted Docker e2e
  - preparation/warmup unit coverage
- CLI-specific validation included:
  - core suite
  - targeted `start` and `logout` e2e coverage
@supabase-cli-releaser supabase-cli-releaser Bot mentioned this pull request May 12, 2026
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.

Auth.signUp Error in Local Env with Supabase CLI

1 participant