Skip to content

feat: add apps publish shortcuts (publish/status/history/error-log) - #12

Merged
raistlin042 merged 23 commits into
feat/lark-apps-devfrom
feat/lark-apps-publish
Jun 3, 2026
Merged

feat: add apps publish shortcuts (publish/status/history/error-log)#12
raistlin042 merged 23 commits into
feat/lark-apps-devfrom
feat/lark-apps-publish

Conversation

@raistlin042

Copy link
Copy Markdown
Owner

Summary

Add four apps release-management shortcuts so AI agents can drive a Miaoda app's release lifecycle from lark-cli: create a release, list release history, check a single release's status, and fetch a failed release's error log. They wrap the spark OpenAPI gateway's app.release methods.

Changes

  • Add shortcuts/apps/apps_publish.goapps +publish (write, scope spark:app:publish): POST /open-apis/spark/v1/apps/:app_id/releases, returns {release_id, status}
  • Add shortcuts/apps/apps_publish_history.goapps +publish-history (read): GET .../releases with --status (publishing/finished/failed) / --limit (1-500) / --page-token query filters
  • Add shortcuts/apps/apps_publish_status.goapps +publish-status (read): GET .../releases/:release_id
  • Add shortcuts/apps/apps_publish_error_log.goapps +publish-error-log (read): GET .../releases/:release_id/error_logs
  • Add shortcuts/apps/apps_publish_common.go — shared gateway path constants
  • Register the four shortcuts in shortcuts/apps/shortcuts.go
  • Add skill reference docs skills/lark-apps/references/lark-apps-publish{,-history,-status,-error-log}.md and surface them in skills/lark-apps/SKILL.md

Test Plan

  • make unit-test passed (includes httpmock happy-path tests for all four commands)
  • validate passed (build / vet / unit / integration / convention / security)
  • local-eval passed (E2E 5/5; skillave 6/7 — one rotating-flaky command-selection case, an eval-agent variance issue, not a product defect)
  • acceptance-reviewer passed (real gateway reachability network-verified; no real release created)
  • manual verification: integration-tested against the deployed gateway in a test environment for all four commands — passed

Related Issues

N/A

Implements the `apps +publish` command with dry-run preview (upstream
PSM path shown) and an Execute gated by ensurePublishWired() per the
not-yet-deployed OpenAPI gateway constraint (publishAPIWired=false).
Declare the four publishXxxPath constants as var instead of const so
go vet's printf analyzer skips them while they are empty placeholders.
Revert the Execute path-build in apps_publish.go from strings.Replace
back to fmt.Sprintf (now safe because the format string is a var).
Add AppsPublish, AppsPublishHistory, AppsPublishStatus, AppsPublishErrorLog
to Shortcuts() and update count test from 6 → 10.
Rename concept instance→release across all 4 publish shortcuts and their
tests: NodeStatus→ReleaseStatus enum, --instance-id→--release-id flag,
pipelineTaskID→releaseID response field, errorJobs→errorLogs, and
upstream HTTP path consts→RPC method name consts (PSM lark.apaas.devops
v1.0.381). Dry-run now shows psm+rpc_method instead of an HTTP path.
- Remove obsolete int-enum machinery (releaseStatusName/toInt/injectStatusName)
  and their encoding/json + fmt imports from apps_publish_common.go
- +publish Execute now returns status string alongside release_id
- +publish-history gains --status Enum flag (publishing/finished/failed);
  buildHistoryBody gains status param, table column status_name→status
- +publish-status Execute drops injectStatusName, pretty prints out["status"]
- +publish-error-log shapeErrorLog is string passthrough (no status_name)
- Unit tests updated: delete 3 obsolete common tests, update history/error-log
… until deploy)

Replace RPC-name placeholders with real OpenAPI paths (publishCreate/Get/ErrorLog/ListPath consts). Switch DryRun to idiomatic HTTP form (POST/GET + real URL + body/params). Fix body/query placement: publish body has no app_id (path-only); history switches from POST body to GET query with snake page_token. Fix Execute response reads to snake_case fields (release_id, created_at, updated_at, error_logs). publishAPIWired stays false; 1-line flip activates live calls.
Replace RPC/PSM dry-run example with real HTTP form (POST/GET /open-apis/spark/v1/apps/:app_id/releases[/:release_id[/error_logs]]).
Fix all response field names to snake_case (release_id, created_at, updated_at, error_log).
Note --status/--limit/--page-token as HTTP query params in publish-history.
@raistlin042 raistlin042 added the feature New functionality label Jun 3, 2026
@raistlin042
raistlin042 merged commit f1fd70a into feat/lark-apps-dev Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant