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

Database: models for group of chroots #1327

Closed
4 tasks
Tracked by #1848
lachmanfrantisek opened this issue Jan 19, 2022 · 4 comments · Fixed by #1787
Closed
4 tasks
Tracked by #1848

Database: models for group of chroots #1327

lachmanfrantisek opened this issue Jan 19, 2022 · 4 comments · Fixed by #1787
Assignees
Labels
area/database Related to the Packit's database kind/refactor Technical debt - the code needs love.

Comments

@lachmanfrantisek
Copy link
Member

lachmanfrantisek commented Jan 19, 2022

Follow-up for: packit/research#128

We need to store information about a group of related chroot-builds that were triggered together.

  • Create a new model for each type (Koji, Copr, TF) with a clear name
  • Provide a migration script that tries to group the already present chroot models (by Copr build id, timestamp, ...)
  • Improve/enhance/fix the API endpoint to be able to show both chroot-info and grouped-info.
  • Make sure that the newly created models are utilized in the existing code base
@lachmanfrantisek lachmanfrantisek added kind/refactor Technical debt - the code needs love. area/database Related to the Packit's database labels Jan 19, 2022
@FrNecas
Copy link

FrNecas commented Feb 1, 2022

Result from today's discussion on Fedora chat about model naming, there is a slight change from the initial research doc, the naming should be explicit so using Group inside the grouped model name seems to be the best way to go. For example, CoprBuildTarget will represent a single build in copr (the word target is used instead of chroot for more clarity) and CoprBuildGroup for the grouping model. Similarly for TF & Koji

softwarefactory-project-zuul bot added a commit that referenced this issue Feb 17, 2022
Improvements to DB model names

Summary of the changes:

Renamed RunModel to PipelineModel
Renamed InstallationModel to GithubInstallationModel
Renamed Koji, Copr and TF models, they now contain the word Target to emphasize that it's a single build/test run (to enable creation of group models, see comment in  #1327 )

Fixes #1326

N/A

Reviewed-by: None <None>
Reviewed-by: František Nečas <None>
Reviewed-by: Matej Focko <None>
Reviewed-by: Tomas Tomecek <tomas@tomecek.net>
@stale

This comment was marked as outdated.

@stale stale bot added the stale Is the issue still valid? label Apr 16, 2022
@stale stale bot closed this as completed Apr 30, 2022
@TomasTomecek TomasTomecek removed the stale Is the issue still valid? label Jun 1, 2022
@TomasTomecek TomasTomecek reopened this Jun 1, 2022
@nikromen
Copy link
Member

When providing the database scheme (the first subtask) you can get inspired by ProposeDownstreamModel - ProposeDownstreamTargetModel scheme.

@stale
Copy link

stale bot commented Nov 2, 2022

This issue has been marked as stale because it hasn't seen any
activity for the last 60 days.

Stale issues are closed after 14 days, unless the label is removed
by a maintainer or someone comments on it.

This is done in order to ensure that open issues are still relevant.

Thank you for your contribution! 🦄 🚀 🤖

(Note: issues labeled with pinned or EPIC are
never marked as stale.)

@stale stale bot added the stale Is the issue still valid? label Nov 2, 2022
@TomasTomecek TomasTomecek removed the stale Is the issue still valid? label Nov 8, 2022
@FrNecas FrNecas mentioned this issue Nov 29, 2022
6 tasks
softwarefactory-project-zuul bot added a commit that referenced this issue Feb 1, 2023
Create group models

This is a good candidate for a pair review, here are just some pointers:

The diff looks scary but a lot of it is just tests and migrations which contain definition of models
We now create a model before sending a request to TF/Copr/Koji, the model will have an empty pipeline ID/web url since it is not known yet. This will be filled in later, once the request succeeds. For handling retries, the handlers now accept a group ID which they fetch rather than creating a new model to avoid creating unnecessary models on failures.
As discussed at last arch, I added an explicit M:N mapping between copr and TF. This was necessary because by introducing groups, a pipeline now contains a group of runs and a group of tests and mapping a test to a single build (e.g. f35 test to f35 build) would otherwise be impossible.
Testing farm changes are probably the most prone to breaking (lots of merge conflicts, I tried to make groups work with Laura's recent work), koji and copr seemed a lot less complex.
I also made some changes to documentation and some other improvements along the way
The migrations are not really backwards compatible, even though I tried my best. When you merge something, splitting it back is complicated. Also see my TODO comment in the migrations             # TODO: should we merge the groups? This would result in deletion and possibly some mess. I feel like removing existing pipelines is not the way to go so I rather went with "duplicating data"

TODO:

 Write new tests or update the old ones to cover new functionality.
 Update doc-strings where appropriate.
 Update or write new documentation in packit/packit.dev. [nothing to document]
 Add API endpoints for getting group data by ID (may not be necessary for now, the existing API should be more-or-less unimpacted, but it may be useful for the future)
 Try running the migration on production data to see how fast it runs and if there is any need for trying to optimize (the 4 migrations take roughly a minute for stage data on my local machine).
 Openshift tests?

Fixes:  #1327
Fixes: #1665

RELEASE NOTES BEGIN
Packit now groups related builds and test runs (e.g. triggered by the same event, just different chroots) together. In the future, this will allow better presentation of the overall pipelines (e.g. in the dashboard). We now also create database entries before sending requests to external service (e.g. Testing Farm), therefore failures will be more visible in the dashboard.
RELEASE NOTES END

Reviewed-by: Tomas Tomecek <tomas@tomecek.net>
Reviewed-by: František Nečas <frantisek.necas@protonmail.com>
Reviewed-by: Jiri Popelka <None>
Reviewed-by: Matej Focko <None>
Reviewed-by: Laura Barcziová <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/database Related to the Packit's database kind/refactor Technical debt - the code needs love.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants