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

Separate api for getting tenant gitManager. #14290

Merged
merged 2 commits into from
Feb 25, 2023
Merged

Separate api for getting tenant gitManager. #14290

merged 2 commits into from
Feb 25, 2023

Conversation

arikt-ms
Copy link
Contributor

How contribute to this repo.

Guidelines for Pull Requests.

The sections included below are suggestions for what you may want to include.
Feel free to remove or alter parts of this template that do not offer value for your specific change.

Description

A lot of consumers of TenantManager.getTenant() across the Server codebase need only the GitManager property of the returned ITenant object. Constructing a tenant GitManager instance requires only the tenant keys (which are already being cached), while retrieving the tenant data involves a call to tenant DB. This change refactors out the tenant GitManager instance construction into a separate API and switches the callers of TenantManager.getTenant() that consume only the GitManager property to this new API, so that they do not unnecessarily incur a tenant DB call.

A concise description of the changes (bug or feature) and their impact/motivation.
If this description is short enough to be used as the title, delete this section and just use the title.

For bug fixes, also include specifics of how to reproduce it / confirm it is fixed.

If this Pull Request should close/resolve any issues when merged, use the special syntax for that here.

Breaking Changes

If this introduces a breaking change, please describe the impact and migration path for existing applications below.
See Breaking-vs-Non-breaking-Changes for details.
If there are no breaking changes, delete this section.

Reviewer Guidance

The review process is outlined on this wiki page.

List any specific things you want to get reviewer opinions on, and anything a reviewer would need to know to review this PR effectively.
Things you might want to include:

  • Questions about how to properly make automated tests for your changes.
  • Questions about design choices you made.
  • Descriptions of how to manually test the changes (and how much of that you have done).
  • etc.

If you have any questions in this section, consider making the PR a draft until all questions have been resolved.

@arikt-ms arikt-ms requested a review from a team as a code owner February 23, 2023 06:56
@github-actions github-actions bot added area: server Server related issues (routerlicious) base: main PRs targeted against main branch labels Feb 23, 2023
@arikt-ms arikt-ms merged commit d368f26 into microsoft:main Feb 25, 2023
NicholasCouri added a commit that referenced this pull request Mar 28, 2023
## Description
Currently tinylicious fails to run sample scenarios in the [Share Live
Repo](https://github.com/microsoft/live-share-sdk)
2 interesting commits: 
a) [Update deps (minor) on server release group in tinylicious (#14586)
· 12b3f4c
(github.com)](12b3f4c#diff-18fce4d66a0b908f502bc635b1c1377557fd7ec4f8d9df8dcaa4d9c261158ca9))

Throws when  getTenantGitManager is invoked. 

2) [Separate api for getting tenant gitManager. (#14290) ·
d368f26
(github.com)](d368f26#diff-deeaa88a2f939b81094f7412e1482709a59c4c47850a5c379c92aef0b78d70d5))
Moved the call when creating the document from getTenant to
getTenantGitManager and I'm not sure if it applies to tinylicious but it
is consumed by it.

This PR is trying to revert the current behavior by keeping changes #2
and not throwing on #1

Repro steps: 
a) Clone https://github.com/microsoft/live-share-sdk

b) Follow instructions from the Readme to install  (I had to also
install vite as it was failing without it)

c) Simply try to run one of the samples (I'm using
samples\javascript\03.live-canvas-demo\) http://localhost:3000/
NicholasCouri added a commit to NicholasCouri/FluidFramework that referenced this pull request Mar 28, 2023
## Description
Currently tinylicious fails to run sample scenarios in the [Share Live
Repo](https://github.com/microsoft/live-share-sdk)
2 interesting commits: 
a) [Update deps (minor) on server release group in tinylicious (microsoft#14586)
· microsoft/FluidFramework@12b3f4c
(github.com)](microsoft@12b3f4c#diff-18fce4d66a0b908f502bc635b1c1377557fd7ec4f8d9df8dcaa4d9c261158ca9))

Throws when  getTenantGitManager is invoked. 

2) [Separate api for getting tenant gitManager. (microsoft#14290) ·
microsoft/FluidFramework@d368f26
(github.com)](microsoft@d368f26#diff-deeaa88a2f939b81094f7412e1482709a59c4c47850a5c379c92aef0b78d70d5))
Moved the call when creating the document from getTenant to
getTenantGitManager and I'm not sure if it applies to tinylicious but it
is consumed by it.

This PR is trying to revert the current behavior by keeping changes microsoft#2
and not throwing on microsoft#1

Repro steps: 
a) Clone https://github.com/microsoft/live-share-sdk

b) Follow instructions from the Readme to install  (I had to also
install vite as it was failing without it)

c) Simply try to run one of the samples (I'm using
samples\javascript\03.live-canvas-demo\) http://localhost:3000/
NicholasCouri added a commit that referenced this pull request Mar 29, 2023
## Description
Currently tinylicious fails to run sample scenarios in the [Share Live
Repo](https://github.com/microsoft/live-share-sdk) 2 interesting
commits: 
a) [Update deps (minor) on server release group in tinylicious (#14586)
· 12b3f4c

(github.com)](12b3f4c#diff-18fce4d66a0b908f502bc635b1c1377557fd7ec4f8d9df8dcaa4d9c261158ca9))

Throws when  getTenantGitManager is invoked. 

2) [Separate api for getting tenant gitManager. (#14290) ·
d368f26

(github.com)](d368f26#diff-deeaa88a2f939b81094f7412e1482709a59c4c47850a5c379c92aef0b78d70d5))
Moved the call when creating the document from getTenant to
getTenantGitManager and I'm not sure if it applies to tinylicious but it
is consumed by it.

This PR is trying to revert the current behavior by keeping changes #2
and not throwing on #1

Repro steps: 
a) Clone https://github.com/microsoft/live-share-sdk

b) Follow instructions from the Readme to install  (I had to also
install vite as it was failing without it)

c) Simply try to run one of the samples (I'm using
samples\javascript\03.live-canvas-demo\) http://localhost:3000/
tylerbutler added a commit to tylerbutler/FluidFramework that referenced this pull request Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: server Server related issues (routerlicious) base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants