Refactored the code and added flow manager for Oauth setup#125
Refactored the code and added flow manager for Oauth setup#125raghavaggarwal2308 merged 12 commits intooauth_epicfrom
Conversation
fmartingr
left a comment
There was a problem hiding this comment.
Did a first pass. As a global question, is there a reason the controller package files where moved to the main server package?
@fmartingr Yes, the controller functions were to be used in the flow manager and related files but importing |
|
Hi @Kshitij-Katiyar, I'm new jumping in here and trying to understand context 👋. The PRs from #125 - #129 have summaries that describe a bit of what changed, but I'd love a bit more detail if possible. Would you mind expanding the descriptions on all of the PRs in that range to include the rationale behind why each change is necessary, and a bit more context on why you chose the proposed solutions? Apologies as I know that most of this has probably been discussed before elsewhere, but it would be very helpful for me when reviewing these changes to have the context plainly outlined here 🙂 A few examples on this PR:
|
Hey @davidkrauser, here is the initial conversation messages. https://hub.mattermost.com/partners/pl/8ezhsep5nbb1fd9w9ayim48bbo To summarize, the existing flow of the Confluence plugin is:
No OAuth/Login was required to get the notifications for the Confluence event on your MM. A user raised an issue that the Plugin stopped working for him after he Upgraded his Confluence version to 9 and above. Telemetry is added to most of the plugins maintained by Mattermost like Jira etc so added it here too. Let me know if we need to update the PR description on each on of them |
|
@Kshitij-Katiyar wrote:
Thank you for the additional context and background on the issue. That's useful 👍 I would like to see this sort of thing added to your open PR descriptions. It helps reviewers jump in and understand what they're reviewing. With this information, they won't need to ask as many questions, and the information can be useful to look back on when we want to understand why a change was made. Additionally, I would like to see details added to the description that explain why your solution is implemented in the way that it is. I understand what you're trying to achieve, but the rationale behind each specific code change in this PR is not readily apparent. An outline of that rationale would answer questions like I posted above (and provide context for questions I didn't even think to ask!):
This would also help us avoid questions like these that Felipe asked above:
You are the expert on this code change, so details explaining why you made the specific code changes you made are enormously valuable. Not only that, it will enable us to give you better feedback on your changes. 🙂 |
|
@davidkrauser Sure, implemented your suggestions for PR descriptions. |
… than 9 (#134) * Refactored the code and added flow manager for Oauth setup (#125) * refactored the code and added flow manager * removed unused code * fixed lint * removed unwanted code and added mutliple status code handling * fixed lint * fixed step title * removed extra lines in flow instructions * review fixes * fixed lint * review fixes * removed unused code * fixed go mod enteries * Added Oauth setup and connect disconnect command (#126) * refactored the code and added flow manager * removed unused code * fixed lint * added oauth setup and connect disconnect command * removed unrelated changes from package lock * fixed lint * fixed missing go mod entry * removed unwanted code and added mutliple status code handling * fixed lint * fixed step title * removed unwanted variables * removed extra lines in flow instructions * updated flow messages * review fixes * fixed callJSONwithURL call * review fixes * fixed lint * fixed lint * Added support for notification with server version greater than 9 (#127) * Added support for notification with server version > 9 * fixed disconnect error * fixed lint issues * refactored code and added constants * fixed lint * review fixes and removed unused codes * fixed lint * moved types out of functions * review fixes * review fixes * fixed lint * review fixes * removed unused code * review fixes * review fixes * removed unused code * fixed go mod enteries * removed external css sheet * review fixes * Added support for generic notification when user is not connected (#128) * refactored the code and added flow manager * removed unused code * fixed lint * added oauth setup and connect disconnect command * removed unrelated changes from package lock * fixed lint * fixed missing go mod entry * Added support for notification with server version > 9 * fixed disconnect error * fixed lint issues * removed unwanted code and added mutliple status code handling * fixed lint * fixed step title * removed unwanted variables * refactored code and added constants * fixed lint * added support for generic notification when user not connected * fixed lint * removed extra lines in flow instructions * updated flow messages * review fixes and removed unused codes * fixed lint * moved types out of functions * add more log information * fixed log info * review fixes * review fixes * review fixes * fixed callJSONwithURL call * review fixes * fixed lint * fixed lint * fixed lint * Added support for notification with server version greater than 9 (#127) * Added support for notification with server version > 9 * fixed disconnect error * fixed lint issues * refactored code and added constants * fixed lint * review fixes and removed unused codes * fixed lint * moved types out of functions * review fixes * review fixes * fixed lint * review fixes * removed unused code * fixed missing var * review fixes * review fixes * review fixes * removed unused code * fixed go mod enteries * removed external css sheet * review fixes * Added support for using admin API token for webhook notifications (#129) * refactored the code and added flow manager * removed unused code * fixed lint * added oauth setup and connect disconnect command * removed unrelated changes from package lock * fixed lint * fixed missing go mod entry * Added support for notification with server version > 9 * fixed disconnect error * fixed lint issues * removed unwanted code and added mutliple status code handling * fixed lint * fixed step title * removed unwanted variables * refactored code and added constants * fixed lint * added support for generic notification when user not connected * fixed lint * added support for admin api token * removed unused code * fixed lint * fixed import issues * removed extra lines in flow instructions * saved server version in plugin config * updated flow messages * review fixes and removed unused codes * fixed lint * moved types out of functions * add more log information * fixed log info * removed unwanted code and improved logs * fixed type in config descriptions * updated config descriptions * review fixes * review fixes * review fixes * fixed callJSONwithURL call * review fixes * fixed lint * fixed lint * fixed lint * removed unused variables * Added support for notification with server version greater than 9 (#127) * Added support for notification with server version > 9 * fixed disconnect error * fixed lint issues * refactored code and added constants * fixed lint * review fixes and removed unused codes * fixed lint * moved types out of functions * review fixes * review fixes * fixed lint * review fixes * removed unused code * review fixes * fixed missing var * added comment to notification logic * review fixes * review fixes * review fixes * fixed lint * review fixes * removed unused code * fixed go mod enteries * replaced marshalling with byte conversion * removed external css sheet * review fixes * Update server/confluence_cloud.go log info Co-authored-by: Raghav Aggarwal <raghav.aggarwal@brightscout.com> * removed unused vars --------- Co-authored-by: Raghav Aggarwal <raghav.aggarwal@brightscout.com> * Removed encryption for admin API token (#133) * refactored the code and added flow manager * removed unused code * fixed lint * added oauth setup and connect disconnect command * removed unrelated changes from package lock * fixed lint * fixed missing go mod entry * Added support for notification with server version > 9 * fixed disconnect error * fixed lint issues * removed unwanted code and added mutliple status code handling * fixed lint * fixed step title * removed unwanted variables * refactored code and added constants * fixed lint * added support for generic notification when user not connected * fixed lint * added support for admin api token * removed unused code * fixed lint * fixed import issues * removed extra lines in flow instructions * saved server version in plugin config * updated flow messages * review fixes and removed unused codes * fixed lint * moved types out of functions * add more log information * fixed log info * removed unwanted code and improved logs * fixed type in config descriptions * updated config descriptions * review fixes * review fixes * review fixes * fixed callJSONwithURL call * review fixes * fixed lint * fixed lint * fixed lint * removed unused variables * Added support for notification with server version greater than 9 (#127) * Added support for notification with server version > 9 * fixed disconnect error * fixed lint issues * refactored code and added constants * fixed lint * review fixes and removed unused codes * fixed lint * moved types out of functions * review fixes * review fixes * fixed lint * review fixes * removed unused code * review fixes * fixed missing var * added comment to notification logic * review fixes * review fixes * review fixes * fixed lint * review fixes * removed unused code * fixed go mod enteries * replaced marshalling with byte conversion * removed external css sheet * review fixes * Update server/confluence_cloud.go log info Co-authored-by: Raghav Aggarwal <raghav.aggarwal@brightscout.com> * removed encryption for admin api token * improved help text for encryption key * removed unused var in plugin struct --------- Co-authored-by: Raghav Aggarwal <raghav.aggarwal@brightscout.com> * fix issues reported by QA * Fixed lint and testcases * fixed import orders * fixed issue of system admin required for API call * removed unused vars * updated the system admin check for webapp based slash command * updated message for system admin commands * updated msg for non admin user running confluence commands for server version < 9 --------- Co-authored-by: Raghav Aggarwal <raghav.aggarwal@brightscout.com>
Summary
Screenshots
For confluence server version < 9
For confluence server version > 9