mattermost-community / mattermost-plugin-aws-SNS

Plugin that receives SNS notification from Alerts created by AWS CloudWatch and sent via AWS SNS
Apache License 2.0
21 stars 22 forks source link

Fixes in build process #3

Closed C2L2C closed 5 years ago

C2L2C commented 5 years ago

I was having the following issues when trying to build the plugin:

  1. Outdated Makefile: After the cloning the repo and running make, I was having the following issue:
    Running govet
    vet: flag "-shadow" not defined
    Run "go help vet" for more information
    Makefile:54: recipe for target 'govet' failed
    make: *** [govet] Error 1

    Solved it by using the following version of Makefile: Makefile

Also need to change L60 in the above link: $(GO) vet -vettool=$(GOPATH)/bin/shadow ./server/... to $(GO) vet -vettool=${GOPATH}/bin/shadow ./server/... @scottleedavis Please check this.

  1. Missing Standard Writer in pkg/mod/github.com/mattermost/mattermost-server@v5.10.0+incompatible/plugin/hclog_adapter.go

The above mentioned file was missing the standard writer and was giving the issue:

../../pkg/mod/github.com/mattermost/mattermost-server@v5.10.0+incompatible/plugin/hclog_adapter.go:86:2: cannot use h (type *hclogAdapter) as type hclog.Logger in return argument:
    *hclogAdapter does not implement hclog.Logger (missing StandardWriter method)
../../pkg/mod/github.com/mattermost/mattermost-server@v5.10.0+incompatible/plugin/hclog_adapter.go:90:2: cannot use h (type *hclogAdapter) as type hclog.Logger in return argument:
    *hclogAdapter does not implement hclog.Logger (missing StandardWriter method)
../../pkg/mod/github.com/mattermost/mattermost-server@v5.10.0+incompatible/plugin/hclog_adapter.go:94:2: cannot use h (type *hclogAdapter) as type hclog.Logger in return argument:
    *hclogAdapter does not implement hclog.Logger (missing StandardWriter method)
../../pkg/mod/github.com/mattermost/mattermost-server@v5.10.0+incompatible/plugin/supervisor.go:62:3: cannot use hclogAdaptedLogger (type *hclogAdapter) as type hclog.Logger in field value:
    *hclogAdapter does not implement hclog.Logger (missing StandardWriter method)
Makefile:56: recipe for target 'govet' failed
make: *** [govet] Error 2

Replaced the file with the one present at hclog_adapter

This adds the Standard Writer to the config.

  1. Change the value for the key "Short" to true instead of short in server/plugin.go

Was getting the following issue:

server/plugin.go:371:3: cannot use short (type bool) as type model.SlackCompatibleBool in field value Changed the value for the key short to true (L371) and was finally able to build successfully. @cpanato Please check this.

scottleedavis commented 5 years ago

@C2L2C I confirm that your changes fixes the issue you address. Also the L60 link you posted appears outdated from master that which has that line at @$(GO) vet -shadow $$(go list ./server/...) || exit 1

fjaeger commented 5 years ago

Could you maybe create a Pull Request for the changes you made?

cpanato commented 5 years ago

moving to use go modules as the upstream

cpanato commented 5 years ago

update the build using the ustream. closing