Skip to content

Add temp-local-stack option to the debug environment switcher#28

Open
IliaMManolov wants to merge 2 commits into
mainfrom
temp-local-stack-env
Open

Add temp-local-stack option to the debug environment switcher#28
IliaMManolov wants to merge 2 commits into
mainfrom
temp-local-stack-env

Conversation

@IliaMManolov

@IliaMManolov IliaMManolov commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a temp-local-stack option to Developer > Switch Environment that points the app at the Railway-hosted instance of the offline local stack (local-stack-backend in the edison-watch project's demo environment, https://local-stack-backend-demo.up.railway.app), so devs can test against the shared offline stack without running docker locally.

Companion to Edison-Watch/shared#18, which defines the TEMP_LOCAL_STACK_CONFIG URLs this option resolves to; this PR needs a shared package version containing that change.

Changes

  • "temp-local-stack" added to DEBUG_ENV_NAMES; the menu radio item, env:changed renderer reload, MCP re-apply, and URL resolution all come from the existing generic code.
  • The two hardcoded env-name checks (getBuildDefaultEnv, getDebugEnvOverride) are replaced with an isDebugEnvName() guard derived from DEBUG_ENV_NAMES, so future env additions are one-line.
  • Menu label reads temp-local-stack (railway offline).
  • No renderer changes needed: useAuth's env sync only special-cases dev, so the new name flows through to localStorage and the shared CONFIGS lookup.

Notes

  • MCP base URL is empty for this env until the FastMCP port (3000) gets a public Railway domain; server status will show offline and MCP client configs are not rewritten when switched to it. Auth and dashboard work.
  • Sign-in: local GoTrue signup is open, so any email/password works; the seeded admin@local adopts the owner row.

Verified

npm run typecheck (node + web) passes with the rebuilt shared package. The auth path was smoke-tested end-to-end against the live Railway instance (signup, password grant, get-api-key).

🤖 Generated with Claude Code


Summary by cubic

Adds a new temp-local-stack option to Developer > Switch Environment so devs can point the app at the shared Railway offline stack without running Docker. Also fixes a GitHub Releases race by pre-creating a draft release and publishing only after assets upload, making releases reliable.

  • New Features

    • Added temp-local-stack to DEBUG_ENV_NAMES with menu label "temp-local-stack (railway offline)".
    • Replaced hardcoded env checks with isDebugEnvName() derived from DEBUG_ENV_NAMES.
    • Resolves URLs via shared TEMP_LOCAL_STACK_CONFIG (requires updated shared package).
  • Bug Fixes

    • Prevented electron-builder release race by pre-creating a draft in release.yml and release-demo.yml.
    • Uploads assets into the draft, then publishes (demo always; release only when publish=true) to ensure beta.yml/latest.yml are present and avoid partial releases.

Written for commit fb917af. Summary will update on new commits.

Review in cubic

Ilia Manolov and others added 2 commits July 10, 2026 13:55
electron-builder races itself creating the GitHub release: the dmg and
zip artifacts finish near-simultaneously, PublishManager's async
publisher cache misses for both, two GitHubPublisher instances are
created, and both POST /releases for the same tag. The loser fails with
422 "Published releases must have a valid tag", killing the job after a
successful notarization and leaving a half-uploaded release without the
update-channel yml (all 7 demo release runs failed this way).

Pre-create the release as a draft before electron-builder runs so every
publisher instance finds and reuses it, then flip it public once all
assets (including beta.yml/latest.yml) are uploaded. This also makes
publishing atomic: auto-updaters never see a partially-uploaded release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds "temp-local-stack" to DEBUG_ENV_NAMES so the Developer > Switch
Environment menu can point the app at the Railway-hosted offline stack
(local-stack-backend in the edison-watch demo project). URLs resolve via
the shared TEMP_LOCAL_STACK_CONFIG (Edison-Watch/shared#18). The two
hardcoded env-name checks are replaced with an isDebugEnvName() guard
derived from DEBUG_ENV_NAMES.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/main/infra/setupConfig.ts">

<violation number="1" location="src/main/infra/setupConfig.ts:27">
P1: Selecting `temp-local-stack` can persist the new env without actually resolving its Railway URLs, because the locked `@edison-watch/shared@0.1.0` does not contain that config. Updating the shared package/lockfile with the companion config keeps the new menu option from silently pointing at the previous environment.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

export const DEBUG_ENV_NAMES = ["demo", "release", "dev"] as const;
// "temp-local-stack" = Railway-hosted offline stack (local-stack-backend in the
// edison-watch demo project); URLs come from the shared TEMP_LOCAL_STACK_CONFIG.
export const DEBUG_ENV_NAMES = ["demo", "release", "dev", "temp-local-stack"] as const;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Selecting temp-local-stack can persist the new env without actually resolving its Railway URLs, because the locked @edison-watch/shared@0.1.0 does not contain that config. Updating the shared package/lockfile with the companion config keeps the new menu option from silently pointing at the previous environment.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/main/infra/setupConfig.ts, line 27:

<comment>Selecting `temp-local-stack` can persist the new env without actually resolving its Railway URLs, because the locked `@edison-watch/shared@0.1.0` does not contain that config. Updating the shared package/lockfile with the companion config keeps the new menu option from silently pointing at the previous environment.</comment>

<file context>
@@ -22,15 +22,21 @@ if (DRY_RUN) console.log("[dry-run] Dry-run mode enabled - config files will not
-export const DEBUG_ENV_NAMES = ["demo", "release", "dev"] as const;
+// "temp-local-stack" = Railway-hosted offline stack (local-stack-backend in the
+// edison-watch demo project); URLs come from the shared TEMP_LOCAL_STACK_CONFIG.
+export const DEBUG_ENV_NAMES = ["demo", "release", "dev", "temp-local-stack"] as const;
 export type DebugEnvName = (typeof DEBUG_ENV_NAMES)[number];
 
</file context>

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