Skip to content

Start the .NET demo with the _51DEGREES_ names as well as the older ones - #32

Merged
jwrosewell merged 2 commits into
rcfrom
fix/demo-new-variable-names
Nov 16, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
fix/demo-new-variable-names

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

The problem

NoClientScriptTag_PmpAddsItAndTheAnswerStillCreates in Browser51Did/PmpAddsClientScriptTests.cs fails when the suite runs in a CI job that also holds _51DEGREES_RESOURCE_KEY_51DID:

Assert.IsTrue failed. 'condition' expression: 'added.Contains(Harness.Resource!, StringComparison.Ordinal)'. the script must be asked for with the resource key PMP already holds, or the cloud has no idea which publisher is asking.

The .NET demo the suite starts (examples/device-detection/Cloud/pmp-web in 51degrees-dotnet) reads its key from _51DEGREES_RESOURCE_KEY first, then from the CI name _51DEGREES_RESOURCE_KEY_51DID, and only then from the older 51DEGREES_RESOURCE_KEY (Settings.FromEnvironment, lines 130 to 160). ExampleApps.Demos started the demo with 51DEGREES_RESOURCE_KEY alone, and the demo process inherits the job's environment. So where the job holds _51DEGREES_RESOURCE_KEY_51DID, the demo used that key instead of the one the harness handed it, and the test, which checks the script was asked for with the harness's key, failed.

The change

  1. ExampleApps.Demos["dotnet"] sets _51DEGREES_RESOURCE_KEY and _51DEGREES_CLOUD_ENDPOINT as well as the older names, as Give the .NET example the _51DEGREES_ variable names alongside the old ones #25 did for the .NET getting started example (commit 5c3f519). The key the suite hands over is then the first one the demo reads. Older versions of the demo read only the older names, so both are kept. The latest release, device-detection/4.5.181 at 8b3220b3a9, reads the _51DEGREES_ names first.
  2. Commit 7337818 follows review.
    • The harness's comments on CloudUrl and Resource, its not-configured message, the root README.md and Browser51Did/README.md said the demo is handed only the older names. They now say it is given the key and the endpoint under each name it reads.
    • The comment in ExampleApps.cs and the test's message say "older versions" where they said "released versions".
    • Demos_Dotnet_SetsTheUnderscoreNames asserts all four names it sets, the older 51DEGREES_CLOUD_ENDPOINT included.

How it was checked

  • The suite's own checks on this pull request build it and run Demos_Dotnet_SetsTheUnderscoreNames. Locally at 7337818 the build has no warnings, and the example and demo settings tests pass, 10 of 10.
  • NoClientScriptTag_PmpAddsItAndTheAnswerStillCreates ran with 51DEGREES_RESOURCE_KEY and _51DEGREES_RESOURCE_KEY_51DID holding different keys, which is the case described above.
    • With the suite at 208a027, before this change, in two runs on 15 November, this test failed with the message quoted above, and each run ended with 1 failed, 22 passed and 1 skipped of 24.
    • With the suite at 5c3f519, in the same setting later that day, 23 passed and 1 skipped of 24.
    • The skip in each run is one of the two IsGdpr tests, which skip with their own reason about what the key and the cloud carry.
    • 7337818 changes only comments, documentation and a unit test, so the run at 5c3f519 stands for it.

What remains

… name

The harness's comments, its not-configured message and both READMEs still
said the demo is handed only the older names. They now say it is given the
key and the endpoint under each name it reads, which for the dotnet demo is
the _51DEGREES_ names and the older ones.

The comment on the older names says older versions read only those, as the
latest release reads the _51DEGREES_ names first. The test now asserts the
older endpoint name as well, so it checks all four names it sets.
@jwrosewell
jwrosewell marked this pull request as ready for review November 16, 2026 11:30
@jwrosewell
jwrosewell merged commit a9d9097 into rc Nov 16, 2026
5 checks passed
@jwrosewell jwrosewell mentioned this pull request Nov 16, 2026
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