Skip to content

Conversation

@JonasSchubert
Copy link
Contributor

@JonasSchubert JonasSchubert commented Mar 23, 2022

@JonasSchubert JonasSchubert changed the title Draft: feat(fail): add hook similar to github feat(fail): add hook similar to github Mar 25, 2022
@JonasSchubert JonasSchubert marked this pull request as ready for review March 25, 2022 16:48
Copy link
Contributor

@fgreinacher fgreinacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JonasSchubert, this is looking great! Just a small idea to reduce duplication in tests.

JonasSchubert and others added 3 commits April 6, 2022 20:09
…failed

BREAKING CHANGE: Issues will be created or are commented by default . Set the `failComment` or `failTitle` option to `false` to disable this behavior.
@fgreinacher fgreinacher changed the title feat(fail): add hook similar to github feat: create issues when the release is failing Apr 9, 2022
@fgreinacher fgreinacher merged commit 0ad008e into semantic-release:master Apr 9, 2022
@github-actions
Copy link

github-actions bot commented Apr 9, 2022

🎉 This PR is included in version 9.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

hvanoch pushed a commit to hvanoch/semantic-release-gitlab that referenced this pull request Apr 14, 2022
BREAKING CHANGE: Issues will be created or are commented by default . Set the `failComment` or `failTitle` option to `false` to disable this behavior.

Co-authored-by: Jonas Schubert <jonas.schubert@siemens.com>
Co-authored-by: Florian Greinacher <florian@greinacher.de>
@jaklan
Copy link

jaklan commented Apr 25, 2022

@JonasSchubert it would be worth to add some example how to pass multiple labels, especially when they contain whitespaces, because it's pretty non-obvious without digging into code.

@JonasSchubert
Copy link
Contributor Author

Would it be helpful to link the API definition?
https://docs.gitlab.com/ee/api/issues.html#new-issue

@jaklan
Copy link

jaklan commented Apr 25, 2022

@JonasSchubert tbh not really, I had to do my own tests, because that case was not covered by docs.

What I discovered is:
a) + instead of spaces work:

curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "https://gitlab.com/api/v4/issues?labels=0)+Release"

b) %20 instead of spaces work:

curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "https://gitlab.com/api/v4/issues?labels=0)%20Release"

Labels should be separated just with comma, if you want to include whitespace after comma - it also has to be encoded as + or %20 - so both works:

curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "https://gitlab.com/api/v4/issues?labels=0)+Release,3)+Type:+Bug"
curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "https://gitlab.com/api/v4/issues?labels=0)+Release,+3)+Type:+Bug"

I haven't tested that with semantic-release yet, but I assume it should work. The question is what would happen if I leave spaces instead of +/%20 - would it be encoded automatically or not?

@JonasSchubert
Copy link
Contributor Author

JonasSchubert commented Apr 25, 2022

It will not be encoded.

I suggest to only support comma separated labels as this is also the official documented functionality. Everything else might stop working at any time.

Todos:

  1. Document it
  2. Maybe add validation

Created #372 to work on that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants