Commit Graph

203 Commits

Author SHA1 Message Date
Konstantin Wohlwend
2b98fd2617 Don't run Freestyle prod tests in parallel 2026-01-21 11:59:15 -08:00
Konstantin Wohlwend
7c85d36c56 npm publish action 2026-01-12 15:41:41 -08:00
Konstantin Wohlwend
20f435fb6d Delete Claude Code review 2026-01-11 17:39:59 -08:00
Konstantin Wohlwend
a809ac16d6 GitHub action for checking migration backwards-compatibility 2026-01-10 15:09:30 -08:00
Konsti Wohlwend
8f74949a7f
Speed up tests (#1063) 2025-12-28 11:25:04 -08:00
Konstantin Wohlwend
671f6b2d1f Fix Prisma migrate 2025-12-27 20:43:54 +01:00
Konsti Wohlwend
b4ae80874e
Upgrade Prisma to v7 (#1064) 2025-12-26 08:13:34 -08:00
Konstantin Wohlwend
a17c841d77 Fix tests 2025-12-17 10:59:23 -08:00
Konstantin Wohlwend
5caf148b7d Less flakey tests 2025-12-15 13:30:35 -08:00
Konstantin Wohlwend
c9d0c1c3e1 Fix tests 2025-12-15 12:04:37 -08:00
Konstantin Wohlwend
de9cfb33a7 Environment variables for disabling email queue 2025-12-15 10:48:00 -08:00
Konstantin Wohlwend
58a4aa91df Fix syntax 2025-12-12 18:48:47 -08:00
Konstantin Wohlwend
77d7117333 More fixes 2025-12-12 18:47:48 -08:00
Konstantin Wohlwend
27b42ceb01 Fix custom base port tests 2025-12-12 18:44:14 -08:00
Konstantin Wohlwend
64c02cbd98 Run email queue in E2E tests 2025-12-12 18:38:29 -08:00
Konstantin Wohlwend
1c74c497c6 Freestyle E2E tests on GH Actions 2025-12-12 16:10:47 -08:00
Konsti Wohlwend
e7e792d462
Email outbox backend (#1030) 2025-12-12 10:26:38 -08:00
Konstantin Wohlwend
98b573877c Replace npx with pnpx across the board
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Runs E2E API Tests with custom port prefix / build (22.x) (push) Has been cancelled
Runs E2E API Tests with external source of truth / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Dev Environment Test With Custom Base Port / restart-dev-and-test-with-custom-base-port (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
2025-11-27 12:28:00 -08:00
Konstantin Wohlwend
5421e6dd38 Upgrade pnpm in GH workflows 2025-11-24 12:02:09 -08:00
Konstantin Wohlwend
8580a1ea14 Upgrade GitHub workflow scripts 2025-11-24 11:21:43 -08:00
BilalG1
b5b311554b
Metrics Endpoint Speed (#966)
<img width="567" height="249" alt="Screenshot 2025-10-20 at 11 23 10 AM"
src="https://github.com/user-attachments/assets/340df844-f619-489f-8d41-cc26bc165018"
/>
<img width="595" height="255" alt="Screenshot 2025-10-20 at 11 24 00 AM"
src="https://github.com/user-attachments/assets/9321bda1-e6f0-4f53-8c6b-e29d0fc16038"
/>

<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- RECURSEML_SUMMARY:START -->
## High-level PR Summary
This PR optimizes the performance of user list and metrics endpoints by
refactoring SQL queries to use more efficient patterns. The changes
include rewriting queries to use `LATERAL` joins and CTEs with proper
filtering, extracting common user mapping logic into reusable functions,
and adding performance tests with SQL scripts to generate realistic test
data (10,000 mock users and activity events across 100 countries).

⏱️ Estimated Review Time: 30-90 minutes

<details>
<summary>💡 Review Order Suggestion</summary>

| Order | File Path |
|-------|-----------|
| 1 | `apps/e2e/tests/backend/performance/mock-users.sql` |
| 2 | `apps/e2e/tests/backend/performance/mock-metric-events.sql` |
| 3 | `apps/e2e/tests/backend/performance/users-list.test.ts` |
| 4 | `apps/backend/src/app/api/latest/users/crud.tsx` |
| 5 | `apps/backend/src/app/api/latest/internal/metrics/route.tsx` |
</details>



[![Need help? Join our
Discord](https://img.shields.io/badge/Need%20help%3F%20Join%20our%20Discord-5865F2?style=plastic&logo=discord&logoColor=white)](https://discord.gg/n3SsVDAW6U)


[![Analyze latest
changes](f22b2c44a1/?repo_owner=stack-auth&repo_name=stack-auth&pr_number=966)
<!-- RECURSEML_SUMMARY:END -->
<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Optimize metrics and user list endpoints with SQL refactoring,
caching, and performance tests, adding a `CacheEntry` model and mock
data scripts.
> 
>   - **Performance Optimization**:
> - Refactor SQL queries in `route.tsx` to use `LATERAL` joins and CTEs
for efficient data retrieval.
> - Implement caching in `route.tsx` using `getOrSetCacheValue()` to
reduce database load.
>   - **Database Changes**:
> - Add `CacheEntry` model to `schema.prisma` and create corresponding
table and index in `migration.sql`.
> - Remove auto-migration metadata step from
`check-prisma-migrations.yaml`.
>   - **Testing**:
> - Add performance tests in `metrics.test.ts` to benchmark metrics and
user endpoints.
> - Create mock data scripts `mock-users.sql` and
`mock-metric-events.sql` for testing with 10,000 users and events across
100 countries.
>   - **Miscellaneous**:
> - Update `db-migrations.ts` to include new migration file generation
logic.
>     - Add `cache.tsx` for caching logic implementation.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 4d9be71063. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>

----


<!-- ELLIPSIS_HIDDEN -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Metrics now use a cache layer with per-entry TTL and tenancy-aware
loaders.

* **Bug Fixes**
* Improved accuracy of daily active and related metrics with
tenancy-aware counting and more robust last-active computation.

* **Performance**
* Faster metrics responses via batched reads and cache-backed endpoints.

* **Tests**
* Added end-to-end performance benchmarks and SQL seed scripts for
metrics/user load testing.

* **Chores**
* DB migration added support for cached entries; CI migration check flow
adjusted; migration tooling improved.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2025-11-05 16:24:04 -08:00
Konstantin Wohlwend
6684db64f3 Enhance lint-and-build workflow to display uncommitted changes and diffs before exiting 2025-10-28 00:32:52 -07:00
BilalG1
0bcec0f08f
mirrored qstash image (#968)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2025-10-21 18:28:22 -07:00
Bilal Godil
985ba9d503 revert 2025-10-20 18:35:46 -07:00
Bilal Godil
b597efaaed test e2e api tests 2025-10-20 18:33:36 -07:00
Konsti Wohlwend
3d4c608187
Customizable ports (#962)
<!--
ONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- RECURSEML_SUMMARY:START -->

## High-level PR Summary

This PR changes the default development ports for several background
services to avoid conflicts. PostgreSQL moves from port `5432` to
`8128`, Inbucket SMTP from `2500` to `8129`, Inbucket POP3 from `1100`
to `8130`, and the OpenTelemetry collector from `4318` to `8131`. All
references across configuration files, Docker Compose setups,
environment files, CI/CD workflows, test files, and documentation have
been updated to reflect these new port assignments. A knowledge base
document has been added to document the new port mappings.

⏱️ Estimated Review Time: 15-30 minutes

<details>
<summary>💡 Review Order Suggestion</summary>

| Order | File Path |
| --- | --- |
| 1 | `claude/CLAUDE-KNOWLEDGE.md` |
| 2 | `apps/dev-launchpad/public/index.html` |
| 3 | `docker/dependencies/docker.compose.yaml` |
| 4 | `docker/emulator/docker.compose.yaml` |
| 5 | `apps/backend/.env` |
| 6 | `apps/backend/.env.development` |
| 7 | `docker/server/.env.example` |
| 8 | `package.json` |
| 9 | `.devcontainer/devcontainer.json` |
| 10 | `apps/e2e/.env.development` |
| 11 | `.github/workflows/check-prisma-migrations.yaml` |
| 12 | `.github/workflows/docker-server-test.yaml` |
| 13 | `.github/workflows/e2e-api-tests.yaml` |
| 14 | `.github/workflows/e2e-source-of-truth-api-tests.yaml` |
| 15 | `.github/workflows/restart-dev-and-test.yaml` |
| 16 |
`apps/e2e/tests/backend/endpoints/api/v1/internal/email-drafts.test.ts`
|
| 17 | `apps/e2e/tests/backend/endpoints/api/v1/internal/email.test.ts`
|
| 18 | `apps/e2e/tests/backend/endpoints/api/v1/send-email.test.ts` |
| 19 |
`apps/e2e/tests/backend/endpoints/api/v1/unsubscribe-link.test.ts` |
| 20 | `apps/e2e/tests/backend/workflows.test.ts` |
| 21 | `docs/templates/others/self-host.mdx` |

</details>

[![Need help? Join our
Discord](https://img.shields.io/badge/Need%20help%3F%20Join%20our%20Discord-5865F2?style=plastic&logo=discord&logoColor=white)](https://discord.gg/n3SsVDAW6U)

[![Analyze latest
changes](21c3d5c362/?repo_owner=stack-auth&repo_name=stack-auth&pr_number=962)

<!-- RECURSEML_SUMMARY:END -->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> This PR introduces customizable development ports using
`NEXT_PUBLIC_STACK_PORT_PREFIX`, updating configurations, documentation,
and tests accordingly.
> 
>   - **Behavior**:
> - Default development ports for services are now customizable via
`NEXT_PUBLIC_STACK_PORT_PREFIX`.
> - PostgreSQL port changed from `5432` to
`${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}28`.
> - Inbucket SMTP port changed from `2500` to
`${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}29`.
> - Inbucket POP3 port changed from `1100` to
`${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}30`.
> - OpenTelemetry collector port changed from `4318` to
`${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}31`.
>   - **Configuration**:
> - Updated `docker.compose.yaml` to use new port variables for services
like PostgreSQL, Inbucket, and OpenTelemetry.
> - Environment files in `apps/backend`, `apps/dashboard`, and
`apps/e2e` updated to use `NEXT_PUBLIC_STACK_PORT_PREFIX`.
> - `package.json` scripts updated to reflect new port configurations.
>   - **Documentation**:
>     - Added `CLAUDE-KNOWLEDGE.md` to document new port mappings.
>     - Updated `self-host.mdx` to reflect new port configurations.
>   - **Testing**:
> - Updated test files in `apps/e2e/tests` to use new port
configurations.
>     - Added `helpers/ports.ts` for port-related utilities in tests.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 76ef55f58f. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>

----


<!-- ELLIPSIS_HIDDEN -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enable configurable development ports via a
NEXT_PUBLIC_STACK_PORT_PREFIX, allowing parallel local environments with
custom port prefixes.

- **Bug Fixes**
- Updated local service port mappings and CI/workflow settings so
tooling and tests use the new prefixed ports consistently.

- **Documentation**
- Added docs and contributor guidance for running multiple parallel
workspaces with custom port prefixes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: N2D4 <N2D4@users.noreply.github.com>
2025-10-20 15:24:47 -07:00
Konstantin Wohlwend
a70e83df0c Fix pnpm-lock.yaml 2025-10-19 11:54:35 -07:00
BilalG1
479d5432ba
fix dev failing tests (#955)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- RECURSEML_SUMMARY:START -->
## High-level PR Summary
This PR fixes database schema issues related to Prisma migrations by
setting the correct `search_path` before applying auto-migrations and
removing the `SchemaMigration` table from the CI workflow to ensure
proper schema comparison during migration checks.

⏱️ Estimated Review Time: 5-15 minutes

<details>
<summary>💡 Review Order Suggestion</summary>

| Order | File Path |
|-------|-----------|
| 1 | `apps/backend/src/auto-migrations/index.tsx` |
| 2 | `.github/workflows/check-prisma-migrations.yaml` |
</details>



[![Need help? Join our
Discord](https://img.shields.io/badge/Need%20help%3F%20Join%20our%20Discord-5865F2?style=plastic&logo=discord&logoColor=white)](https://discord.gg/n3SsVDAW6U)


[![Analyze latest
changes](d1ed7a31db/?repo_owner=stack-auth&repo_name=stack-auth&pr_number=955)
<!-- RECURSEML_SUMMARY:END -->
<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Fixes Prisma migration schema issues and a string concatenation error
in `getUserInfo`.
> 
>   - **Database Schema**:
> - Removes `SchemaMigration` table in
`.github/workflows/check-prisma-migrations.yaml` to ensure correct
schema comparison.
> - Sets `STACK_SEED_MODE` to `'true'` in `seed()` in `seed.ts` for
consistent seeding behavior.
>   - **Bug Fix**:
> - Fixes string concatenation error in `getUserInfo` in
`myFunctions.ts` by using `+` instead of `obj.displayName`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 5b664a0fe7. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Corrected user info message to properly display the user’s name in the
example app.

* **Chores**
* CI workflow now clears auto-generated migration metadata before
comparing schema changes to reduce false positives.
* Seeding now explicitly sets a seed-mode environment flag and no longer
auto-executes on direct invocation, enabling more controlled runs.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-10-15 13:57:28 -07:00
Konstantin Wohlwend
07b5830eed Test extra envvars 2025-10-14 10:41:33 -07:00
Konstantin Wohlwend
5dac3a3167 Fix Prisma migrations 2025-10-14 00:51:20 -07:00
Konstantin Wohlwend
f60415eb3f Fix prisma migrations
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Emulator Test / docker (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Runs E2E API Tests with external source of truth / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
2025-10-14 00:34:36 -07:00
Konstantin Wohlwend
455e99b82e Fix tests
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Emulator Test / docker (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Runs E2E API Tests with external source of truth / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
2025-10-10 20:47:15 -07:00
BilalG1
3fe82b68b6
Convex implementation (#913)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Add Convex integration with new auth helpers, update access token
handling, and include documentation, examples, and tests for the new
features.
> 
>   - **Features**:
> - Add Convex integration with new auth helpers for Convex clients and
HTTP in `client-app-impl.ts` and `server-app-impl.ts`.
> - Support for Convex context in user APIs and partial user retrieval.
> - Access tokens now include `is_anonymous` for better anonymous
handling in `tokens.tsx`.
>   - **Documentation**:
> - Add Convex integration guide in `docs/templates/others/convex.mdx`.
> - Update docs navigation in `docs/docs-platform.yml` and
`docs/templates/meta.json`.
>   - **Examples**:
> - Add Convex + Next.js example app in `examples/convex` with auth
wiring, functions, schema, and UI.
>   - **Tests**:
>     - Add E2E tests for Convex auth flows in `convex.test.ts`.
> - Update JWT payload checks in `backend-helpers.ts` and
`anonymous-comprehensive.test.ts`.
>   - **Chores**:
>     - Add Convex dependencies in `package.json` files.
> - Update CI steps for example environments in `e2e-api-tests.yaml` and
`e2e-source-of-truth-api-tests.yaml`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for aa0983a8b7. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>

----


<!-- ELLIPSIS_HIDDEN -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Convex integration: auth helpers for Convex clients/HTTP, Convex-aware
user APIs, and partial-user retrieval (token/convex).
- Access tokens now surface is_anonymous for clearer anonymous handling.

- **Documentation**
  - Added Convex integration guide and nav entries.

- **Examples**
- New Convex + Next.js example app with auth wiring, backend functions,
schema, and UI.

- **Tests**
  - Added E2E tests covering Convex auth flows and JWT payload checks.

- **Chores**
  - Added Convex deps, CI env steps, and workspace/test config updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
2025-09-24 19:16:45 +00:00
Konstantin Wohlwend
f22e1d6996 Update review assigner script 2025-09-10 12:05:04 -07:00
Konstantin Wohlwend
4148a4ab2d Automatic review assignment 2025-09-10 10:50:35 -07:00
Armin Stepanyan
a77d50c145
Clarifying Recurse ML Naming Rules (#872)
I've noticed `naming.mdc` has been responsible for a lot of false
positives in your PRs. This PR takes a stab at improving it.
<!-- ELLIPSIS_HIDDEN -->
2025-09-02 09:31:14 -07:00
Konstantin Wohlwend
3ab5aa5c94 Only run E2E repeats on main/dev branches
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Emulator Test / docker (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Runs E2E API Tests with external source of truth / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
2025-08-25 22:33:33 -07:00
Konstantin Wohlwend
c8c12f8ef2 Update sync-main-to-dev script 2025-08-25 14:09:27 -07:00
Konstantin Wohlwend
fba89196fb Sync main commits back to dev 2025-08-25 12:00:26 -07:00
Konsti Wohlwend
ae620bb1bf
Wildcard domains (#830) 2025-08-19 22:59:21 -07:00
Konstantin Wohlwend
92a39dd6da Various small fixes 2025-08-19 18:16:08 -07:00
BilalG1
249271b22d
Payment dogfooding (#847)
https://www.loom.com/share/642ec83442594512817f571e7e96514c?sid=42b82e19-bca3-488a-9257-8dbad1a26e29
2025-08-19 15:47:10 -07:00
Konsti Wohlwend
acd03b7af5
Add Claude Code GitHub Workflow (#833)
## 🤖 Installing Claude Code GitHub App

This PR adds a GitHub Actions workflow that enables Claude Code
integration in our repository.

### What is Claude Code?

[Claude Code](https://claude.ai/code) is an AI coding agent that can
help with:
- Bug fixes and improvements  
- Documentation updates
- Implementing new features
- Code reviews and suggestions
- Writing tests
- And more!

### How it works

Once this PR is merged, we'll be able to interact with Claude by
mentioning @claude in a pull request or issue comment.
Once the workflow is triggered, Claude will analyze the comment and
surrounding context, and execute on the request in a GitHub action.

### Important Notes

- **This workflow won't take effect until this PR is merged**
- **@claude mentions won't work until after the merge is complete**
- The workflow runs automatically whenever Claude is mentioned in PR or
issue comments
- Claude gets access to the entire PR or issue context including files,
diffs, and previous comments

### Security

- Our Anthropic API key is securely stored as a GitHub Actions secret
- Only users with write access to the repository can trigger the
workflow
- All Claude runs are stored in the GitHub Actions run history
- Claude's default tools are limited to reading/writing files and
interacting with our repo by creating comments, branches, and commits.
- We can add more allowed tools by adding them to the workflow file
like:

```
allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test)
```

There's more information in the [Claude Code action
repo](https://github.com/anthropics/claude-code-action).

After merging this PR, let's try mentioning @claude in a comment on any
PR to get started!
2025-08-07 18:44:49 -07:00
Zai Shi
a7acab4646
Auto migration (#526)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Introduces an automated database migration system, replacing manual
Prisma commands with new scripts and updating workflows, configurations,
and tests accordingly.
> 
>   - **Auto-Migration System**:
> - Introduces `db-migrations.ts` script for handling database
migrations automatically.
> - Adds utility functions in `utils.tsx` for managing migration files.
> - Implements `applyMigrations` and `runMigrationNeeded` in `index.tsx`
for executing migrations.
>   - **Workflow and Scripts**:
> - Updates GitHub workflows (`check-prisma-migrations.yaml`,
`e2e-api-tests.yaml`) to use new migration commands.
> - Replaces `prisma migrate` commands with `db:init`, `db:migrate`,
etc., in `package.json` and `README.md`.
>   - **Testing**:
> - Adds `auto-migration.tests.ts` for testing migration logic and
concurrency handling.
>   - **Configuration**:
> - Updates `.env.development` and `vitest.config.ts` for new
environment variables and paths.
> - Modifies `turbo.json` and `package.json` to include new migration
tasks and scripts.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 2c24183879. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-07-24 02:38:37 +02:00
Konsti Wohlwend
22fe096141
Fix source of truth for custom schemas (#764)
Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-07-18 11:01:29 -07:00
Armin Stepanyan
bdf8c0e5f9
Add Recurse ML rules for naming and code patterns (#780) 2025-07-18 09:58:23 -07:00
Konsti Wohlwend
a7ef394be4
Source of Truth (#660)
Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-07-11 17:59:03 -07:00
Konstantin Wohlwend
a00dcb1cb1 Move Docker test actions to Ubicloud 2025-07-08 18:28:34 -07:00
Zai Shi
668ab68ebb Update Docker build workflow to use ubicloud 2025-07-03 14:12:14 -07:00
Konstantin Wohlwend
d96dceb42b Remove Fern GH Actions 2025-06-20 15:34:42 -07:00
Madison
4e467c4026
New docs (#698)
Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
Co-authored-by: Madison Kennedy <madison@Madisons-MacBook-Pro.local>
Co-authored-by: BilalG1 <bg2002@gmail.com>
2025-06-20 13:30:01 -07:00
Konstantin Wohlwend
ab5d33647d Better logging for all-good 2025-06-17 15:11:23 -07:00
Konstantin Wohlwend
2bcbe01ea5 Fix all-good script 2025-06-17 09:28:10 -07:00
Zai Shi
097fbc6e4c
Fix docker (#664)
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Emulator Test / docker (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Preview Docs / run (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Enable Docker build by removing fail step and switch from `bcrypt` to
`bcryptjs` for password hashing.
> 
>   - **Docker Workflow**:
> - Removed temporary fail step in
`.github/workflows/docker-server-build.yaml` to enable Docker build
process.
>   - **Dependencies**:
> - Replaced `bcrypt` with `bcryptjs` in `package.json` and `hashes.tsx`
for password hashing.
>     - Updated `@types/bcrypt` to `@types/bcryptjs` in `package.json`.
>   - **Documentation**:
> - Added `docker/README.md` with instructions for building and running
Docker containers for server and emulator.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for c7a3ed9f11. You can
[customize](https://app.ellipsis.dev/stack-auth/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
2025-05-08 01:31:03 +02:00
Htoo Pyae Lwin
466c891fab
chore: add arm support in docker build (#633)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Add ARM support to Docker build in GitHub Actions workflow by
including `linux/arm64` platform.
> 
>   - **GitHub Actions**:
> - Add ARM support to Docker build in
`.github/workflows/docker-server-build.yaml` by including `linux/arm64`
in `platforms` parameter of `docker/build-push-action`.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 10630c432b. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
2025-05-07 02:28:36 +02:00
Konstantin Wohlwend
ead128680d Disable Docker build 2025-04-29 08:57:34 -07:00
Armin Stepanyan
b493a89130
Disable recurse status checks (#618) 2025-04-11 09:15:49 -07:00
Konstantin Wohlwend
1311467c1b Run auto-assign on draft PRs 2025-04-10 10:18:47 -07:00
Konsti Wohlwend
cc3c563c76
Fix auto assign action (#612) 2025-04-07 11:52:39 -07:00
Konstantin Wohlwend
77997b1a1e Auto assign PR creator 2025-04-07 11:43:16 -07:00
Konsti Wohlwend
07be60f054
Port dashboard to Next.js 15 (#560)
<!--

Make sure you've read the CONTRIBUTING.md guidelines:
https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md

-->

<!-- ELLIPSIS_HIDDEN -->


----

> [!IMPORTANT]
> Port dashboard to Next.js 15, update dependencies, and enhance Docker
workflows.
> 
>   - **Next.js 15 Migration**:
> - Update `next` to `15.2.3` in `apps/backend/package.json`,
`apps/dashboard/package.json`, and `examples/demo/package.json`.
>     - Remove MDX support in `next.config.mjs`.
> - Use `turbopack` in `dev` scripts in `apps/dashboard/package.json`
and `examples/demo/package.json`.
>   - **Docker Workflows**:
>     - Add `docker-emulator-test.yaml` for testing Docker emulator.
> - Rename `docker-build.yaml` to `docker-server-build.yaml` and
`docker-test.yaml` to `docker-server-test.yaml`.
>     - Update `docker-compose.yaml` for emulator setup.
>   - **Code Refactoring**:
> - Convert several `Page` components to async functions in
`apps/dashboard/src/app`.
>     - Use `dynamic` import for `react-globe.gl` in `globe.tsx`.
>     - Remove `experimental` config in `next.config.mjs`.
>   - **Dependency Updates**:
> - Update `react` and `react-dom` to `19.0.0` in
`apps/backend/package.json`, `apps/dashboard/package.json`, and
`examples/demo/package.json`.
> - Add `pnpm` overrides for `@types/react` and `@types/react-dom` in
multiple `package.json` files.
>   - **Miscellaneous**:
>     - Add `docker/readme.md` for Docker instructions.
>     - Update `entrypoint.sh` for Docker server setup.
>     - Remove `globals.d.ts` as it's empty.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 5f5d8fd65c. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-03-24 00:03:50 +01:00
Konstantin Wohlwend
0e05662e4e Increase test workers 2025-03-19 15:13:24 -07:00
Konstantin Wohlwend
2605850f95 Increase Vitest test timeout 2025-03-19 15:12:05 -07:00
Konstantin Wohlwend
217e6da8b6 Verbose test outputs 2025-03-19 14:07:21 -07:00
Konstantin Wohlwend
656bf4c44b chore: update package versions 2025-03-19 12:54:10 -07:00
Konstantin Wohlwend
130c8e648e Fix CI 2025-03-19 09:32:10 -07:00
Konstantin Wohlwend
79668811db Disable file parallelism for dev tests 2025-03-18 13:13:52 -07:00
Zai Shi
fa599792d6 allow outside PR to run fern preview 2025-03-13 09:56:27 -07:00
Konstantin Wohlwend
717cb7e12c Remove PR trigger for Docker push 2025-03-13 09:46:08 -07:00
Konstantin Wohlwend
66c5823349 Run auto-update only once per day 2025-03-12 17:10:03 -07:00
Konstantin Wohlwend
08d7403527 Run auto-update every 6 hours 2025-03-12 17:07:15 -07:00
Konstantin Wohlwend
16704f778c Attempt CI fix 2025-03-12 16:50:55 -07:00
Konstantin Wohlwend
4a52f52721 Fix CI 2025-03-12 14:52:54 -07:00
Konstantin Wohlwend
67dc31687f Fix all-good for PRs 2025-03-12 14:42:12 -07:00
Konstantin Wohlwend
8cc3393110 GH Actions push trigger only on main or dev branches 2025-03-12 10:52:35 -07:00
Konstantin Wohlwend
bd687e8c43 Re-add pull request trigger to GH Actions 2025-03-12 10:43:36 -07:00
Konstantin Wohlwend
7c3c4863ab Fix GitHub Actions concurrency 2025-03-10 14:09:09 -07:00
Konstantin Wohlwend
1f10e26139 Fix GH Actions concurrency 2025-03-10 14:07:59 -07:00
Konstantin Wohlwend
a2dbecb606 Cancel in-progress GitHub Actions on feature branches 2025-03-10 12:14:58 -07:00
Konstantin Wohlwend
7f2a378286 Run E2E tests only once 2025-03-10 12:10:06 -07:00
Konstantin Wohlwend
e5b32013cb Update all-good to understand neutral checks 2025-03-10 12:04:51 -07:00
Konstantin Wohlwend
d24105dd42 Use PAT for auto update 2025-03-07 14:19:08 -08:00
Konstantin Wohlwend
316233b165 Continue auto-update on error 2025-03-07 14:05:52 -08:00
Konsti Wohlwend
b41681d1e4
Reduce test flakeyness (#517)
Some checks failed
All good? / all-good (push) Has been cancelled
Update pull request branches / Update pull request branches (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Test / docker (push) Has been cancelled
Runs E2E API Tests / build (20.x) (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Runs E2E API Tests / build (latest) (push) Has been cancelled
Lint & build / lint_and_build (20.x) (push) Has been cancelled
Lint & build / lint_and_build (22.x) (push) Has been cancelled
Mirror main branch to main-mirror-for-wdb / lint_and_build (push) Has been cancelled
Publish Docs / run (push) Has been cancelled
Dev Environment Test / test (push) Has been cancelled
Run setup tests / test (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
2025-03-07 13:34:50 -08:00
Konstantin Wohlwend
0e17833609 Ignore PR merge conflicts in GH Actions 2025-03-05 00:03:57 -08:00
Konstantin Wohlwend
95e4827c14 Give PR updater more permissions 2025-03-05 00:01:11 -08:00
Konsti Wohlwend
d072df29d8
Automatically update pull request branches (#509) 2025-03-04 23:52:05 -08:00
devin-ai-integration[bot]
7920440eb6
Update branding from Stack to Stack Auth in documentation (#504)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: zai@stack-auth.com <zai@stack-auth.com>
2025-03-04 04:07:54 +01:00
Zai Shi
427ab34adb
Codegen + macros for SDK docs (#456) 2025-02-27 23:12:30 +01:00
Konstantin Wohlwend
f4db6df342 Run E2E tests on latest Node.js version 2025-02-27 14:06:14 -08:00
Konstantin Wohlwend
93cbf8f7da Run E2E API tests on Node v22 too 2025-02-27 14:05:32 -08:00
devin-ai-integration[bot]
36bd601c35
Add restart-dev-environment script and GitHub action (#474)
Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
2025-02-26 14:56:53 -08:00
Zai Shi
4df77497a0 Update GitHub repository links in documentation 2025-02-20 10:14:55 -08:00
Zai Shi
e55b42f848
Local emulator (#422) 2025-02-13 18:57:02 +01:00
Konstantin Wohlwend
02d1680d2e Run GitHub Actions on push instead of PR 2025-02-11 09:59:18 -08:00
Zai Shi
12dfe82db7
added sleep after starting the server (#423) 2025-02-09 18:25:44 +01:00
Konsti Wohlwend
f2f1b9df82
Tenancies (#418)
Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-02-07 22:54:04 -08:00
Konsti Wohlwend
f869c93563
Use Depot for GitHub Actions (#402) 2025-01-29 10:08:16 -08:00
CactusBlue
e27173d27e
Automated testing for setup instructions in README.md (#399)
* add setup tests

* continue, even on error

* add build:packages

* add automated branch for setup testing

* add delay

* combine commands

* rollback

* update README

* use action to run in background

* try running in foreground for testing

* set shell

* check if running codegen before works

* fix quetzal file missing

* swap the order

* use background action

* fix

* try this instead

* modify readme

* add sleep

* raise the timeout

* run on faster machine

* use jarvus instead

* Update packages/stack/scripts/merge-quetzal-translations.ts

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>

* Update README.md

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>

* fix run on all branches

* Update .github/workflows/setup-tests.yaml

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>

---------

Co-authored-by: root <TheCactusBlue>
Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
2025-01-27 16:48:38 -08:00
Konstantin Wohlwend
b46bdc8f04 Fix STACK-BACKEND-5K 2024-12-23 19:16:24 -08:00