openlawlibrary / taf

The Archive Framework
GNU Affero General Public License v3.0
10 stars 10 forks source link

Local master has commit missing from remote tracking branch, requires manual git fetch before taf repo update #524

Closed n-dusan closed 1 month ago

renatav commented 1 month ago

I've been thinking about this and I think that the only thing that can be done here would be to check if this new commit exists on remote and fail early if it does not. A lot of the solutions I can think of would make the current pipeline code a lot messier, as now we have a nice flow where we validate the initial state of the repositories, and then, if there are no issues, create temp repositories, fetch etc. Since we should fetch before validating and we should not use something like GitHub API, th only solution I can think of would be to move that check if there are additional local commits to a separate step and execute it after the temp repos are updated. However, it will be necessary to compare the local and temp repos. The reason why this worked before this newest release is because we didn't have that check and we were fetching changes of target repositories before validating them. We didn't have these temp repos. This is not as terrible as it seems.

I'd like to pair with someone and show them how to fix this, as it's not sustainable to have so little updater knowledge floating around