mattermost-plugin-gitlab
mattermost-plugin-gitlab copied to clipboard
Encountered an error getting your to do items
After setting up the plugin everything works fine except the todo function.
When calling /gitlab todo
I get Encountered an error getting your to do items
in the UI.
In the Mattermost log the plugin is throwing two errors almonst every minute:
-
{"level":"error","ts":1587731687.333412,"caller":"mlog/sugar.go:23","msg":"can't get todo in command","plugin_id":"com.github.manland.mattermost-plugin-gitlab","err":"can't list todo in GitLab api: json: cannot unmarshal string into Go struct field TodoTarget.target.id of type int"}
-
| {"level":"error","ts":1587731600.044075,"caller":"mlog/sugar.go:23","msg":"unable to list unreads in GitLab API","plugin_id":"com.github.manland.mattermost-plugin-gitlab","err":"can't list todo in GitLab api: json: cannot unmarshal string into Go struct field TodoTarget.target.id of type int"}
We should improve logging all over the place for JSON unmarshaling failing.
Any news? This is unresolved :-(
Hi @zawadaa ,what MM/Gitlab versions are you using? Also, are you sure you see these exact messages flooding? Thanks.
Hi! Yesterday I've updated my Gitlab installation (so MM is now 7.2.0) and works!! Thanks!!
Hi @paulkitt , can you validate that it works and close the ticket if it indeed does? Thanks.
@zawadaa Could you please tell me which version of gitlab you upgraded to?
This was probably Gitlab https://about.gitlab.com/releases/2022/09/22/gitlab-15-4-released/ - check changelog.
@zawadaa I'm using gitlab 15.11.13, mm 7.10.0 and plugin version 1.7.0 but the problem is still there, it's so weird =\
SOA#1 Gitlab 16.4.1 and MM 8.1.2.
@DHaussermann, @levb, @mickmister, @manland we were experimenting with the plugin at my workplace and encountered this issue as well. After digging into the code and dependencies (more precisely go-gitlab
), I found that this comes from the issue described here https://github.com/xanzy/go-gitlab/issues/1743
To summarize, gitlab is supposed to return an int
id for targets of todos but instead returns a commit sha as a string when the target is a commit (it happens when your todo item is a comment on a commit for example).
The team at go-gitlab
fixed the problem by putting a workaround while Gitlab still has the issue open (see https://gitlab.com/gitlab-org/gitlab/-/issues/416180). But they introduced a typo which needs to be fixed (see https://github.com/xanzy/go-gitlab/pull/1744#issuecomment-1917573203).
I see that the latest release of the mattermost plugin stil uses the version 0.55.0 of go-gitlab.
Can you update to the latest version (now it 0.96.0 but still has the problem) once they fix the typo?
And to all the commenters above, you are seeing that sometimes it works and sometimes not because it happens only when you receive a comment in Gitlab from someone who wrote it on a commit (see my test here)
Hi @aelgasser, thanks so much for this thorough explanation. We can certainly ship a fix with the latest go-gitlab
version once this is fixed in that library. Thanks again for the full context and resolution here :+1:
cc @hanzei
Hi @mickmister the issue has just been fixed in go-gitlab in their 0.97.0 release (https://github.com/xanzy/go-gitlab/pull/1744#issuecomment-1925326400, https://github.com/xanzy/go-gitlab/releases/tag/v0.97.0)
Thanks @aelgasser, we're queuing this change for the next release :+1:
Thanks again for your help here!
Thank you @mickmister Do you have an approximate timeline for the next release? I know it's been about 4 years for other people waiting in this discussion and only about 1 week for me, but we are evaluating ways to streamline our workflows with Mattermost and would love to keep the momentum.
Best
Hi @aelgasser, we have a release in process and are including this fix in the release. I'm thinking this will be released next week. I'll keep you updated. Thanks again
Hi @mickmister, I see you released version 1.8.1 with the fix thank you! Although we don't see it on the Mattermost plugin marketplace (https://mattermost.com/marketplace/gitlab-plugin/) or at least when we try to update from our version 1.8.0, Mattermost doesn't find any newer version. Is there another step before updating this marketplace?
I don't know if it's the proper channel, but may I suggest adding the current version number to the plugin page in the marketplace (on the right sidebar along with the author and categories for example)?
Best, Abdel
@aelgasser Apologies, this actually did not get into the 1.8.1 release. We are wrapping up last changes for 1.9.0 though, and will have it out as soon as it's been validated and tested.
Version 1.8.1 should be showing in the in-product marketplace though. Is this not what you see?
@mickmister found version 1.8.1 and now waiting patiently for 1.9.0 then :)