Uploaded image for project: 'OpenShift Builds'
  1. OpenShift Builds
  2. BUILD-1343

Specify Depth when Git Cloning

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • builds-1.5
    • builds-1.3
    • shipwright
    • None
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      With this update, the `source.git.depth` parameter was added to the Build resource to specify the depth of the Git history. The default value is 1 and no history is cloned. This is the fastest way to clone a Git repository and is applicable for all cases where your build logic doesn't rely on Git history.

      Any value greater than 1 will create a clone with the specified depth. For a full Git history clone, set the depth to 0.

      [NOTE]
      ====
      If you specify a commit SHA as a revision, the full history is always cloned before this commit is checked out.
      ====
      Show
      With this update, the `source.git.depth` parameter was added to the Build resource to specify the depth of the Git history. The default value is 1 and no history is cloned. This is the fastest way to clone a Git repository and is applicable for all cases where your build logic doesn't rely on Git history. Any value greater than 1 will create a clone with the specified depth. For a full Git history clone, set the depth to 0. [NOTE] ==== If you specify a commit SHA as a revision, the full history is always cloned before this commit is checked out. ====
    • Feature
    • Proposed
    • Builds Sprint #29
    • 1

      Story (Required)

      As a developer trying to build container images with Shipwright I want to specify the history depth when cloning source from Git so that I have access to commit history and logs during the build.

      <Describes high level purpose and goal for this story. Answers the questions: Who is impacted, what is it and why do we need it? How does it improve the customer’s experience?>

      Background (Required)

      <Describes the context or background related to this story>

      A bug in Shipwright leads to different behavior cloning source code. When no `ref` is specified, Shipwright clones source from the repository's default branch without any history. This is equivalent to `git clone --depth 1`.

      When `ref` is specified, the `--depth` flag appears to be omitted and Shipwright clones the full history. For some builds with the source-to-image strategy, this can significantly increase the size of the resulting container image.

      Out of scope

      <Defines what is not included in this story>

      Approach (Required)

      <Description of the general technical path on how to achieve the goal of the story. Include details like json schema, class definitions>

      Dependencies

      <Describes what this story depends on. Dependent Stories and EPICs should be linked to the story.>

      Acceptance Criteria (Mandatory)

      <Describe edge cases to consider when implementing the story and defining tests>

      <Provides a required and minimum list of acceptance tests for this story. More is expected as the engineer implements this story>

      INVEST Checklist

      Dependencies identified

      Blockers noted and expected delivery timelines set

      Design is implementable

      Acceptance criteria agreed upon

      Story estimated

      Legend

      Unknown

      Verified

      Unsatisfied

      Done Checklist

      • Code is completed, reviewed, documented and checked in
      • Unit and integration test automation have been delivered and running cleanly in continuous integration/staging/canary environment
      • Continuous Delivery pipeline(s) is able to proceed with new code included
      • Customer facing documentation, API docs etc. are produced/updated, reviewed and published
      • Acceptance criteria are met

              rh-ee-asatyam Ayush Satyam
              rh-ee-sabiswas Sayan Biswas
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: