Skip to content

feat(template): expose latest job id in template list across clients#546

Open
xiaojunxiang2023 wants to merge 1 commit into
TencentCloud:masterfrom
xiaojunxiang2023:feat/template-list-job-id
Open

feat(template): expose latest job id in template list across clients#546
xiaojunxiang2023 wants to merge 1 commit into
TencentCloud:masterfrom
xiaojunxiang2023:feat/template-list-job-id

Conversation

@xiaojunxiang2023

@xiaojunxiang2023 xiaojunxiang2023 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Template list/detail responses now include each template's latest create/rebuild job id (job_id / jobID). This lets operators look up build status without guessing ids after tpl ls, Web UI browsing, or SDK listing.

Fixes the gap where cubemastercli tpl ls showed building template ids but not the corresponding job id needed for tpl status --job-id / tpl watch --job-id.

Changes

Layer Field Behavior
CubeMaster job_id Populated from the latest TemplateImageJob per template
cubemastercli JOB_ID column Added to tpl ls / tpl ls -o wide; tpl info prints job_id when present
CubeAPI jobID Added to GET /templates and GET /templates/:id
Web UI jobID Shown on template cards; detail page uses it to auto-poll in-progress builds
Python SDK TemplateInfo.job_id Parsed from list/detail responses
Go SDK TemplateInfo.JobID Parsed from list/detail responses

Semantics: returns the latest job id for the template (including READY / FAILED), not only in-progress jobs. Templates with no job history (e.g. legacy entries) omit the field.

Example

cubemastercli tpl ls
# TEMPLATE_ID  STATUS   JOB_ID              CREATED_AT  IMAGE_INFO
# tpl-abc...   RUNNING  job-xyz...          ...         nginx:latest@sha256:...

cubemastercli tpl status --job-id job-xyz...
cubemastercli tpl watch --job-id job-xyz...

Deploy and Verify

image image

Comment thread web/src/api/client.ts Outdated
@xiaojunxiang2023 xiaojunxiang2023 force-pushed the feat/template-list-job-id branch 2 times, most recently from 51a2cd3 to bfa5c81 Compare June 13, 2026 02:41
@fslongjin

Copy link
Copy Markdown
Member

Thanks for this proposal @xiaojunxiang2023 — exposing the latest job ID in template list responses is a great idea. It closes a real UX gap where operators had to guess the right --job-id after running tpl ls.

However, it looks like this PR now has conflicts with master, likely because #580 (merged June 22) introduced a TUI-based interface for tpl ls / tpl watch / tpl status, which significantly changed CubeMaster/cmd/cubemastercli/commands/cubebox/template.go — the same file your CLI changes touch.

Could you please rebase this branch onto the latest master and resolve the conflicts? In particular, the tpl ls output is now rendered through the TUI rather than the old tabwriter table, so the JOB_ID column integration there may need to be rethought to fit the new TUI layout. (The API, SDK, and Web UI parts of this PR should be unaffected and are still very welcome!)

Happy to take another look once it's rebased. Thanks for the contribution! 🙏

Return each template's latest create/rebuild job id from CubeMaster list
and detail APIs so operators can inspect build status without guessing ids.
Propagate the field through CubeAPI, cubemastercli, web UI, and SDKs.

Signed-off-by: xiaojunxiang <xiaojunxiang@kingsoft.com>
@xiaojunxiang2023 xiaojunxiang2023 force-pushed the feat/template-list-job-id branch from bfa5c81 to 599113a Compare June 25, 2026 14:46
@xiaojunxiang2023

Copy link
Copy Markdown
Contributor Author

Thanks for this proposal @xiaojunxiang2023 — exposing the latest job ID in template list responses is a great idea. It closes a real UX gap where operators had to guess the right --job-id after running tpl ls.

However, it looks like this PR now has conflicts with master, likely because #580 (merged June 22) introduced a TUI-based interface for tpl ls / tpl watch / tpl status, which significantly changed CubeMaster/cmd/cubemastercli/commands/cubebox/template.go — the same file your CLI changes touch.

Could you please rebase this branch onto the latest master and resolve the conflicts? In particular, the tpl ls output is now rendered through the TUI rather than the old tabwriter table, so the JOB_ID column integration there may need to be rethought to fit the new TUI layout. (The API, SDK, and Web UI parts of this PR should be unaffected and are still very welcome!)

Happy to take another look once it's rebased. Thanks for the contribution! 🙏

Thanks for the review! I've rebased onto the latest master and resolved the conflicts in template.go, httpservice/cube/template.go, and store.go.

For tpl ls, I kept the JOB_ID column in the existing tabwriter output — on current master, the TUI changes from #580 apply to watch/status, while ls still uses the table layout, so this should fit without extra rework. API, SDK, and Web UI parts are unchanged.

Ready for another look whenever you have time.

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.

2 participants