gitlab icon indicating copy to clipboard operation
gitlab copied to clipboard

fix: file labels in GitLab releases, to ensure they're unique.

Open EvanCarroll opened this issue 4 years ago • 10 comments

Previously GitLab lables were just the basename for files uploaded as part of the release. This is problematic because GitLab doesn't allow conflicting labels -- a condition that could be caused by uploading a release with two files by the same name in different directories. This would generate a 409 Conflict error.

This changes the labels for files uploaded as part of a release to the name relative to pkgRoot, or the package.

A project may look like this

pkg pkg \ foo \ baz pkg \ bar \ baz

This would previously result in two conflicting labels of 'baz'. Now you would have {"foo/baz", "bar/baz"} with no conflict.

GitHub issues: #265, #158

EvanCarroll avatar Jul 29 '21 18:07 EvanCarroll

The force pushes are all commit message. I linked it to the issues and fixed some typos.

EvanCarroll avatar Jul 29 '21 19:07 EvanCarroll

It may be worth documenting too, but you would use this feature like this

    ["@semantic-release/gitlab", {
      "gitlabUrl": "https://gitlab.awe.eco.cpanel.net/",
      "pkgRoot": "dist/cpanel/angular-validators",
      "assets": [
        {"path": "dist/cpanel/angular-validators/**", "label": "Dist output"}
      ]   
    }] 

Now all things found in dist/cpanel/angular-validators/ have their label in the release relative to the pkgRoot

EvanCarroll avatar Jul 29 '21 20:07 EvanCarroll

I rebased this can I get some input on it?

EvanCarroll avatar Sep 24 '21 18:09 EvanCarroll

This PR has been stale for nearly two years now, so I'm closing it.

Feel free to send a new PR if you want this 🙇

fgreinacher avatar Oct 05 '23 15:10 fgreinacher

It was stale because you never gave any input on it lol. Despite being asked by others in the same issues https://github.com/semantic-release/gitlab/issues/265#issuecomment-1009940657

EvanCarroll avatar Oct 05 '23 15:10 EvanCarroll

Ha wow, too ambitious in cleaning up. Sorry!

@EvanCarroll I'll review tomorrow or early next week. Can you rebase once more? 🙇

fgreinacher avatar Oct 05 '23 16:10 fgreinacher

@EvanCarroll Do you still want to tackle this? If not someone else could take over.

fgreinacher avatar Dec 04 '23 13:12 fgreinacher

@EvanCarroll shall somebody else take over for you or do you want to continue here?

JonasSchubert avatar Mar 03 '24 11:03 JonasSchubert