Store real computation revision
Summary
To make model comparison precise we cannot store only branches names. That is why concrete SHA need to be stored for computation run. Current MR implementation does this exactly. User is choosing branch and instead of branch name latest SHA of selected branch is stored in our database. This has one drawback: user is selecting branch but latter SHA is shown in the table. The solution would be to store both (branch name and SHA). This can be solved in two ways:
- In the
CompuationController#update
action make another request to fetch branch name from selected SHA. This is not good enough, since the same SHA can be in many branches - Make select values composed with
branchName:SHA
and make some splitting in controller to store both data. This has also drawbacks, because user can cheat a bit and modify this tuple. - In the
ComputationController#show
action cache result for theGitlab::Versions
and in theComputationController#update
method fetch concrete SHA for selected branch (with fallback to ask Gitlab once again about branch SHA if it is not available in the cache).
Currently I'm opting for option number 3. @Nuanda, @amber7b, @jmeizner, @dharezlak any better proposition how to solve this issue?
Other Information
References #178 (closed)
Edited by Jan Meizner