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

Fix issue with generating slug for sharing #18986

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from

Conversation

arash77
Copy link
Collaborator

@arash77 arash77 commented Oct 14, 2024

This pull request fixes an issue with generating a slug for sharing. The commit includes a patch that adds a check to ensure that the slug base is not empty, and if it is, it sets it to "unnamed". This resolves the problem with generating slugs for sharing and publishing when it is not alphanumeric. related to #18584

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@arash77 arash77 marked this pull request as ready for review October 14, 2024 14:34
@github-actions github-actions bot added this to the 24.2 milestone Oct 14, 2024
@arash77
Copy link
Collaborator Author

arash77 commented Oct 15, 2024

Should I add types-python-slugify==8.0.2.20240310 ; python_version >= "3.8" and python_version < "3.13" into /lib/galaxy/dependencies/pinned-typecheck-requirements.txt to fix the Library stubs not installed error?

@nsoranzo
Copy link
Member

Should I add types-python-slugify==8.0.2.20240310 ; python_version >= "3.8" and python_version < "3.13" into /lib/galaxy/dependencies/pinned-typecheck-requirements.txt to fix the Library stubs not installed error?

Can you please also modify pyproject.toml by adding python-slugify to the [tool.poetry.dependencies] section and types-python-slugify to the [tool.poetry.group.typecheck.dependencies] section?

@arash77
Copy link
Collaborator Author

arash77 commented Oct 15, 2024

Should I add a requirement into one of the test-requirements.txt to fix the Test Galaxy packages?

@nsoranzo
Copy link
Member

Should I add a requirement into one of the test-requirements.txt to fix the Test Galaxy packages?

Sorry, forgot about that! You should add python-slugify to the [options] -> install_requires section of packages/app/setup.cfg . That's because this dependency is used in lib/galaxy/manages which ends up in the galaxy-app package as you can see from the packages/app/galaxy/managers symlink.
Happy to give you more details about how the modules are split in packages if you are interested.

pyproject.toml Outdated Show resolved Hide resolved
@arash77
Copy link
Collaborator Author

arash77 commented Oct 15, 2024

Should I add a requirement into one of the test-requirements.txt to fix the Test Galaxy packages?

Sorry, forgot about that! You should add python-slugify to the [options] -> install_requires section of packages/app/setup.cfg . That's because this dependency is used in lib/galaxy/manages which ends up in the galaxy-app package as you can see from the packages/app/galaxy/managers symlink. Happy to give you more details about how the modules are split in packages if you are interested.

Thank you for the explanation! I’d love to know more.

@nsoranzo
Copy link
Member

Thank you for the explanation! I’d love to know more.

Some info is in this presentation, slides 65-72:

https://training.galaxyproject.org/training-material/topics/dev/tutorials/architecture/slides.html#65

Ping me on Matrix if you need clarifications.

@arash77
Copy link
Collaborator Author

arash77 commented Oct 17, 2024

The test failures seems to be irrelevant.

history_name = "تاریخچه"
history_id = self.dataset_populator.new_history(name=history_name)
response = self.dataset_populator.make_public(history_id)
assert response["username_and_slug"]
Copy link
Member

@mvdbeek mvdbeek Oct 17, 2024

Choose a reason for hiding this comment

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

Can you assert the actual slug?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The SharingStatus model doesn't have the slug itself.
Should I split it from this one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

like this:

Suggested change
assert response["username_and_slug"]
assert response["username_and_slug"].split("h/")[1] == history_name

Copy link
Contributor

Choose a reason for hiding this comment

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

You can also assert that the history_name is in response["username_and_slug"], whatever you prefer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants