Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

git-tar needs to clone with a unique path (including branch) #615

Open
alexellis opened this issue Mar 9, 2020 · 0 comments
Open

git-tar needs to clone with a unique path (including branch) #615

alexellis opened this issue Mar 9, 2020 · 0 comments

Comments

@alexellis
Copy link
Member

alexellis commented Mar 9, 2020

git-tar needs to clone with a unique path (including branch)

Expected Behaviour

git-tar should clone to a path like: /tmp/owner/repo/branch to avoid conflicts

Current Behaviour

It clones to:

func clone(pushEvent sdk.PushEvent) (string, error) {
	workDir := os.TempDir()
	destPath := path.Join(workDir, path.Join(pushEvent.Repository.Owner.Login, pushEvent.Repository.Name))

This could lead to conflicts if building two branches on the same OFC installation

Possible Solution

  1. Enhance the path to avoid conflicts. (see: git-tar/function/ops.go)
  2. A fix must include a unit test - ideally one which mocks out the exec step to git clone.
alexellis added a commit that referenced this issue Mar 9, 2020
These tests will enable #615 to be worked on. Additional if
guards are added through the tests.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
alexellis added a commit that referenced this issue Mar 9, 2020
These tests will enable #615 to be worked on. Additional if
guards are added through the tests.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant