You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using Gitlab 17.4.1 and CML 0.20.4. We have recently started noticing that images added to MR comments via cml comment create or cml comment update, while uploaded correctly, cannot be accessed under the link CML puts into the MR comment.
I was not able to find a change in Gitlab 17 that would explain this behaviour yet, so it might be configuration on our end. I talked to the admins but they aren't aware of anything either.
I would like to propose switching to a more robust version of the links though.
When users manually upload files to a comment, Gitlab simply puts in a relative path like this:
Update: Forgot to mention this above, but from what I saw from the CML code the currently used links are put together from the Gitlab API response of the projects/uploads endpoint and the project path. The former part being exactly that relative URL/path mentioned in my last code snippet. So, seemingly, all that would need to be done is to change
Hi everyone,
We are using Gitlab 17.4.1 and CML 0.20.4. We have recently started noticing that images added to MR comments via
cml comment create
orcml comment update
, while uploaded correctly, cannot be accessed under the link CML puts into the MR comment.CML puts in absolute URLs like
For new file uploads in Gitlab 17 these URLs do not work anymore (they continue working for uploads that already exist).
What works instead is this:
I was not able to find a change in Gitlab 17 that would explain this behaviour yet, so it might be configuration on our end. I talked to the admins but they aren't aware of anything either.
I would like to propose switching to a more robust version of the links though.
When users manually upload files to a comment, Gitlab simply puts in a relative path like this:
Is there any reason not to use this approach?
Update: Forgot to mention this above, but from what I saw from the CML code the currently used links are put together from the Gitlab API response of the projects/uploads endpoint and the project path. The former part being exactly that relative URL/path mentioned in my last code snippet. So, seemingly, all that would need to be done is to change
cml/src/drivers/gitlab.js
Line 144 in 5e9fcd2
and drop
${repo}
from it. In my rather naive attempt of testing that it led to an assertion error for the URL though.The text was updated successfully, but these errors were encountered: