-
Notifications
You must be signed in to change notification settings - Fork 45
Store duration in database #487
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
Conversation
Kobzol
left a comment
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.
Hi, thank you for the PR! Could you also add code that loads the duration from the DB into the build model? Just so that we can check that the Interval type can be correctly deserialized into Rust.
|
Sorry. I'm busy this week. I will do as soon as I have time |
|
Hi! Now I notice some interesting things on: The same way Only common pattern where I see the error is query with CTE(Common Table Expression). |
|
Interesting. Are you using the same Postgres version that we have in |
|
Yes, I haven't changed anything related to database. |
|
I guess so, but I would also like to find out what differs for you. If you use the same Postgres, and the same |
|
Yes, currently on Also I discovered |
|
I also tried to look into marcos |
|
Have you tried removing the |
|
This commands The error was gone after I deleted |
|
Ah, it that happens again, just do cargo sqlx database reset :) |
|
WIP. Do not review immediately, please. |
|
Thanks! Let me know when I can take a look. (Also, no hurry, I have a lot of other things to fix/improve in bors in the meantime xD) |
|
I think that the status doesn't have to be optional - the only time we update the duration, we also set the status, right? And regarding the SQL query, I think that Btw I think that some rebase went wrong, and the |
Kobzol
left a comment
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.
Thank you! Left some comments to simplify the Interval operations and about the actual build duration logic.
|
That being said, what you have should already work for the common case! And I don't want to be too nitpicky here. So if you want, we can merge the PR and I can then make the changes to compute the running time from the set of workflows, as I expect that it will require also some changes to the testing infrastructure. |
|
Yes, I want this PR to be merged. I will continue on representing |
Duration type from database to struct. Extend update build Fix rebase issues Fix after PR review
|
Also I have to point out update_build_check_run_id can also be included to |
Kobzol
left a comment
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.
Ok! I'll merge this and make some improvements (refactor the build DB functions, try to load the duration from workflows, write some tests), and in the meantime you can take a look at representing the expected duration. It's mostly a UX thing, I'm not sure what's the best way to do it - reuse the vertical yellow bar? Or create a new horizontal progress bar? Or maybe ditch the "pending" string and just show a progress bar instead of it? So many options! :)
Thank you, great work!
Related to #486
Note:
durationcolumn of thebuildtable for possible future use. Try build duration records should not effect performance, we will filter out only successfully completed auto builds.