Skip to content
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

Clone preparation in PCS does to reset branches correctly #4251

Open
premun opened this issue Dec 16, 2024 · 0 comments
Open

Clone preparation in PCS does to reset branches correctly #4251

premun opened this issue Dec 16, 2024 · 0 comments
Assignees

Comments

@premun
Copy link
Member

premun commented Dec 16, 2024

Context

Before each synchronization, we need to make sure that the local git references point to the same place as the remote ones.
For instance, if we have this situation:

%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showCommitLabel': false, 'tagLabelFontSize': '24px', "mainBranchName":"remote/some-branch"}} }%%
gitGraph
    commit
    commit
    branch local/some-branch
    checkout local/some-branch
    commit type: HIGHLIGHT tag: "Extra commit with a conflict from a previous sync"
    checkout remote/some-branch
    commit
Loading

Some sync has run and maybe tried to do make new commits on the branch but there were conflicts so the sync ended and left the branch pointing somewhere else than the remote original branch.
Another sync starts and maybe it would try to update the same branch but when we are preparing the local clone, we need to make sure that some-branch points to the same place as the remote (so the tip of the branch where maybe new commits appeared).

Right now, this is not possible - we ask the cloner to prepare VMR with a given remote and a given ref and if the ref is present, we do not force-update it to the same place as the remote.

Goal

We should make the RepositoryCloneManager pull from the origin, find the refs we want and create a local ref pointing to it.

However, we need to put this behaviour behind a flag so that it only triggers in the service. If someone would call darc vmr update locally, we don't want to overwrite that person's local state with remote so it must work like it is working now (only check if we have all the refs).

I think this might be a considerable rewrite of how we clone repos in the service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

2 participants