Skip to content
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

[MM-50985] Remove usage of model.AppError #648

Merged
merged 8 commits into from
Apr 11, 2023

Conversation

hanzei
Copy link
Contributor

@hanzei hanzei commented Mar 2, 2023

@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2023

Codecov Report

Patch coverage: 1.61% and no project coverage change.

Comparison is base (fa1237a) 15.54% compared to head (6846df0) 15.54%.

❗ Current head 6846df0 differs from pull request most recent head 207e612. Consider uploading reports for the commit 207e612 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #648   +/-   ##
=======================================
  Coverage   15.54%   15.54%           
=======================================
  Files          15       15           
  Lines        5476     5469    -7     
=======================================
- Hits          851      850    -1     
+ Misses       4582     4577    -5     
+ Partials       43       42    -1     
Impacted Files Coverage Δ
server/plugin/cluster.go 0.00% <0.00%> (ø)
server/plugin/command.go 8.09% <0.00%> (-0.07%) ⬇️
server/plugin/configuration.go 34.50% <0.00%> (-0.25%) ⬇️
server/plugin/mm_34646_token_refresh.go 0.00% <0.00%> (ø)
server/plugin/plugin.go 5.98% <0.00%> (+0.01%) ⬆️
server/plugin/telemetry.go 0.00% <0.00%> (ø)
server/plugin/webhook.go 0.81% <0.00%> (-0.01%) ⬇️
server/plugin/api.go 7.80% <2.85%> (+0.06%) ⬆️
server/plugin/subscriptions.go 8.88% <14.28%> (-0.13%) ⬇️
server/plugin/permalinks.go 73.19% <28.57%> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hanzei hanzei marked this pull request as ready for review March 4, 2023 18:39
@hanzei hanzei added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Mar 4, 2023
if appErr != nil {
return errors.Wrap(appErr, "failed check whether MM-34646 refresh is already done")
var data []byte
err := p.client.KV.Get(mm34646DoneKey, &data)
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we can rename this var to something else? It doesn't provide much context reading the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To which variable are you referring?

Copy link
Member

Choose a reason for hiding this comment

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

mm34646DoneKey

@hanzei hanzei removed the 2: Dev Review Requires review by a core committer label Mar 21, 2023
@hanzei hanzei added this to the v2.2.0 milestone Mar 21, 2023
@hanzei
Copy link
Contributor Author

hanzei commented Mar 21, 2023

@DHaussermann While there is nothing specific to test for, I would appreciate a general smoke test on the plugin functionality, as the PR touches the whole code base.

@hanzei hanzei changed the title Remove usage of model.AppError [MM-50985] Remove usage of model.AppError Mar 28, 2023
@DHaussermann
Copy link

DHaussermann commented Mar 30, 2023

@hanzei The plugin seems to crash when deployed from this build. I have seen this occur locally on master as well as a cloud server.
I have this commit

image

All I did was enable the plugin or try upgrading to this build. The /github commands are not available and within a minute or so it has crashed too many times.

Local logs show the following where I see a panic (I have also attached more logs in a file in case I missed something helpful):

debug [2023-03-30 16:59:00.317 -04:00] starting plugin                               caller="plugin/hclog_adapter.go:52" plugin_id=github wrapped_extras="pathplugins/github/server/dist/plugin-darwin-arm64args[plugins/github/server/dist/plugin-darwin-arm64]"
debug [2023-03-30 16:59:00.320 -04:00] plugin started                                caller="plugin/hclog_adapter.go:52" plugin_id=github wrapped_extras=pathplugins/github/server/dist/plugin-darwin-arm64pid80869
debug [2023-03-30 16:59:00.321 -04:00] waiting for RPC address                       caller="plugin/hclog_adapter.go:52" plugin_id=github wrapped_extras=pathplugins/github/server/dist/plugin-darwin-arm64
debug [2023-03-30 16:59:00.347 -04:00] using plugin                                  caller="plugin/hclog_adapter.go:52" plugin_id=github wrapped_extras=version1
debug [2023-03-30 16:59:00.347 -04:00] plugin address                                caller="plugin/hclog_adapter.go:52" plugin_id=github wrapped_extras="address/var/folders/r4/bc0_cvt965n_b4n6ct_nrc800000gn/T/plugin2944661743networkunixtimestamp2023-03-30T16:59:00.347-0400"
debug [2023-03-30 16:59:00.351 -04:00] panic: runtime error: invalid memory address or nil pointer dereference caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] [signal SIGSEGV: segmentation violation code=0x2 addr=0x40 pc=0x103073434] caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00]                                               caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] goroutine 79 [running]:                       caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] github.com/mattermost/mattermost-plugin-github/server/plugin.(*Plugin).OnConfigurationChange(0x14000434820) caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] 	github.com/mattermost/mattermost-plugin-github/server/plugin/configuration.go:196 +0x34 caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] github.com/mattermost/mattermost-server/v6/plugin.(*hooksRPCServer).OnActivate(0x14000090fc0, 0x140007c6978, 0x14000282680) caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] 	github.com/mattermost/mattermost-server/v6@v6.0.0-20221109191448-21aec2741bfe/plugin/client_rpc.go:304 +0x1cc caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] reflect.Value.call({0x1400028c720?, 0x1400000ebe8?, 0x13?}, {0x10309cc41, 0x4}, {0x14000111ef8, 0x3, 0x3?}) caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] 	reflect/value.go:584 +0x688                  caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] reflect.Value.Call({0x1400028c720?, 0x1400000ebe8?, 0x1?}, {0x140005066f8?, 0x14000080000?, 0x0?}) caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] 	reflect/value.go:368 +0x90                   caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] net/rpc.(*service).call(0x140002c6b00, 0x8?, 0x0?, 0x140005927e0, 0x1400029d780, 0x140002a4600?, {0x10330e580?, 0x140007c6978?, 0x0?}, {0x10330e5c0?, ...}, ...) caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] 	net/rpc/server.go:382 +0x20c                 caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] created by net/rpc.(*Server).ServeCodec       caller="plugin/hclog_adapter.go:54" plugin_id=github
debug [2023-03-30 16:59:00.351 -04:00] 	net/rpc/server.go:479 +0x378                 caller="plugin/hclog_adapter.go:54" plugin_id=github
error [2023-03-30 16:59:00.352 -04:00] RPC call to OnActivate plugin failed.         caller="plugin/client_rpc.go:268" plugin_id=github error="unexpected EOF"
debug [2023-03-30 16:59:00.352 -04:00] Plugin activated                              caller="plugin/environment.go:360" plugin_id=github version=2.1.2
error [2023-03-30 16:59:00.352 -04:00] plugin process exited                         caller="plugin/hclog_adapter.go:79" plugin_id=github wrapped_extras="pathplugins/github/server/dist/plugin-darwin-arm64pid80869errorexit status 2"

debug-logs.txt

@DHaussermann
Copy link

@hanzei please advise on next steps for this.
Do you need to investigate anything on your end before I try this again?

Copy link

@DHaussermann DHaussermann left a comment

Choose a reason for hiding this comment

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

Tested and passed

  • Smoke tested GitHub
    • Authentication is working from browser and desktop
    • Create and attach are working as expected
    • Tested subscription creation and delivery
    • Various slash commands to retrieve data me, todo etc...
  • No new error in the server logs found (just the known issue with API rate limit)
  • No issues found in dev console or network tab

No regression or changes in behavior found

LGTM!

@DHaussermann DHaussermann added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester labels Apr 11, 2023
@hanzei hanzei merged commit c712474 into master Apr 11, 2023
@hanzei hanzei deleted the MM-50985_remove_model.AppError branch April 11, 2023 21:32
trilopin added a commit that referenced this pull request Apr 17, 2023
* master:
  [MM-50985] Remove usage of model.AppError (#648)
  [GH-548]:Fixed issue #548 on github 'org lock for username not working'  (#658)
@avas27JTG avas27JTG mentioned this pull request Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants