Merged
Conversation
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes several bugs related to evidence creation timing and validation in workflow and step execution status updates. The main issue being addressed is that evidence was being created before status updates, which could lead to inconsistencies. The PR moves evidence creation to occur after status updates and relaxes validation to handle both pre- and post-transition states.
Changes:
- Moved evidence creation from before to after status updates in both workflow and step execution services
- Added early returns when status update is a no-op (status already matches target)
- Fixed a typo where "complete" should have been "completed" in evidence validation
- Updated validation to allow evidence creation for both pending/in_progress states (started) and in_progress/completed states (completed)
- Fixed step execution service to load due_date field when needed for setDueDateIfNeeded logic
- Updated tests to reflect that evidence now captures the post-transition status
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/workflow/evidence.go | Relaxed validation to allow evidence creation in both pre- and post-transition states; fixed typo changing "complete" to "completed" |
| internal/service/relational/workflows/workflow_execution_service.go | Moved evidence creation to after status update; added early return for no-op updates |
| internal/service/relational/workflows/step_execution_service.go | Moved evidence creation to after status update; added early return for no-op updates; added due_date to Select calls for setDueDateIfNeeded |
| internal/workflow/evidence_test.go | Updated test expectations to reflect post-transition status; improved test names and comments for clarity |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.