Some changelogers were always returning the short sha instead of the
full one, so setting an abbrev had no effect.
This fixes these changelogers, which should now always return the full
sha.
Note that github usually still shortens the SHAs rendered in markdown,
so the changes might not even be visible in most cases.
closes#4829
<!--
Hi, thanks for contributing!
Please make sure you read our CONTRIBUTING guide.
Also, add tests and the respective documentation changes as well.
-->
<!-- If applied, this commit will... -->
...
<!-- Why is this change being made? -->
...
<!-- # Provide links to any relevant tickets, URLs or other resources
-->
...
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This allows to use templates for commit messages in the changelog when
using `github`, `gitea`, or `gitlab` as the changelog implementation.
closes#4800
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
**Depends on #4792**
This adds support for opening pull requests on brew, krew, nix, scoop
and winget changes with Gitlab.
---------
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Creating files on a new branch is only possible with the API if
`start_branch`
is given otherwise the API returns:
> You can only create or edit files when you are on a branch
Fixes https://github.com/goreleaser/goreleaser/issues/4543
---------
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
<!--
Hi, thanks for contributing!
Please make sure you read our CONTRIBUTING guide.
Also, add tests and the respective documentation changes as well.
-->
<!-- If applied, this commit will... -->
Allow for using a projectID for a gitlab homebrew tap destination. There
are still some issues here because I can't use our full project name but
one step at a time.
<!-- Why is this change being made? -->
According to the goreleaser [gitlab
doc](https://goreleaser.com/customization/release/#gitlab), gitlab's
project IDs are supported. Before this change that isn't true for
homebrew formulas.
<!-- # Provide links to any relevant tickets, URLs or other resources
-->
Some conversation here:
https://github.com/goreleaser/goreleaser/issues/4664#issuecomment-1986056251.
Co-authored-by: Brad Reynolds <brad@shipium.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
closes#3485
also fixed a bug in file creation for github: it was always searching
for the file in the default branch
also, we don't need to create the file first, update does both create
and update.
TODO: implement the for krew, scoop, etc...
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
alternative to #3806
the idea is that both `context.New` and `context.Context{}` are never
used in tests.
not sure yet how much I like it, so far code does look a bit more
readable though.
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Hi, I found a bug in the GitLab client that leads to not correctly
prepend/append/keep releases notes.
This will use the original `Description` instead of the pre-rendered
`DescriptionHTML`. Furthermore, as `include_html_description` is not
enabled, the `DescriptionHTML` field is always empty.
[GitLab
documentation](https://docs.gitlab.com/ee/api/releases/index.html#get-a-release-by-a-tag-name)
If applied, this commit will allow for new GitLab clients to use both ci
job tokens and plain tokens (for things like brew publishing where the
CI_JOB_TOKEN isn't applicable)
This provides a fix for #3399
---
closes#3399
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* feat: changelog from github
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* refactor: unifying client mocks
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* refactor: unifying client mocks
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* fix: mocks
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* test: added tests
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* fix: remove unused code
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* test: added more
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* fix: testdata
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* fix: fmt
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* test: fix
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* test: fix
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* docs: improve docs
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* feat: allow default branch to be used in gitlab
* feat: add func to get default branch
* fix: matching branch args
* feat: branch customization
* fix: fixing dummyclient naming
* refactor: remove createbranch
* feat: Adding gitlab branch customization
* feat: testing for github and gitea defaultbranch
* fix: remove dummy debug message
* fix: removing note about gitea not being supported
* feat: allow default branch to be used in gitlab
* docs: links updat
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* chore: delete kodiak.yml
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* feat: add func to get default branch
* fix: matching branch args
* feat: branch customization
* fix: docs: Missing mattermost docs on website (#2543)
* docs: update CircleCI example (#2545)
* fix: fixing dummyclient naming
* docs: some little fixes on the webpage (#2547)
* feat: some little fixes on the webpage
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
* Update www/docs/overrides/home.html
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* refactor: remove unused not impl error (#2540)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* feat: add template support for homebrew tap owner (#2544)
* feat: add template support for homebrew tap name
refs #2544
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* refactor: remove createbranch
* feat: Adding gitlab branch customization
* feat: testing for github and gitea defaultbranch
* fix: remove dummy debug message
* fix: removing note about gitea not being supported
Co-authored-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Co-authored-by: Engin Diri <engin.diri@mail.schwarz>
Co-authored-by: Ricardo N Feliciano <FelicianoTech@gmail.com>
Co-authored-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Erik Weber <terbolous@gmail.com>
Background
---
In 5bcfa9042d the condition was changed to
that it can support the new status code returned by GitLab. However, the
condition is now checked `resp != nil` and not `resp == nil` which causes
the condition not to trigger when the resp is nil and only returns an
error. We can reproduce this issue by running
`TestGitLabCreateReleaseUknownHost` test added in this commit.
Solution
---
If we look at other error handling
91a8abb2e6/internal/client/gitlab.go (L106)
we can see that we check if the `resp` is nil as well before continuing.
Added tests for the following use cases:
- When there is an error and no response was returned.
- When there is a 403 or 404 error so we expect to create a release
first.
- When there is an unknown error (not 404, 403) we just bail.
Background
---
When a git repository is hosted in multiple GitLab instances the
`.goreleaser.yml` needs to take in consideration both APIs endpoints. At
the moment it defaults to GitLab.com and you can override it with
`gitlab_urls` however this forces you to only support 1 GitLab instance.
We need this for
https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/14122
where we have a tool that is developed on GitLab.com but then mirrored
to an internal GitLab instance since we need it to operate GitLab.com
even when it's down.
Solution
---
Support templates like `{{ .Env.CI_SERVER_URL }}` for the
`gitlab_urls`, `github_urls` and `gitea_urls` so it can use environment
variables and the same `.goreleaser` file can be used in multiple SCM
instances.
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* feat: Use GitLab Direct Asset Links
Implement the use of Direct Asset Links when uploading artifacts to a GitLab release
* fix: Remove ArtifactUploadHash
As GitLab support for direct asset linking exists, remove ArtifactUploadHash due to it no longer being required
* test: fix unit tests for gitlab urls
* fix: Use artifact name during GitLab upload
file.Name() included the path to the file, which isn't needed and breaks other areas such as homebrew releases
* docs: Require GitLab version v12.9+
Due to newly introduced dependency on direct asset linking
* refactor: use require on all tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* refactor: use require on all tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* makes context tokentype a public var
* passes artifacts object into client upload function. extracts gitlab upload hash from url
* adds gitlab url to brew config
* build brew formula depending on token type
* fixes client for release tests
* fixes exiting brew tests
* fixes scoop test with dummy client adaption
* uses new artifact upload hash
* fixes brew usage
* updates gitlab createFile for brew
* fixes logging for non-existing file in gitlab logging
* fix: gitlab createFile
* fix: removes encoding from gitlab create and update file opts
* fix: gitlab upload and artifact set upload hash
* fix: linter
* changed artifact item to a pointer in ctx
* docs: updates homebrew
* feat: enables scoop for gitlab release
* fix: scoop panic for pointer access
* chore: rename formula build func for brew
* chore: brew removes comments
* fix: brew tests
* test: updates brew tests
* docs: updates homebrew
* test: for token type not implemented for brew
* tests: for multiple linux builds
* fix: build artifacts are pointer in scoop
* test: for scoop and gitlab
* test: for artifacts set upload hash
* adds missing files after adaption
* chore: removes and clarifies comments
* fix: moves artifact upload hash to extra map
* adds comment why we initialize the extra map