Skip to content

Adapt Studio surface to modelscope_service master (OAuth + env descri… - #83

Open
J-z202408 wants to merge 2 commits into
modelscope:mainfrom
J-z202408:main
Open

J-z202408 wants to merge 2 commits into
modelscope:mainfrom
J-z202408:main

Conversation

@J-z202408

Copy link
Copy Markdown

…ption)

Re-implements the 20261027 OpenAPI adaptation on top of current main (post-#77 rewrite), replacing the pre-#77 implementation previously carried on this branch:

  • CLI: studio settings/create expose the OAuth app configuration flags (--oauth-enabled/--no-oauth-enabled, --oauth-scope, --oauth-token-expire-time, --oauth-callback-url, --oauth-homepage-url); lone oauth_* settings without an explicit oauth_enabled are rejected client-side, mirroring the server's HTTP 400 gate
  • CLI/API: --description on studio secret/variable add/update (and the top-level secret family); description is tri-state on update — None omits the field (server keeps the stored one), empty string clears it
  • CLI: secret/variable list now renders the description column the server returns
  • compat: legacy add/update_studio_secret/variable forward passthrough kwargs (description) instead of silently dropping them
  • fixture: openapi.json gains the oauth_* fields on CreateStudioRequest / UpdateStudioSettingsRequest / GetStudioResponse with service-master-aligned descriptions

Verified: full cli subset 868 passed / 37 skipped; ruff + mypy clean; modelscope SDK tests/studios/test_studio_cli.py against this build: 19 passed / 19 skipped (gates active).

jz02070540 added 2 commits November 12, 2026 14:16
…ption)

Re-implements the 20261027 OpenAPI adaptation on top of current main
(post-modelscope#77 rewrite), replacing the pre-modelscope#77 implementation previously
carried on this branch:

- CLI: studio settings/create expose the OAuth app configuration flags
  (--oauth-enabled/--no-oauth-enabled, --oauth-scope,
  --oauth-token-expire-time, --oauth-callback-url, --oauth-homepage-url);
  lone oauth_* settings without an explicit oauth_enabled are rejected
  client-side, mirroring the server's HTTP 400 gate
- CLI/API: --description on studio secret/variable add/update (and the
  top-level secret family); description is tri-state on update — None
  omits the field (server keeps the stored one), empty string clears it
- CLI: secret/variable list now renders the description column the
  server returns
- compat: legacy add/update_studio_secret/variable forward passthrough
  kwargs (description) instead of silently dropping them
- fixture: openapi.json gains the oauth_* fields on
  CreateStudioRequest / UpdateStudioSettingsRequest / GetStudioResponse
  with service-master-aligned descriptions

Verified: full cli subset 868 passed / 37 skipped; ruff + mypy clean;
modelscope SDK tests/studios/test_studio_cli.py against this build:
19 passed / 19 skipped (gates active).
…erance

Three review findings on modelscope#83 plus a help-text clarification:

- create: reject OAuth flag combinations the server would silently drop.
  The create contract decodes oauth_enabled as a plain bool, so detail
  fields without an explicit flag never reach the OAuth app creation —
  the studio deploys without its login runtime variables. Lone details
  and non-studio misuse now fail fast before any request
  (openapi/backend/studio.go:634, service/space.go:3899).
- secret/variable list: keep keys (and variable values) untruncated —
  server-legal keys run to 128 bytes and must stay copyable; only the
  description column is capped via the new per-column max_widths
  (openapi/types/studio.go:216).
- compat: forward only description on add/update_studio_secret/variable;
  unknown kwargs keep the legacy silent-ignore behaviour instead of
  raising TypeError from the fixed-signature modern API.
- CLI help: --oauth-callback-url now distinguishes create (defaults to
  the studio subdomain) from update (keeps existing callbacks).

Verified: full non-remote suite 1775 passed / 1 skipped; ruff + mypy
clean; modelscope tests/studios with this build: 23 passed / 19 skipped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant