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

Git Clone History Inconsistent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • builds-1.6
    • builds-1.2
    • shipwright
    • Builds Sprint #29
    • 1

      Description of problem:

      When we do not use "spec.source.git.revision" ,  it automatically does a  shallow git clone which is same behaviour with buildconfig.  But when we   specify "spec.source.git.revision", it does a full git clone.
      

      Workaround: None

      Prerequisites (if any, like setup, operators/versions):

      • Builds for OpenShift 1.3

      Steps to Reproduce

      1. Create a `Build` as follows:
        1. Use the `buildah` strategy to create a build with a Dockerfile at the source root.
        2. In the source for the build, use a Dockerfile that prints the size of the .git directory:
             FROM registry.access.redhat.com/ubi9/ubi:latest
             RUN mkdir -p /opt/app-root
             WORKDIR /opt/app-root
             COPY . .
             RUN ls -al .git
           
        3. Ensure the build source from git using a specific revision. This could be a branch, tag, or commit sha.
      2. Start a `BuildRun` from said build, using the `shp` command line (`shp build run ...`)

       

      Actual results:

      Git source contains the full history

      Expected results:

      Git has a shallow clone, which does not contain the full history.

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Acceptance criteria: 

      Cloning with our without the revision specified produces the same behavior - shallow clone by default.

      Definition of Done:

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

              rh-ee-anborah Anchita Borah
              adkaplan@redhat.com Adam Kaplan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: