Patch chromium flag endpoint #77
Merged
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.
Here's a PR description for your changes:
Add Dynamic Chromium Flags API & Refactor Restart Logic
This PR adds the ability to dynamically update Chromium launch flags at runtime and consolidates duplicate code across the codebase.
Changes
New Feature:
PATCH /chromium/flagsendpoint to update Chromium flags dynamically without container restartrun-docker.shto make flags file writable (removedromount option)--kioskmode for better fullscreen experienceCode Refactoring:
mergeAndWriteChromiumFlags()helper to consolidate flag merging logic (eliminates 52 lines of duplication)restartChromiumAndWait()helper to consolidate Chromium restart logic (eliminates 62 lines of duplication)restartChromium()function fromdisplay.goBenefits:
Testing
E2E Tests:
TestExtensionUploadAndActivationine2e_chromium_test.goto verify extension endpoint still works correctlyManual Testing:
Unit Tests:
TestApiService_PatchChromiumFlagsto verify flag validation and merging logicNote
Introduces a new PATCH /chromium/flags API and consolidates Chromium flag merging and restart logic into shared helpers, updating extension upload and display flows, with OpenAPI/client generation and a unit test.
PATCH /chromium/flagsendpoint (request:{ flags: string[] }; responses:200/400/500).oapiclient/server types, routing, and swagger spec for the new endpoint.ApiService.PatchChromiumFlagsto validate, merge, write flags, restart Chromium, and wait for DevTools.mergeAndWriteChromiumFlags()andrestartChromiumAndWait().UploadExtensionsAndRestartto use the new helpers and improved logging.restartChromium()fromdisplay.goand replace calls withrestartChromiumAndWait().TestApiService_PatchChromiumFlagscovering flag validation/flow.Written by Cursor Bugbot for commit ee0c0f3. This will update automatically on new commits. Configure here.