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

SS-1191: Bugfix related to environment and flavor deletion #243

Merged
merged 38 commits into from
Dec 10, 2024

Conversation

akochari
Copy link
Collaborator

@akochari akochari commented Oct 21, 2024

Description

This PR contains bugfix SS-1191 - environment and flavor deletion from the UI resulted in internal server error when these were currently used in an app. While working on it, I also made a number of other improvements:

  • regular users no longer allowed to send post requests to endpoints to create and delete flavors and environments
  • flavor and environment deletion is not allowed from the django admin panel either
  • added unit tests for flavor and environment creation and deletion

This PR also includes an unrelated small change that was missed in previous PR: allowing display of instructions to run Gradio and Streamlit apps locally with Docker.

Finally, this PR includes an updated Serve logo

Checklist

If you're unsure about any of the items below, don't hesitate to ask. We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • This pull request is against develop branch (not applicable for hotfixes)
  • I have included a link to the issue on GitHub or JIRA (if any)
  • I have included migration files (if there are changes to the model classes)
  • I have included, reviewed and executed tests (unit and end2end) to complement my changes
  • I have updated the related documentation (if necessary)
  • I have added a reviewer for this pull request
  • I have added myself as an author for this pull request
  • In the case I have modified settings.py, then I have also updated the studio-settings-configmap.yaml file in serve-charts

@akochari akochari added the bug Something isn't working label Oct 21, 2024
apps/migrations/0017_alter_streamlitinstance_port.py Outdated Show resolved Hide resolved
projects/views.py Outdated Show resolved Hide resolved
projects/views.py Outdated Show resolved Hide resolved
projects/views.py Outdated Show resolved Hide resolved
projects/views.py Outdated Show resolved Hide resolved
projects/views.py Outdated Show resolved Hide resolved
projects/views.py Outdated Show resolved Hide resolved
@churnikov
Copy link
Contributor

Do I get it right, that this pr has to do with these errors?
image

akochari and others added 3 commits October 22, 2024 09:35
Co-authored-by: Nikita Churikov <[email protected]>
Co-authored-by: Nikita Churikov <[email protected]>
Co-authored-by: Nikita Churikov <[email protected]>
@akochari
Copy link
Collaborator Author

Do I get it right, that this pr has to do with these errors? image

No, these errors are coming from periodic tasks. That's solved in PR #239

@akochari akochari changed the title Bugfix SS-1191 - environment and flavor deletion SS-1191: Bugfix related to environment and flavor deletion Nov 21, 2024
@akochari akochari marked this pull request as ready for review November 27, 2024 06:58
@akochari akochari requested a review from churnikov November 27, 2024 09:12
@hamzaimran08 hamzaimran08 requested a review from Copilot November 27, 2024 09:14

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 10 changed files in this pull request and generated no suggestions.

Files not reviewed (5)
  • templates/common/app_card.html: Language not supported
  • templates/projects/settings.html: Language not supported
  • apps/migrations/0019_alter_jupyterinstance_environment_and_more.py: Evaluated as low risk
  • apps/models/app_types/jupyter.py: Evaluated as low risk
  • apps/models/app_types/rstudio.py: Evaluated as low risk
Comments skipped due to low confidence (3)

projects/tests/test_create_delete_environments.py:23

  • [nitpick] The method name test_environment_creation_user should be test_environment_creation_by_user for better readability.
def test_environment_creation_user(self):

projects/tests/test_create_delete_environments.py:60

  • [nitpick] The method name test_environment_creation_deletion_superuser should be test_environment_creation_and_deletion_by_superuser for better readability.
def test_environment_creation_deletion_superuser(self):

projects/tests/test_create_delete_environments.py:24

  • The docstring should be updated to "Test regular user is not allowed to create environment".
"""Test regular user not allowed to create environment"""
Copy link
Member

@alfredeen alfredeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@churnikov churnikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just minor comment, after them LGTM

projects/tests/test_create_delete_environments.py Outdated Show resolved Hide resolved
projects/tests/test_create_delete_flavors.py Show resolved Hide resolved
projects/views.py Outdated Show resolved Hide resolved
messages.error(
request,
"Environment cannot be deleted because it is currently used by at least one app \
(can also be a deleted app).",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What to do if it's a deleted app?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think then we are not allowed to delete that flavor. If there is a use case where it is needed we can implement something else later I think. It may have repercussions further down, not sure.

templates/common/app_card.html Show resolved Hide resolved
@akochari akochari requested a review from churnikov December 9, 2024 15:44
Copy link
Contributor

@churnikov churnikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small suggestion that could be applied to most of the other test. Otherwise, lgtm

projects/tests/test_create_delete_environments.py Outdated Show resolved Hide resolved
projects/tests/test_create_delete_environments.py Outdated Show resolved Hide resolved
@akochari akochari merged commit 305827e into develop Dec 10, 2024
2 checks passed
@akochari akochari deleted the env-and-flavor-deletion-fixes branch December 10, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants