jupyterhub / kubespawner

Kubernetes spawner for JupyterHub
https://jupyterhub-kubespawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
536 stars 301 forks source link

API Calls to spawn user servers do not handle defaults in profileList correctly #758

Closed GeorgianaElena closed 10 months ago

GeorgianaElena commented 12 months ago

Bug description

Following up on https://github.com/jupyterhub/kubespawner/pull/735, there is still an issue related to how defaults are considered when user_options is empty and server spawned is triggered through an api call, rather than through the UI.

Unfortunately, it's not easy to spot where the issue is coming from, as the profileList codebase has grown a lot and it's becoming harder to follow. We should take this opportunity, of searching the issue to also do some refactoring and possibly move all the profile handling code into a separate file.

Expected behaviour

When an user spawn is triggered through an api call, with an empty user_options dict, a server should be spawned with default profile and option choices.

Actual behaviour

An error is thrown from the validatation of the options like in https://github.com/2i2c-org/infrastructure/issues/2146#issuecomment-1649445203.

welcome[bot] commented 12 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

consideRatio commented 10 months ago

Closed by #769

consideRatio commented 10 months ago

There is a related bug to this and I'm writing about it here for now.

We have an expectation that users starting a server and then starting another server shouldn't get influenced by what they did before, but I think that may be a broken expectation.

I'm digging into this @GeorgianaElena. I'm planning to provide a "Explanation" section about how profile_list is implemented on top of the Spawner base class functionality as I need it for myself to understand what goes wrong. I think the crux may be in this code, but I'm trying to piece together my undertanding on what goes on before addressing it.

GeorgianaElena commented 10 months ago

@consideRatio, let's track this bug in https://github.com/jupyterhub/kubespawner/issues/772, as the current issue is related to a totally different bug. What do you think?