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

Add confirmation message when building with plugin id "com.mattermost.plugin-starter-template" #156

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ endif
.PHONY: server
server:
ifneq ($(HAS_SERVER),)
$(info Are you sure you want to build the plugin with an id of "com.mattermost.plugin-starter-template"? Consider editing plugin.json to configure your project.)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wondering if using $(info message) is the right approach or should it be changed to $(warning message)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Only my system using warning outputs the line number, which is not so helpful.

Maybe adding a newline after the output helps to separate it from the following log lines.

Copy link

Choose a reason for hiding this comment

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

This will show the message always, right? I mean... even if I have edited my plugin.json and have the correct id, I will still receive this message. Shouldn't we do a check on the manifest id somehow? Or add something more like "edit the plugin.json and remove this line".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @larkox, thanks for your review:) Instead of having a check, we can do something simple like adding "Ignore if already edited" to the end of the message. How does that sound?
/cc @hanzei

Copy link

Choose a reason for hiding this comment

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

I don't like it, because a warning that always appear is a warning you ignore. And the problem will still be there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What change would you like to suggest here?

Copy link

Choose a reason for hiding this comment

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

Something like:

ifeq ($(PLUGIN_ID), com.mattermost.plugin-starter-template)
    echo "Are you sure you want to build the plugin with an id of "com.mattermost.plugin-starter-template"? Consider editing plugin.json to configure your project."
endif

I would even consider exiting and not allowing the plugin to be compiled, but that may be too drastic :P

Copy link
Contributor

Choose a reason for hiding this comment

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

@haardikdharma10 let us know if you have any questions for the above suggestion?

mkdir -p server/dist;
ifeq ($(MM_DEBUG),)
cd server && env GOOS=linux GOARCH=amd64 $(GO) build $(GO_BUILD_FLAGS) -o dist/plugin-linux-amd64;
Expand Down