-
Notifications
You must be signed in to change notification settings - Fork 10
fix(web): retain prepared browser popup handle #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
56dd6eb
fix(web): retain prepared browser popup handle
skulidropek 858b84a
fix(browser): wait for current controller and runtime
skulidropek 1235301
fix(browser): apply controller review feedback
skulidropek 78ade66
fix(browser): satisfy controller review checks
skulidropek 4f40f6c
fix(browser): deduplicate health probe options
skulidropek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
44 changes: 44 additions & 0 deletions
44
packages/app/src/docker-git/controller-reachability-diagnostics.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { Effect } from "effect" | ||
|
|
||
| import * as ControllerDocker from "./controller-docker.js" | ||
| import { type DockerNetworkIps, formatNetworkIps } from "./controller-reachability.js" | ||
|
|
||
| // CHANGE: document controller reachability diagnostics as a SHELL effect. | ||
| // WHY: diagnostics inspect published controller ports and must make their runtime dependency explicit. | ||
| // QUOTE(ТЗ): n/a | ||
| // REF: PR-360-coderabbit-reachability-diagnostics-contract | ||
| // SOURCE: n/a | ||
| // FORMAT THEOREM: forall candidates C: diagnostics(C) returns a string containing attempted endpoints and runtime network state. | ||
| // PURITY: SHELL | ||
| // EFFECT: Effect<string, never, ControllerDocker.ControllerRuntime> | ||
| // INVARIANT: every returned diagnostic string includes candidate URLs, published ports, current runtime networks, and controller networks. | ||
| // COMPLEXITY: O(n) where n = |candidateUrls|. | ||
| /** | ||
| * Collects host/controller reachability diagnostics for failed bootstrap probes. | ||
| * | ||
| * @param candidateUrls - API base URL candidates attempted by the bootstrap path. | ||
| * @param currentContainerNetworks - network IPs visible from the current runtime container. | ||
| * @param controllerNetworks - network IPs attached to the docker-git controller container. | ||
| * @returns Effect.Effect<string, never, ControllerDocker.ControllerRuntime> | ||
| * | ||
| * @pure false | ||
| * @effect Requires ControllerDocker.inspectControllerPublishedPorts through ControllerDocker.ControllerRuntime. | ||
| * @invariant The result describes controller runtime endpoints, published ports, and network visibility. | ||
| * @complexity O(n) where n is candidateUrls.length. | ||
| */ | ||
| export const collectReachabilityDiagnostics = ( | ||
| candidateUrls: ReadonlyArray<string>, | ||
| currentContainerNetworks: DockerNetworkIps, | ||
| controllerNetworks: DockerNetworkIps | ||
| ): Effect.Effect<string, never, ControllerDocker.ControllerRuntime> => | ||
| Effect.gen(function*(_) { | ||
| const publishedPorts = yield* _(ControllerDocker.inspectControllerPublishedPorts()) | ||
|
|
||
| return [ | ||
| "Tried endpoints:", | ||
| ...candidateUrls.map((candidateUrl) => `- ${candidateUrl}`), | ||
| `Published ports: ${publishedPorts.length > 0 ? publishedPorts : "unavailable"}`, | ||
| `Current runtime networks: ${formatNetworkIps(currentContainerNetworks)}`, | ||
| `Controller networks: ${formatNetworkIps(controllerNetworks)}` | ||
| ].join("\n") | ||
| }) | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.