Skip to content

Conversation

SAKURA-CAT
Copy link
Member

@SAKURA-CAT SAKURA-CAT commented May 25, 2025

Early (private) versions of SwanLab did not have the /project endpoint. The /project/{username} endpoint had to be used instead, as the default workspace feature was not available at that time.

@SAKURA-CAT SAKURA-CAT requested review from Zeyi-Lin and Copilot May 25, 2025 10:52
@SAKURA-CAT SAKURA-CAT self-assigned this May 25, 2025
@SAKURA-CAT SAKURA-CAT added 🐛 bug Something isn't working 💪 enhancement New feature or request labels May 25, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds compatibility for early self-hosted SwanLab versions that lack the /project endpoint by falling back to the legacy /project/{username} API.

  • Catch 404 on /project and retry with /project/{groupname} POST/GET
  • Store and reuse __groupname for both modern and legacy endpoints
Comments suppressed due to low confidence (1)

swanlab/api/http.py:275

  • The variable username is not defined in this scope. You may need to accept it as a function parameter or derive it from the initial response (e.g., resp['username']).
self.__groupname = self.__groupname if username is None else username

@SAKURA-CAT SAKURA-CAT force-pushed the feat/compatible-with-privatization branch from 0d60b7f to 4fd225f Compare May 25, 2025 10:54
@SAKURA-CAT SAKURA-CAT force-pushed the feat/compatible-with-privatization branch from 4fd225f to 3f1a297 Compare May 25, 2025 10:55
@Zeyi-Lin Zeyi-Lin merged commit a413eec into main May 25, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the feat/compatible-with-privatization branch June 13, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 💪 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants