Skip to content

Fix #165: Validate features before subscribing - #183

Merged
marianunez merged 2 commits into
mattermost:masterfrom
checkaayush:master
Feb 12, 2020
Merged

marianunez merged 2 commits into
mattermost:masterfrom
checkaayush:master

Conversation

@checkaayush

Copy link
Copy Markdown
Contributor

Summary

Adds validation to prevent subscription to a repo with invalid feature(s)

Ticket Link

Fixes #165

@mickmister mickmister added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Feb 4, 2020
@levb

levb commented Feb 5, 2020

Copy link
Copy Markdown
Contributor

@checkaayush it's failing gofmt; you can either run gofmt -w ob that file yourself; or as we usually do, configure your editor to automatically apply the go formatting.

@hanzei

hanzei commented Feb 5, 2020

Copy link
Copy Markdown
Contributor

Glad to see you are still around @checkaayush 🎉

@jfrerich jfrerich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Have one comment pending another dev approval. @checkaayush, if this would be a simple fix, you could go ahead and implement! Thanks for the PR!

Comment thread server/command.go Resolved
@mickmister
mickmister removed their request for review February 5, 2020 23:03
@checkaayush
checkaayush force-pushed the master branch 2 times, most recently from d467f98 to 371bedb Compare February 6, 2020 09:06

@marianunez marianunez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work @checkaayush! 🎉Thanks for adding the tests for this as well 💯

@marianunez marianunez removed the 2: Dev Review Requires review by a core committer label Feb 6, 2020
@DHaussermann

Copy link
Copy Markdown

Hi @checkaayush thanks for this improvement! It really adds some usability to the feature.

I think I may have found an issue with this change. I testes subscribing to all features and the validation. I'm not seeing the use of labels work as expected on your branch.
For example
/github subscribe mattermost/mattermost-mobile issues,label:"ruby" returns Invalid feature(s) provided: label:"ruby"
I believe this exact syntax works on the master branch. Can you see if you can reproduce this issue?

Check for labels when validating features
@checkaayush

Copy link
Copy Markdown
Contributor Author

Hi @checkaayush thanks for this improvement! It really adds some usability to the feature.

I think I may have found an issue with this change. I testes subscribing to all features and the validation. I'm not seeing the use of labels work as expected on your branch.
For example
/github subscribe mattermost/mattermost-mobile issues,label:"ruby" returns Invalid feature(s) provided: label:"ruby"
I believe this exact syntax works on the master branch. Can you see if you can reproduce this issue?

Nice catch @DHaussermann! Have made the required changes and added relevant tests.

I've assumed validating labels, when present, from the GH API is out of scope of the current fix.

@DHaussermann DHaussermann left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the fix @checkaayush This is now working as expected!

No checking if the label exists was not part of this issue. This PR already solves the problem of a subscription not delivering any events because it contains an invalid feature.

Tested and passed

  • Features are validated
  • All supported features work to save a subscription (including passing in a label)
  • Invalid features are caught when used individually or in coma separated lists
  • When invalid save attempt is made, no change is made to an existing subscription
    LGTM!
    Updated release testing to cover this.

@DHaussermann DHaussermann added QA Review Done PR has been approved by QA and removed 3: QA Review Requires review by a QA tester labels Feb 11, 2020
@checkaayush

checkaayush commented Feb 12, 2020 •

Copy link
Copy Markdown
Contributor Author

Hey @marianunez, I've made some critical code changes to fix bugs pointed out during QA after you reviewed the code. Could you have a quick look at the changes again?

@marianunez

Copy link
Copy Markdown
Member

/update-branch

@marianunez marianunez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @checkaayush! LGTM.

Just a reminder for future PRs that always try and avoid force pushing a PR that's actively being reviewed.
See https://developers.mattermost.com/blog/submitting-great-prs/#4-avoid-force-pushing

@marianunez marianunez added the 4: Reviews Complete All reviewers have approved the pull request label Feb 12, 2020
@marianunez
marianunez merged commit 4d1b666 into mattermost:master Feb 12, 2020
@hanzei hanzei modified the milestone: v0.13.0 Feb 20, 2020
@hanzei hanzei added this to the v0.14.0 milestone Feb 23, 2020
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 QA Review Done PR has been approved by QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub plugin has no validation if subscribing with an invalid feature

8 participants