Skip to content
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

Drop all the foreign keys on artifacts table except for the organization_id #1352

Merged
merged 2 commits into from
Dec 8, 2024

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Dec 8, 2024

"


Important

Remove foreign keys from artifacts table except organization_id and update ArtifactModel accordingly.

  • Database Migration:
    • In 2024_12_08_0131-8069e38dc1b4_drop_all_the_foreign_keys_on_artifacts_.py, drop foreign keys on artifacts table except organization_id.
    • Add org_observer_cruise_index index on artifacts table.
  • Model Changes:
    • In models.py, remove ForeignKey constraints from workflow_run_id, workflow_run_block_id, observer_cruise_id, and observer_thought_id in ArtifactModel.
    • Add org_observer_cruise_index index to ArtifactModel.

This description was created by Ellipsis for 848e112. It will automatically update as commits are pushed.


\n"

"<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Add support for observer artifact creation in `ArtifactManager` with new schema models and database updates.
>
>   - **Artifact Manager**:
>     - Adds `create_observer_thought_artifact()` in `manager.py` for creating observer thought artifacts.
>     - Introduces `_create_artifact()` as a helper method in `manager.py`.
>   - **Schemas**:
>     - Adds `ObserverCruise` and `ObserverThought` models in `schemas/observers.py`.
>     - Defines `ObserverCruiseStatus` enum for cruise status.
>   - **Database Models**:
>     - Renames `ObserverCruise` to `ObserverCruiseModel` and `ObserverThought` to `ObserverThoughtModel` in `models.py`.
>   - **Storage**:
>     - Adds `build_observer_thought_uri()` and `build_observer_cruise_uri()` in `base.py`, `local.py`, and `s3.py` for URI construction.
>   - **Misc**:
>     - Updates `convert_to_artifact()` in `utils.py` to handle new fields.
>
> <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 703d4a6c7efe742d40e7bea91cba13b04fcfe558. It will automatically update as commits are pushed.</sup>

----

<!-- ELLIPSIS_HIDDEN -->\n"
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 7624b8d in 26 seconds

More details
  • Looked at 24 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_I1j66rlcXDcqDoFH


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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing ForeignKey constraints for workflow_run_id, workflow_run_block_id, observer_cruise_id, and observer_thought_id in ArtifactModel can lead to data integrity issues. Consider keeping these constraints to ensure referential integrity.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 7624b8d in 29 seconds

More details
  • Looked at 24 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_YDMJ1oJvKlUDeFd2


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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing foreign key constraints from workflow_run_id, workflow_run_block_id, observer_cruise_id, and observer_thought_id may lead to data integrity issues. Consider keeping these constraints if these fields are meant to reference existing records.

@wintonzheng wintonzheng changed the title Observer artifact creation Drop all the foreign keys on artifacts table except for the organization_id Dec 8, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 848e112 in 7 seconds

More details
  • Looked at 63 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. alembic/versions/2024_12_08_0131-8069e38dc1b4_drop_all_the_foreign_keys_on_artifacts_.py:1
  • Draft comment:
    Typo in docstring: 'orgnaization_id' should be 'organization_id'.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions dropping foreign keys except for organization_id, but the docstring in the migration script has a typo in 'organization_id'.

Workflow ID: wflow_Q364kwexdMHIr9AK


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@wintonzheng wintonzheng merged commit 620b5bf into main Dec 8, 2024
2 checks passed
@wintonzheng wintonzheng deleted the repo-sync/shu/observer_artifacts branch December 8, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant