-
Notifications
You must be signed in to change notification settings - Fork 221
Add public projects #2759
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
Merged
r4victor
merged 14 commits into
dstackai:master
from
haydnli-shopify:PR1-add-is-public-property-to-projects
Jun 13, 2025
Merged
Add public projects #2759
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3f36a08
feat: Add support for public projects (#2670)
haydnli-shopify 2c951f9
refactor: Extract complex SQL query into helper function
haydnli-shopify cf1458f
fix: Keep list_user_projects backward compatible - Dakota pointed out…
haydnli-shopify 325b0c9
test: Add service-level tests for backward compatibility
haydnli-shopify 43228e7
refactor: Consolidate query logic with parameter approach
haydnli-shopify c55f183
Simplify project service functions for public project discovery
haydnli-shopify 64947e1
Clean up inline comments in project service
haydnli-shopify 6e4537f
Fix code formatting for pre-commit compliance
haydnli-shopify 0387e52
Add database migration for ProjectModel.is_public
haydnli-shopify 878759e
Fix code formatting for pre-commit compliance
haydnli-shopify 366f9c0
fix: clarify docstring for global admin behavior
haydnli-shopify 761fba6
Fix public project access for non-members
haydnli-shopify ea840a6
Apply pre-commit formatting fixes
haydnli-shopify 24306d1
Fix comments and docstrings
r4victor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/dstack/_internal/server/migrations/versions/35f732ee4cf5_add_projectmodel_is_public.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| """Add ProjectModel.is_public | ||
|
|
||
| Revision ID: 35f732ee4cf5 | ||
| Revises: bca2fdf130bf | ||
| Create Date: 2025-06-06 13:04:02.912032 | ||
|
|
||
| """ | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "35f732ee4cf5" | ||
| down_revision = "bca2fdf130bf" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| # Add is_public column as nullable first | ||
| with op.batch_alter_table("projects", schema=None) as batch_op: | ||
| batch_op.add_column(sa.Column("is_public", sa.Boolean(), nullable=True)) | ||
|
|
||
| # Set is_public to False for existing projects | ||
| op.execute(sa.sql.text("UPDATE projects SET is_public = FALSE")) | ||
|
|
||
| # Make is_public non-nullable with default value | ||
| with op.batch_alter_table("projects", schema=None) as batch_op: | ||
| batch_op.alter_column("is_public", nullable=False, server_default=sa.false()) | ||
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| # Remove is_public column | ||
| with op.batch_alter_table("projects", schema=None) as batch_op: | ||
| batch_op.drop_column("is_public") | ||
| # ### end Alembic commands ### | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please avoid WHAT comments that duplicate the code. If LLM generated, please remove.