semantic-release / semantic-release/gitlab

Can not create release if patterns matches multiple files with the same name.

Open
#265 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I'm getting this error,

[12:29:11 PM] [semantic-release] [@semantic-release/gitlab] › ✖  An error occurred while making a request to the GitLab release API:
HTTPError: Response code 400 (Bad Request)
    at EventEmitter.<anonymous> (/home/ecarroll/n/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise.js:118:31)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
[12:29:11 PM] [semantic-release] › ✖  Failed step "publish" of plugin "@semantic-release/gitlab"
[12:29:11 PM] [semantic-release] › ✖  An error occurred while running semantic-release: HTTPError: Response code 400 (Bad Request)
    at EventEmitter.<anonymous> (/home/ecarroll/n/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise.js:118:31)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  pluginName: '@semantic-release/gitlab'
}
HTTPError: Response code 400 (Bad Request)
    at EventEmitter.<anonymous> (/home/ecarroll/n/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise.js:118:31)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  pluginName: '@semantic-release/gitlab'
}%

This error comes right after a release PUSH. Currently it's silently failing failing I opened this ticket to fix the silent failing: https://github.com/semantic-release/gitlab/issues/264

{
  responseType: 'text',
  body: '{"message":"Validation failed: Links have duplicate values (acme-angular-validators.js) for #\\u003cRelease:0x00007f0702a43908\\u003e scope"}'
}

You can see here that the problem is that GitLab errors with 400 (Bad Request) because it's upload multiple files (in different directories) to the release API.

dist/acme/angular-validators/fesm2015/acme-angular-validators.js
dist/acme/angular-validators/esm2015/acme-angular-validators.js

I believe the solution for this should be to add the paths to the file's basename, relatively to the pkgRoot.

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

Reproduce the GitLab release upload with two same-basename files under different directories, then trace how upload paths are formed relative to pkgRoot. Done means both assets can be uploaded without GitLab returning the duplicate-link 400 response, with the failure no longer silent.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.