Open clemensutschig opened 2 years ago
@clemensutschig I cannot remember any situation in which we did not want to clean before checkout. So if cleanup does not happen, I would say it is a bug.
However, the code piece you link calls https://github.com/opendevstack/ods-jenkins-shared-library/blob/master/src/org/ods/services/GitService.groovy#L168-L197, right? That seems to do CleanBeforeCheckout
...
hmm - you are right @michaelsauter - it's weird because e.g. tags that are removed in bitbucket - are still there on every new run .. which is no good ... other ideas? :(
from https://www.jenkins.io/doc/pipeline/steps/workflow-scm-step/ - maybe
$class: 'PruneStaleBranch'
Run "git remote prune" for each remote, to prune obsolete local branches.
and
pruneTags
I am confused why this is NOT happening by default ...
@clemensutschig @michaelsauter can you add a bit more transparency for me and my team members? I am a bit lost.
@clemensutschig I need to understand effect and cause rather quickly. Let’s spend a bit on Monday
At least tags that are removed in bitbucket are not cleaned on checkout/clone - the impact is that pushing will recreate them in bitbucket based on this stale data in 'workspace' - the other piece I am worried about is branches that were created and not pushed because of errors and are then pushed later with "intermediate" commits from an earlier run
https://github.com/opendevstack/ods-jenkins-shared-library/blob/master/vars/odsOrchestrationPipeline.groovy#L69-L75
this creates a LOT of problems - e.g. if you remove a tag in bitbucket - and it's left here - it will be pushed back later by
https://github.com/opendevstack/ods-jenkins-shared-library/blob/master/src/org/ods/services/GitService.groovy#L238
We should alwys and only use git as the source of truth
@michaelsauter - was there any reason to not do this? @metmajer fyi - this is the reason why one cannot cleanup doc history