-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(rebuild): preserve disabledChannels across destroy/recreate #3532
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
14 commits
Select commit
Hold shift + click to select a range
f44e4c8
fix(e2e): dump cloudflared diagnostics on tunnel test failure
sandl99 a0b608a
ci(e2e): add manual-dispatch workflow for deployment-services-e2e
sandl99 ef9e688
ci(e2e): remove repo guard from deployment-services-e2e-manual
sandl99 b855a10
fix(rebuild): preserve disabledChannels across destroy/recreate
sandl99 3dce5dc
fix(rebuild): re-stash disabledChannels from registry on every rebuild
sandl99 473708c
chore(e2e): refresh parity inventory after dead-var removal
sandl99 c49c2d9
refactor(onboard): extract disabled channel resolution
sandl99 dd2f1a0
revert(e2e): remove deployment services ops changes
sandl99 4f8617b
merge(main): merge origin main into messaging stop
sandl99 92e294f
fix(rebuild): clear disabled channel registry state
sandl99 f4f6cf5
ci(e2e): address channels stop-start review
sandl99 1595c3b
Merge remote-tracking branch 'origin/main' into u/sdang/messaging-stop
sandl99 ee7a7e1
Merge branch 'main' into u/sdang/messaging-stop
cv caa7949
merge: merge origin/main into PR 3532
cv 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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { describe, expect, it, vi } from "vitest"; | ||
|
|
||
| import { resolveDisabledChannels } from "./channel-state"; | ||
|
|
||
| describe("onboard channel state helpers", () => { | ||
| it("prefers disabledChannels from the onboard session mirror", () => { | ||
| const getRegistryDisabledChannels = vi.fn(() => ["discord"]); | ||
|
|
||
| expect( | ||
| resolveDisabledChannels("alpha", { | ||
| loadSession: () => ({ disabledChannels: ["telegram"] }), | ||
| getRegistryDisabledChannels, | ||
| }), | ||
| ).toEqual(["telegram"]); | ||
| expect(getRegistryDisabledChannels).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("falls back to the registry when the session has no mirror", () => { | ||
| expect( | ||
| resolveDisabledChannels("alpha", { | ||
| loadSession: () => ({ disabledChannels: null }), | ||
| getRegistryDisabledChannels: (sandboxName) => | ||
| sandboxName === "alpha" ? ["discord"] : [], | ||
| }), | ||
| ).toEqual(["discord"]); | ||
| }); | ||
|
|
||
| it("treats an empty session mirror as authoritative", () => { | ||
| const getRegistryDisabledChannels = vi.fn(() => ["telegram"]); | ||
|
|
||
| expect( | ||
| resolveDisabledChannels("alpha", { | ||
| loadSession: () => ({ disabledChannels: [] }), | ||
| getRegistryDisabledChannels, | ||
| }), | ||
| ).toEqual([]); | ||
| expect(getRegistryDisabledChannels).not.toHaveBeenCalled(); | ||
| }); | ||
| }); |
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,26 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import * as onboardSession from "../state/onboard-session"; | ||
| import * as registry from "../state/registry"; | ||
|
|
||
| type DisabledChannelsSession = Pick<onboardSession.Session, "disabledChannels">; | ||
|
|
||
| export type DisabledChannelsDeps = { | ||
| loadSession: () => DisabledChannelsSession | null; | ||
| getRegistryDisabledChannels: (sandboxName: string) => string[]; | ||
| }; | ||
|
|
||
| export function resolveDisabledChannels( | ||
| sandboxName: string, | ||
| deps?: DisabledChannelsDeps, | ||
| ): string[] { | ||
| // `rebuild` destroys the registry entry before `onboard --resume` reaches | ||
| // createSandbox, so the session mirror is authoritative when present. | ||
| const sessionDisabledChannels = (deps?.loadSession ?? onboardSession.loadSession)() | ||
| ?.disabledChannels; | ||
| if (Array.isArray(sessionDisabledChannels)) { | ||
| return sessionDisabledChannels; | ||
| } | ||
| return (deps?.getRegistryDisabledChannels ?? registry.getDisabledChannels)(sandboxName); | ||
| } |
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.