[1.26.x] feat(dashboard): modernize OpenAPI SDK generation - #2989
Draft
wklken wants to merge 58 commits into
Draft
[1.26.x] feat(dashboard): modernize OpenAPI SDK generation#2989wklken wants to merge 58 commits into
wklken wants to merge 58 commits into
Conversation
Validate SDK language settings during settings construction, require Generic BKRepo configuration for generation, and enforce approved generator property keys.
Require resource-version objects as the package-version authority, freeze language properties while keeping fingerprint payloads serializable, and retain literal golang compatibility only for legacy SDK records and manager routing.
wklken
marked this pull request as draft
July 13, 2026 01:50
Why this change was needed: PR TencentBlueKing#2989 conflicted with the current master branch after the v2 sync API, configuration, and contract tests evolved. What changed: - merged upstream/master into feat/openapi-sdk-generation - preserved the asynchronous SDK generation 202 response contract - retained master Celery, configuration, API, and test changes - kept superseded legacy SDK generators and templates deleted Problem solved: The PR branch now contains the current master history with all textual and semantic conflicts resolved and verified.
Why this change was needed: The asynchronous SDK generation APIs did not expose a reliable task lifecycle, and retry, lease, legacy artifact, and native publishing edge cases could produce misleading states or unusable artifact links. What changed: - align the frontend and public APIs around observable generation tasks - harden task status, lease renewal, retry, artifact selection, and publishing recovery - synchronize OpenAPI definitions and docs with regression coverage Problem solved: SDK generation now reports terminal outcomes accurately, preserves compatibility, and recovers safely from partial publication and worker ownership changes.
…generation # Conflicts: # src/dashboard/apigateway/apigateway/tests/conf/test_utils.py
Ignore legacy SDK records in the usage-example endpoint so obsolete clients are not documented with the new OpenAPI Generator API. Render Java imports from the generated invoker package, and render Go imports with the persisted module path and package name. Add bilingual regression coverage for the corrected examples.
Why this change was needed: PR review found retry corruption, task-state races, unbounded polling, and repository credential handling gaps in the new SDK pipeline. What changed: - isolate each request and its Generic artifact ownership - guard lifecycle recovery, cleanup, and repository credentials - preserve API aliases and document the asynchronous V1 contract - bound frontend polling and handle usable partial results - add focused regression coverage for the reviewed failure paths Problem solved: SDK generation retries no longer contaminate other requests, deployment configuration failures are classified correctly, and clients receive a bounded, compatible generation flow.
Use SDK_GENERATION_ENABLED as the single source for the existing frontend SDK flags. Remove the obsolete Python SDK quota and unused log-size setting, with regression coverage for legacy environment variables.
Prevent stale item writes and inconsistent lock ordering, validate legacy SDK resource-version ownership, support native publication retries, and map legacy V2 validation failures correctly.
Use ENABLE_SDK as the only frontend SDK capability flag and remove the obsolete ALLOW_UPLOAD_SDK_TO_REPOSITORY response field, type, defaults, and consumers.
Why this change was needed: Internal superpowers design artifacts should not be included in the repository or pull request. What changed: - Removed the OAS3 resource documentation renderer design file from docs/superpowers Problem solved: The implementation remains in the branch without publishing internal planning material.
wklken
commented
Sep 4, 2026
Why this change was needed: The SDK worker deployment guide should not be maintained in this repository. What changed: - Removed src/dashboard/docs/sdk-worker-deployment.md - Kept the standalone image smoke gate because it validates generated SDK artifacts across all supported languages Problem solved: The pull request no longer publishes deployment documentation while retaining useful image-level validation.
Harden the asynchronous SDK generation workflow after PR review while preserving the legacy V2 response contract. Unify language handling, centralize serialization, remove model-layer business validation, constrain subprocess execution, simplify fixed worker configuration, and keep the worker image non-root. Update focused tests and SDK smoke coverage accordingly.
Disable generated placeholder tests and share the production generator with the worker smoke check. Infer missing path parameters and avoid live backend lookups for historical SDK exports. Preserve adopted legacy SDK metadata, include the private PyPI index in installation commands, and use versioned Go module paths for major releases.
5 tasks
wklken
commented
Sep 8, 2026
Keep package identity and native publication choices stable across queued tasks. Accept legacy golang configuration, skip cleanup when disabled, and lock JavaScript builds with npm ci. Centralize artifact selection and retry state updates, remove redundant configuration forwarding, and apply SDK field and setting review renames.
Escape OpenAPI prose in resource docs, strip descriptions before code generation, compile Go SDKs with go build, and redact local paths from worker errors. Co-authored-by: Cursor <cursoragent@cursor.com>
wklken
commented
Sep 8, 2026
Import and SDK generation now share a visited-set $ref scan, so YAML aliases cannot hang the checker and remote refs cannot reach the validator. Dashboard docs also drop <style> bodies that the XSS filter previously kept. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replace the preset SDK templates with asynchronous, database-backed OpenAPI Generator tasks for Python, Java, Go, and JavaScript (TypeScript Fetch client).
Generated packages are always stored in BKRepo Generic. Python can additionally publish to PyPI and Java to Maven when their repositories are configured. Generation and native publication have independent retries; native publication reuses the built package identity saved with the task.
A dedicated SDK worker image contains the pinned toolchains. JavaScript builds install from the checked-in dependency lock using npm ci. Django uses one set of SDK settings, and download responses share a consistent Generic artifact selection rule.
Compatibility notes
data: [].data: [].versioninput remains accepted; package versions derive from the resource version.golangremains accepted at API and deployment environment boundaries and is normalized togo.Verification
uv run make testduring SDK remediation: 4231 passed (the local checkout also contained unrelated existing tests).uv run make lint-checkandgit diff --checkpassed.pnpm build-onlypassed (existing bundle-size warnings).The related Helm chart work is on
feat/apigateway-sdk-worker-1.23frombk-apigateway-1.23.x: https://git.woa.com/blueking/helm-charts/-/merge_requests/new?merge_request%5Bsource_branch%5D=feat%2Fapigateway-sdk-worker-1.23Checklist