Skip to content

Read the cloud endpoint from _51DEGREES_CLOUD_ENDPOINT - #77

Merged
jwrosewell merged 3 commits into
rcfrom
fix/cloud-endpoint-variable
Nov 11, 2026
Merged

jwrosewell merged 3 commits into
rcfrom
fix/cloud-endpoint-variable

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

The cloud request engine and the 51Did client read their endpoint from _51DEGREES_CLOUD_ENDPOINT in place of FOD_CLOUD_API_URL, with no fallback, for consistency with the other languages in the 11 November release. The environment variable name check now rejects the old name anywhere in the repository.

The problem

Node read the endpoint from FOD_CLOUD_API_URL in two places, the cloud request engine (cloudRequestEngine.js line 143 at 8093efa) and the 51Did client (didClient.js line 1009). The CI script set it for the cloud contract tests (ci/run-integration-tests.ps1 line 88), and four IP Intelligence examples, the creator context web example, two readmes, the 51Did type declarations and two integration tests named it.

Rust reads _51DEGREES_CLOUD_ENDPOINT (README.md line 419 at 245bc39), and the drafts 51degrees-dotnet#131, 51degrees-java#105, 51degrees-python#100, 51degrees-php#68 and 51degrees-go#102 make the same rename. .NET's draft takes FOD_CLOUD_API_URL and FIFTYONE_CLOUD_ENDPOINT to _51DEGREES_CLOUD_ENDPOINT under the decision it quotes, "Just use the version that works everywhere all the time with no fallback."

What changed

  • cloudRequestEngine.js and didClient.js read process.env._51DEGREES_CLOUD_ENDPOINT. Nothing reads the old name. The baseURL and endpoint options still win over the variable, and the public cloud is still the default.
  • The examples, both readmes, types/didClient.d.ts, the two 51Did integration tests and ci/run-integration-tests.ps1 name the new variable. Two comments, one readme paragraph and one error message that the longer name pushed past 80 columns are rewrapped.
  • ci/tests/environmentVariableNames.test.js gains OLD_NAME, which matches the whole old name in any letter case wherever it appears, read, set or in prose, and leaves a longer name holding it alone. The test "names no old cloud endpoint variable" runs it over every tracked file, and "matches only the whole old cloud endpoint name" checks what it matches.

Tests, red then green

New and changed tests:

  • cloudRequestEngine.test.js sets _51DEGREES_CLOUD_ENDPOINT in the two endpoint precedence tests, and the new "custom end point - old variable name not read" sets only the old name and expects the default.
  • didClient.test.js uses the new name throughout, and the new "endpoint does not read the old variable name" does the same for the 51Did client.
  • The two guard tests above.

The tests in cloudRequestEngine.test.js and didClient.test.js that name the old name build it in two parts, 'FOD' + '_CLOUD_API_URL', so the guard does not find it in them. The guard file itself does not do that. ci/tests/environmentVariableNames.test.js carries the old name as a literal nine times, once in OLD_NAME and eight times in its own test of what OLD_NAME matches, and the scan passes over it only because that file is the one entry in SKIPPED_FILES (lines 63 to 66 at 80a1bf7), which namesInRepository leaves out of every scan (line 120). So a name added to the guard's own tests is not found by the guard, and a name added anywhere else is.

The red and green runs used a temporary workflow on throwaway branches, since deleted, which ran these three test files with Jest.

Full build

The head is 80a1bf7, which merges rc at f76d8b0 into 0948eb3. rc had taken #45 since this draft was opened, which also changes cloudRequestEngine.js and cloudRequestEngine.test.js, and the merge was clean. The red and green above are of 0948eb3, and the merge changes no line this draft changes.

macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.

Release note

  • The cloud request engine and the 51Did client read their endpoint from _51DEGREES_CLOUD_ENDPOINT in place of FOD_CLOUD_API_URL. The old name is no longer read, so set the new one.

What remains

Nothing in this repository. The same rename in the other languages is in the drafts listed above.

The cloud request engine and the 51Did client must read their endpoint from
_51DEGREES_CLOUD_ENDPOINT and not from the old name, and the environment
variable name check now fails on any file that still names the old one.
The cloud request engine and the 51Did client read their endpoint from
_51DEGREES_CLOUD_ENDPOINT, the name the other 51Degrees languages use, with
no fallback to the old name. The examples, readmes, type declarations,
integration tests and the CI script name the new variable.
@jwrosewell

Copy link
Copy Markdown
Contributor Author

Closing and reopening at once to start the checks again, because the runs queued during GitHub's Actions outage this evening never started.

@jwrosewell jwrosewell closed this Nov 11, 2026
@jwrosewell jwrosewell reopened this Nov 11, 2026
@jwrosewell
jwrosewell marked this pull request as ready for review November 11, 2026 23:51
@jwrosewell
jwrosewell merged commit 42181ba into rc Nov 11, 2026
2 checks passed
@jwrosewell
jwrosewell deleted the fix/cloud-endpoint-variable branch November 11, 2026 23:51
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