-
Notifications
You must be signed in to change notification settings - Fork 141
Fix incorrect column order in the pipelines table #6592
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import type { PipelineThumb } from '$lib/services/pipelineManager' | |
| import type { useUpdatePipelineList } from './pipelines/usePipelineList.svelte' | ||
|
|
||
| export const duplicatePipelineTooltip = | ||
| 'Pipeline storage and state are not duplicated. The new pipeline starts fresh.' | ||
| 'The connectors are preserved. Pipeline storage and state are not copied - the new pipeline starts fresh.' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not entirely sure what "preserved" means. Does it mean the code is the same, or that the state of the storage systems behind the connectors is also somehow preserved? |
||
|
|
||
| export const MAX_DUPLICATE_ATTEMPTS = 10_000 | ||
|
|
||
|
|
||
68 changes: 68 additions & 0 deletions
68
js-packages/web-console/src/lib/functions/pipelines/status.spec.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,68 @@ | ||
| /** | ||
| * Unit tests for `deletePipelineDisabledReason`, the helper that names why a | ||
| * pipeline cannot be deleted. It mirrors the pipeline-manager's delete | ||
| * preconditions (fully stopped, storage cleared), so the tests walk the same | ||
| * two blockers and their resolution order. | ||
| */ | ||
| import { describe, expect, it } from 'vitest' | ||
| import type { StorageStatus } from '$lib/services/manager' | ||
| import type { PipelineStatus } from '$lib/services/pipelineManager' | ||
| import { deletePipelineDisabledReason } from './status' | ||
|
|
||
| describe('deletePipelineDisabledReason', () => { | ||
| it('allows deletion once the pipeline is stopped and storage is cleared', () => { | ||
| expect(deletePipelineDisabledReason('Stopped', 'Cleared', false)).toBeUndefined() | ||
| }) | ||
|
|
||
| it('reports when the pipeline is already deleted', () => { | ||
| expect(deletePipelineDisabledReason('Stopped', 'Cleared', true)).toBe( | ||
| 'This pipeline has already been deleted.' | ||
| ) | ||
| }) | ||
|
|
||
| it('asks to stop the pipeline while it is still running', () => { | ||
| expect(deletePipelineDisabledReason('Running', 'Cleared', false)).toBe('Stop the pipeline to delete it.') | ||
| }) | ||
|
|
||
| // Stop takes priority: a running pipeline always holds its storage, so naming | ||
| // storage first would send the user down a step they cannot take yet. | ||
| it('asks to stop first even when storage is still in use', () => { | ||
| expect(deletePipelineDisabledReason('Running', 'InUse', false)).toBe('Stop the pipeline to delete it.') | ||
| }) | ||
|
|
||
| it('asks to clear storage when stopped but storage is in use', () => { | ||
| expect(deletePipelineDisabledReason('Stopped', 'InUse', false)).toBe( | ||
| 'Clear the pipeline storage to delete it.' | ||
| ) | ||
| }) | ||
|
|
||
| it('asks to wait while storage is mid-clear', () => { | ||
| expect(deletePipelineDisabledReason('Stopped', 'Clearing', false)).toBe( | ||
| 'Wait for storage to finish clearing to delete the pipeline.' | ||
| ) | ||
| }) | ||
|
Karakatiza666 marked this conversation as resolved.
|
||
|
|
||
| // A pipeline in an error state is fully stopped, so cleared storage unblocks | ||
| // deletion just as it does for the normal Stopped state. | ||
| it('treats error states as stopped', () => { | ||
| const errorStates: PipelineStatus[] = ['SqlError', 'RustError', 'SystemError'] | ||
| for (const status of errorStates) { | ||
| expect(deletePipelineDisabledReason(status, 'Cleared', false)).toBeUndefined() | ||
| expect(deletePipelineDisabledReason(status, 'InUse', false)).toBe( | ||
| 'Clear the pipeline storage to delete it.' | ||
| ) | ||
| } | ||
| }) | ||
|
|
||
| // Transitional states are not fully stopped, so deletion stays blocked on stop | ||
| // regardless of the storage state. | ||
| it('blocks on stop for transitional states', () => { | ||
| const transitional: PipelineStatus[] = ['Pausing', 'Resuming', 'Stopping', 'Suspending'] | ||
| const anyStorage: StorageStatus[] = ['Cleared', 'InUse', 'Clearing'] | ||
| for (const status of transitional) { | ||
| for (const storage of anyStorage) { | ||
| expect(deletePipelineDisabledReason(status, storage, false)).toBe('Stop the pipeline to delete it.') | ||
| } | ||
| } | ||
| }) | ||
| }) | ||
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
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.
this works only if there's a single table in the whole document
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.
At the time of this test there is, but I'll narrow down the selection just to be safe