mattermost-plugin-gitlab icon indicating copy to clipboard operation
mattermost-plugin-gitlab copied to clipboard

Add support for triggering pipelines and job status updates

Open spirosoik opened this issue 3 years ago • 16 comments

Summary

Add the capability to trigger the Gitlab pipelines. In parallel after the trigger if you are subscribed to jobs you will get status updates for jobs of the pipelines.dc

Ticket Link

Ticket: #213 & #289

spirosoik avatar Jun 07 '22 11:06 spirosoik

checking why it fails

spirosoik avatar Jun 07 '22 11:06 spirosoik

Seems to be related to npm and some deprecation

spirosoik avatar Jun 07 '22 11:06 spirosoik

@spirosoik Should be fixed with https://github.com/mattermost/mattermost-plugin-gitlab/pull/303

mickmister avatar Jun 07 '22 20:06 mickmister

Codecov Report

Base: 28.48% // Head: 28.89% // Increases project coverage by +0.40% :tada:

Coverage data is based on head (7feb313) compared to base (2c3003b). Patch coverage: 39.04% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #302      +/-   ##
==========================================
+ Coverage   28.48%   28.89%   +0.40%     
==========================================
  Files          20       21       +1     
  Lines        2619     2724     +105     
==========================================
+ Hits          746      787      +41     
- Misses       1789     1851      +62     
- Partials       84       86       +2     
Impacted Files Coverage Δ
server/command.go 23.57% <0.00%> (-2.66%) :arrow_down:
server/subscription/subscription.go 94.87% <0.00%> (-5.13%) :arrow_down:
server/webhook.go 40.00% <0.00%> (-2.34%) :arrow_down:
server/webhook/webhook.go 55.38% <ø> (ø)
server/webhook/jobs.go 87.23% <87.23%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Jun 09 '22 08:06 codecov[bot]

@catalintomai fixed the comments

spirosoik avatar Jun 21 '22 13:06 spirosoik

@catalintomai are you ok to merge this?

spirosoik avatar Jun 24 '22 06:06 spirosoik

@mickmister are we waiting for QA or are we ok to merge?

spirosoik avatar Jul 05 '22 14:07 spirosoik

@DHaussermann could you please help for the QA review?

spirosoik avatar Jul 06 '22 08:07 spirosoik

I've tried to take a look at the commands you added but, I'm seeing an issue. The plugin appears to be crashing when I try using a pipeline command. Not actully sure I'm using this right but, it crashes when I do pipelines run such as /gitlab pipelines run dhaussermann/pipelinetest image

When this occurs, other GitLab commands seem to be functional.

Streps:

  • Create a server using /cloud
  • Upload the plugin from this PR branch
  • Configure the Plugin to use a 3rd party oAuth App on the GitLab side that I have created for my profile
  • Connect a test user and ensure new commands are available
  • run /gitlab pipelines run dhaussermann/pipelinetest Observed Plugin seem to crach and logs show:
{"timestamp":"2022-07-11 19:36:54.617 Z","level":"warn","msg":"event type not implemented","caller":"app/plugin_api.go:943","plugin_id":"com.github.manland.mattermost-plugin-gitlab","type":"Job Hook"}
{"timestamp":"2022-07-11 19:37:07.902 Z","level":"warn","msg":"event type not implemented","caller":"app/plugin_api.go:943","plugin_id":"com.github.manland.mattermost-plugin-gitlab","type":"Job Hook"}
{"timestamp":"2022-07-11 19:37:08.668 Z","level":"info","msg":"new msg","caller":"app/plugin_api.go:937","plugin_id":"com.github.manland.mattermost-plugin-gitlab","message":"[dhaussermann/pipelinetest](https://gitlab.com/dhaussermann/pipelinetest) Your pipeline has failed for Comment\nWith\nLine\nBreaks\n[View Commit](https://gitlab.com/dhaussermann/pipelinetest/-/commit/2250e100e19a5354b75723862b74152a4d28d39e)","from":""}
{"timestamp":"2022-07-11 19:37:08.669 Z","level":"info","msg":"new msg","caller":"app/plugin_api.go:937","plugin_id":"com.github.manland.mattermost-plugin-gitlab","message":"[dhaussermann/pipelinetest](https://gitlab.com/dhaussermann/pipelinetest) Pipeline by [dhaussermann](https://gitlab.com/dhaussermann) fail for Comment\nWith\nLine\nBreaks\n[View Commit](https://gitlab.com/dhaussermann/pipelinetest/-/commit/2250e100e19a5354b75723862b74152a4d28d39e)","from":"dhaussermann"}
{"timestamp":"2022-07-11 20:46:14.662 Z","level":"info","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:61","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"pathplugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-linux-amd64pid83"}
{"timestamp":"2022-07-11 20:46:15.195 Z","level":"warn","msg":"ignored duplicate step name","caller":"app/plugin_api.go:943","plugin_id":"com.github.manland.mattermost-plugin-gitlab","name":"oauth-info","flow":"oauth"}
{"timestamp":"2022-07-11 21:06:57.267 Z","level":"warn","msg":"Can't list merge-request where author in GitLab API","caller":"app/plugin_api.go:943","plugin_id":"com.github.manland.mattermost-plugin-gitlab","userid":"u3akdebgg38jzqmontipwh5gth","gitlab userid":"2658775","gitlab username":"dhaussermann","error":"context deadline exceeded"}
{"timestamp":"2022-07-11 21:11:35.150 Z","level":"error","msg":"RPC call ExecuteCommand to plugin failed.","caller":"plugin/client_rpc_generated.go:104","plugin_id":"com.github.manland.mattermost-plugin-gitlab","error":"unexpected EOF"}
{"timestamp":"2022-07-11 21:11:35.150 Z","level":"error","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:79","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"pathplugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-linux-amd64pid91errorexit status 2"}
{"timestamp":"2022-07-11 21:11:35.150 Z","level":"error","msg":"/gitlab command crashed the com.github.manland.mattermost-plugin-gitlab plugin. Please contact your system administrator","caller":"web/context.go:105","path":"/api/v4/commands/execute","request_id":"nth53yrz1p8t8ybpg4wosir1zr","ip_addr":"100.98.151.0","user_id":"u3akdebgg38jzqmontipwh5gth","method":"POST","err_where":"ExecutePluginCommand","http_code":500,"err_details":"err= Plugin com.github.manland.mattermost-plugin-gitlab crashed due to /gitlab command"}
{"timestamp":"2022-07-11 21:11:38.089 Z","level":"warn","msg":"Health check failed for plugin","caller":"plugin/health_check.go:59","id":"com.github.manland.mattermost-plugin-gitlab","error":"plugin RPC connection is not responding"}
{"timestamp":"2022-07-11 21:11:38.089 Z","level":"error","msg":"RPC call OnDeactivate to plugin failed.","caller":"plugin/client_rpc_generated.go:33","plugin_id":"com.github.manland.mattermost-plugin-gitlab","error":"connection is shut down"}
{"timestamp":"2022-07-11 21:11:38.089 Z","level":"warn","msg":"error closing client during Kill","caller":"plugin/hclog_adapter.go:70","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"errconnection is shut down"}
{"timestamp":"2022-07-11 21:11:38.089 Z","level":"warn","msg":"plugin failed to exit gracefully","caller":"plugin/hclog_adapter.go:72","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-07-11 21:11:38.300 Z","level":"warn","msg":"ignored duplicate step name","caller":"app/plugin_api.go:943","plugin_id":"com.github.manland.mattermost-plugin-gitlab","name":"oauth-info","flow":"oauth"}

@spirosoik let me know if your able to reproduce this or have any thoughts on how to further isolate what's happening.

DHaussermann avatar Jul 11 '22 21:07 DHaussermann

I will check this @DHaussermann

spirosoik avatar Jul 12 '22 05:07 spirosoik

/update-branch

DHaussermann avatar Sep 14 '22 12:09 DHaussermann

@mickmister I did all the fixes we discussed. @DHaussermann you can give a try to test, i did some tests too. Thanks :)

spirosoik avatar Sep 16 '22 13:09 spirosoik

@mickmister fixed all the comments. @DHaussermann whenever you have time let's do the QA testing

spirosoik avatar Sep 23 '22 07:09 spirosoik

Hi @spirosoik, just some quick

  1. I'm slightly confused by how to run the command to trigger a pipeline, When I run /gitlab pipelines run dhaussermann/pipelinetest I see Please specify a repository. even though it's been supplied. Maybe the ref parameter is not optional?
  2. What value exactly to I supply for ref?
  3. Can we update the /help to give some info about this?

DHaussermann avatar Sep 23 '22 14:09 DHaussermann

Hi @spirosoik, just some quick questions

  1. I'm slightly confused by how to run the command to trigger a pipeline, When I run /gitlab pipelines run dhaussermann/pipelinetest I see Please specify a repository. even though it's been supplied. Maybe the ref parameter is not optional?
  2. What value exactly to I supply for ref?
  3. Can we update the /help to give some info about this?

fixed you are right actually. We did a change during the code review and we broke this. Now it should be fine. I will evolve help too.

spirosoik avatar Sep 23 '22 14:09 spirosoik

@spirosoik I have the latest now and when I run /gitlab pipelines run dhaussermann/pipelinetest I see the plugin crash with

{"timestamp":"2022-09-23 10:57:49.313 -04:00","level":"error","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:79","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"pathplugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-darwin-amd64pid98821errorexit status 2"}
{"timestamp":"2022-09-23 10:57:49.313 -04:00","level":"error","msg":"RPC call ExecuteCommand to plugin failed.","caller":"plugin/client_rpc_generated.go:104","plugin_id":"com.github.manland.mattermost-plugin-gitlab","error":"unexpected EOF"}
{"timestamp":"2022-09-23 10:57:49.313 -04:00","level":"error","msg":"/gitlab command crashed the com.github.manland.mattermost-plugin-gitlab plugin. Please contact your system administrator","caller":"web/context.go:117","path":"/api/v4/commands/execute","request_id":"nbje6b5a1jgi8dgtrhx4or81hy","ip_addr":"::1","user_id":"ryme39dkdirg3kuzyg688d8y3w","method":"POST","err_where":"ExecutePluginCommand","http_code":500,"error":"ExecutePluginCommand: /gitlab command crashed the com.github.manland.mattermost-plugin-gitlab plugin. Please contact your system administrator, err= Plugin com.github.manland.mattermost-plugin-gitlab crashed due to /gitlab command"}

Please let me know if you can reproduce this?

More of the logs here:

{"timestamp":"2022-09-23 10:57:49.307 -04:00","level":"debug","msg":"reflect.Value.Call({0xc000390a20?, 0xc000010098?, 0xffffffffffffffff?}, {0xc0005d56f8, 0x3, 0x3})","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-23 10:57:49.307 -04:00","level":"debug","msg":"\treflect/value.go:339 +0xbf","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-23 10:57:49.307 -04:00","level":"debug","msg":"net/rpc.(*service).call(0xc00068e080, 0xc0015136c0?, 0xc0006fd560?, 0xc0000d60d0, 0xc0004f6100, 0xc0005d5798?, {0x196a100?, 0xc0001e8ef0?, 0x12abc26?}, {0x196a140, ...}, ...)","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-23 10:57:49.307 -04:00","level":"debug","msg":"\tnet/rpc/server.go:381 +0x226","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-23 10:57:49.307 -04:00","level":"debug","msg":"created by net/rpc.(*Server).ServeCodec","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-23 10:57:49.307 -04:00","level":"debug","msg":"\tnet/rpc/server.go:478 +0x3fe","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-23 10:57:49.313 -04:00","level":"error","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:79","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"pathplugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-darwin-amd64pid98821errorexit status 2"}
{"timestamp":"2022-09-23 10:57:49.313 -04:00","level":"error","msg":"RPC call ExecuteCommand to plugin failed.","caller":"plugin/client_rpc_generated.go:104","plugin_id":"com.github.manland.mattermost-plugin-gitlab","error":"unexpected EOF"}
{"timestamp":"2022-09-23 10:57:49.313 -04:00","level":"error","msg":"/gitlab command crashed the com.github.manland.mattermost-plugin-gitlab plugin. Please contact your system administrator","caller":"web/context.go:117","path":"/api/v4/commands/execute","request_id":"nbje6b5a1jgi8dgtrhx4or81hy","ip_addr":"::1","user_id":"ryme39dkdirg3kuzyg688d8y3w","method":"POST","err_where":"ExecutePluginCommand","http_code":500,"error":"ExecutePluginCommand: /gitlab command crashed the com.github.manland.mattermost-plugin-gitlab plugin. Please contact your system administrator, err= Plugin com.github.manland.mattermost-plugin-gitlab crashed due to /gitlab command"}
{"timestamp":"2022-09-23 10:57:49.313 -04:00","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:165","method":"POST","url":"/api/v4/commands/execute","request_id":"nbje6b5a1jgi8dgtrhx4or81hy","status_code":"500"}
{"timestamp":"2022-09-23 10:57:56.104 -04:00","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:165","method":"POST","url":"/api/v4/channels/members/me/view","request_id":"6ac958ua5pn6zj18wiihh3fy8h","status_code":"200"}
{"timestamp":"2022-09-23 10:57:56.981 -04:00","level":"warn","msg":"Health check failed for plugin","caller":"plugin/health_check.go:59","id":"com.github.manland.mattermost-plugin-gitlab","error":"plugin RPC connection is not responding"}
{"timestamp":"2022-09-23 10:57:56.981 -04:00","level":"debug","msg":"Restarting plugin due to failed health check","caller":"plugin/health_check.go:72","id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-23 10:57:56.981 -04:00","level":"error","msg":"RPC call OnDeactivate to plugin failed.","caller":"plugin/client_rpc_generated.go:33","plugin_id":"com.github.manland.mattermost-plugin-gitlab","error":"connection is shut down"}
{"timestamp":"2022-09-23 10:57:56.981 -04:00","level":"warn","msg":"error closing client during Kill","caller":"plugin/hclog_adapter.go:70","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"errconnection is shut down"}
{"timestamp":"2022-09-23 10:57:56.981 -04:00","level":"warn","msg":"plugin failed to exit gracefully","caller":"plugin/hclog_adapter.go:72","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-23 10:57:57.110 -04:00","level":"debug","msg":"starting plugin","caller":"plugin/hclog_adapter.go:52","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"pathplugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-darwin-amd64args[plugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-darwin-amd64]"}
{"timestamp":"2022-09-23 10:57:57.115 -04:00","level":"debug","msg":"plugin started","caller":"plugin/hclog_adapter.go:52","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"pathplugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-darwin-amd64pid98901"}
{"timestamp":"2022-09-23 10:57:57.116 -04:00","level":"debug","msg":"waiting for RPC address","caller":"plugin/hclog_adapter.go:52","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"pathplugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-darwin-amd64"}
{"timestamp":"2022-09-23 10:57:57.151 -04:00","level":"debug","msg":"plugin address","caller":"plugin/hclog_adapter.go:52","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"address/var/folders/5n/r24krwzx2g560sp89tj6cv6h0000gn/T/plugin1595431326networkunixtimestamp2022-09-23T10:57:57.151-0400"}
{"timestamp":"2022-09-23 10:57:57.151 -04:00","level":"debug","msg":"using plugin","caller":"plugin/hclog_adapter.go:52","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"version1"}
{"timestamp":"2022-09-23 10:57:57.232 -04:00","level":"warn","msg":"ignored duplicate step name","caller":"app/plugin_api.go:977","plugin_id":"com.github.manland.mattermost-plugin-gitlab","name":"oauth-info","flow":"oauth"}

DHaussermann avatar Sep 23 '22 15:09 DHaussermann

@DHaussermann I think there are some lines missing from your stack trace. There should be a few more lines above that block that has more info on where the panic occurred

mickmister avatar Sep 29 '22 15:09 mickmister

Thanks for pointing this out @mickmisterand
Here is I believe a more complete stack trace that shows a panic

{"timestamp":"2022-09-29 18:35:02.662 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:165","method":"GET","url":"/api/v4/system/ping","request_id":"n935zik9a7g18jb5t5n3dcooxc","status_code":"200"}
{"timestamp":"2022-09-29 18:35:02.662 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:165","method":"GET","url":"/api/v4/system/ping","request_id":"zqkn8pgh1j8exdupyq488wjh8o","status_code":"200"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"panic: runtime error: index out of range [2] with length 2","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"goroutine 243 [running]:","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"main.(*Plugin).pipelinesCommand(0xc000327110?, {0x10e8970?, 0xc0006daae0?}, {0xc00047fa20?, 0x0?, 0x0?}, {0xc0006ab460?, 0x1?}, 0xc0000374cc?)","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"\tgithub.com/mattermost/mattermost-plugin-gitlab/server/command.go:619 +0xd4","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"main.(*Plugin).ExecuteCommand(0xc000327110, 0xf11f40?, 0xc000649040)","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"\tgithub.com/mattermost/mattermost-plugin-gitlab/server/command.go:281 +0x12fe","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"github.com/mattermost/mattermost-server/v6/plugin.(*hooksRPCServer).ExecuteCommand(0x2?, 0xc0005bd530, 0xc0005bd560)","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"\tgithub.com/mattermost/mattermost-server/[email protected]/plugin/client_rpc_generated.go:114 +0x5d","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"reflect.Value.call({0xc000303380?, 0xc00000e5b8?, 0x13?}, {0xf1f5c7, 0x4}, {0xc000471ef8, 0x3, 0x3?})","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"\treflect/value.go:556 +0x845","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"reflect.Value.Call({0xc000303380?, 0xc00000e5b8?, 0xffffffffffffffff?}, {0xc0003be6f8, 0x3, 0x3})","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"\treflect/value.go:339 +0xbf","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"net/rpc.(*service).call(0xc0000a2440, 0xc00147e240?, 0xc00068c360?, 0xc0003da390, 0xc0000e8680, 0xc0003be798?, {0xd65220?, 0xc0005bd530?, 0x6a5be6?}, {0xd65260, ...}, ...)","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"\tnet/rpc/server.go:381 +0x226","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"created by net/rpc.(*Server).ServeCodec","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.904 Z","level":"debug","msg":"\tnet/rpc/server.go:478 +0x3fe","caller":"plugin/hclog_adapter.go:54","plugin_id":"com.github.manland.mattermost-plugin-gitlab"}
{"timestamp":"2022-09-29 18:35:06.906 Z","level":"error","msg":"RPC call ExecuteCommand to plugin failed.","caller":"plugin/client_rpc_generated.go:104","plugin_id":"com.github.manland.mattermost-plugin-gitlab","error":"unexpected EOF"}
{"timestamp":"2022-09-29 18:35:06.906 Z","level":"error","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:79","plugin_id":"com.github.manland.mattermost-plugin-gitlab","wrapped_extras":"pathplugins/com.github.manland.mattermost-plugin-gitlab/server/dist/plugin-linux-amd64pid181errorexit status 2"}
{"timestamp":"2022-09-29 18:35:06.906 Z","level":"error","msg":"/gitlab command crashed the com.github.manland.mattermost-plugin-gitlab plugin. Please contact your system administrator","caller":"web/context.go:117","path":"/api/v4/commands/execute","request_id":"ikcmwyh8pj86pg1s1pwo5p345h","ip_addr":"100.120.23.128","user_id":"hima51im7tb95y6rg11z9g4mke","method":"POST","err_where":"ExecutePluginCommand","http_code":500,"error":"ExecutePluginCommand: /gitlab command crashed the com.github.manland.mattermost-plugin-gitlab plugin. Please contact your system administrator, err= Plugin com.github.manland.mattermost-plugin-gitlab crashed due to /gitlab command"}
{"timestamp":"2022-09-29 18:35:06.906 Z","level":"debug","msg":"Received HTTP request","caller":"web/handlers.go:165","method":"POST","url":"/api/v4/commands/execute","request_id":"ikcmwyh8pj86pg1s1pwo5p345h","status_code":"500"}

cc @spirosoik

DHaussermann avatar Sep 29 '22 18:09 DHaussermann

@DHaussermann the issues is the trigger. you need to do /gitlab pipelines run dhaussermann/pipelinetest <branch-name> eg. /gitlab pipelines run dhaussermann/pipelinetest main

Though I will fix this to get the right error back

spirosoik avatar Oct 12 '22 14:10 spirosoik

@DHaussermann fixed if you miss any of repository or branch you will get an error message back.

spirosoik avatar Oct 12 '22 14:10 spirosoik

Thanks @spirosoik, I've done another round of testing and have a couple points for you to review.

  1. I'm not sure how the trigger command is working. To my understanding - in the following example, build or test should be individual jobs I can trigger. But I can't sort out the syntax. Please provide guidance. It seems like I don't need to provide owner``projectbut either way,/gitlab pipelines trigger testand/gitlab pipelines trigger dhaussermann/pipelinetest testreturnUnknown action` Screen Shot 2022-10-23 at 1 54 16 PM
  2. Pipeline commands are missing from the help
UX Issues - Maybe could be addressed in a separate PR if needed
  1. If the branch is not found this error could be less cryptic. Current shows web response code error.
  2. Is it possible to show branch rather than ref to make this more intuitive?

DHaussermann avatar Oct 23 '22 20:10 DHaussermann

hey @DHaussermann

  1. Gitlab has the notion of pipeline and after triggering this you have the notion of Job. So the first step is to be able to trigger pipelines and run the CI/CD automation on this repo. In the Gitlab CI/CD pipelines is possible to have jobs which you need to trigger manually but for now you need the pipeline ID and the job name. This needs some changes which could be in a second iteration so we can improve the exprience.

  2. Let's merge it and we can have separate issues in Github which I can work on.

spirosoik avatar Oct 26 '22 07:10 spirosoik

@stylianosrigas sorry for the delay in posting an update.

On 1. I Thanks for providing some detail. I understand that there are future enhancements planned for this. but I am still unable to actually see the trigger command working. I tried adding the pipeline ID like so /gitlab pipelines trigger [pipeline ID] [job name] but I get the response Unknown action Can you provide a sample syntax if the trigger command should be functional in this current PR.

On. 2. Created https://github.com/mattermost/mattermost-plugin-gitlab/issues/331 to address.

DHaussermann avatar Nov 17 '22 15:11 DHaussermann

@DHaussermann

  1. I mean it's not implemented sorry I wasn't clear enough. I will remove the autocompletion as it's causing confusion.
  2. Great thanks :)

spirosoik avatar Nov 17 '22 20:11 spirosoik

Thanks @spirosoik, I understand now. For the time being we don't have this implemented in a way that we want to ship so, it should be removed. I wrote this up as a new issue here. https://github.com/mattermost/mattermost-plugin-gitlab/issues/332

DHaussermann avatar Nov 22 '22 17:11 DHaussermann