-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: return sites from db for email login #754
Conversation
@@ -128,7 +128,6 @@ export class SitesRouter { | |||
|
|||
router.get( | |||
"/", | |||
this.statsMiddleware.countGithubSites, |
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.
Removing the countGithubSites middleware to prevent excessive calls to github
cc @isomerpages/iso-engineers
lastUpdated?: GitHubRepositoryData["pushed_at"] | ||
permissions?: GitHubRepositoryData["permissions"] | ||
repoName: GitHubRepositoryData["name"] | ||
isPrivate: GitHubRepositoryData["private"] | ||
isPrivate?: GitHubRepositoryData["private"] |
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.
hmm actually removing isPrivate has implications specifically for loading homepages on private repos - without this param available the images on editHomepage don't load properly. I feel like this can be a future fix though since the affected repos should be small, but let's check with prod ops first if any existing email login sites are private
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.
We should then be tracking this info in our DB right? Should we add a column to track this?
But yes, for now, lets check with Ops
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.
LGTM for the scope of this pr, but I do share the concens that Alex has, we would need to tell ops about this + plan to rectify this. I am sure that we will have private repos for email login in the future.
* fix: close pull request (#751) * Fix: publish button delay (#752) * Fix: publish button delay * Fix: tests * Fix: move review request status check into router * feat: return sites from db for email login (#754) * feat: return sites from db for email login * fix: tests * fix: use lodash function for type guard * fix(githhub service): get call to github to prevent race condition (#756) * fix(githhub service): get call to github to prevent race condition * fix(github service): throw error if directory name not defined * style(github service): add comments for clarity * fix: tests --------- Co-authored-by: Alexander Lee <[email protected]> * Fix: handle updating of files in root directory (#761) * fix: create .keep first when rename subfolder (#762) * 0.26.0 --------- Co-authored-by: seaerchin <[email protected]> Co-authored-by: Alexander Lee <[email protected]> Co-authored-by: Harish <[email protected]>
Problem
We are making unnecessary Github calls on /sites page especially on email login flow when this could be a call to our DB. In light of us reaching the limits of Github api, we should try to prevent excessive calls.
Closes IS-165
Solution
Added a check on getSites to return the list of site names for the user from our DB (only if it is a non-admin and non-github flow user).
Breaking Changes
Deploy Notes
Note minor dependency on isomerpages/isomercms-frontend#1265
Needs to be deployed together