semantic-release / semantic-release/gitlab

Error in request to create release

Open
#192 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
344
Forks
89
Avg merge
16h 11m
Merged PRs (30d)
4

Description

Hello everyone

I'm receiving an error when I run the semantic release in last step. The code can create the tag, but after this, there is a request to /release that I'm receiving a 400 error code

[3:27:32 PM] [semantic-release] [@semantic-release/changelog] › ℹ  Create /tmp/build/group/project-name/CHANGELOG.md
[3:27:32 PM] [semantic-release] › ✔  Completed step "prepare" of plugin "@semantic-release/changelog"
[3:27:33 PM] [semantic-release] › ✔  Created tag v1.3.1
[3:27:33 PM] [semantic-release] › ℹ  Start step "publish" of plugin "@semantic-release/gitlab"
[3:27:33 PM] [semantic-release] › ✖  Failed step "publish" of plugin "@semantic-release/gitlab"
[3:27:33 PM] [semantic-release] › ✖  An error occurred while running semantic-release: HTTPError: Response code 400 (Bad Request)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise.js:118:31)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  pluginName: '@semantic-release/gitlab'
}
HTTPError: Response code 400 (Bad Request)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise.js:118:31)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  pluginName: '@semantic-release/gitlab'
}

I start to investigate the problem in code and I put a debug with error message in API:

2020-12-17T16:59:53.675Z semantic-release:gitlab error in request: Response code 400 (Bad Request)
2020-12-17T16:59:53.675Z semantic-release:gitlab {"error":"name is missing"}

Is required a field called name in json data send with GOT.

https://github.com/semantic-release/gitlab/blob/f8957c30a29f851e9400a6a3bbe169d9b9c7cfbb/lib/publish.js#L73-L87
There is no field called name in this file

I changed and add a name with any value and I received a 201 code.

Is this a bug, different version or I made something wrong?

Thanks for this

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/publish.js at lines 73-87 and compare the release request payload with the GitLab API behavior shown in the report. Reproduce the publish step using the reported 400 response, then verify whether the missing name field is required for the supported API version. Done means the cause is confirmed and the publish request succeeds or the incompatibility is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
gitlab, javascript
Domain
release
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.