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

prompt to star the repo leads to crash (possibly because of GHE?) #376

Closed
jonathanloske opened this issue Jan 5, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@jonathanloske
Copy link
Contributor

When I ran spr, it prompted me to star the repo. I agreed to do so but then it crashed because it Could not resolve to a Repository with the name 'ejoffe/spr'.. This might possibly be related to me having set it up with GitHub Enterprise (GHE) for the repository I was working in.

Full log:

enjoying git spr? add a GitHub star? [Y/n]:y
panic: repository: Could not resolve to a Repository with the name 'ejoffe/spr'.


goroutine 1 [running]:
github.com/ejoffe/spr/github/githubclient.check({0x104c99e38, 0x1400000cba0})
        /Users/runner/work/spr/spr/github/githubclient/client.go:696 +0xe8
github.com/ejoffe/spr/github/githubclient.(*client).addStar(0x14000200270, {0x104c9d5f0, 0x104fb9460})
        /Users/runner/work/spr/spr/github/githubclient/star.go:83 +0x60
github.com/ejoffe/spr/github/githubclient.(*client).MaybeStar(0x14000218600?, {0x104c9d5f0, 0x104fb9460}, 0x14000200018)
        /Users/runner/work/spr/spr/github/githubclient/star.go:38 +0x2ec
main.main.func1(0x14000228580?)
        /Users/runner/work/spr/spr/cmd/spr/main.go:119 +0x198
github.com/urfave/cli/v2.(*App).RunContext(0x1400021e9c0, {0x104c9d5f0?, 0x104fb9460}, {0x1400001e040, 0x2, 0x2})
        /Users/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.8.1/app.go:328 +0x554
github.com/urfave/cli/v2.(*App).Run(...)
        /Users/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.8.1/app.go:247
main.main()
        /Users/runner/work/spr/spr/cmd/spr/main.go:224 +0x11bc
@ejoffe
Copy link
Owner

ejoffe commented Jan 11, 2024

Yes, I believe this is related to the use of GHE. A fix is needed to not crash in this case.
I believe that after you star the repo, you should not get this message anymore, so it's a one time crash. Correct me if that's not the case.

@jonathanloske
Copy link
Contributor Author

I think it might still happen because SPR can't know whether I starred the repo and seems to crash before it saves that I had the intent to do so. I had to manually edit ~/.spr.state.

@ejoffe ejoffe added the bug Something isn't working label Jan 11, 2024
ejoffe added a commit that referenced this issue Jan 11, 2024
@ejoffe ejoffe closed this as completed in 93956c4 Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants