-
Notifications
You must be signed in to change notification settings - Fork 786
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
create observer tables #1351
create observer tables #1351
Conversation
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Add `observer_cruises` and `observer_thoughts` tables, modify `artifacts` table with new columns, indexes, and constraints. > > - **Database Schema**: > - Create `observer_cruises` table with columns `observer_cruise_id`, `status`, `organization_id`, `workflow_run_id`, `workflow_id` and foreign keys. > - Create `observer_thoughts` table with columns `observer_thought_id`, `organization_id`, `observer_cruise_id`, `workflow_run_id`, `workflow_run_block_id`, `workflow_id`, `user_input`, `observation`, `thought`, `answer` and foreign keys. > - **Artifacts Table**: > - Add columns `workflow_run_id`, `workflow_run_block_id`, `observer_cruise_id`, `observer_thought_id` to `artifacts` table. > - Add `org_workflow_run_index` and `org_observer_cruise_index` indexes to `artifacts` table. > - Add foreign key constraints to `artifacts` table for new columns. > - **Downgrade Function**: > - Update `downgrade()` to drop `observer_thoughts` and `observer_cruises` tables and remove new columns and constraints from `artifacts`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for a0b4c18459c7824c8084933697e948151cad8776. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
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.
👍 Looks good to me! Incremental review on db58708 in 27 seconds
More details
- Looked at
443
lines of code in9
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. skyvern/forge/sdk/artifact/manager.py:11
- Draft comment:
The import ofObserverThought
has been removed, but ensure that all related functionality and references are also removed or refactored accordingly. - Reason this comment was not posted:
Confidence changes required:50%
The removal of theObserverThought
import inmanager.py
is correct since the related functionality has been removed. However, theObserverThought
class is still present in the codebase, which might indicate incomplete removal or refactoring.
2. skyvern/forge/sdk/artifact/manager.py:19
- Draft comment:
The_create_artifact
method has been removed and its logic consolidated intocreate_artifact
. Ensure that all previous use cases and parameters are still covered by the new implementation. - Reason this comment was not posted:
Confidence changes required:50%
Thecreate_artifact
method inmanager.py
has been refactored to remove the_create_artifact
method and consolidate the logic. This is a good change for simplicity, but ensure that all previous use cases are still covered.
3. skyvern/forge/sdk/artifact/manager.py:62
- Draft comment:
Theprimary_key
parameter has been removed fromupdate_artifact_data
. Ensure thattask_id
is always available and used correctly, asobserver_thought_id
handling has been removed. - Reason this comment was not posted:
Confidence changes required:50%
Theupdate_artifact_data
method inmanager.py
has been simplified by removing theprimary_key
parameter. This change assumes thattask_id
is always available, which might not be the case ifobserver_thought_id
was previously used. Verify that this assumption holds true.
4. skyvern/forge/sdk/db/models.py:170
- Draft comment:
Foreign key constraints forworkflow_run_id
,workflow_run_block_id
,observer_cruise_id
, andobserver_thought_id
have been removed. Ensure that this does not lead to data integrity issues if these fields are still used elsewhere. - Reason this comment was not posted:
Confidence changes required:50%
TheArtifactModel
inmodels.py
has removed foreign key constraints forworkflow_run_id
,workflow_run_block_id
,observer_cruise_id
, andobserver_thought_id
. This could lead to data integrity issues if these fields are still used elsewhere.
5. skyvern/forge/sdk/db/models.py:510
- Draft comment:
ObserverCruiseModel
andObserverThoughtModel
have been renamed toObserverCruise
andObserverThought
. Ensure all references to these models are updated accordingly. - Reason this comment was not posted:
Confidence changes required:50%
TheObserverCruiseModel
andObserverThoughtModel
have been renamed toObserverCruise
andObserverThought
respectively inmodels.py
. This change should be reflected in all references to these models.
Workflow ID: wflow_MKxhpGsYLqbwD5bQ
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
❌ Changes requested. Reviewed everything up to db58708 in 44 seconds
More details
- Looked at
445
lines of code in9
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. skyvern/forge/sdk/artifact/manager.py:11
- Draft comment:
The removal of theObserverThought
import is consistent with the removal of related methods and is a good cleanup step. - Reason this comment was not posted:
Confidence changes required:0%
The removal of theObserverThought
import frommanager.py
andbase.py
files is consistent with the removal of thecreate_observer_thought_artifact
method and related methods. This is a good cleanup step.
2. skyvern/forge/sdk/artifact/manager.py:19
- Draft comment:
The refactoring ofcreate_artifact
to remove the_create_artifact
helper method simplifies the code and reduces redundancy. - Reason this comment was not posted:
Confidence changes required:0%
Thecreate_artifact
method inmanager.py
has been refactored to remove the_create_artifact
helper method. This simplifies the code and reduces redundancy, which is a positive change.
3. skyvern/forge/sdk/artifact/manager.py:62
- Draft comment:
The simplification ofupdate_artifact_data
by removing theprimary_key
parameter and related logic makes the method more straightforward and easier to maintain. - Reason this comment was not posted:
Confidence changes required:0%
Theupdate_artifact_data
method inmanager.py
has been simplified by removing theprimary_key
parameter and related logic. This change makes the method more straightforward and easier to maintain.
4. skyvern/forge/sdk/artifact/models.py:62
- Draft comment:
The addition of detailed field descriptions and examples in theArtifact
model improves documentation and usability. - Reason this comment was not posted:
Confidence changes required:0%
TheArtifact
model inmodels.py
has been updated to include detailed field descriptions and examples. This improves the documentation and usability of the model.
5. skyvern/forge/sdk/artifact/storage/base.py:6
- Draft comment:
Consider movingFILE_EXTENTSION_MAP
to be part of theArtifactType
model for better organization. - Reason this comment was not posted:
Confidence changes required:30%
TheFILE_EXTENTSION_MAP
inbase.py
is a dictionary mappingArtifactType
to file extensions. The comment suggests it should be part of theArtifactType
model, which would be a more organized approach.
6. skyvern/forge/sdk/db/client.py:183
- Draft comment:
The removal of unused parameters increate_artifact
reduces complexity and potential confusion. - Reason this comment was not posted:
Confidence changes required:0%
Thecreate_artifact
method inclient.py
has been updated to remove unused parameters. This is a good practice as it reduces complexity and potential confusion.
Workflow ID: wflow_fxx4gK9akTE3YBPv
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
workflow_run_block_id = Column(String, ForeignKey("workflow_run_blocks.workflow_run_block_id")) | ||
observer_cruise_id = Column(String, ForeignKey("observer_cruises.observer_cruise_id")) | ||
observer_thought_id = Column(String, ForeignKey("observer_thoughts.observer_thought_id")) | ||
workflow_run_id = Column(String) |
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.
The workflow_run_id
, workflow_run_block_id
, observer_cruise_id
, and observer_thought_id
columns should have foreign key constraints to ensure data integrity, as mentioned in the PR description.
Important
Add
observer_cruises
andobserver_thoughts
tables, modifyartifacts
table, and refactor related code for improved database schema and codebase organization.observer_cruises
table with columnsobserver_cruise_id
,status
,organization_id
,workflow_run_id
,workflow_id
.observer_thoughts
table with columnsobserver_thought_id
,organization_id
,observer_cruise_id
,workflow_run_id
,workflow_run_block_id
,workflow_id
,user_input
,observation
,thought
,answer
.artifacts
table by adding columnsworkflow_run_id
,workflow_run_block_id
,observer_cruise_id
,observer_thought_id
.org_workflow_run_index
,org_observer_cruise_index
toartifacts
table.artifacts
table for new columns.ObserverThought
andObserverCruise
inmanager.py
,base.py
,local.py
,s3.py
.create_artifact
andupdate_artifact_data
methods inmanager.py
by removing unnecessary parameters.Artifact
model inmodels.py
to include new fields and descriptions.downgrade()
function to dropobserver_thoughts
andobserver_cruises
tables and remove new columns and constraints fromartifacts
.This description was created by for db58708. It will automatically update as commits are pushed.