-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong Gitlab issue link in release notes #449
Comments
I have the exact same issue for almost every url. Every url is missing
I bumped the version of all packages expecting that this was already fixed, but it looks like the issue is still present on the newest version. It looks like GitLab no longer supports urls without the CC @travi |
from my understanding, the underlying @fgreinacher are you familiar with the details necessary to get this working as expected? |
if you execute with the |
I have never noticed that. Might be a change in GitLab 16? |
I guess this is what made the change:: https://docs.gitlab.com/ee/update/deprecations.html?removal_milestone=16.0#legacy-urls-replaced-or-removed |
This sounds like something that would be better handled in |
we tried this for commits and issues: 1.1.0 (https://gitlab.com/xxxxxxxx/semantic-test/compare/v1.0.0...v1.1.0) (2023-05-18) Features
As you see, it worked for commits (/-/commit/) but not for issues |
Hey @travi , |
help me understand. are you trying to highlight something that is beyond the understanding that i'm outlining here? |
@travi |
@doteric please stop pinging maintainers directly for updates. i understand that this feels urgent from your perspective, but we have to ask for your patience with this. i would never tell someone to delay updating to the latest version of a major tool, but by upgrading to a version that includes changes that break tools like semantic-release, that is a consequence of making that upgrade. before our users, like you, started reporting the breakage to us, we were unaware that this breakage was coming.
as i mentioned above, i believe the better place to fix this is in conventional-changelog. if you do a search in that project for "gitlab" you can find several previous conversations about formatting of gitlab urls. i could be wrong about that being the proper place, but one of the reasons we ask for patience is to have a chance to investigate further and hear back from the maintainers of conventional-changelog. in addition, semantic-release is not a full time project for any of us, so time available for our investigation is limited. beyond that context, we try very hard to avoid configuration that enables arbitrary content to be provided by users that is then injected into output like a link. it is very unlikely that we would accept such an approach unless there is no better option (and would likely require some level of input sanitization). from my understanding, this gitlab update also broke links contained in previous releases. a fix in semantic-release would only impact links generated for new releases. until a resolution is found, new links will be broken in the same way as your previous releases. it is up to you if you go back and update previous releases, but such changes could be applied the same way to the releases impacted by this time period. another workaround could be to disable |
Thanks for the reply Travi,
Sorry for bothering, don't want to cause problems and just a reply whenever you have some spare time is perfectly fine. Anyway there is nothing one could do, it's a breaking change on GitLab's side and in such case we can't just go to a previous version therefore it simply does not work anymore and will not until addressed, but I understand your concern also.
I fully understand your concerns, but the thing is that
Yes exactly, a fix would not fix previous releases anyway, but at least new releases would not be impacted. So to conclude - you are right that there is not big hurry and let's wait and see if there is a better solution on a different level. 👍 Sorry for bothering again and wish you a good day 🙇 |
as i continue to investigate this, i think i'm finally grasping what you were clarifying here. these details were defined this way before i joined the project as a maintainer, so i was making an assumption that appears to be incorrect. i thought we were leveraging the host details defined in the core package from the conventional-changelog project. since the configs appear to be the same at first glance between the projects, it left me wondering why we have our own definition. it appears that our version was defined a few months ahead of the version exposed in the other package, or at least ahead of when it was exposed in the current way. i havent compared the two sets of configs in detail, but assuming further inspection doesnt expose a reason to keep them separate, that duplication feels like debt that should be cleaned up rather than making a change that causes them to diverge. that sort of cleanup obviously would not solve the gitlab breaking change situation, but i think it does get us in line with my earlier understanding where the conventional-changelog project would be the proper source of those rules. aligning on a way to make the update there would then also enable fixing use with semantic-release and with other consumers of those rules through various uses of the conventional-changelog-core package. assuming no surprises would arise from taking such a step in this plugin, are there concerns that come up that i might not be considering? |
given my misunderstanding of the hosts config, i was not fully processing the proposal to define the extra path part as part of the hosts config. instead, i was understanding the proposal as open user input as part of the plugin config. i now understand that this would be less freeform than i thought. however, this does raise another question that i thought would have been handled by opting into the extra path part through plugin config. how is semantic-release or conventional-changelog to know which version of gitlab is in use? is my understanding correct that there are supported versions of gitlab that still use the old format? wouldn't using the new format for all github projects just break those that have not upgraded instead of those that have upgraded? |
for info, the "new" urls were deployed in gitlab 9.0 5 years ago so I'm pretty sure everybody has jumped to the new pattern. |
No worries, you are kinda right on one part though, these values can also be edited by the plugin payload/config and in case someone has a self-hosted instance then all of them will need to be inputed manually anyway (at least from what I understand from the code). Edit: Not all values can actually be edited, just the ones provided here: https://github.com/semantic-release/release-notes-generator/blob/master/index.js#LL77C43
According to https://github.com/semantic-release/release-notes-generator/blob/master/index.js#L45 (and https://github.com/semantic-release/release-notes-generator/blob/master/lib/hosts-config.js#LL30C5-L30C13) the hostname needs to match the one provided in the config that means that if someone is using a self-hosted GitLab instance then it won't match anyway and there is no way to use an old version of the |
I override the configuration as described in the conventional-changelog documentation const config = {
plugins: [
[
'@semantic-release/release-notes-generator',
{
presetConfig:
{
commitUrlFormat: '{{host}}/{{owner}}/{{repository}}/-/commit/{{hash}}',
compareUrlFormat: '{{host}}/{{owner}}/{{repository}}/-/compare/{{previousTag}}...{{currentTag}}',
issueUrlFormat: '{{host}}/{{owner}}/{{repository}}/-/issues/{{id}}',
},
},
],
],
}; |
i've dug further into the refactor that i mentioned above to attempt to leverage the hosts config from the core conventional-changelog package. while i do think there is direct duplication of the current hosts config between our two projects, i'm not seeing a clean way to share that config from conventional-changelog and also handle use of that config in a way that is compatible with our context. in addition, while that code would be accessible from the conventional-changelog package, it isnt defined to be part of their public api, so we would be taking a risk of being broken from that being made inaccessible in the future. given that context, it does seem like it would be on us if we want to handle this correctly for this plugin when gitlab is used. the one hesitation that i still with the proposed change in #450 is considering the generic approach to be simply a suffix to the repository definition. that does work in this scenario, but because the change that gitlab decided to make happens to be between the repository and the rest of the path parts. plus, they applied it consistently across all of the links necessary. @baby-gnu thank you for sharing the approach that you found to work. the thing i like about that approach is that it handles the various links independently and would enable changes at other positions in the url. i have not had a chance to determine if this sort of approach is possible directly through the writer api, but i think i would lean in this sort of direction if it is possible. if someone would be willing to determine if something like this would be possible in our call to the writer, that would be helpful for moving this forward. |
Just FYI. As for the format urls I'm not really a fan of having to set each one of those (not even sure if it would work in all cases anyway) especially that we know that every GitLab url changes. Up to you to decide though ;D |
Hello,
in Release notes the links of issues and commits are not correct. the link is missing "-/"
for example:
the link in release notes:
Repository_URL/issues/<issue_iid>
the link in Gitlab:
Repository_URL/-/issues/<issue_iid>
any idea how to fix this issue?
The text was updated successfully, but these errors were encountered: