Skip to content

Cherry pick app api doc#743

Open
tossmilestone wants to merge 2 commits into
masterfrom
cherry-pick-app-api-doc
Open

Cherry pick app api doc#743
tossmilestone wants to merge 2 commits into
masterfrom
cherry-pick-app-api-doc

Conversation

@tossmilestone
Copy link
Copy Markdown
Member

@tossmilestone tossmilestone commented May 7, 2026

Summary by CodeRabbit

  • Documentation
    • Added localized Application APIs docs (English & Chinese) including an overview plus pages for lifecycle, management operations, and query/resources.
    • Published a complete OpenAPI specification for Application APIs covering create/update/delete, rollback/start/stop, snapshots, exports, resource queries, topology, cronjob exec, logs, and namespace management.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

Walkthrough

Adds a complete OpenAPI 3.0 specification for Application APIs and four localized MDX docs (index, lifecycle, management, query) that render Overview/OpenAPIPath components and surface the new API paths and schemas.

Changes

Application API Documentation

Layer / File(s) Summary
OpenAPI Specification
docs/shared/openapis/application.v1.json
Adds OpenAPI 3.0 document with global bearerAuth, paths for application CRUD and operations (rollback/start/stop, snapshots, exports, cronjob exec, resource search/topology, logs, batch create, general-namespace), and components.schemas for Application, ApplicationSpec, ApplicationStatus, ObjectMeta, KubernetesResource, GeneralNamespace, ApplicationChartPackage.
Overview Page
docs/en/apis/advanced_apis/application/index.mdx
Adds index MDX with i18n.title in English/Chinese and renders <Overview />.
Lifecycle Documentation
docs/en/apis/advanced_apis/application/lifecycle.mdx
Adds lifecycle MDX with i18n.title and OpenAPIPath block listing list/detail/rollback/start/stop endpoints under cluster/namespace routes.
Management Documentation
docs/en/apis/advanced_apis/application/management.mdx
Adds management MDX with i18n.title and OpenAPIPath block for snapshot, chartpackage/export, cronjob exec, and resource endpoints.
Query & Resources Documentation
docs/en/apis/advanced_apis/application/query.mdx
Adds query MDX with i18n.title and OpenAPIPath block for status-by-name, address lookup, topology, and resource search endpoints.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • chinameok
  • JounQin

Poem

🐰 I hopped through JSON, MDX, and lines,

Docs in two tongues, API signs,
Paths and schemas all set to play,
Overview shines and guides the way,
🥕 Hop—now read, explore, and stay!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "Cherry pick app api doc" is vague and generic, using abbreviations and not clearly conveying what documentation content is being added or modified in this changeset. Improve the title to be more specific and descriptive, such as "Add Application API documentation pages for lifecycle, management, and query operations" to clearly convey the main changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cherry-pick-app-api-doc

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
docs/shared/openapis/application.v1.json (1)

90-91: ⚡ Quick win

Clarify the operation summary.

The summary "List Application Resources" could be misinterpreted as listing multiple applications. Since the path includes {name}, consider a more precise summary.

📝 Suggested improvement
       "get": {
-        "summary": "List Application Resources",
+        "summary": "Get Application and Sub-Resources",
         "description": "Lists the application resource itself and its sub-resources.",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/shared/openapis/application.v1.json` around lines 90 - 91, Update the
OpenAPI operation summary to clearly indicate this endpoint targets a single
application instance (path contains {name}) rather than multiple applications;
replace the ambiguous "List Application Resources" summary with a precise phrase
such as "List resources for an application" or "Get resources for application
{name}" in the operation's "summary" field so it matches the existing
"description" that refers to the application resource and its sub-resources.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/en/apis/advanced_apis/application/management.mdx`:
- Line 15: The docs reference two undefined endpoints
'/acp/v1/kubernetes/{cluster}/namespaces/{namespace}/applications/{name}/chartpackage'
and '/acp/v1/kubernetes/{cluster}/general-namespaces' that are not present in
the OpenAPI file; either remove these paths from
docs/en/apis/advanced_apis/application/management.mdx or add corresponding path
definitions to the OpenAPI spec (application.v1.json) including operations,
parameters, and responses so they render—locate the entries by the exact path
strings in the MDX and in application.v1.json (or the generator source that
imports it) and perform the chosen action consistently for both paths.

In `@docs/en/apis/advanced_apis/application/query.mdx`:
- Line 14: Update the path parameter name to match the OpenAPI spec by replacing
the incorrect placeholder `{cluster}` with `{cluster_name}` in the route string
used to document the endpoint (the path entry string
'/acp/v1/kubernetes/{cluster}/namespaces/{namespace}/applications/{name}');
ensure the resulting path exactly matches the OpenAPI `application.v1.json`
definition so the docs renderer picks up the correct parameter name.

In `@docs/shared/openapis/application.v1.json`:
- Line 17: The OpenAPI spec mixes path parameter names "cluster_name" and
"cluster"; find every path parameter object where "name": "cluster" (and any
path templates using {cluster}) and rename them to "cluster_name", updating any
corresponding schema/$ref, examples, and path templates (e.g., change
"/.../{cluster}/..." to "/.../{cluster_name}/...") so all endpoints consistently
use "cluster_name"; ensure required:true and schema:type remain unchanged and
run the spec validation after edits.
- Around line 8-10: The OpenAPI document references the bearerAuth security
requirement but lacks a matching components.securitySchemes entry; add a
security scheme named "bearerAuth" under components.securitySchemes that defines
an HTTP bearer token scheme (type: http, scheme: bearer, bearerFormat: JWT) so
the referenced security requirement resolves and OpenAPI validation passes;
update the components section to include this new "bearerAuth" security scheme.

---

Nitpick comments:
In `@docs/shared/openapis/application.v1.json`:
- Around line 90-91: Update the OpenAPI operation summary to clearly indicate
this endpoint targets a single application instance (path contains {name})
rather than multiple applications; replace the ambiguous "List Application
Resources" summary with a precise phrase such as "List resources for an
application" or "Get resources for application {name}" in the operation's
"summary" field so it matches the existing "description" that refers to the
application resource and its sub-resources.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18798d2c-be37-44ea-b59f-987e6dc3cdd4

📥 Commits

Reviewing files that changed from the base of the PR and between 3de405e and 11d421d.

📒 Files selected for processing (5)
  • docs/en/apis/advanced_apis/application/index.mdx
  • docs/en/apis/advanced_apis/application/lifecycle.mdx
  • docs/en/apis/advanced_apis/application/management.mdx
  • docs/en/apis/advanced_apis/application/query.mdx
  • docs/shared/openapis/application.v1.json

Comment thread docs/en/apis/advanced_apis/application/management.mdx
Comment thread docs/en/apis/advanced_apis/application/query.mdx
Comment thread docs/shared/openapis/application.v1.json
Comment thread docs/shared/openapis/application.v1.json
Remove the deprecated app.k8s.io/v1beta1 API reference from the application lifecycle documentation as part of the effort to clean up Kubernetes-style resource definitions.

Signed-off-by: Xiaoxi He <xxhe@alauda.io>
@tossmilestone tossmilestone force-pushed the cherry-pick-app-api-doc branch from 11d421d to 53d4ee3 Compare May 8, 2026 06:31
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
docs/shared/openapis/application.v1.json (2)

8-10: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Define the referenced bearerAuth security scheme.

Line 8 references bearerAuth, but there is no matching components.securitySchemes.bearerAuth definition, so OpenAPI validation will fail.

🔧 Minimal fix
   "components": {
+    "securitySchemes": {
+      "bearerAuth": {
+        "type": "http",
+        "scheme": "bearer",
+        "bearerFormat": "JWT"
+      }
+    },
     "schemas": {
#!/bin/bash
# Verify security requirement has a matching scheme definition
rg -n '"security"\s*:\s*\[' docs/shared/openapis/application.v1.json
rg -n '"bearerAuth"' docs/shared/openapis/application.v1.json
rg -n '"securitySchemes"\s*:' docs/shared/openapis/application.v1.json

Also applies to: 482-483

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/shared/openapis/application.v1.json` around lines 8 - 10, The OpenAPI
file uses the security requirement "bearerAuth" but no matching
components.securitySchemes.bearerAuth is defined; add a
components.securitySchemes object and define bearerAuth (e.g., type: http,
scheme: bearer, bearerFormat: JWT) so the referenced "bearerAuth" under
"security" resolves correctly; update the top-level schema (components →
securitySchemes → bearerAuth) to match the expected name "bearerAuth" used in
the "security" arrays.

231-235: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Standardize cluster path parameter naming with cluster_name.

Several endpoints still use {cluster} / "name": "cluster" while most of this spec uses cluster_name (e.g., Line 12 and peers). This inconsistency increases client/doc confusion.

🔧 Example of the required normalization
- "/acp/v1/kubernetes/{cluster}/topology/{namespace}/{kind}/{name}": {
+ "/acp/v1/kubernetes/{cluster_name}/topology/{namespace}/{kind}/{name}": {
...
- { "name": "cluster", "in": "path", "required": true, "schema": { "type": "string" } },
+ { "name": "cluster_name", "in": "path", "required": true, "schema": { "type": "string" } },
#!/bin/bash
# List remaining mixed cluster placeholders/params for normalization
rg -n '\{cluster\}' docs/shared/openapis/application.v1.json
rg -n '"name":\s*"cluster"' docs/shared/openapis/application.v1.json
rg -n '\{cluster_name\}' docs/shared/openapis/application.v1.json
rg -n '"name":\s*"cluster_name"' docs/shared/openapis/application.v1.json

Also applies to: 259-263, 310-314, 331-335, 359-363, 396-403

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/shared/openapis/application.v1.json` around lines 231 - 235, The OpenAPI
spec uses the path
"/acp/v1/kubernetes/{cluster}/topology/{namespace}/{kind}/{name}" and a path
parameter with "name": "cluster"; standardize this to "cluster_name" everywhere:
rename the path placeholder to "{cluster_name}" and update the corresponding
parameter object from "name": "cluster" to "name": "cluster_name" (and any
"schema" or examples referencing it) so they match the rest of the spec; apply
the same replacement to the other listed endpoint occurrences (lines referenced
in the review) and ensure any $ref, examples, or server/operation-level
parameters that reference "cluster" are updated to "cluster_name" as well to
keep the spec consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@docs/shared/openapis/application.v1.json`:
- Around line 8-10: The OpenAPI file uses the security requirement "bearerAuth"
but no matching components.securitySchemes.bearerAuth is defined; add a
components.securitySchemes object and define bearerAuth (e.g., type: http,
scheme: bearer, bearerFormat: JWT) so the referenced "bearerAuth" under
"security" resolves correctly; update the top-level schema (components →
securitySchemes → bearerAuth) to match the expected name "bearerAuth" used in
the "security" arrays.
- Around line 231-235: The OpenAPI spec uses the path
"/acp/v1/kubernetes/{cluster}/topology/{namespace}/{kind}/{name}" and a path
parameter with "name": "cluster"; standardize this to "cluster_name" everywhere:
rename the path placeholder to "{cluster_name}" and update the corresponding
parameter object from "name": "cluster" to "name": "cluster_name" (and any
"schema" or examples referencing it) so they match the rest of the spec; apply
the same replacement to the other listed endpoint occurrences (lines referenced
in the review) and ensure any $ref, examples, or server/operation-level
parameters that reference "cluster" are updated to "cluster_name" as well to
keep the spec consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad3b0119-2f6a-40a4-9844-cd2e8446f42b

📥 Commits

Reviewing files that changed from the base of the PR and between 11d421d and 53d4ee3.

📒 Files selected for processing (2)
  • docs/en/apis/advanced_apis/application/lifecycle.mdx
  • docs/shared/openapis/application.v1.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/en/apis/advanced_apis/application/lifecycle.mdx

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying alauda-container-platform with  Cloudflare Pages  Cloudflare Pages

Latest commit: 53d4ee3
Status: ✅  Deploy successful!
Preview URL: https://30a989a3.alauda-container-platform.pages.dev
Branch Preview URL: https://cherry-pick-app-api-doc.alauda-container-platform.pages.dev

View logs

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