Feat/allow parallel execution and pushes of ProjectRepos on two different machines #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a change to the output repository push logic to support parallel result pushes from multiple machines / instances of the from the same ProjectRepo plus corresponding tests and test changes.
The new test simulates two independent clones of the same CADET-RDM project pushing results to the same remote output repository.
The root cause of the original failures was that all runs update shared files in the output repository
mainbranch, especiallylog.tsvand therun_historydirectory. When multiple machines attempted to push these updates concurrently, Git rejected the push due to non-fast-forward conflicts.Additionally, output branch names were previously only based on timestamp, project branch, and project commit hash, which could lead to branch name collisions in fast CI runs or concurrent executions. This is why a random suffix was added to the branch name.
Changes introduced in this PR
1. Integration test for parallel pushes
A new integration test was added that:
This test reproduces the parallel push issue and ensures the push logic works correctly.
2. Unique output branch names
Output branches now include a short random suffix:
This prevents branch name collisions.
3. Safe output repository push logic
The output push sequence was redesigned to safely handle parallel updates:
mainbranch are applied using:This ensures updates are always based on the latest remote state.
4. Retry logic for concurrent updates
If pushing the output
mainbranch fails due to a non-fast-forward conflict, the operation is retried automatically. This allows concurrent pushes from multiple machines to eventually succeed without manual intervention.5. Removal of implicit
git pullduring pushThe previous implementation relied on
git pull, which can fail when the remote has changed. The new implementation uses explicitfetchand controlled updates.