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

ProjectName empty when releasing to gitlab #1337

Closed
acobaugh opened this issue Feb 10, 2020 · 5 comments · Fixed by #1364
Closed

ProjectName empty when releasing to gitlab #1337

acobaugh opened this issue Feb 10, 2020 · 5 comments · Fixed by #1364
Labels
bug Something isn't working

Comments

@acobaugh
Copy link

Describe the bug

.ProjectName appears to be empty when releasing to gitlab. I'm trying to build a reusable CI pipeline, so I don't want to set the project_name setting in .goreleaser.yml if I can avoid it.

To Reproduce

Steps to reproduce the behavior:

env:
  - CGO_ENABLED=0
  - GO111MODULE=on
  - GOPROXY=https://gocenter.io
before:
  hooks:
    #- go mod tidy
builds:
- ldflags:
  - -X git.psu.edu/swe-golang/buildversion.commit={{.ShortCommit}}
  - -X git.psu.edu/swe-golang/buildversion.version={{.Version}}
  - -X git.psu.edu/swe-golang/buildversion.buildDate={{.Date}}
  goos:
  - windows
  - darwin
  - linux
  goarch:
  - amd64
checksum:
  name_template: 'checksums.txt'
snapshot:
  name_template: "snapshot"
changelog:
  sort: asc
  filters:
    exclude:
    - '^docs:'
    - '^test:'
    - '^ci:'
    - Merge pull request
    - Merge branch
gitlab_urls:
  api: https://git.psu.edu/api/v4/
  download: https://git.psu.edu
  skip_tls_verify: false
release:
  gitlab:

Make sure your config file is valid by running
goreleaser check -f path-to-config-file.

Expected behavior

.ProjectName is set correctly.

Environment (please complete the following information):

  • OS: linux
  • OS version: golang:1.12-alpine
  • GoReleaser Version v0.126.0
  • GitLab: Community Edition 12.6.6

Additional context
This appears to be caused by https://github.com/goreleaser/goreleaser/blob/master/internal/pipe/project/project.go#L16

@acobaugh acobaugh added the bug Something isn't working label Feb 10, 2020
@caarlos0
Copy link
Member

whats the output of your git remote -v?

@acobaugh
Copy link
Author

So, what's interesting is I have two versions of this pipeline, one that runs goreleaser release --snapshot --rm-dist and another that does goreleaser release --rm-dist. The --snapshot pipeline gets the correct .ProjectName, but the actual release doesn't.

git remote -v:

33 $ git remote -v
34 origin	https://gitlab-ci-token:[MASKED]@git.psu.edu/swe-golang/umgctl.git (fetch)
35 origin	https://gitlab-ci-token:[MASKED]@git.psu.edu/swe-golang/umgctl.git (push)

@acobaugh
Copy link
Author

Hey @caarlos0, any idea where the issue is? I've looked at the code a couple of times and nothing jumped out at me, but there's a lot of abstraction and I have a hard time following it. If it's something easy, I wouldn't mind taking a stab at a PR to fix this if I knew where to look.

@craigfurman
Copy link
Contributor

I had this issue too, and submitted a PR that appears to fix it: #1364.

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants