-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
perf(filestate): DoesProjectExist should not list all #12547
Comments
Hi @abhinav , I am interested to work on this issue. Here is my proposed solution:
Btw, I am assuming the behavior of Please LMK if you have concern or anything. Thanks! |
Thanks, @neverbeenthisweeb! A PR would absolutely be welcome. Adding projectName to ListProjects is a valid option. The implementation that you're planning itself sounds reasonable: see if listing |
@abhinav I see, agree. Would you mind to assign this to me? |
Done! |
@abhinav Hi, questions Let's say we have this bucket structure
I'm quite sure that we consider project However, do we consider project As a context, I am going to use PS. I've created a draft PR for this case (see https://github.com/pulumi/pulumi/pull/12798/files#r1181096721) |
I would say "a" should return as not existing. A project exists if it has any stacks. |
12798: Update DoesProjectExist to not list all projects r=abhinav a=neverbeenthisweeb <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Add `projectReferenceStore.ProjectExists`. `projectReferenceStore.ProjectExists` enables us to search for a specific project in `localBackend.DoesProjectExist`. **Tasks** - [X] Add `projectReferenceStore.ProjectExists` - [X] Replace `projectReferenceStore.ListProjects` with `projectReferenceStore.ProjectExists` in `localBackend.DoesProjectExist` Fixes #12547 ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [X] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [X] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> Co-authored-by: neverbeenthisweeb <rf.ramadhana@gmail.com>
12798: Update DoesProjectExist to not list all projects r=abhinav a=neverbeenthisweeb <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> Add `projectReferenceStore.ProjectExists`. `projectReferenceStore.ProjectExists` enables us to search for a specific project in `localBackend.DoesProjectExist`. **Tasks** - [X] Add `projectReferenceStore.ProjectExists` - [X] Replace `projectReferenceStore.ListProjects` with `projectReferenceStore.ProjectExists` in `localBackend.DoesProjectExist` Fixes #12547 ## Checklist <!--- Please provide details if the checkbox below is to be left unchecked. --> - [X] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [X] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. --> Co-authored-by: neverbeenthisweeb <rf.ramadhana@gmail.com>
Hello!
Issue details
There's room for a small performance improvement to the DoesProjectExist method
in the filestate backend:
Instead of listing all projects and searching through them, it could search for
the prefix
$projectName/
, and report success if that doesn't fail withNotFound.
Credit to @Frassle for the suggestion:
#12437 (comment)
Affected area/feature
filestate backend
The text was updated successfully, but these errors were encountered: