Skip to content

docs: add the hot load procedure for ENV to the README - #172

Open
jaredwray wants to merge 2 commits into
mainfrom
claude/lucid-mccarthy-l50ng5
Open

jaredwray wants to merge 2 commits into
mainfrom
claude/lucid-mccarthy-l50ng5

Conversation

@jaredwray

Copy link
Copy Markdown
Contributor

Please check if the PR fulfills these requirements

  • Followed the Contributing guidelines and Code of Conduct
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage. This pull request changes only README.md. It does not add, change, or delete a test.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Docs update.

The README did not tell the reader how to do a hot load of ENV values. The SDK has no watch option, so the new section shows how to call load() again on a timer.

  • Add the section "Hot Loading Environment Variables" after "Loading Environment Variables from Hyphen".
  • Add the section to the table of contents.
  • Give the rules for a safe hot load. Each rule agrees with the behavior of load() in src/env-service.ts:
    • override: false does not change a variable that process.env already has.
    • load() does not delete a variable from process.env. The example deletes the removed variables.
    • A load that fails does not change process.env.
    • Each load sends one request for each environment and one request for the key.

Verification

  • pnpm test ran in an environment that has no Hyphen credentials. 241 tests passed and 52 tests failed.
  • The 52 tests failed because the credentials are absent (HYPHEN_API_KEY is not set, Unauthorized, You must set the publicApiKey). This pull request does not change source code or tests.
  • Test audit: this pull request does not add, change, or delete a test.

Generated by Claude Code

The SDK has no watch option. The new section shows how to call load()
on a timer and gives the rules for a safe hot load.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017rB6hH3yCdkDRkim3y4pUg
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T17:21:51.627478Z 2c70d71 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the README.md to add documentation and a code example for hot loading environment variables using the Hyphen Node.js SDK. The feedback suggests improving the code example by replacing the setInterval implementation with a recursive setTimeout pattern to avoid overlapping executions during slow network requests, and updating the corresponding instructions to use clearTimeout instead of clearInterval.

Comment thread README.md Resolved
Comment thread README.md Resolved
The example used setInterval. A slow load could run at the same time
as the next load and write old values. The example now starts the
timer again only after a load ends.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017rB6hH3yCdkDRkim3y4pUg

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c70d712e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md Resolved

Copy link
Copy Markdown
Contributor Author

The build check and the build-test checks fail. This pull request does not cause the failure.

What fails

  • 14 tests in test/link.test.ts fail. The other 281 tests pass.
  • Each failed test calls the live Hyphen Link API. The API returns Not Found (Failed to create short code: Not Found, Failed to get short codes: Not Found, Failed to get tags: Not Found).

Why this pull request is not the cause

  • This pull request changes only README.md. It does not change src/link.ts or test/link.test.ts.
  • The failure occurred on commit 2c70d71 and occurred again on commit b445716. The second run was the one re-run.
  • The last tests run on main passed, but its date is 2026-10-11. The Link API or the CI secrets for it possibly changed after that date.

Fix

No fix exists in this repository at this time. The cause is in the live Link API or in the organization and API key secrets that CI uses. A person who has access to those must examine them. A new run of tests on main will show if main fails too.


Generated by Claude Code

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.

2 participants