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

Create Local Branch of Remote Repo #15

Closed
2 tasks
nelsonic opened this issue May 4, 2022 · 7 comments
Closed
2 tasks

Create Local Branch of Remote Repo #15

nelsonic opened this issue May 4, 2022 · 7 comments

Comments

@nelsonic
Copy link
Member

nelsonic commented May 4, 2022

I've got local_branch_create/2:

gogs/lib/gogs.ex

Lines 169 to 173 in c05cd77

def local_branch_create(repo_name, _branch_name \\ "draft") do
path = local_repo_path(repo_name)
repo = %Git.Repository{path: path}
Git.checkout(repo, ~w(-b draft)) # ["-b", branch_name])
end

working on my machine:

image

But it fails on GitHub CI:

https://github.com/dwyl/gogs/runs/6297415703?check_suite_focus=true#step:6:58
image

I need to either

  • create a stub/mock function
    or
  • figure out how to write to the GitHub Actions CI filesystem
@nelsonic nelsonic added this to More ToDo ThanCanEver Be Done in Nelson's List via automation May 4, 2022
@nelsonic nelsonic self-assigned this May 4, 2022
@nelsonic nelsonic moved this from More ToDo ThanCanEver Be Done to In progress in Nelson's List May 4, 2022
@nelsonic
Copy link
Member Author

nelsonic commented May 4, 2022

Able to replicate it on localhost by running the mix test as a different user:

image

Basically

@nelsonic
Copy link
Member Author

nelsonic commented May 4, 2022

Invalid workflow file
The workflow is not valid. .github/workflows/ci.yml (Line: 13, Col: 5): Unexpected value 'options'

https://github.com/dwyl/gogs/actions/runs/2272562194/workflow#L13
image

So this SO answer was not helpful ... https://stackoverflow.com/questions/58921029/github-actions-cannot-write-to-file-permission-denied-inside-the-docker-contai

nelsonic added a commit that referenced this issue May 4, 2022
@nelsonic
Copy link
Member Author

nelsonic commented May 4, 2022

whoami ? 🤷‍♂️ --> runner

https://github.com/dwyl/gogs/runs/6297951028#step:5:4
image

Still the same error: https://github.com/dwyl/gogs/runs/6297951028#step:7:58
image

Going to need a fresh pair of eyes for this ... 😫

@nelsonic
Copy link
Member Author

nelsonic commented May 4, 2022

Able to create branch:
https://github.com/dwyl/gogs/runs/6298147274?check_suite_focus=true#step:6:18
image

Just not from Elixir ... 🤷‍♂️

@nelsonic
Copy link
Member Author

nelsonic commented May 5, 2022

Creating Gogs.GitMock because I don't have time for this right now ... ⏳ 🔥
We can revisit the End-to-End tests once we've shipped the "first vertical slice".

@nelsonic
Copy link
Member Author

nelsonic commented May 5, 2022

Figured out that I only needed two Mock functions: clone and push.
The rest can all be real just by using a test-repo (and actual barebones Git repo embedded in the project)
Happier with this. ✅

@nelsonic nelsonic closed this as completed May 5, 2022
Nelson's List automation moved this from In progress to Done May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Nelson's List
  
Done
Development

No branches or pull requests

1 participant