Skip to content

Commit

Permalink
Fixed Template Update Location and Improved Logger Statements in Repr…
Browse files Browse the repository at this point in the history
…ovisionWorkflowTransportAction

Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Oct 17, 2024
1 parent db24699 commit 2f0b9ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
### Features
### Enhancements
### Bug Fixes
- Fixed Template Update Location and Improved Logger Statements in ReprovisionWorkflowTransportAction.java ([#918](https://github.com/opensearch-project/flow-framework/pull/918))
### Infrastructure
- Set Java target compatibility to JDK 21 ([#730](https://github.com/opensearch-project/flow-framework/pull/730))
- Add knowledge base alert agent into sample templates ([#874](https://github.com/opensearch-project/flow-framework/pull/874))

### Documentation
- Add alert summary agent template ([#873](https://github.com/opensearch-project/flow-framework/pull/873))

Expand All @@ -25,6 +25,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
- Incrementally remove resources from workflow state during deprovisioning ([#898](https://github.com/opensearch-project/flow-framework/pull/898))

### Bug Fixes
- Fixed Template Update Location and Improved Logger Statements in ReprovisionWorkflowTransportAction.java ([#918](https://github.com/opensearch-project/flow-framework/pull/918))
### Infrastructure
### Documentation
- Add query assist data summary agent into sample templates ([#875](https://github.com/opensearch-project/flow-framework/pull/875))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@ private void executeWorkflowAsync(
) {
try {
threadPool.executor(PROVISION_WORKFLOW_THREAD_POOL).execute(() -> {
updateTemplate( template,workflowId);
executeWorkflow(workflowSequence, workflowId); });
updateTemplate(template, workflowId);
executeWorkflow(workflowSequence, workflowId);
});

Check warning on line 276 in src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java#L273-L276

Added lines #L273 - L276 were not covered by tests
} catch (Exception exception) {
listener.onFailure(new FlowFrameworkException("Failed to execute workflow " + workflowId, ExceptionsHelper.status(exception)));
}
Expand All @@ -283,17 +284,14 @@ private void executeWorkflowAsync(
* @param template The template to store after reprovisioning completes successfully
* @param workflowId The workflowId associated with the workflow that is executing
*/
private void updateTemplate ( Template template, String workflowId) {
flowFrameworkIndicesHandler.updateTemplateInGlobalContext(
workflowId,
template,
ActionListener.wrap(templateResponse -> {
logger.info("Updated template for {}", workflowId, State.COMPLETED);
}, exception -> {
String errorMessage = "Failed to update use case template for " + workflowId;
logger.error(errorMessage, exception);
}),
true // ignores NOT_STARTED state if request is to reprovision
private void updateTemplate(Template template, String workflowId) {
flowFrameworkIndicesHandler.updateTemplateInGlobalContext(workflowId, template, ActionListener.wrap(templateResponse -> {
logger.info("Updated template for {}", workflowId, State.COMPLETED);
}, exception -> {
String errorMessage = "Failed to update use case template for " + workflowId;
logger.error(errorMessage, exception);
}),

Check warning on line 293 in src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java#L288-L293

Added lines #L288 - L293 were not covered by tests
true // ignores NOT_STARTED state if request is to reprovision
);
}

Check warning on line 296 in src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/transport/ReprovisionWorkflowTransportAction.java#L296

Added line #L296 was not covered by tests

Expand Down

0 comments on commit 2f0b9ee

Please sign in to comment.