unstract
unstract copied to clipboard
feat: UN-1983 BE API changes for file centric logging
What
-
Updated execution time in WF and file execution models
-
Added data migrations for older records
-
MINOR: Storing
enum.valuein file execution table -
From #1131
- Added new field
total_filesto WF execution model - Added
successful_filesandfailed_filesfields to execution serializer - Changes to calculate
total_filesbefore an execution begins - MINOR: Checked and changed typing of
workflow_executionarg in some functions - NOTE: The
total_filesvalue will not be filled for existing records but it can be handled with a data migration if required
- Added new field
-
From #1132
- Updated status field for below models to use
TextChoicescorrectly- WorkflowExecution
- WorkflowFileExecution
- FileHistory
- Updated usage of this enum across
backend - MINOR: Fixed bug with
log_levelfor latest_log` while listing files - Added retrieve API for executions to obtain by execution ID
- Updated status field for below models to use
Why
- Previously was not calculated, need it for file centric logging enhancements
How
- Update execution time whenever the status is one of ERROR / COMPLETED / STOPPED
Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
- No, updated a previously empty value
Database Migrations
WorkflowFileExecution- data migration to- rename statuses correctly
- update execution time as
modified_at - created_at
WorkflowExecution- data migration to- update execution time as
modified_at - created_at
- update execution time as
Related Issues or PRs
- UN-1983
- Merged PRs into this branch
- #1131
- #1132
Notes on Testing
- Tried executing and noticed these values were updated correctly
- Migration ran without issues
Screenshots
-
After migration with updated times and statuses
-
From #1131
Checklist
I have read and understood the Contribution Guidelines.
| filepath | function | $$\textcolor{#23d18b}{\tt{passed}}$$ | SUBTOTAL |
|---|---|---|---|
| $$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ | $$\textcolor{#23d18b}{\tt{test\_logs}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ |
| $$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ | $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ |
| $$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ | $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ |
| $$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ | $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ |
| $$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ | $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ |
| $$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ | $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ |
| $$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ | $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ |
| $$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ | $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ |
| $$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ | $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ | $$\textcolor{#23d18b}{\tt{1}}$$ |
| $$\textcolor{#23d18b}{\tt{TOTAL}}$$ | $$\textcolor{#23d18b}{\tt{9}}$$ | $$\textcolor{#23d18b}{\tt{9}}$$ |
Quality Gate passed
Issues
5 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code