Add file path setup for mock policy server and improve state polling - #333272
Merged
Conversation
Contributor
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 4
New issues introduced by this change (5)
| Severity | Finding |
|---|---|
scripts/mock-policy-server/public/app.ts — This accepts every syntactically valid JSON value, so arrays, primitives, and null get deploy… |
|
scripts/mock-policy-server/public/app.ts — sudo tee only creates a root-owned regular file when the destination does not already exist. If… |
|
scripts/mock-policy-server/public/app.ts — This “Go to” action only scrolls after closing the modal, leaving keyboard and screen-reader focus… |
|
scripts/mock-policy-server/README.md — The generated Unix and PowerShell snippets are multiline here-doc/here-string commands, not… |
|
scripts/mock-policy-server/public/app.ts — applyState calls renderTabs, which replaces every endpoint tab and toggle. If an external… |
What changed in this PR
Adds file-based managed-settings deployment to the mock policy server and synchronizes external server-state changes into its GUI.
Changes:
- Adds platform-specific deployment commands and setup UI.
- Polls server state every two seconds.
- Documents file-based policy testing.
| File | Description |
|---|---|
scripts/mock-policy-server/README.md |
Documents file deployment. |
scripts/mock-policy-server/public/style.css |
Styles the new UI. |
scripts/mock-policy-server/public/index.html |
Adds setup and deployment controls. |
scripts/mock-policy-server/public/app.ts |
Generates commands and polls state. |
.github/skills/policy-and-managed-settings/local-testing.md |
Updates testing guidance. |
Suppressed comments (2)
scripts/mock-policy-server/public/app.ts:690
- The polling guard only treats focus or a pending/active save as an edit. An invalid JSON/status draft (or a draft whose save failed) has neither marker once the user blurs the field, so any external state change causes
applyExternalStateto overwrite that unsaved draft. Track dirty drafts independently and skip/reconcile polling until the matching save succeeds rather than using focus as the source of truth.
async function refreshState(): Promise<void> {
if (stateWritesInFlight > 0 || pendingSaves.size > 0 || isInteractingWithEditor()) {
return;
scripts/mock-policy-server/public/app.ts:139
- As on macOS,
sudo teepreserves an existing file's ownership and mode and follows a symlink, so this does not guarantee the root-owned, regular, non-group/world-writable file promised by the UI. Replace the existing entry and set the required mode explicitly.
return `sudo mkdir -p /etc/github-copilot && sudo tee ${linuxManagedSettingsPath} >/dev/null <<'JSON'\n${body}\nJSON`;
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
joshspicer
enabled auto-merge (squash)
August 28, 2026 22:47
roblourens
approved these changes
Aug 28, 2026
roblourens
approved these changes
Aug 28, 2026
Raymond Zhao (rzhao271)
approved these changes
Aug 29, 2026
Dmitriy Vasyura (dmitrivMS)
approved these changes
Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This pull request introduces enhancements to the mock policy server, focusing on file path configuration and improving the responsiveness of the GUI to external state changes.
Changes made:
Documentation Updates:
Code Enhancements:
app.tsto check for external state changes via the/api/stateendpoint, ensuring the GUI reflects updates without requiring a page reload.Validation: