Skip to content

feat(flightcheck): validate ServiceNow portal base URL env vars (US 7535608) - #174

Open
srideshpande wants to merge 5 commits into
mainfrom
srdeshpande/servicenow-base-url-flightcheck
Open

feat(flightcheck): validate ServiceNow portal base URL env vars (US 7535608)#174
srideshpande wants to merge 5 commits into
mainfrom
srdeshpande/servicenow-base-url-flightcheck

Conversation

@srideshpande

Copy link
Copy Markdown
Contributor

What & why

Adds ESS FlightCheck coverage for the update-safe ServiceNow portal base URL environment variables introduced for US 7535608 (Option B). An empty base URL is the root cause of ICM 820635151 — ServiceNow record hyperlinks only returned when explicitly requested.

Changes

  • New checks SN-URL-001 (HRSD) / SN-URL-002 (ITSM) in servicenow.py, wired into run_servicenow_checks. Each verifies its env var (msdyn_ServiceNow{HRSD,ITSM}PortalBaseURI) is present and a well-formed absolute URL:
    • PASSED – valid absolute URL
    • FAILED – definition exists but no value (the maker step was missed — the ICM bug)
    • WARNING – value set but not an absolute URL
    • NotConfigured – pack not installed
    • SKIPPED – no Dataverse token
  • New test test_servicenow_base_url.py — 6 cases (both-set, missing-value, per-pack independence, malformed URL, definition-absent, no-token), mirroring the Workday env-var test and using the documented-tier Dataverse mock.

Validation

pytest tests/flightcheck/checks/test_servicenow_base_url.py → 6 passed. Full ServiceNow + role-enforcement suite (37 tests) green.

Related

Pairs with the ESSVivaCopilot solution PR that creates these env vars + wires the orchestrator flows (US 7535608 Tasks 2–3).

…535608)

Adds SN-URL-001 (HRSD) and SN-URL-002 (ITSM) checks that verify each
ServiceNow extension pack's update-safe portal base URL environment variable
(msdyn_ServiceNow{HRSD,ITSM}PortalBaseURI) is present and a well-formed
absolute URL. An empty value is the root cause of ICM 820635151 (hyperlinks
only returned when explicitly requested).

Status mapping: PASSED (valid URL), FAILED (definition exists but no value -
the maker step was missed), WARNING (value set but not an absolute URL),
NotConfigured (pack not installed), SKIPPED (no Dataverse token). Wired into
run_servicenow_checks.

Test (test_servicenow_base_url.py) mirrors the Workday env-var pattern using
the documented-tier Dataverse mock: 6 cases covering both-set, missing-value,
per-pack independence, malformed URL, definition-absent, and no-token.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nehaoss

nehaoss commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

👋 Friendly reminder: This PR has been inactive for a while. Could the author or reviewers take a look and either push it forward, request changes, or close it if it's no longer needed? Let's keep our PR queue healthy! 🚀

srideshpande and others added 2 commits July 24, 2026 15:07
…hipped solution

The ESSVivaCopilot solution ships the portal base URL environment variables
without a publisher prefix (ServiceNow{HRSD,ITSM}PortalBaseURI), for consistency
with existing env var naming. Update the FlightCheck expected-schema constants,
test fixtures, and docs to match. The runtime lookup was already publisher-agnostic
(contains-filter + prefix-stripped substring match), so behavior is unchanged; this
keeps the declared schema names accurate.
daeunJe0ng added a commit that referenced this pull request Jul 28, 2026
…r (fix false positives found in PROD validation)

Validated SN-CFG-002 against a real PROD tenant: of 21 ServiceNow-named
template configs, only 2 (msdyn_ServiceNowHRSD / msdyn_ServiceNowITSM) carry
the portal base URL as a ServiceNowPortalBaseURI field. The original check
flagged all 21, producing 19 false positives.

- Scope the check to only configs that carry a ServiceNowPortalBaseURI field;
  scenario/field-mapping configs never hold a URL and are ignored.
- Validate the ServiceNowPortalBaseURI field value specifically rather than
  scanning the whole config blob for any URL.
- Defer per-pack to the update-safe SN-URL env var (US 7535608, PR #174) when
  it holds a valid URL, so SN-CFG-002 and SN-URL-001/002 do not double-fire on
  tenants migrated to the env-var mechanism.
- Rewrite SN-CFG-002 tests to the real config shape and add scoping and
  deference coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cae8da1a-6f8b-44db-af8c-52a559fc6a94
daeunJe0ng and others added 2 commits July 30, 2026 11:45
…ull env-var scan)

The ServiceNow portal base URL check pulled every environmentvariablevalues
record in the environment and filtered client-side. Narrow the values query to
only the PortalBaseURI definition ids found, and skip it entirely when no
definitions exist. Behavior is unchanged; this avoids a full environment-variable
scan on every run. Verified the _environmentvariabledefinitionid_value eq <id>
filter returns the correct value against a live environment.

Add a test asserting no environmentvariablevalues query is issued when no
definitions are found.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 06a09025-d97f-4f25-97af-cf2e37ae1d6d
@daeunJe0ng

Copy link
Copy Markdown
Contributor

Review summary — SN-URL-001 / SN-URL-002 (ServiceNow portal base URL env vars)

Verdict: Approve. I reviewed the design and logic, validated the checks against a live EmployeeHub environment, and applied one small efficiency fix with a test. Nothing else blocks merge.

Design.
This is the right home for the fix. The portal base URL moved to update-safe environment variables under US 7535608 precisely because the template-config value ships empty and resets on every managed-solution update, which is the root cause of ICM 820635151. Validating the env vars is validating the actual source of truth, so SN-URL-001/002 supersede the template-config check.

Live validation (EmployeeHub tenant).
I ran the check's real Dataverse queries against every accessible ServiceNow environment.
On ESS DA ServiceNow UpdateCase Validate the HRSD variable is provisioned as ServiceNowHRSDPortalBaseURI with no publisher prefix and holds a valid absolute URL, and the check correctly returned PASSED for SN-URL-001 and NotConfigured for SN-URL-002. This confirms the schema-name alignment from the 2026-07-24 commit matches what the shipped solution actually provisions.
On the other accessible ServiceNow environments the PortalBaseURI definitions are not present yet, and the check correctly returned NotConfigured for both packs.
The FAILED (defined-but-empty) and WARNING (non-absolute value) states are covered by unit tests but were not reproducible on a live tenant, because no accessible environment is currently in those states.

Fix applied.
The values lookup previously pulled every environmentvariablevalues record in the environment and filtered client-side. I narrowed it to query only the PortalBaseURI definition ids found by the definitions query, and to skip the values query entirely when no definitions exist. Behavior is unchanged; it just avoids a full environment-variable scan on every run. I verified the _environmentvariabledefinitionid_value eq filter returns the correct single value against the live environment.

Tests.
Added an assertion that no environmentvariablevalues query is issued when no definitions are found. test_servicenow_base_url.py is 6 passed, the full tests/flightcheck suite is 1002 passed, and ruff is clean on both changed files.

The fix is pushed to this branch as commit 49e07b6.

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.

3 participants