-
Notifications
You must be signed in to change notification settings - Fork 746
feat(stepfunctions): Supporting Express Executions in Execution Details #7664
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
laileni-aws
merged 1 commit into
aws:feature/stepfunctions-execution
from
l0minous:ExpressExecutions
Jul 22, 2025
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
39 changes: 39 additions & 0 deletions
39
packages/core/src/stepFunctions/commands/viewExecutionDetails.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,39 @@ | ||
| /*! | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import * as vscode from 'vscode' | ||
| import * as nls from 'vscode-nls' | ||
| import { AwsContext } from '../../shared/awsContext' | ||
| import { ExecutionDetailProvider } from '../executionDetails/executionDetailProvider' | ||
| import { ViewExecutionDetailsWizard } from '../wizards/viewExecutionDetailsWizard' | ||
|
|
||
| const localize = nls.loadMessageBundle() | ||
|
|
||
| interface ViewExecutionDetailsParams { | ||
| awsContext: AwsContext | ||
| outputChannel: vscode.OutputChannel | ||
| } | ||
|
|
||
| export async function viewExecutionDetails(params: ViewExecutionDetailsParams): Promise<void> { | ||
| try { | ||
| const wizard = new ViewExecutionDetailsWizard() | ||
| const wizardResponse = await wizard.run() | ||
|
|
||
| if (wizardResponse) { | ||
| const { executionArn, startTime } = wizardResponse | ||
|
|
||
| await ExecutionDetailProvider.openExecutionDetails(executionArn, startTime) | ||
| } | ||
| } catch (error) { | ||
| const errorMessage = localize( | ||
| 'AWS.stepFunctions.viewExecutionDetails.error.general', | ||
| 'Failed to view execution details' | ||
| ) | ||
|
|
||
| params.outputChannel.appendLine('') | ||
| params.outputChannel.appendLine(errorMessage) | ||
| params.outputChannel.show() | ||
| } | ||
| } |
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
109 changes: 109 additions & 0 deletions
109
packages/core/src/stepFunctions/wizards/viewExecutionDetailsWizard.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,109 @@ | ||
| /*! | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import * as nls from 'vscode-nls' | ||
| const localize = nls.loadMessageBundle() | ||
|
|
||
| import { createCommonButtons } from '../../shared/ui/buttons' | ||
| import { createInputBox, InputBoxPrompter } from '../../shared/ui/inputPrompter' | ||
| import { Wizard } from '../../shared/wizards/wizard' | ||
| import { validate } from '@aws-sdk/util-arn-parser' | ||
| import { isExpressExecution } from '../utils' | ||
|
|
||
| function createExecutionArnPrompter(): InputBoxPrompter { | ||
| function validateArn(value: string): string | undefined { | ||
| if (!value) { | ||
| return localize( | ||
| 'AWS.stepFunctions.viewExecutionDetails.executionArn.validation.empty', | ||
| 'Execution ARN cannot be empty' | ||
| ) | ||
| } | ||
|
|
||
| if (!validate(value)) { | ||
| return localize( | ||
| 'AWS.stepFunctions.viewExecutionDetails.executionArn.validation.invalid', | ||
l0minous marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'Invalid ARN format. Please provide a valid Step Functions execution ARN' | ||
| ) | ||
| } | ||
|
|
||
| return undefined | ||
| } | ||
|
|
||
| const prompter = createInputBox({ | ||
| title: localize('AWS.stepFunctions.viewExecutionDetails.executionArn.title', 'Enter Execution ARN'), | ||
| placeholder: | ||
| 'arn:aws:states:us-east-1:123456789012:execution:MyStateMachine:12345678-1234-1234-1234-123456789012', | ||
| validateInput: validateArn, | ||
| buttons: createCommonButtons(), | ||
| }) | ||
|
|
||
| return prompter | ||
| } | ||
|
|
||
| function createStartTimePrompter(): InputBoxPrompter { | ||
| function validateStartTime(value: string): string | undefined { | ||
| if (!value) { | ||
| return localize( | ||
| 'AWS.stepFunctions.viewExecutionDetails.startTime.validation.empty', | ||
| 'Start time cannot be empty for express executions' | ||
| ) | ||
| } | ||
|
|
||
| // Checking if the value is a numeric string (Unix timestamp) | ||
| if (/^\d+$/.test(value)) { | ||
| const timestamp = Number(value) | ||
| const date = new Date(timestamp) | ||
| if (!isNaN(date.getTime())) { | ||
| return undefined | ||
| } | ||
| } | ||
|
|
||
| // parsing ISO date format | ||
| const date = new Date(value) | ||
| if (isNaN(date.getTime())) { | ||
| return localize( | ||
| 'AWS.stepFunctions.viewExecutionDetails.startTime.validation.invalid', | ||
| 'Invalid time format. Use Unix timestamp or ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ)' | ||
| ) | ||
| } | ||
|
|
||
| return undefined | ||
| } | ||
|
|
||
| const prompter = createInputBox({ | ||
| title: localize('AWS.stepFunctions.viewExecutionDetails.startTime.title', 'Enter Start Time'), | ||
| placeholder: localize( | ||
| 'AWS.stepFunctions.viewExecutionDetails.startTime.placeholder', | ||
| 'Start time of the express execution (e.g., 2023-12-01T10:00:00.000Z)' | ||
| ), | ||
| validateInput: validateStartTime, | ||
| buttons: createCommonButtons(), | ||
| }) | ||
|
|
||
| return prompter | ||
| } | ||
|
|
||
| export interface ViewExecutionDetailsWizardState { | ||
| readonly executionArn: string | ||
| readonly startTime?: string | ||
| } | ||
|
|
||
| export class ViewExecutionDetailsWizard extends Wizard<ViewExecutionDetailsWizardState> { | ||
| public constructor() { | ||
| super() | ||
| const form = this.form | ||
|
|
||
| form.executionArn.bindPrompter(() => createExecutionArnPrompter()) | ||
|
|
||
| form.startTime.bindPrompter(() => createStartTimePrompter(), { | ||
| showWhen: (state) => { | ||
| if (!state.executionArn) { | ||
| return false | ||
| } | ||
| return isExpressExecution(state.executionArn) | ||
| }, | ||
| }) | ||
| } | ||
| } | ||
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.
nit:
Do we have dispose events for this Webview?
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.
There arent any currently but maybe later if something that needs to be disposed is added