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-23184] Omit empty labels list #48

Merged
merged 3 commits into from
Mar 19, 2020
Merged

[MM-23184] Omit empty labels list #48

merged 3 commits into from
Mar 19, 2020

Conversation

hanzei
Copy link
Collaborator

@hanzei hanzei commented Mar 11, 2020

Summary

This make the json output a bit nicer. Forgot about the case in #42

Ticket Link

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

@hanzei hanzei added the 2: Dev Review Requires review by a core committer label Mar 11, 2020
@hanzei hanzei requested review from lieut-data and alifarooq0 March 11, 2020 06:41
@hanzei
Copy link
Collaborator Author

hanzei commented Mar 11, 2020

@lieut-data @ali-farooq0 I would like to merge master into production soon and also include this change. Would you give this please a quick review?

@alifarooq0
Copy link
Contributor

@hanzei what's the reason for this change?

I kinda like the field labels to always be there, so it's clear what fields to expect. What if we marshalled it as label: [] instead?

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.

Agree with @ali-farooq0's question -- uncertain as to the motivation of this change. Agree it would be cleaner, but at this point, is there something else that makes it high-impact? We'd also want to carefully test this with the Mattermost server to avoid any unexpected surprises.

@hanzei
Copy link
Collaborator Author

hanzei commented Mar 13, 2020

@ali-farooq0 @lieut-data I should have given more background to my changes:

When you are currently running make plugis.json on master, the diff contains a lot of "labels": null, which get added. This is caused by me removing the labels field manually in #42, but forgetting that an nil list is marshaled as null.

There are three ways to sync the output of make plugis.json with the committed plugis.json:

  1. Omit labels (This PR)
  2. Run make plugis.json and commit the result
  3. Change the generator to have an empty, but not nil list of labels by default , then run plugins.json and commit the result and code changes

I'm mostly 0/5 on which way to go. I did pick 1. because it's the smallest diff and to me it seams like the cleanest approach.

I did test my changes with the latest webapp and server.

Please let me know what you think about this and which way you prefer.

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.

Got it! I also forgot that since the marketplace consumes plugin.json, it probably ends up at the same internal representation relative to what the Mattermost server sees, so less of a concern.

Thanks for clarifying, @hanzei :)

Copy link
Contributor

@alifarooq0 alifarooq0 left a comment

Choose a reason for hiding this comment

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

Thanks @hanzei. I guess this would be more of a concern if we had other open clients using this marketplace directly, but since we don't this might be OK for now.

I personally don't mind having null label values for plugins.json or doing something special for our internal plugins.json generation, I am more worried about the API responses that the marketplace returns now, as in some cases it'll have the label field and in others it wont.

Do you think the consistency issue is worth addressing in the long run? Perhaps as a HW ticket. Thoughts?

@hanzei
Copy link
Collaborator Author

hanzei commented Mar 19, 2020

I personally don't mind having null label values for plugins.json or doing something special for our internal plugins.json generation, I am more worried about the API responses that the marketplace returns now, as in some cases it'll have the label field and in others it wont.

Do you think the consistency issue is worth addressing in the long run? Perhaps as a HW ticket. Thoughts?

@ali-farooq0 The same struct is used to generate plugins.json that is used for the API responses. Could you elaborate a bit how you would not omit the field for the API responses, but would for plugins.json without duplicating code?

@hanzei hanzei added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Mar 19, 2020
@hanzei
Copy link
Collaborator Author

hanzei commented Mar 19, 2020

@ali-farooq0 Heads up that I'm going merge the PR as it is and we can iterate if needed.

@hanzei hanzei merged commit 856bd9d into master Mar 19, 2020
@hanzei hanzei deleted the omitempty branch March 19, 2020 12:05
@alifarooq0
Copy link
Contributor

@ali-farooq0 The same struct is used to generate plugins.json that is used for the API responses. Could you elaborate a bit how you would not omit the field for the API responses, but would for plugins.json without duplicating code?

@hanzei what's the issue with having nulls in the generated plugins.json?

@hanzei
Copy link
Collaborator Author

hanzei commented Mar 19, 2020

@ali-farooq0 There is none. Having null inside of plugins.json was one of the considered options in #48 (comment)

@alifarooq0
Copy link
Contributor

Ah gotcha. Yeaa i missed that 🤦‍♂. Would've preferred that over the omit :) but oh well. Since we don't have an external client relying on this, not the end of the world 👍

hanzei added a commit that referenced this pull request Mar 24, 2020
* [MM-21749] [MM-22214] Add "Beta" and "Community" label (#37)

* Add beta and community label

* wording

* Feedback

* Make use of model.IsValid() (#44)

* Pin github.com/rakyll/statik version (#47)

* document automatic deployment (#46)

* document automatic deployment

* tweak merging language

Co-authored-by: Ben Schumacher <[email protected]>

* Add issue templates for community plugins (#45)

Add two issue templates: one for adding a new community plugin and one for updating an existing community plugin.

* [MM-23184] Omit empty labels list (#48)

Co-authored-by: Jesse Hallam <[email protected]>
lieut-data added a commit that referenced this pull request Jul 13, 2020
* [MM-21749] [MM-22214] Add "Beta" and "Community" label (#37)

* Add beta and community label

* wording

* Feedback

* Make use of model.IsValid() (#44)

* Pin github.com/rakyll/statik version (#47)

* document automatic deployment (#46)

* document automatic deployment

* tweak merging language

Co-authored-by: Ben Schumacher <[email protected]>

* Add issue templates for community plugins (#45)

Add two issue templates: one for adding a new community plugin and one for updating an existing community plugin.

* [MM-23184] Omit empty labels list (#48)

* Drop iconPaths workaround (#62)

* Use GITHUB_TOKEN env variable instead of having the user define it (#54)

* Proxy upstream support (#60)

* s/store/staticStore/

* prefer later plugins if version exactly matches

* introduce merged and proxy stores

* support --upstream

* generate on run-server

* update to go1.14

* tidy up interface/comments

* golangci-lint local-only complaints

* Update internal/store/proxy_test.go

* revert generate on run-server

* avoid merged store unless needed

Co-authored-by: Ben Schumacher <[email protected]>
Co-authored-by: mattermod <[email protected]>

* Ensure manually added plugins stay in the database (#68)

* Send Announcements for new plugins (#76)

* Limit enterprise plugins to E20 installations (#79)

* Limit enterprise plugins to E20 installations

* Apply suggestions from code review

Co-authored-by: Aaron Rothschild <[email protected]>

* Make getPlugins signature more clear

* Don't omit enterprise in json

* make generate

* Include workaround for https://mattermost.atlassian.net/browse/MM-26507

* Fix typo

* Changes as requested

* Drop else

* Move minVersionSupportingEnterpriseFlags into global scope

Co-authored-by: Aaron Rothschild <[email protected]>

* Add Enterprise label to MS Calendar

* make generate

Co-authored-by: Jesse Hallam <[email protected]>
Co-authored-by: mattermod <[email protected]>
Co-authored-by: Aaron Rothschild <[email protected]>
lieut-data added a commit that referenced this pull request Jul 13, 2020
* Merge master into production (#49)

* [MM-21749] [MM-22214] Add "Beta" and "Community" label (#37)

* Add beta and community label

* wording

* Feedback

* Make use of model.IsValid() (#44)

* Pin github.com/rakyll/statik version (#47)

* document automatic deployment (#46)

* document automatic deployment

* tweak merging language

Co-authored-by: Ben Schumacher <[email protected]>

* Add issue templates for community plugins (#45)

Add two issue templates: one for adding a new community plugin and one for updating an existing community plugin.

* [MM-23184] Omit empty labels list (#48)

Co-authored-by: Jesse Hallam <[email protected]>

* Add v0.14.0 of mattermost-plugin-github to the Marketplace (#51)

* Add v1.3.0 of mattermost-plugin-zoom to the Marketplace (#50)

* Add v1.2.0 of mattermost-plugin-custom-attributes to the Marketpl… (#53)

* Add mattermost plugin autolink v1.2.0 (#56)

* Add v1.2.0 of mattermost-plugin-autolink to the Marketplace

* Remove custom-attributes from this PR

* add the statik.go file after manually removed autolink from plugins.json and reran 'make generate'

Co-authored-by: Ben Schumacher <[email protected]>

* Add v1.3.1 of mattermost-plugin-zoom to the Marketplace (#59)

* Add mattermost plugin todo v0.2.0 (#57)

* Add v2.4.0 of mattermost-plugin-jira to the Marketplace (#66)

* Add v1.0.4 of mattermost-plugin-nps to the Marketplace (#63)

* Add v0.2.0 of mattermost-plugin-skype4business to the Marketplace (#70)

* Add v1.0.0 of mattermost-plugin-github to the Marketplace (#69)

* Add v1.2.0 of mattermost-plugin-confluence to the Marketplace (#73)

* Add mattermost plugin welcomebot v1.2.0 (#71)

* Add v1.0.0 of mattermost-plugin-mscalendar to the Marketplace (#78)

* Add v1.1.0 of mattermost-plugin-jenkins to the Marketplace (#80)

* Add v2.0.0 of mattermost-plugin-jitsi to the Marketplace (#82)

* Add Enterprise label to MS Calendar

* make generate

* Add v1.3.0 of mattermost-plugin-giphy-moussetc to the Marketplace (#85)

Co-authored-by: Jesse Hallam <[email protected]>
Co-authored-by: Jason Frerich <[email protected]>
lieut-data added a commit that referenced this pull request Jul 13, 2020
* [MM-21749] [MM-22214] Add "Beta" and "Community" label (#37)

* Add beta and community label

* wording

* Feedback

* Make use of model.IsValid() (#44)

* Pin github.com/rakyll/statik version (#47)

* document automatic deployment (#46)

* document automatic deployment

* tweak merging language

Co-authored-by: Ben Schumacher <[email protected]>

* Add issue templates for community plugins (#45)

Add two issue templates: one for adding a new community plugin and one for updating an existing community plugin.

* [MM-23184] Omit empty labels list (#48)

* Drop iconPaths workaround (#62)

* Use GITHUB_TOKEN env variable instead of having the user define it (#54)

* Proxy upstream support (#60)

* s/store/staticStore/

* prefer later plugins if version exactly matches

* introduce merged and proxy stores

* support --upstream

* generate on run-server

* update to go1.14

* tidy up interface/comments

* golangci-lint local-only complaints

* Update internal/store/proxy_test.go

* revert generate on run-server

* avoid merged store unless needed

Co-authored-by: Ben Schumacher <[email protected]>
Co-authored-by: mattermod <[email protected]>

* Ensure manually added plugins stay in the database (#68)

* Send Announcements for new plugins (#76)

* Limit enterprise plugins to E20 installations (#79)

* Limit enterprise plugins to E20 installations

* Apply suggestions from code review

Co-authored-by: Aaron Rothschild <[email protected]>

* Make getPlugins signature more clear

* Don't omit enterprise in json

* make generate

* Include workaround for https://mattermost.atlassian.net/browse/MM-26507

* Fix typo

* Changes as requested

* Drop else

* Move minVersionSupportingEnterpriseFlags into global scope

Co-authored-by: Aaron Rothschild <[email protected]>

* Merge production into master (#88)

* Merge master into production (#49)

* [MM-21749] [MM-22214] Add "Beta" and "Community" label (#37)

* Add beta and community label

* wording

* Feedback

* Make use of model.IsValid() (#44)

* Pin github.com/rakyll/statik version (#47)

* document automatic deployment (#46)

* document automatic deployment

* tweak merging language

Co-authored-by: Ben Schumacher <[email protected]>

* Add issue templates for community plugins (#45)

Add two issue templates: one for adding a new community plugin and one for updating an existing community plugin.

* [MM-23184] Omit empty labels list (#48)

Co-authored-by: Jesse Hallam <[email protected]>

* Add v0.14.0 of mattermost-plugin-github to the Marketplace (#51)

* Add v1.3.0 of mattermost-plugin-zoom to the Marketplace (#50)

* Add v1.2.0 of mattermost-plugin-custom-attributes to the Marketpl… (#53)

* Add mattermost plugin autolink v1.2.0 (#56)

* Add v1.2.0 of mattermost-plugin-autolink to the Marketplace

* Remove custom-attributes from this PR

* add the statik.go file after manually removed autolink from plugins.json and reran 'make generate'

Co-authored-by: Ben Schumacher <[email protected]>

* Add v1.3.1 of mattermost-plugin-zoom to the Marketplace (#59)

* Add mattermost plugin todo v0.2.0 (#57)

* Add v2.4.0 of mattermost-plugin-jira to the Marketplace (#66)

* Add v1.0.4 of mattermost-plugin-nps to the Marketplace (#63)

* Add v0.2.0 of mattermost-plugin-skype4business to the Marketplace (#70)

* Add v1.0.0 of mattermost-plugin-github to the Marketplace (#69)

* Add v1.2.0 of mattermost-plugin-confluence to the Marketplace (#73)

* Add mattermost plugin welcomebot v1.2.0 (#71)

* Add v1.0.0 of mattermost-plugin-mscalendar to the Marketplace (#78)

* Add v1.1.0 of mattermost-plugin-jenkins to the Marketplace (#80)

* Add v2.0.0 of mattermost-plugin-jitsi to the Marketplace (#82)

* Add Enterprise label to MS Calendar

* make generate

* Add v1.3.0 of mattermost-plugin-giphy-moussetc to the Marketplace (#85)

Co-authored-by: Jesse Hallam <[email protected]>
Co-authored-by: Jason Frerich <[email protected]>

* s/sls/serverless

Co-authored-by: Ben Schumacher <[email protected]>
Co-authored-by: mattermod <[email protected]>
Co-authored-by: Aaron Rothschild <[email protected]>
Co-authored-by: Jason Frerich <[email protected]>
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.

3 participants