-
Notifications
You must be signed in to change notification settings - Fork 747
feat(stepfunctions): Enable execution details page #7578
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
chungjac
merged 7 commits into
aws:feature/stepfunctions-execution
from
l0minous:ExecutionDetailWrapper
Jul 4, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8f87b49
feat(stepfunctions): enable hardcoded execution details page
ea965d9
feat(stepfunctions): enable hardcoded execution details page
2a8f022
Reverting changes
5a1e389
Deleting Changelog
4c744e6
Handling naming issues
ddde043
removing unused properties
7ea9aaa
Implemented common context for both WebviewContext and ExecutionDetai…
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
75 changes: 75 additions & 0 deletions
75
packages/core/src/stepFunctions/executionDetails/handleMessage.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,75 @@ | ||
| /* | ||
| /*! | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { | ||
| Command, | ||
| Message, | ||
| MessageType, | ||
| ExecutionDetailsContext, | ||
| ApiCallRequestMessage, | ||
| InitResponseMessage, | ||
| } from '../messageHandlers/types' | ||
| import { | ||
| loadStageMessageHandler, | ||
| handleUnsupportedMessage, | ||
| apiCallMessageHandler, | ||
| } from '../messageHandlers/handleMessageHelpers' | ||
|
|
||
| /** | ||
| * Handles messages received from the ExecutionDetails webview. Depending on the message type and command, | ||
| * calls the appropriate handler function | ||
| * @param message The message received from the webview | ||
| * @param context The context object containing information about the execution details webview environment | ||
| */ | ||
| export async function handleMessage(message: Message, context: ExecutionDetailsContext) { | ||
l0minous marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const { command, messageType } = message | ||
| if (messageType === MessageType.REQUEST) { | ||
| switch (command) { | ||
| case Command.INIT: | ||
| void initMessageHandler(context) | ||
| break | ||
| case Command.API_CALL: | ||
| void apiCallMessageHandler(message as ApiCallRequestMessage, context) | ||
| break | ||
| default: | ||
| void handleUnsupportedMessage(context, message) | ||
| break | ||
| } | ||
| } else if (messageType === MessageType.BROADCAST) { | ||
| switch (command) { | ||
| case Command.LOAD_STAGE: | ||
| void loadStageMessageHandler(context) | ||
| break | ||
| default: | ||
| void handleUnsupportedMessage(context, message) | ||
| break | ||
| } | ||
| } else { | ||
| void handleUnsupportedMessage(context, message) | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Handler for when the webview is ready. | ||
| * This handler is used to initialize the webview with execution details. | ||
| * @param context The context object containing the necessary information for the webview. | ||
| */ | ||
| async function initMessageHandler(context: ExecutionDetailsContext) { | ||
| try { | ||
| await context.panel.webview.postMessage({ | ||
| messageType: MessageType.BROADCAST, | ||
| command: Command.INIT, | ||
| executionArn: context.executionArn, | ||
| }) | ||
| } catch (e) { | ||
| await context.panel.webview.postMessage({ | ||
| messageType: MessageType.RESPONSE, | ||
| command: Command.INIT, | ||
| isSuccess: false, | ||
| failureReason: (e as Error).message, | ||
| } as InitResponseMessage) | ||
| } | ||
| } | ||
47 changes: 47 additions & 0 deletions
47
packages/core/src/stepFunctions/messageHandlers/handleMessageHelpers.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,47 @@ | ||
| /* | ||
| /*! | ||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { Command, Message, MessageType, BaseContext, ApiCallRequestMessage, UnsupportedMessage } from './types' | ||
| import { StepFunctionApiHandler } from './stepFunctionApiHandler' | ||
| import globals from '../../shared/extensionGlobals' | ||
| import { getLogger } from '../../shared/logger/logger' | ||
|
|
||
| /** | ||
| * Handler for managing webview stage load, which updates load notifications. | ||
| * @param context The context object containing the necessary information for the webview. | ||
| */ | ||
| export async function loadStageMessageHandler(context: BaseContext) { | ||
| context.loaderNotification?.progress.report({ increment: 25 }) | ||
| setTimeout(() => { | ||
| context.loaderNotification?.resolve() | ||
| }, 100) | ||
| } | ||
|
|
||
| /** | ||
| * Handler for making API calls from the webview and returning the response. | ||
| * @param request The request message containing the API to call and the parameters | ||
| * @param context The webview context used for returning the API response to the webview | ||
| */ | ||
| export function apiCallMessageHandler(request: ApiCallRequestMessage, context: BaseContext) { | ||
| const logger = getLogger('stepfunctions') | ||
| const apiHandler = new StepFunctionApiHandler(globals.awsContext.getCredentialDefaultRegion(), context) | ||
| apiHandler.performApiCall(request).catch((error) => logger.error('%s API call failed: %O', request.apiName, error)) | ||
| } | ||
|
|
||
| /** | ||
| * Handles unsupported or unrecognized messages by sending a response to the webview. Ensures compatibility with future | ||
| * commands and message types, preventing issues if the user has an outdated extension version. | ||
| * @param context The context object containing information about the webview environment | ||
| * @param command The command received from the webview | ||
| * @param messageType The type of the message received | ||
| */ | ||
| export async function handleUnsupportedMessage(context: BaseContext, originalMessage: Message) { | ||
| await context.panel.webview.postMessage({ | ||
| messageType: MessageType.RESPONSE, | ||
| command: Command.UNSUPPORTED_COMMAND, | ||
| originalMessage, | ||
| } as UnsupportedMessage) | ||
| } |
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.