Enable budget calculation for more than two phases#4264
Conversation
3158b4a to
66ec801
Compare
|
@jmsmkn I don't think it is worth splitting up the PR or creating stacked commits, but let me know if this is annoying to review. |
|
+1800 LOC is going to be too much for me to review this afternoon, sorry. |
|
No worries, let me see if I can present this in chunks |
0e01495 to
937157b
Compare
|
Cleaned it into 6 commits. Fixed some issues along the way, so it's good that you did not review it before. Should be ready now! |
937157b to
1cc6a8c
Compare
|
Sorry! Heavy conflict with #4495. We'll need to discuss how to combine this and what makes more sense to merge first. |
1cc6a8c to
108509e
Compare
|
Ah, this get's automatically closed when the branch is up-to-date with main. I wanted to use this as a base for a feature branch with stacked PR's. Will open it again after the first PR. |
|
@chrisvanrun I'm replying to your comment here, as this will be the final PR.
How do you think this will bite us in the future? I don't follow how adding a new |
In the idea that tasks are a 'simple' combination of phases. However, I had not taken into consideration that tasks are also unifying some costs related with submissions. That makes the modelling quite a bit more difficult! In the future, we might want to add additional properties which might be easier added when modelled instead of increasing dimensionality in some of the fields. But I'd have to have a closer look at how the dimensionality is handled in your changes. |
|
A quick study has me sketch your implementation as follows, please let me know if it is not correct. Per Task
Per Phase
Other
We keep the main relationship between task and phases via Hence, I suggest tackling the integrity and check the fields on the model:
|
That is all correct.
I believe I have these covered in the |
Ah, darn. Sorry! I used a reference lookup on the model.field, but that of course doesn't hit the form. Silly me. One classic argument is moving those to the model so we don't end-up with integrity problems if we edit via the backend. Relevant, since we are maybe planning on removing the budget fields from the requests. However, I think we'll likely want to work on this via the frontend form anyway, even if we remove those. So then the argument is mute. Do you agree? |
|
Yes, the budget update form is for us to change it through the frontend. I think it is fine to keep the validation there. |
|
It is alive again! |
1331e8d to
ddc86a1
Compare
|
I'll double-check this as a whole one more time tomorrow! |
…quest task on configure algorithm phases form (#4504) Co-authored-by: Chris van Run <chrisvanrun@users.noreply.github.com>
ddc86a1 to
282fc9a
Compare
|
One test was duplicated because I hadn't rebased before merging #4504. I carefully backtracked, but that was the only difference. Stacked PRs and squashed merge commits are a total nightmare. |
Yes, maybe we should not squash them when the stacking is 'merged down' and only do a final squash at the final merge into |
That would then allow non-squashed commits into main, so is a no-go. PRs should be made to main that are small and reviewable. |
Can we allow non-squashed merges if main is not the target branch?
Generally, I think this is the way to go. Stacked PR's are a slippery slope that lead to work that is hard to review. Just because it is split up, doesn't always make it easier to review. @chrisvanrun I think you'll agree? |
Tricky. In this case it was all the same change (in essence) but it propagated to different parts of the code base. Any split would have broken Splitting a large PR into smaller PRs post hoc, like with this change set, always runs into problems with upstream changes and squashes. IMO - optimally you work up to a small change set that makes some sense as a whole, push it out in a PR for reviewing and then work on the next change set. And then make sure to never work on the next step after that, and consider to be blocked when the first PR is stuck in reviewing. |
New fields have been added to the ChallengeRequest model to define any number of phases for any number of tasks for the budget calculation.
The ChallengeRequestBudgetUpdateForm has been updated to allow changing these new fields. The new fields are initially filled with values from the old fields that are used by the ChallengeRequestCreateForm, which has not changed from the users perspective.
Because the challenge request can now define multiple tasks, runtime limits are set for the phases by supplying the corresponding task when they are converted to algorithm phases; unless there is only one task defined on the challenge request, then the input is not needed.
Related to https://github.com/DIAGNijmegen/rse-roadmap/issues/421
Related to #3787