Skip to content

Bring V2 admin Scale settings to parity with the classic page - #1681

Merged
Paul Lizer (paullizer) merged 4 commits into
microsoft:paullizer-react-v2-uifrom
paullizer:paullizer-admin-v2-scale-settings-parity
Oct 7, 2026
Merged

Paul Lizer (paullizer) merged 4 commits into
microsoft:paullizer-react-v2-uifrom
paullizer:paullizer-admin-v2-scale-settings-parity

Conversation

@paullizer

@paullizer Paul Lizer (paullizer) commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Most of the V2 Admin Settings Scale group was missing from the field schema, so V2 drew only the enable_* switches its fallback scan could guess. Admins could not edit the Redis connection, cache TTLs, Cosmos resource or throughput guardrails in V2, and none of the classic page's operational panels existed. This brings Scale to parity with the classic page in the existing V2 design language: section cards, a capability switch with its dependents nested beneath it, collapsible groups, and links between related sections.

  • Redis & Caching: Redis Cache gets its connection settings, a key field that becomes Key Vault Secret Name under Key Vault auth (with a link to Key Vault while that is not set up), and Test Redis connection. Redis Metrics shows health and capacity when scrolled into view, with an inline, read-only Redis Explorer. Conversation Cache gets its TTL and 15-minute activity readouts.
  • Cosmos: DAI Metrics shows the always-on index components plus backfill, read and cache metrics; its diagnostics and backfill actions appear only while Document Access Index diagnostics (enable_dai_debug) is on under Operations > Debug Logging, matching the classic page. Cosmos Maintenance shows index and stale-cache status with on-demand runs. Cosmos DB Throughput adds the resource, guardrails, access validation and manual scaling, and Cosmos Metrics is a list-beside-detail container workbench whose policies save with the page.
  • Safe operations: applying indexes, deleting stale cache docs, resetting the backfill, and scaling or converting throughput all confirm first, and a scale shows the current RU/s and the estimated target. V2 saves enforce the classic throughput rules, put each error beside the field that broke it, and report RU/s values the server rounds. Container policy timestamps always come from storage, so saving a stale page cannot reset a cooldown.
  • Shared plumbing: two generic schema descriptors (label_variants, requires.when), and a "Used by" line on cards that other sections depend on.

Worth a careful look:

  • No new routes. V2 calls the existing admin-guarded APIs (redis-monitoring, redis-explorer, app-maintenance, cosmos-throughput). A parity test pins their paths, methods and guards against route_backend_settings.py, and the maintenance request bodies against admin_settings.js.
  • Shared with V1: functions_cosmos_throughput.py gains collect_cosmos_throughput_policy_errors, which returns structured errors. validate_cosmos_throughput_policy_settings, which V1 calls, now wraps it and returns the same messages as before.
  • Browser mirrors: the page mirrors the policy rules and the manual-scale target so it can explain a change before sending it. The server stays authoritative, and the mirrors are tested against cases generated from the Python functions.
  • DAI diagnostics gate: the diagnostics fields depend on the enable_dai_debug key, the switch the V2 Operations work declared under Debug Logging, so they appear as soon as it is turned on. Scale itself has no toggle for it.
  • Section links: prerequisite links use the base's navigateToSetting from Add the Governance group to V2 Admin Settings #1680, which leads to the section owning a hidden target's condition. The "Used by" line links through the same function.
  • Suppressed keys: the four always-on DAI flags (forced to true on every read and write) no longer get fallback switches, which reverted on save.
  • Shared section helpers: collectRequirements, deriveSectionStatus, computeSectionStatus and buildSectionDependents take the base's fieldsByKey and then runtimeFlags.
  • Seeded default: redis_auth_type now seeds 'key' instead of ''. Every reader already treats an empty value as key auth, so runtime behavior is unchanged.
  • Deliberate difference from V1: Validate access keeps what it read with its result instead of replacing the status panel, because it reads unsaved values that may name another target. Manual changes always estimate from the saved target.
Screenshots (UI test fixture, synthetic data)

Redis Cache with Key Vault authentication selected: the Key Vault prerequisite, and "Used by" on both cards

Redis Cache with Key Vault authentication

Redis Metrics with the inline Redis Explorer

Redis Explorer

Confirming a manual scale

Scale confirmation

Cosmos Metrics workbench with a container policy edited in place

Container policy workbench

Linked issue

N/A (no tracking issue for this work)

Release Notes & Latest Features

  • New Feature
  • Bug Fix
  • UI Enhancement
  • Breaking Change
  • Internal only

Is this visible to end users?

  • Yes
  • No

Is this admin-facing (Admin Settings, governance, deployment, config)?

  • Yes
  • No

Should this become a Latest Feature card?

  • Yes
  • No
  • Already added

Screenshot needed for the card?

  • Yes
  • No
  • Attached

Version bump

  • application/single_app/config.py VERSION third segment bumped, or not needed because this is docs-only
  • deployers/version.txt bumped, or not needed because deployers/ was not changed

Synced with paullizer-react-v2-ui at 485d51aa by merge commit 8d3024e2 and renumbered to 0.261.274, because the Governance group (#1680) took 0.261.273.

Testing / validation

Run from the repo root in PowerShell with $env:PYTHONDONTWRITEBYTECODE="1", on the merge result committed as 8d3024e2:

  • npx tsc -b --noEmit (in application/v2_ui): passed
  • npm run build (in application/v2_ui): passed
  • python -m pytest (Get-ChildItem functional_tests -Filter "test_v2_admin_*.py").FullName functional_tests/test_cosmos_throughput_autoscale_logic.py functional_tests/test_pytest_return_false_guard.py functional_tests/test_search_result_cache_admin_setting.py functional_tests/test_ai_connection_embedding_defaults_api.py functional_tests/test_content_screening_admin_settings_fix.py -p no:cacheprovider -q: 436 passed, 12 failed. All 12 fail identically on the base 485d51aa and are unrelated to Scale: test_v2_admin_security_parity.py::test_every_v1_security_field_is_claimed (unclaimed chat_content_settings_present marker), test_v2_admin_settings_schema.py::test_defaults_match_their_field_type (m365_trusted_download_hosts default []), test_v2_admin_settings_rail_collapse.py::test_the_rail_collapses_to_labelled_icons (disabled={delegationDirty} assertion), and 9 checks in test_ai_connection_embedding_defaults_api.py.
  • python -m pytest (Get-ChildItem ui_tests -Filter "test_v2_admin_*.py").FullName -p no:cacheprovider -q: 159 passed across all 14 V2 admin UI suites, including Governance (local Chromium)
  • python -m pytest functional_tests/route_tests/test_route_blueprint_policy_inventory.py functional_tests/route_tests/test_route_unauthenticated_policy_contract.py functional_tests/route_tests/test_route_policy_test_coverage.py -p no:cacheprovider -q: 21 passed
  • python scripts/build_docs_inventory.py --check: inventory in sync
  • python functional_tests/test_docs_app_surface_coverage.py: 7/7 passed
  • python functional_tests/test_docs_site_quality.py: 6/6 passed
  • Not run: functional_tests/route_tests/test_workflow_*_policy.py. They fail at import on this machine (import OpenSSL raises AttributeError: module 'lib' has no attribute 'GEN_EMAIL', a local pyOpenSSL/cryptography mismatch), and this change touches no workflow code.
  • Manual: reverting the capacity-change guard fails the double-submit check in test_v2_admin_scale_settings.py. An automated review found three issues, all fixed with coverage: a second scale could be sent while the status refreshed, policy inputs rewrote half-typed numbers, and Validate access replaced the status that manual changes estimate from. Playwright screenshots were reviewed at desktop and 390px widths, light and dark, and XL text.

New tests: test_v2_admin_scale_parity.py (17), test_v2_admin_scale_normalization.py (13), test_v2_admin_scale_logic.py with test_v2_admin_scale_logic.ts (18 checks, browser mirrors against generated Python cases), and ui_tests/test_v2_admin_scale_settings.py (15).

Documentation

  • Release notes updated, or not needed
  • Feature documentation updated, or not needed
  • Fix documentation updated, or not needed

Release notes: new v0.261.274 section. Feature doc: docs/explanation/features/V2_ADMIN_SCALE_SETTINGS.md. Admin docs: docs/admin/scale.md rewritten to cover every Scale setting, readout and action. No fix doc is needed: this PR carries no bug fix of its own.

Security checklist

  • New Flask routes include @swagger_route(security=get_auth_security()) (no new routes)
  • Settings sent to non-admin frontends use sanitize_settings_for_user() (admin-only surface; redis_key is a declared secret, so V2 receives only the redaction placeholder)
  • Browser JavaScript is served from local SimpleChat static assets only; no CDN-hosted JS
  • No secrets, keys, connection strings, or local-only artifacts are included

Paul Lizer (paullizer) and others added 4 commits October 6, 2026 23:14
- Declare all seven Scale sections in admin_settings_fields.py: the Redis
  connection with a Key Vault-aware key field and connection test, Redis
  Metrics and Explorer, the conversation cache, DAI metrics with diagnostics
  behind enable_dai_debug, Cosmos maintenance, the throughput console and
  guardrails, and the container policy workbench.
- Enforce the classic throughput policy rules on V2 saves through the new
  structured collect_cosmos_throughput_policy_errors, report RU/s values the
  server rounds, and keep container policy timestamps from storage.
- Add the label_variants and requires.when schema descriptors, and a
  "Used by" line driven by requires.target_section.
- Fix flag-gated fields being dropped inside settings cards, which hid the
  Inbound MCP settings while its preview was enabled.
- Confirm every action that changes a production resource, keep a capacity
  change busy until the status is read again, and keep validate-access
  readings out of the status manual changes estimate from.
- Add Scale parity, normalization, browser-logic and UI tests, the admin
  page rewrite, a feature doc and release notes for 0.261.260.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
With the preview enabled the card rendered empty; the page had already
dropped the "preview disabled" notice, so it never appeared in its place.
Text-only: the release note and the regression check's comment.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve the 15 conflicts with paullizer-react-v2-ui and reconcile the Scale
work with what landed there:

- DAI diagnostics now follow the Document Access Index diagnostics switch the
  V2 Operations work declares under Debug Logging (enable_dai_debug), as a
  depends_on key, so they appear as soon as it is turned on. The
  dai_debug_enabled runtime flag and the enable_dai_debug suppression are gone.
- The base already passes runtime flags into SettingsSection, so the duplicate
  release note and regression check for that fix are dropped.
- collectRequirements, deriveSectionStatus, computeSectionStatus and
  buildSectionDependents take the base's fieldsByKey and then runtimeFlags.
- The Scale docs point the search result cache at Azure AI Search, where the
  base now declares it.
- test_v2_admin_nested_setting_reads accepts arguments after the field index
  in the page's section status call.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ity to 0.261.274

The Governance group landed as 0.261.273, so this work moves to the next free
patch: VERSION, its release-note section, and the version markers in this
branch's tests, fixture and feature doc. Governance's own 0.261.273 markers
are unchanged.

Governance also added in-page navigation for prerequisite links, through
SettingsSection's onNavigate and the page's navigateToSetting, which leads to
the section owning a hidden target's condition. The notice now uses that
implementation, so this branch's isSectionAvailable gate, navigateWithin and
availableSectionIds are removed. The "Used by" line keeps its dependents prop
and links through the same navigateToSetting.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paullizer
Paul Lizer (paullizer) merged commit b8db49d into microsoft:paullizer-react-v2-ui Oct 7, 2026
11 checks passed
Paul Lizer (paullizer) added a commit that referenced this pull request Oct 7, 2026
Brings in the Scale settings parity work (#1681), which also took 0.261.274.

- admin_settings_fields.py: Scale joins the fully described groups in the
  module notes, alongside the Backup & Recovery component note.
- adminFields.ts: search text includes keywords, label variants and
  endpoint lists.
- AdminSettingsPage.tsx: keep both sets of imports; section status keeps the
  Backup & Recovery override and passes the target's runtimeFlags; keep the
  target's section-dependents and throughput-validation memos; render both
  the leave dialog and CosmosCapacityConfirm. Still one useBlocker.
- test_v2_admin_capability_placement.py: Backup & Recovery and Scale are both
  fully described groups.
- Version 0.261.275: the Backup & Recovery release-notes entry moves to its
  own section above Scale's 0.261.274, and this feature's test and doc
  headers follow it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Paul Lizer (paullizer) added a commit that referenced this pull request Oct 7, 2026
…61.275

Brings in the Scale group (#1681), which took 0.261.274, so this branch
moves to 0.261.275. Six conflicts, each resolved by keeping both sides:

- admin_settings_fields.py: the related_section docstring stays, and the
  fully described groups list both Scale and Help. The Help constants sit
  beside the Scale groups and Cosmos limits. The recipient and visibility
  validators sit beside the Redis port and container-policy checks.
- SettingsSection.tsx: the section-status provider wraps the base's new
  "Used by" dependents line as well as the requirement notices.
- AdminSettingsPage.tsx: one adminSections import with buildSectionDependents
  and readSectionValue, plus the base's cosmosThroughput import.
- release_notes.md: this branch's entries move to a v0.261.275 section,
  above the base's v0.261.274 Scale section.
- test_v2_admin_capability_placement.py: both history lines and narratives
  are kept, FULLY_DESCRIBED_GROUP_IDS includes scale and help, and
  invariant 1 now names Scale, which the base's tuple already held.
- ui_tests/fixtures/v2_admin_settings.py: both history lines are kept, and
  the built-in Help stubs run before the base's test-supplied extra_routes.

This branch's own version references move to 0.261.275. The base's
0.261.274 Scale lines are left as they are.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Paul Lizer (paullizer) added a commit to paullizer/simplechat that referenced this pull request Oct 7, 2026
Brings in V2 at 919375b (microsoft#1682, VERSION 0.261.275), which also
includes microsoft#1681 (VERSION 0.261.274).

Conflicts:
- docs/explanation/release_notes.md: V2's file byte-for-byte, with this
  branch's own (v0.261.256) section inserted at the very top, above V2's
  first section, (v0.261.275). Every V2 section is unchanged.
- application/single_app/config.py merged cleanly to V2's file (VERSION
  0.261.275), because this branch hadn't changed it since the last
  merge. The renumber commit sets the final number.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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