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

Seed data fix #32

Merged
merged 6 commits into from
Jun 26, 2023
Merged

Seed data fix #32

merged 6 commits into from
Jun 26, 2023

Conversation

omar-selo
Copy link
Collaborator

Looks like previous PRs broke scripts/seed_data.py as we changed the endpoint. Additionally, after adding a test to seed_data function and making it fail on none success status codes. I found an actual bug with get_or_create approach as sometimes the properties that should be included in creation of model shouldn't be included in querying. E.g. if we try to create an artefact and it fails due to unique constraints, then there is already an artefact with the same name, version and source combo. But if we query for this artefact with a different stage than it is in, we wont find it.

@omar-selo omar-selo requested a review from nadzyah June 22, 2023 11:43
@@ -97,10 +98,10 @@
]


def seed_data():
def seed_data(client: TestClient | requests.Session):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I really dislike adding TestClient type here. But didn't find a way around it other than using Any which is worse

@omar-selo omar-selo merged commit a913988 into main Jun 26, 2023
@omar-selo omar-selo deleted the seed_data_fix branch June 26, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants