Skip to content

Conversation

@arpoch
Copy link
Contributor

@arpoch arpoch commented Mar 25, 2021

JENKINS-64406 - Expand environment variable to perform lightweight-checkout for Pipeline script from SCM using single branch

When performing a lightweight-checkout for Pipeline script from SCM using a global environment variable with a single branch, would lead to an error as the environment variable support was not provided in the supports(SCM source) method of GitSCMFileSystem class. This PR focuses on providing environment variable support for a single branch build only. For multiple branches a full-checkout is performed and seems more rational for now.

Checklist

  • I have read the CONTRIBUTING doc
  • I have referenced the Jira issue related to my changes in one or more commit messages
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • Documentation in README has been updated as necessary
  • Online help has been added and reviewed for any new or modified fields
  • I have interactively tested my changes
  • Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Further comments

Although the environment variable support could also be provided in build(Item owner, SCM scm, jenkins.scm.api.SCMRevision rev) method as well but then the branch name has to be checked against the issue JENKINS-57587 again and other match cases, defeating the purpose of supports (SCM source) method.

@MarkEWaite MarkEWaite added the enhancement Improvement or new feature label Apr 10, 2021
@MarkEWaite
Copy link
Contributor

#1305 resolves the issue once the required release of workflow-cps is available from jenkinsci/workflow-cps-plugin#577

@MarkEWaite MarkEWaite closed this Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants