Skip to content

[MM-874]: Fixed the issue of LHS not working without setting organisation lock - #838

Merged
raghavaggarwal2308 merged 2 commits into
masterfrom
MM-874
Nov 12, 2024
Merged

[MM-874]: Fixed the issue of LHS not working without setting organisation lock#838
raghavaggarwal2308 merged 2 commits into
masterfrom
MM-874

Conversation

@Kshitij-Katiyar

@Kshitij-Katiyar Kshitij-Katiyar commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

Summary

Fixed the issue of Github LHS not working if any organization is not set in the organization lock of the plugin config

What to test

  • Check the data of LHS with and without organisation lock

@Kshitij-Katiyar Kshitij-Katiyar self-assigned this Oct 21, 2024
@Kshitij-Katiyar Kshitij-Katiyar added the 2: Dev Review Requires review by a core committer label Oct 21, 2024
@Kshitij-Katiyar Kshitij-Katiyar added this to the v2.4.0 milestone Oct 21, 2024
Comment thread server/plugin/graphql/lhs_request.go Outdated
@wiggin77 wiggin77 added the 3: QA Review Requires review by a QA tester label Oct 22, 2024
@AayushChaudhary0001

Copy link
Copy Markdown

@Kshitij-Katiyar I was testing this PR and faced a new issue.
While testing this PR without adding any organization, the data was not getting populated in the LHS and no error was received. On further investigation, I found that I need to grant the access of the orgs to my Github's personal access token. I have added the error below as per the server logs. Can we try to provide such error as a direct message from the Github DM bot..

{"timestamp":"2024-10-23 15:26:11.959 +05:30","level":"warn","msg":"Failed to search for the sidebar data","caller":"app/plugin_api.go:1006","plugin_id":"github","userid":"db84puwc6tn3frubpu1xfim3to","github username":"AayushChaudhary0001","error":"Not able to excute the query: error in executing query: Resource protected by organization SAML enforcement. You must grant your OAuth token access to this organization."}

@Kshitij-Katiyar

Copy link
Copy Markdown
Contributor Author

@Kshitij-Katiyar I was testing this PR and faced a new issue. While testing this PR without adding any organization, the data was not getting populated in the LHS and no error was received. On further investigation, I found that I need to grant the access of the orgs to my Github's personal access token. I have added the error below as per the server logs. Can we try to provide such error as a direct message from the Github DM bot..

{"timestamp":"2024-10-23 15:26:11.959 +05:30","level":"warn","msg":"Failed to search for the sidebar data","caller":"app/plugin_api.go:1006","plugin_id":"github","userid":"db84puwc6tn3frubpu1xfim3to","github username":"AayushChaudhary0001","error":"Not able to excute the query: error in executing query: Resource protected by organization SAML enforcement. You must grant your OAuth token access to this organization."}

@AayushChaudhary0001 This error can only occur in case the User has PRs in an org that has not been granted access to the OAuth app. It is expected that LHS will show data from the organizations granted access to the Oauth app.
This error log will not cause any issues with the plugin functionality.

@arush-vashishtha

Copy link
Copy Markdown

@Kshitij-Katiyar, When the user is part of an external organization and the organization also have granted access to the Oauth application as we can see in the below screenshot. The very first organization has granted access,
Screenshot from 2024-11-07 16-40-00
But the count in the LHS is not counting the events related to that external organization and also when the user opens the list of event it is not showing those events.
image
image

@Kshitij-Katiyar

Copy link
Copy Markdown
Contributor Author

@arush-vashishtha You can enable the below configuration related to private repo and hopefully get to see the PRs you want
Screenshot from 2024-11-11 16-45-54

@arush-vashishtha

Copy link
Copy Markdown

@arush-vashishtha You can enable the below configuration related to private repo and hopefully get to see the PRs you want Screenshot from 2024-11-11 16-45-54

Thank you, it is working now.

@arush-vashishtha

Copy link
Copy Markdown

This PR has been tested and the desired functionality LGTM. The user is getting the count for all the organizations in the LHS when the organization lock is not set. For external organizations, the user must enable the settings discussed above.

@arush-vashishtha arush-vashishtha 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.

Tested and verified, the functionality is looking good to me.

@raghavaggarwal2308 raghavaggarwal2308 added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Nov 12, 2024
@raghavaggarwal2308
raghavaggarwal2308 merged commit b6d576c into master Nov 12, 2024
@raghavaggarwal2308
raghavaggarwal2308 deleted the MM-874 branch November 12, 2024 12:15
@arush-vashishtha
arush-vashishtha restored the MM-874 branch March 17, 2025 10:54
@arush-vashishtha
arush-vashishtha deleted the MM-874 branch March 17, 2025 10:55
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.

5 participants