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-33506] Use embed package to include plugin manifest #145

Merged
merged 3 commits into from
May 18, 2021

Conversation

hanzei
Copy link
Contributor

@hanzei hanzei commented Mar 3, 2021

Summary

Instead of generating a manifest.go file the code makes use of the new embed feature of go1.16 to embed the manifest directly. This drops the last generated file from the repo and makes the developers live easier. I leaved make apply intentionally as a command in case someone runs it from old habits or some script is still using it.

Ticket Link

https://mattermost.atlassian.net/browse/MM-33506

@hanzei hanzei added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Mar 3, 2021
@hanzei
Copy link
Contributor Author

hanzei commented Mar 3, 2021

Please note that CI is expected to fail until the orb is updated to go1.16.

@hanzei hanzei changed the title Use embed package to include plugin manifest [MM-33506] Use embed package to include plugin manifest Mar 3, 2021
github.com/kr/text v0.2.0 // indirect
github.com/mattermost/mattermost-server/v5 v5.26.2
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/mattermost/mattermost-server/v5 v5.32.1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I piggy backed a dependency update into this PR

@@ -0,0 +1,17 @@
package root
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Naming is hard. I thought about using manifest but manifest.Manifest would stutter. Ideas?

Copy link
Member

@lieut-data lieut-data left a comment

Choose a reason for hiding this comment

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

Only adding a brief comment, since we diverged somewhat in incident collaboration in a way that I think requires keeping the apply target in some fashion (to auto-populate the version field). cc @cpoile for review

@lieut-data lieut-data requested a review from cpoile March 3, 2021 19:25
Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

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

Awesome! LGTM

@mickmister
Copy link
Contributor

Looks like the typescript linter is failing

@ check-types /home/circleci/project/webapp
tsc

Running golangci-lint
golangci-lint run ./...
WARN [runner] Can't run linter goanalysis_metalinter: S1016: failed prerequisites: > [(inspect@github.com/mattermost/mattermost-plugin-starter-template, isgenerated@github.com/mattermost/mattermost-plugin-starter-template): analysis skipped: errors in package: [/home/circleci/project/plugin.go:4:4: could not import embed (plugin.go:4:2: package embed is not in GOROOT (/usr/local/go/src/embed))]]
WARN [runner] Can't run linter unused: buildir: failed to load package : could not load export data: no export data for "embed"
ERRO Running error: buildir: failed to load package : could not load export data: no export data for "embed"
make: *** [Makefile:48: check-style] Error 3

@cpoile
Copy link
Member

cpoile commented Mar 8, 2021

@lieut-data As long as we don't expect to be able to merge the starter-template with incident collaboration, I don't think there's any effect of keeping/removing/dummy-fying the apply make target here.

Even if we change circle-ci so that it doesn't require or call apply, incident collaboration will still be okay (it calls apply as part of check-style, test, and dist targets now).

@hanzei hanzei added Do Not Merge/Awaiting PR Awaiting another pull request before merging (e.g. server changes) and removed 2: Dev Review Requires review by a core committer labels Mar 9, 2021
@hanzei hanzei requested a review from DHaussermann March 9, 2021 11:16
@hanzei hanzei removed the Do Not Merge/Awaiting PR Awaiting another pull request before merging (e.g. server changes) label Mar 11, 2021
@hanzei
Copy link
Contributor Author

hanzei commented May 13, 2021

@DHaussermann Would you be fine if I merge this PR without QA review as it's purely tooling related?

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.

I agree with @hanzei

This PR is okay to merge without functional testing.

@hanzei hanzei added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester labels May 18, 2021
@hanzei hanzei merged commit ca9ee3c into master May 18, 2021
@hanzei hanzei deleted the MM-33506_embed branch May 18, 2021 13:51
lieut-data added a commit that referenced this pull request Dec 12, 2023
lieut-data added a commit that referenced this pull request Jan 23, 2024
#192)

* Revert "Update main.go (#154)"

This reverts commit be4a281.

* Revert "[MM-33506] Use embed package to include plugin manifest (#145)"

This reverts commit ca9ee3c.

* Revert "Don't generate manifest.ts (#127)"

This reverts commit 18d30b5.

* install-go-tools target, adopt gotestsum

* bring back make apply + automatic versioning

* Update build/manifest/main.go

Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>

* suppress git describe error when no tags match

* make version/release notes opt-in

* fix whitespace in Makefile

* document version management options

---------

Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
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.

6 participants