Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: relative submodules in git artifacts. Fixes #7141 #7162

Merged
merged 1 commit into from Nov 4, 2021

Conversation

valorl
Copy link
Contributor

@valorl valorl commented Nov 4, 2021

Upgrades src-d/go-git v4 to go-git/go-git v5.3.0.
See go-git/go-git#195.

Signed-off-by: valorl 11498571+valorl@users.noreply.github.com

Testing

Built and ran locally and tried to reproduce with the example Workflow from #7141. This time it clone the repo successfully.

Workflow

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: clone-relative-submodule
spec:
  entrypoint: clone
  templates:
  - name: clone
    inputs:
      artifacts:
      - name: repo
        path: /repo
        git:
          repo: https://github.com/valorl/repository-with-relative-submodule.git
          revision: main
    script:
      image: alpine/git:latest
      command: [sh]
      workingDir: /repo
      source: |
        git status

Output

time="2021-11-04T09:47:01.581Z" level=info msg="Starting Workflow Executor" executorType=emissary version=untagged
time="2021-11-04T09:47:01.584Z" level=info msg="Creating a emissary executor"
time="2021-11-04T09:47:01.584Z" level=info msg="Executor initialized" deadline="2021-11-04 09:52:00 +0000 UTC" includeScriptOutput=false namespace=argo podName=clone-relative-submodule-6lr46 template="{\"name\":\"clone\",\"inputs\":{\"artifacts\":[{\"name\":\"repo\",\"path\":\"/repo\",\"git\":{\"repo\":\"https://github.com/valorl/repository-with-relative-submodule.git\",\"revision\":\"main\"}}]},\"outputs\":{},\"metadata\":{},\"script\":{\"name\":\"\",\"image\":\"alpine/git:latest\",\"command\":[\"sh\"],\"workingDir\":\"/repo\",\"resources\":{},\"source\":\"git status\\n\"},\"archiveLocation\":{\"archiveLogs\":true,\"s3\":{\"endpoint\":\"minio:9000\",\"bucket\":\"my-bucket\",\"insecure\":true,\"accessKeySecret\":{\"name\":\"my-minio-cred\",\"key\":\"accesskey\"},\"secretKeySecret\":{\"name\":\"my-minio-cred\",\"key\":\"secretkey\"},\"key\":\"clone-relative-submodule-6lr46/clone-relative-submodule-6lr46\"}}}" version="&Version{Version:untagged,BuildDate:2021-11-04T09:37:37Z,GitCommit:b7e4bda9bad2c830dc5f6ef57e42522876e47bfd,GitTag:untagged,GitTreeState:clean,GoVersion:go1.17.2,Compiler:gc,Platform:linux/amd64,}"
time="2021-11-04T09:47:01.629Z" level=info msg="Loading script source to /argo/staging/script"
time="2021-11-04T09:47:01.629Z" level=info msg="Start loading input artifacts..."
time="2021-11-04T09:47:01.629Z" level=info msg="Downloading artifact: repo"
time="2021-11-04T09:49:22.948Z" level=info msg="Checking out revision main"
time="2021-11-04T09:49:23.527Z" level=info msg="`[git checkout main]` stdout:\nYour branch is up to date with 'origin/main'.\n"
time="2021-11-04T09:49:23.788Z" level=info msg="`[git checkout main]` stdout:\nSubmodule path 'argo-workflows': checked out '9293512674c21a2494c704978990cf89eb5ad8c0'\n"
time="2021-11-04T09:49:23.788Z" level=info msg="Detecting if /argo/inputs/artifacts/repo.tmp is a tarball"
time="2021-11-04T09:49:23.789Z" level=info msg="Successfully download file: /argo/inputs/artifacts/repo"
time="2021-11-04T09:49:23.791Z" level=info msg="Alloc=84748 TotalAlloc=5309165 Sys=531815 NumGC=55 Goroutines=3"

Don't bother creating a PR until you've done this:

  • Run make pre-commit -B to fix codegen, lint, and commit message problems.

Create your PR as a draft.

  • Your PR needs to pass the required checks before it can be approved. If the check is not required (e.g. E2E tests) it
    does not need to pass.
  • Once required tests have passed, you can make it "Ready for review".
  • Say how how you tested your changes. If you changed the UI, attach screenshots.

Tips:

  • If changes were requested, and you've made them, then dismiss the review to get it looked at again.
  • Add you organization to USERS.md if you like.
  • You can ask for help!

Upgrades src-d/go-git v4 to go-git/go-git v5.3.0.
See go-git/go-git#195.

Signed-off-by: valorl <11498571+valorl@users.noreply.github.com>
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Are you aware of any changes that might affect existing users since this is a major version update for go-git?

@valorl
Copy link
Contributor Author

valorl commented Nov 4, 2021

Based on this comment from the project, there shouldn't be any breaking changes going from 4 to 5.

The new version and all future versions in v5 branch can be used as a drop-in replacement for v4. This major update was required due to the new project home at go-git org and the full adoption of go modules.​

https://github.com/go-git/go-git/wiki/go-git-has-a-new-home!-v5-and-some-explanations

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Thank you!

@terrytangyuan terrytangyuan merged commit f9e554d into argoproj:master Nov 4, 2021
@alexec alexec mentioned this pull request Nov 5, 2021
25 tasks
@sarabala1979 sarabala1979 mentioned this pull request Dec 15, 2021
73 tasks
sarabala1979 pushed a commit that referenced this pull request Dec 15, 2021
Upgrades src-d/go-git v4 to go-git/go-git v5.3.0.
See go-git/go-git#195.

Signed-off-by: valorl <11498571+valorl@users.noreply.github.com>
@Hunter-Thompson
Copy link
Contributor

This upgrade might have been responsible for #7736

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git Artifact does not support relative submodules (fixed in go-git v5.3.0)
3 participants