fix(shared): tag unkey deployment context - #584
Conversation
|
The latest updates on your projects. Learn more about Unkey Deploy
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
Greptile SummaryThe PR adds Unkey environment, commit, and region metadata to shared evlog context and adds focused coverage for an Unkey-only runtime. The environment fallback is currently ordered ahead of Railway and Vercel, contrary to the stated requirement to preserve their precedence.
Confidence Score: 4/5The precedence regression should be fixed before merging because overlapping deployment metadata can attribute logs to the wrong environment. UNKEY_ENVIRONMENT_SLUG is evaluated before the existing Railway and Vercel environment variables, so it overrides them whenever metadata sources overlap rather than acting as a fallback. Files Needing Attention: packages/shared/src/evlog-redaction.ts, packages/shared/src/evlog-redaction.test.ts Important Files Changed
Reviews (1): Last reviewed commit: "fix(shared): tag unkey deployment contex..." | Re-trigger Greptile |
| env.APP_ENV?.trim() || | ||
| env.UNKEY_ENVIRONMENT_SLUG?.trim() || | ||
| env.RAILWAY_ENVIRONMENT_NAME?.trim() || | ||
| env.VERCEL_ENV?.trim() || |
There was a problem hiding this comment.
Unkey overrides existing platform metadata
If a runtime contains both UNKEY_ENVIRONMENT_SLUG and Railway or Vercel metadata, the new ordering selects the Unkey slug first, causing logs to be attributed to the wrong deployment environment.
| env.APP_ENV?.trim() || | |
| env.UNKEY_ENVIRONMENT_SLUG?.trim() || | |
| env.RAILWAY_ENVIRONMENT_NAME?.trim() || | |
| env.VERCEL_ENV?.trim() || | |
| env.APP_ENV?.trim() || | |
| env.RAILWAY_ENVIRONMENT_NAME?.trim() || | |
| env.VERCEL_ENV?.trim() || | |
| env.UNKEY_ENVIRONMENT_SLUG?.trim() || |
Summary
Why
Links deployments run on Unkey, whose runtime metadata variable names differ from the existing service platforms. Without these fallbacks, Axiom cannot reliably distinguish preview versus production deployments or correlate logs to an Unkey commit and region.
This change only improves telemetry attribution; it does not alter request or deployment behavior.
Validation
AI disclosure
OpenAI Codex assisted with incident investigation, implementation, tests, and PR preparation. The change was validated locally through the repository hooks and full test suite.
Summary by cubic
Tag Unkey deployments in
packages/sharedevlog by readingUNKEY_ENVIRONMENT_SLUG,UNKEY_GIT_COMMIT_SHA, andUNKEY_REGION, so logs show the correct environment, commit, and region. Keep platform precedence as Railway > Vercel > Unkey; this only changes telemetry tags.link-visit-deliveryexports inapps/linkstests when mocking.Written for commit a5702a5. Summary will update on new commits.