Support shallow clone in multibranch Pipeline and resolveScm
in current state CloneOptionTrait ignored, this PR allow set depth when you need find branch
Testing done
cheked locally in pipeline with
resolveScm([
ignoreErrors: false,
source : gitSource(
credentialsId: 'git-cred',
remote: 'https://....',
traits: [cloneOption(cloneOption(depth: 1, shallow: true)), gitBranchDiscovery()]
),
targets : ['main', 'master']
])
17:55:17 Checking for first existing branch from [main, master]...
17:55:17 > git rev-parse --resolve-git-dir /var/jenkins_home/caches/git-xxx/.git # timeout=10
17:55:17 Setting origin to https://site/xxx.git
17:55:17 > git config remote.origin.url https://site/xxx.git # timeout=10
17:55:17 Fetching & pruning origin...
17:55:17 Listing remote references...
17:55:17 > git config --get remote.origin.url # timeout=10
17:55:17 > git --version # timeout=10
17:55:17 > git --version # 'git version 2.52.0'
17:55:17 using GIT_HTTP to set credentials
17:55:17 > git ls-remote -h -- https://site/xxx.git # timeout=10
17:55:17 Fetching upstream changes from origin
17:55:17 > git config --get remote.origin.url # timeout=10
17:55:17 using GIT_HTTP to set credentials
17:55:17 > git fetch --no-tags --force --progress --prune --depth=1 -- origin +refs/heads/*:refs/remotes/origin/* # timeout=10
17:55:18 Checking branches...
17:55:18 Checking branch main
17:55:18 Met criteria
17:55:18 Processed 1 branches
17:55:18 Found main at revision xxxx
Submitter checklist
- [x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests that demonstrate the feature works or the issue is fixed
Needs documentation that describes it so that users have an example they can use.
Pipeline syntax generate code resolveScm with cloneOption trait. Without these chnages trait will be ignored.
Needs documentation that describes it so that users have an example they can use.
Pipeline syntax generate code resolveScm with cloneOption trait. Without these chnages trait will be ignored.
That is certainly necessary, but I also like to include documentation in the README. People do not always use the syntax generator.
Seems it's enough)
It is much better for me as a reviewer if you don't force push new changes once we've started reviewing. When a commit is force pushed, the comments may be dissociated from the current push. It is better for me as a reviewer if you push new commits. When the review is complete, it can be squash merged into the master branch before release.
It is much better for me as a reviewer if you don't force push new changes once we've started reviewing. When a commit is force pushed, the comments may be dissociated from the current push. It is better for me as a reviewer if you push new commits. When the review is complete, it can be squash merged into the master branch before release.
i see. will create new commits
@MarkEWaite still checking?