-
Notifications
You must be signed in to change notification settings - Fork 515
Fix dev CI build failures #1524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
N2D4
wants to merge
8
commits into
dev
Choose a base branch
from
devin/1780093703-fix-dev-ci
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
efb6602
Fix dev CI build failures
devin-ai-integration[bot] 23191f8
Address instrumentation review feedback
devin-ai-integration[bot] a278a6b
Fix docs deployment env fallback
devin-ai-integration[bot] 82c4697
Handle docs placeholder env values
devin-ai-integration[bot] 36c4213
Treat docs REPLACE_ME env values as unset
devin-ai-integration[bot] 4367dde
Normalize quoted docs env placeholders
devin-ai-integration[bot] 51636b1
Handle quoted docs comment placeholders
devin-ai-integration[bot] 3f212df
Handle unresolved docs env references
devin-ai-integration[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import "server-only"; | ||
|
|
||
| import { getEnvBoolean } from "@hexclave/shared/dist/utils/env"; | ||
|
|
||
| export async function startRemoteDevelopmentEnvironmentLifecycleIfNeeded(): Promise<void> { | ||
| if (!getEnvBoolean("NEXT_PUBLIC_STACK_IS_REMOTE_DEVELOPMENT_ENVIRONMENT")) { | ||
| return; | ||
| } | ||
|
|
||
| const { startRemoteDevelopmentEnvironmentLifecycle } = await import("./lib/remote-development-environment/manager"); | ||
| startRemoteDevelopmentEnvironmentLifecycle(); | ||
|
vercel[bot] marked this conversation as resolved.
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,52 @@ | ||
| import * as Sentry from "@sentry/nextjs"; | ||
| import { getEnvBoolean, getEnvVariable, getNextRuntime, getNodeEnvironment } from "@hexclave/shared/dist/utils/env"; | ||
| import { getEnvBoolean, getEnvVariable, getNodeEnvironment } from "@hexclave/shared/dist/utils/env"; | ||
| import { sentryBaseConfig } from "@hexclave/shared/dist/utils/sentry"; | ||
| import { nicify } from "@hexclave/shared/dist/utils/strings"; | ||
| import "./polyfills"; | ||
|
|
||
| async function startRemoteDevelopmentEnvironmentLifecycleIfNeeded(): Promise<void> { | ||
| if (getNextRuntime() !== "nodejs" || getEnvVariable("NEXT_PUBLIC_STACK_IS_REMOTE_DEVELOPMENT_ENVIRONMENT", "") !== "true") { | ||
| export async function register(): Promise<void> { | ||
| if (process.env.NEXT_RUNTIME !== "nodejs" && process.env.NEXT_RUNTIME !== "edge") { | ||
| return; | ||
| } | ||
|
|
||
| const { startRemoteDevelopmentEnvironmentLifecycle } = await import("./lib/remote-development-environment/manager"); | ||
| startRemoteDevelopmentEnvironmentLifecycle(); | ||
| } | ||
|
|
||
| export async function register() { | ||
| if (getNextRuntime() === "nodejs") { | ||
| if (process.env.NEXT_RUNTIME === "nodejs") { | ||
| if (getEnvBoolean("NEXT_PUBLIC_STACK_IS_REMOTE_DEVELOPMENT_ENVIRONMENT")) { | ||
| globalThis.process.title = `Hexclave — Development Server (port ${getEnvVariable("PORT", "?")})`; | ||
| } else { | ||
| globalThis.process.title = `stack-dashboard:${getEnvVariable("NEXT_PUBLIC_HEXCLAVE_PORT_PREFIX", "81")} (node/nextjs)`; | ||
| } | ||
| const { startRemoteDevelopmentEnvironmentLifecycleIfNeeded } = await import("./instrumentation-node"); | ||
| await startRemoteDevelopmentEnvironmentLifecycleIfNeeded(); | ||
| } | ||
|
|
||
| if (getNextRuntime() === "nodejs" || getNextRuntime() === "edge") { | ||
| Sentry.init({ | ||
| ...sentryBaseConfig, | ||
|
|
||
| dsn: getEnvVariable("NEXT_PUBLIC_SENTRY_DSN", ""), | ||
|
|
||
| enabled: getNodeEnvironment() !== "development" && !getEnvVariable("CI", ""), | ||
|
|
||
| // Add exception metadata to the event | ||
| beforeSend(event, hint) { | ||
| const error = hint.originalException; | ||
| let nicified; | ||
| try { | ||
| nicified = nicify(error, { maxDepth: 8 }); | ||
| } catch (e) { | ||
| nicified = `Error occurred during nicification: ${e}`; | ||
| } | ||
| if (error instanceof Error) { | ||
| event.extra = { | ||
| ...event.extra, | ||
| cause: error.cause, | ||
| errorProps: { | ||
| ...error, | ||
| }, | ||
| nicifiedError: nicified, | ||
| }; | ||
| } | ||
| return event; | ||
| }, | ||
| }); | ||
|
|
||
| } | ||
| Sentry.init({ | ||
| ...sentryBaseConfig, | ||
|
|
||
| dsn: getEnvVariable("NEXT_PUBLIC_SENTRY_DSN", ""), | ||
|
|
||
| enabled: getNodeEnvironment() !== "development" && !getEnvVariable("CI", ""), | ||
|
|
||
| beforeSend(event, hint) { | ||
| const error = hint.originalException; | ||
| let nicified; | ||
| try { | ||
| nicified = nicify(error, { maxDepth: 8 }); | ||
| } catch (nicifyError: unknown) { | ||
| // Only nicify errors are converted to metadata; the original event still reports. | ||
| const nicifyErrorMessage = nicifyError instanceof Error ? nicifyError.message : String(nicifyError); | ||
| nicified = `Error occurred during nicification: ${nicifyErrorMessage}`; | ||
| } | ||
| if (error instanceof Error) { | ||
| event.extra = { | ||
| ...event.extra, | ||
| cause: error.cause, | ||
| errorProps: { | ||
| ...error, | ||
| }, | ||
| nicifiedError: nicified, | ||
| }; | ||
| } | ||
| return event; | ||
| }, | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/template/src/providers/translation-provider-client.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
startRemoteDevelopmentEnvironmentLifecycle()call is fire-and-forget: if the imported function returns a rejected Promise, it will become an unhandled rejection that is silently swallowed. SincestartRemoteDevelopmentEnvironmentLifecycleIfNeededis itselfasync, awaiting the inner call ensures any error propagates up to theregister()caller.Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked this:
startRemoteDevelopmentEnvironmentLifecycle()currently returnsvoid, so applying the suggestedawaitfails lint with@typescript-eslint/await-thenable. I kept the call synchronous and addressed the actionable nearby instrumentation feedback in 23191f8.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct.
startRemoteDevelopmentEnvironmentLifecycle()has avoidreturn type, so awaiting it would violate@typescript-eslint/await-thenable. The synchronous call is the right approach here — the function only sets up a timer viaensureShutdownTimer()and logs, with no async work to propagate. My original comment was incorrect. Thanks for checking.Tip: You can customize Greptile's behavior for this repo with
.greptile/rules.mdand.greptile/config.json.