Repository navigation
fix(ssh): move enabled SSH automations to the host's Orca server #34044
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 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
799ee34
fix(ssh): move enabled SSH automations to the host's Orca server
nwparker 81cf2e3
Merge remote-tracking branch 'origin/main' into nwparker/ssh-move-ena…
nwparker 7700265
test(ssh): mock the server automation enabler in the delta-move handl…
nwparker aaebce5
Merge remote-tracking branch 'origin/main' into nwparker/ssh-move-ena…
nwparker dec3c4e
Merge branch 'main' into nwparker/ssh-move-enabled-automations
nwparker 11f066d
Merge branch 'main' into nwparker/ssh-move-enabled-automations
nwparker e55e53e
Merge remote-tracking branch 'origin/main' into nwparker/ssh-move-ena…
nwparker 5d1ac33
test(e2e): keep the Move anyway specs refusing now that enabled autom…
nwparker 3a5ecb7
Merge remote-tracking branch 'origin/nwparker/ssh-move-enabled-automa…
nwparker 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export class AutomationDispatchCancelledError extends Error {} |
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,35 @@ | ||
| import { getAppEnvironment } from '../../shared/app-environment' | ||
| import type { Automation } from '../../shared/automations-types' | ||
| import type { Store } from '../persistence' | ||
| import { listOrcadMigrationCutoverChainForTarget } from '../ssh/orcad-migration-cutover-journal' | ||
|
|
||
| export const ORCAD_FENCED_AUTOMATION = "This automation now runs on its SSH host's Orca server." | ||
|
|
||
| /** While a move is in flight, or once it took this row, any desktop write would break or duplicate it. Rows Move anyway left behind stay runnable here. */ | ||
| export function isOrcadFencedAutomation( | ||
| store: Pick<Store, 'getSshTarget'>, | ||
| automation: Pick<Automation, 'id' | 'executionTargetType' | 'executionTargetId'>, | ||
| userDataPath: () => string = () => getAppEnvironment().getPath('userData') | ||
| ): boolean { | ||
| if ( | ||
| automation.executionTargetType !== 'ssh' || | ||
| store.getSshTarget(automation.executionTargetId)?.orcadFence === undefined | ||
| ) { | ||
| return false | ||
| } | ||
| let chain | ||
| try { | ||
| chain = listOrcadMigrationCutoverChainForTarget(userDataPath(), automation.executionTargetId) | ||
| } catch { | ||
| return true // An unreadable journal can't show the row stayed behind. | ||
| } | ||
| return ( | ||
| chain.length === 0 || | ||
| chain.some( | ||
| (cutover) => | ||
| cutover.phase === 'source-fenced' || | ||
| cutover.phase === 'destination-staged' || | ||
| cutover.manifest.payload.dormantState?.automations?.some(({ id }) => id === automation.id) | ||
| ) | ||
| ) | ||
| } |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔎 Supported by static analysis
Script executed:
Repository: stablyai/orca
Length of output: 10252
Script executed:
Repository: stablyai/orca
Length of output: 41387
Script executed:
Repository: stablyai/orca
Length of output: 42296
Script executed:
Repository: stablyai/orca
Length of output: 42468
Script executed:
Repository: stablyai/orca
Length of output: 42277
Script executed:
Repository: stablyai/orca
Length of output: 41921
Script executed:
Repository: stablyai/orca
Length of output: 14529
Preserve
automationsLeftDisabledduring retained-status admission.A renderer reload or runtime reconnect snapshots the live managed status.
admitSshManagedServerStatusthen removesautomationsLeftDisabled, so Settings loses the notice while the server keeps those automations disabled. This correction is separate from combining renderer warning lines.Suggested fix
const linked = admitSshManagedServerLinkedProjects('linked' in value ? value.linked : undefined) + const automationsLeftDisabled = + 'automationsLeftDisabled' in value && + isNonNegativeSafeInteger(value.automationsLeftDisabled) + ? { automationsLeftDisabled: value.automationsLeftDisabled } + : {} return { managedServer: { kind: 'managed', environmentId: value.environmentId, ...update, ...serving, - ...linked + ...linked, + ...automationsLeftDisabled } }