-
Notifications
You must be signed in to change notification settings - Fork 134
Fix creating default project #1181
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
Conversation
Reviewer's GuideImplements automatic creation of missing default and listing projects by extending metastore logic, and refactors tests to parameterize project/namespace creation permissions and cover a new save-to-default-project storage path. Sequence diagram for automatic creation of default and listing projectssequenceDiagram
participant Caller
participant Metastore
participant DB
Caller->>Metastore: get_project(name, namespace_name)
alt name/namespace is default or listing
Metastore->>Metastore: _is_listing_project() / _is_default_project()
Metastore->>Metastore: set create = True
end
Metastore->>DB: Query for project
alt Project does not exist and create=True
Metastore->>DB: Create project
end
Metastore->>Caller: Return project
Class diagram for updated Metastore project creation logicclassDiagram
class Metastore {
+create_project(name, namespace, ...)
+get_project(name, namespace_name, create=False, conn=None)
-_is_listing_project(project_name, namespace_name) bool
-_is_default_project(project_name, namespace_name) bool
-listing_project_name
-system_namespace_name
-default_project_name
-default_namespace_name
}
Metastore : get_project() now always creates default/listing projects if missing
Metastore : _is_listing_project() added
Metastore : _is_default_project() added
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Deploying datachain-documentation with
|
| Latest commit: |
dc8d493
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ca6ca20b.datachain-documentation.pages.dev |
| Branch Preview URL: | https://ilongin-1180-default-project.datachain-documentation.pages.dev |
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.
Hey @ilongin - I've reviewed your changes - here's some feedback:
- You can eliminate the repeated @pytest.mark.parametrize decorators by turning allow_create_project and allow_create_namespace into parametrized fixtures (e.g.
@pytest.fixture(params=[True, False])), which reduces boilerplate in each test. - Please update the get_project docstring to note that default and listing projects are always auto-created when missing, so readers know why
creategets forced to True in those cases.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You can eliminate the repeated @pytest.mark.parametrize decorators by turning allow_create_project and allow_create_namespace into parametrized fixtures (e.g. `@pytest.fixture(params=[True, False])`), which reduces boilerplate in each test.
- Please update the get_project docstring to note that default and listing projects are always auto-created when missing, so readers know why `create` gets forced to True in those cases.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1181 +/- ##
=======================================
Coverage 88.68% 88.68%
=======================================
Files 152 152
Lines 13518 13524 +6
Branches 1873 1874 +1
=======================================
+ Hits 11988 11994 +6
Misses 1088 1088
Partials 442 442
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
dreadatour
left a comment
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.
Looks good to me 👍 Thank you for the fix ❤️
Co-authored-by: Vladimir Rudnykh <[email protected]>
Co-authored-by: Vladimir Rudnykh <[email protected]>
Fixing issue on creating missing default project on empty DB.
Summary by Sourcery
Ensure that default and listing projects are automatically created when accessed on an empty database and update test infrastructure to parameterize project/namespace creation permissions.
Bug Fixes:
Enhancements:
Tests: