feat: add plan metadata flags for title and description with validation - #20705
feat: add plan metadata flags for title and description with validation#20705manhvu1997 wants to merge 1 commit into
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: vuchumanh.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5e71907b5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if len(w.PlanTitle) > 200 { | ||
| return errors.Errorf("--plan-title must be at most 200 characters") | ||
| } | ||
| if len(w.PlanDescription) > 10000 { |
There was a problem hiding this comment.
Count Unicode characters when enforcing metadata limits
When users pass non-ASCII plan titles or descriptions, len counts UTF-8 bytes rather than characters, so the CLI rejects values that fit the documented/proto character limits. The repo's validation standard calls these tiers chars (proto/v1/v1/VALIDATION_STANDARDS.md:43 and :68), and Plan.title/Plan.description use max_len 200/10000 (proto/v1/v1/plan_service.proto:208-211); for example, a 100-character CJK title is rejected here before it can create a plan. Use a rune count for these CLI checks.
Useful? React with 👍 / 👎.
f5e7190 to
8fdae14
Compare
|
We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please sign CLA and add your name to contributors list. |
|
|
Hi @manhvu1997 . Thanks for the PR. Before we review the implementation in detail, could you share the use case that motivated this? From the diff, the main functional change seems to be allowing It would help to understand the workflow you’re trying to support. For example, are you trying to map Bytebase plans back to GitHub PRs, CI build metadata, change tickets, release notes, or some internal approval process? A concrete example of the GitHub Actions usage and what you expect to see in Bytebase would help us decide whether these should be first-class action flags, whether the flag names/defaults are right, and whether we need to support things like multiline descriptions or templated values. |
|
Thank @RainbowDashy for the feedback. The motivation is to make plans created by bytebase-action more self-descriptive. Today, when a rollout is created via the action, the generated plan uses the release ID as its title (e.g. release_20260628-RC01) and doesn't have a description. As a result, when looking at the Plans page, it's difficult to understand the purpose of a plan without opening it or tracing it back to the CI pipeline. For example, this is what I see: In practice, I'd like to populate these fields with meaningful information from our CI/CD pipeline, for example: Title Add customer_status column to users Description This makes it much easier for operators and DBAs to identify what a rollout (created by bytebase-action) is doing directly from the Bytebase UI, without having to inspect the SQL or correlate the release ID with external systems. I intentionally made both flags optional: --plan-title defaults to the current behavior (the release ID), so there is no breaking change. My primary use case is improving the readability and traceability of plans created by bytebase-action, although the same metadata can also be used to reference PRs, CI builds, release information, or internal change tickets if desired. |
|
Thanks, that context helps. The use case makes sense: even in GitOps, Bytebase is still the control plane for operators/DBAs to monitor, approve, troubleshoot, and audit rollouts, so the generated I think the product requirement here is traceability from a Bytebase plan/rollout back to the GitOps source: PR/MR, commit, CI run, release ID, and optionally an internal change ticket. One thing I want to think through before accepting this exact API is whether free-form For this PR, could you share the exact GitHub Actions snippet you plan to use, including how you would populate the title and description? That will help us evaluate whether these flags are sufficient, whether multiline values work well in practice, and whether we should instead expose more structured GitOps metadata. |
|
Currently I'm using GitLab CI instead of GitHub Actions so I can share the equivalent GitLab workflow snippet. Example GitLab CI usage: Where "$OUT.desc" is generated from the SQL comment plus GitLab CI context for example:
I agree that structured GitOps metadata may be a long-term solution across GitHub, GitLab, Bitbucket and Azure. |



What
This change adds support for plan customization metadata in the rollout action flow, including plan title, plan description, release ID template, release ID timezone, and target stage handling.
Changes
Testing
go test ./action/...