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-15425] Improve plugin deploy/redeploy/debug cycle #43

Closed
wants to merge 4 commits into from

Conversation

cpoile
Copy link
Member

@cpoile cpoile commented May 3, 2019

Improve the workflow for plugin development.

make debug command:

  • only recompile for the architecture the developer is actually using (speeds up the change/test cycle)
  • compile with debug flags for the server plugin (allows us to attach a dlv process and debug the server component. I'll write instructions.)

make webapp-debug command:

  • compile in dev mode (with source maps) for the webapp
  • setup npm correctly so that webapp changes are compiled immediately, and only changes need to be compiled
  • symlink the webapp directory so that webapp changes don't need to redeployed (a plugin restart will pick up the changes immediately)
    • this means that the webapp can be debugged directly from the development directory (yay)

make reset command:

  • disable the plugin
  • enable the plugin (to pick up new changes in the server and webapp)
    • this stops the current instance of the plugin (to prevent 20+ zombie plugin processes)

make stop command:

  • stop the webapp watcher

Quick Instructions (I'll write more detailed instructions when I merge this into the demo plugin... so that everyone can use this)

  1. Instead of running make deploy, run make debug.
    • It will set up the link between the mattermost server and the plugin's directory.
  2. Run make webapp-debug to build the webapp with source maps, and start the npm watch process.
  3. Whenever a change is made to the plugin's server component, run make debug to recompile and reload the plugin.
  4. Whenever a change is made to the webapp, run make reset to stop and restart the plugin process on the server. Your changes will now appear (you may need to refresh the page)
  5. To debug the server part of the plugin, run the script ./debug-plugin.sh which will attach a delve headless process to the plugin. Attach your debugger of choice to localhost:2346
  6. To debug the webapp part of the plugin, attach the debugger to localhost:8065 (as you would normally debug the mattermost webapp).

Links

MM-15425

@cpoile cpoile requested review from levb and jfrerich May 3, 2019 22:35
@levb levb requested a review from crspeller May 4, 2019 13:19
Copy link
Contributor

@levb levb left a comment

Choose a reason for hiding this comment

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

Overall, many thanks for the improvement fixing many annoyances in the dev flow.

A couple minor change requests, also added @crspeller to review the webapp portion, as I hardly qualify there. We should also apply these to ...-plugin-sample, and ...-demo once everyone is in agreementt.

Copy link
Member

@crspeller crspeller left a comment

Choose a reason for hiding this comment

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

Looks great! Once this is in I can stop hacking my Makefile to do this stuff :P

We should make this as a PR against mattermost-plugin-sample. Can you open a PR there with the feedback addressed? Then once that's merged we can pull in the changes to the JIRA plugin.

Copy link
Contributor

@levb levb left a comment

Choose a reason for hiding this comment

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

My only remaining comment duplicates that of @crspeller (uname) so I'm approving, pending the fixes he requested.

@hanzei hanzei self-requested a review May 6, 2019 16:48
@hanzei hanzei added the 2: Dev Review Requires review by a core committer label May 6, 2019
@cpoile cpoile added Do Not Merge Should not be merged until this label is removed and removed 2: Dev Review Requires review by a core committer labels May 18, 2019
@levb levb changed the base branch from jira2 to master May 21, 2019 19:25
@cpoile cpoile changed the base branch from master to jira2 May 21, 2019 20:02
@cpoile cpoile closed this May 21, 2019
levb added a commit that referenced this pull request Aug 10, 2020
* iterate through instances when printing out the channel subscriptions
update tests for new printing output format

don't require --intance for subscribelist

* Update tests

* shorten field name

* several PR feedback fixes

* remove unused variable
rename map variable

* Disconnect users on instance uninstall (#41)

* [GH-4] add EE license check (#22)

* restrict plugin activation based on license

* run go mod tidy -v

* wip

* add enterprise package

* rename license naming to enterprise
if user does not have enterprise license, check number of instances
  installed before allowed to install another cloud or server instance

* remove function

* fix review feedback

* Add license checking tests

* wip

* wip by Lev

* wip

* wip

* remove comments

* remove function to return pointer to true bool value

* getMockInstanceStoreKV(0) should return initialized empty store
was returning instance store with one instance
correct all occurences call of getMockInstanceStoreKV(0) to call with 1
instanance. This fixes many failing tests
Add tests for InstallInstance function with extensive license checking

* fix linting

Co-authored-by: Lev Brouk <[email protected]>

* Fixed #31, #33 (#54)

- Use plugin URL as the "home" for app links
- Added extra logging for suspicious callbacks
- Use templates for `/jira instance install` output

* Fix test (#64)

* GH-21 Fixed websocket update on user disconnect, instance uninstall (#61)

* Fixed websocket update on user disconnect

* Revert "Fixed websocket update on user disconnect"

This reverts commit 84ca4b27ca2a3ed55408bf359786b3162dc1b29a.

* Fixed empty set refresh, defaulting in commands

* fixed instance status update

* GH-49: Fixed webhook, transition commands (#67)

* Use connectInstances array for userConnected redux selector (#71)

* Use connectInstances array for userConnected redux selector

* add null check

* [GH-45] Make sure frontend has up-to-date default instance data (#65)

* fetch instances on modal open

* Fix errors regarding redux update and missing channelId prop

* Get instances when subscribe modal opens

* fix tests

* Handle case where default instance value in frontend is stale (uninstalled)

* Make if statement more safe

* Make if statement more safe

* fix test

* lint

* GH-60: Fixed multi-work command alias parsing in webapp (#72)

* Fixed --instance

Co-authored-by: Lev <[email protected]>
Co-authored-by: Lev Brouk <[email protected]>
Co-authored-by: Michael Kochell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do Not Merge Should not be merged until this label is removed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants