Skip to content

fix: count only the tenant's baselines in the documentation header - #49

Merged
royklo merged 1 commit into
mainfrom
fix/doc-baseline-count
Nov 9, 2026
Merged

royklo merged 1 commit into
mainfrom
fix/doc-baseline-count

Conversation

@royklo

@royklo royklo commented Nov 9, 2026

Copy link
Copy Markdown
Owner

What

Export-InforcerTenantDocumentation -Format Html showed the number of every baseline the credential can see in the report header ("29 baselines"), not the tenant's, and also with -Baseline filtering the report to one baseline.

Now the header:

  • counts only the baselines the tenant is the source or a member of (matched on baselineMsTenantId and members[].msTenantId, both APIs);
  • shows no count when -Baseline is set: the "Baseline: …" line already names it;
  • reads "1 product", "1 policy", "1 baseline".

The bug predates 1.0.0 (it is in 0.8.0). 1.0.0 is not on PSGallery yet, so this ships as part of 1.0.0; the CHANGELOG entry is dated 2026-11-09.

Evidence

Export Before After
Inforcer Blueprint Library (beta), no filter 29 baselines 24 baselines
Same, -Baseline 'Inforcer Blueprint Project - Microsoft Edge' 29 baselines no count
Roytoso (v1), no filter 10 baselines 5 baselines

Tests: 4 new in Tests/DocModel.Tests.ps1; each fails on the old code. Full suite 856: 852 pass, 3 skipped, 1 known failure (settings-catalog integration, same as on main).

🤖 Generated with Claude Code

The HTML header counted every baseline the credential can see, so a
partner with 29 baselines showed "29 baselines" on every tenant, even
with -Baseline filtering the report to one. It now counts the baselines
the tenant is the source or a member of, shows no count when -Baseline
is set (the "Baseline:" line already names it), and reads "1 product",
"1 policy" and "1 baseline".

Measured live: Inforcer Blueprint Library (beta) 29 -> 24, filtered to
one baseline -> no count; Roytoso (v1) 10 -> 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 11:10

Copilot AI 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.

🟢 Approval recommended

There are no active review issues for the tenant-specific baseline count and report-label changes.

No open issues 🎉

What changed in this PR

Corrects baseline counts in tenant documentation HTML reports as part of the unreleased 1.0.0 release.

Changes:

  • Limits baseline counts to baselines where the tenant is the source or a member.
  • Hides the baseline count when -Baseline is set and uses singular labels for counts of one.
  • Adds four regression tests and updates the changelog date and test totals.
File Description
Tests/​DocModel.Tests.ps1 Tests tenant-specific counts, filtered headers, and singular labels.
module/​Private/​ConvertTo-InforcerHtml.ps1 Hides filtered baseline counts and handles singular count labels.
module/​Private/​ConvertTo-InforcerDocModel.ps1 Filters baseline names by tenant source or membership.
CHANGELOG.md Documents the fix and updates release metadata and test totals.

Review effort: Balanced

@royklo
royklo merged commit b6d4280 into main Nov 9, 2026
4 checks passed
@royklo
royklo deleted the fix/doc-baseline-count branch November 9, 2026 11:15
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