-
Notifications
You must be signed in to change notification settings - Fork 123
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-21722 - Repository synchronization tool #86
Conversation
Running against
|
Followups for this:
To make a long story short - proper, developer-friendly synchronization is complicated. |
This issue has been automatically labelled "stale" because it hasn't had recent activity. /cc @jasonblais @hanzei |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @tasdomas. I will do some iteration on change requests. Before diving into the code, I was looking at the files that were in plan.yml and how the file is organized. I also created some small code nitpicks before I decided to review the plan.yml
build/sync/plan.yml
Outdated
params: | ||
repo: plugin | ||
reference-repo: template | ||
- path: public/hello.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an optional file that will not be used in plugins 99% of the time. Perhaps we could add an action that warns when the file exists and notes to the author that they might remove this dir/file.
This also suggests adding a .plan.yml file in a repository that will allow setting action ignores to the script. An example is if a plugin actually uses this file they would continue getting the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I think it'd be ok to address this in a follow-up.
build/sync/plan.yml
Outdated
params: | ||
repo: plugin | ||
reference-repo: template | ||
- path: server/configuration.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For .go
files, it is going to be very difficult to do a compare and merge. I think the best we could do is add some AST scripts to check for certain issues.
I'm only thinking aloud here:
- known plugin hooks are in specific files or exist?
- use of known helper functions that could be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems more like a checker/linter type tool - I think it makes sense to make that a separate command, instead of integrating it with the sync tool.
build/sync/plan.yml
Outdated
params: | ||
repo: plugin | ||
reference-repo: template | ||
# TODO: add action to merge package.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a collection of files categorized by types and how they should be handled. I'm only making a comment for informational purposes and tracking
server/ Go Files
- could add some checks, but this is going to be difficult
- Plugin Specific
- path: go.mod
- path: server/configuration.go
- path: server/plugin.go
- path: server/plugin_test.go
webapp/ Files
- only compare if plugin has webapp/ dir
- path: webapp/.babelrc
- path: webapp/webpack.config.js
- path: webapp/tsconfig.json
- path: webapp/.eslintrc.json
- path: webapp/src/index.js
json Files
- Plugin Specific
- path: webapp/package.json
Should warn that they don't exists (Good to have for plugins)
- path: webapp/i18n/en.json
OPTIONAL Files (warn, but don't fail)
- path: public/hello.html
Should match Demo Plugin not starter template
- path: .circleci/config.yml
Should match starter-template 100%
- path: Makefile
- path: .editorconfig
Hi @tasdomas, thanks for all of the great work in this PR. Do you plan on continuing the project? If not, I would like to continue the work in a separate PR. |
@mickmister - sorry for the late reply. I was sort of expecting reviews for the PR. Give me a day or so to at least clean up the PR and address the existing comments. Then you can take over. |
@tasdomas No problem at all. I wrongly assumed you did not intend to continue with the PR, but looking at the history it is absolutely due for reviews. There is a ton of work here that has not been reviewed for quite some time. It is up to you whether you choose to continue with this PR. I can give this a review sometime this week, please let me know what you think. Thank you for all you've done here. This is an unprecedented tool that will make a huge difference. |
@hanzei, @mickmister, @jfrerich - I've updated the PR with your suggestions. Also, I've noticed that the root |
Would it be possible to support an |
Sure. I'd like to handle that in a follow-up though. |
@tasdomas Do you mind putting the Repo sync tool: Support @hanzei What do you think about merging this, given these followup tickets? |
@mickmister - I've updated the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @tasdomas 🎉 Sorry for the huge delay.
@mickmister Absolutely. Let's get this merged. |
@hanzei, @mickmister, @ben, @jfrerich thank you for reviewing this! Time for 🍾 :) |
Heads up: I've posted some follow up thoughts in https://community-release.mattermost.com/core/pl/tkyb38n9hib3jby3t1g64w1xia |
Summary
This PR adds a proof-of-concept implementation of a tool for synchronizing mattermost plugin repositories with the template repository (
mattermost-plugin-starter-template
).Ticket Link
See https://mattermost.atlassian.net/browse/MM-21722