dm: fix operate-source create description to match its actual behavior - #23837
dm: fix operate-source create description to match its actual behavior#23837yahonda wants to merge 1 commit into
Conversation
The command registers an existing data source (source.yaml) into the DM cluster; it does not create the configuration file. The surrounding "Flags description" section already documents create as creating upstream database sources, and config-file as pointing to a pre-existing source.yaml path.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Warning Review limit reachedNext included review available in 4 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
What is changed, added or deleted? (Required)
The usage example said "Use the following `operate-source` command to create a source configuration file", which describes the command backwards. The same document's own "Flags description" section (directly above) already states that `create` "Creates one or more upstream database sources" and that `config-file` "Specifies the file path of `source.yaml`" (an existing, pre-created input file) — i.e. the command registers an existing source file's contents into the DM cluster; it does not create the file.
Playground verification: deployed a live DM cluster (dm-master + dm-worker + dmctl v8.5.3) in a local Docker container and ran `operate-source create ./source.yaml`. No new file was written to disk, and `operate-source show` continued to report the source as registered even after `source.yaml` was deleted — confirming the command registers the source into cluster state rather than creating a file.
Source-code verification: `dm/ctl/master/operate_source.go` (`operateSourceFunc`) calls `common.GetFileContent(arg)` to read the existing `source.yaml`'s bytes, parses it with `config.SourceCfgFromYaml`, and sends the content over gRPC as `OperateSourceRequest{Config: contents, ...}`. The CLI never writes a file — it only reads one and transmits its content to dm-master.
Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?