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

Replace family and stage tables with enum fields #238

Merged
merged 28 commits into from
Jan 7, 2025

Conversation

omar-selo
Copy link
Collaborator

Description

Changes:

  • Add stage and family fields to artefact entity
  • Drop stage and family tables
  • Some changes to add user tests to make it faster by avoiding an actual request being made

Reasoning:
Families and stages were first introduced as tables with the idea of it being easier to add families in the future. That turned out not to be so simple though. Adding families requires specific code changes for each family. Hence the code base ended up knowing the families and in fact using them in conditionals. That beats the purpose of storing them as data tables. So this PR removes these tables. Doing so simplified our queries as it avoids the need for joins to figure out an artefact's family or stage.

Resolved issues

A refactor to help towards https://warthogs.atlassian.net/browse/RTW-301

Documentation

Web service API changes

  • The name of the first column of reports endpoints has been changed from Family.name to Artefact.family (these endpoints are only used by us)

Tests

Updated tests.

Comment on lines +31 to +37
class StageName(str, Enum):
proposed = "proposed"
updates = "updates"
edge = "edge"
beta = "beta"
candidate = "candidate"
stable = "stable"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could further distinguish between the stages of each family. But I think that's not necessary right now

@omar-selo omar-selo requested a review from nadzyah January 7, 2025 12:12
Copy link
Collaborator

@nadzyah nadzyah left a comment

Choose a reason for hiding this comment

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

This is a big change, but everything looks fine. I've double-checked it :)

backend/test_observer/data_access/models.py Show resolved Hide resolved
@omar-selo omar-selo merged commit e5a848b into main Jan 7, 2025
1 check passed
@omar-selo omar-selo deleted the replace-family-and-stage-tables-with-enum-fields branch January 7, 2025 14:23
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