Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dmctl(dm): add config task-template #3991

Merged
merged 20 commits into from
Jan 18, 2022
Merged

dmctl(dm): add config task-template #3991

merged 20 commits into from
Jan 18, 2022

Conversation

Ehco1996
Copy link
Contributor

@Ehco1996 Ehco1996 commented Dec 20, 2021

What problem does this PR solve?

Issue Number: ref #3583

What is changed and how it works?

  • add new cmd dmctl config task-template
➜ dmctl config task-template  -h
show task template which is created by WebUI with task config format

Usage:
  dmctl config task-template [task-name] [flags]

Flags:
  -h, --help   help for task-template
  • fix templates openapi path from api/v1/task/templates to api/v1/tasks/templates

we don't exporse this cmd to public user , beascause it's just a workaround for user who user WebUI and want to get task config template that created by openapi but want to dump with v1 format

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

  • Possible performance regression

Related changes

  • Need to update the documentation

Release note

`None`.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 20, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lance6716
  • okJiang

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 20, 2021
@Ehco1996 Ehco1996 added the area/dm Issues or PRs related to DM. label Dec 21, 2021
@Ehco1996 Ehco1996 changed the title dmctl(dm): support OpenAPI task config in get-config command dmctl(dm): get-config command support --template flag Dec 21, 2021
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Dec 21, 2021
@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 21, 2021
@Ehco1996
Copy link
Contributor Author

will add dmctl it test after #3656 merged

dm/dm/ctl/master/config.go Outdated Show resolved Hide resolved
@Ehco1996 Ehco1996 marked this pull request as ready for review December 21, 2021 07:04
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 21, 2021
@lance6716
Copy link
Contributor

it's get-config task, nothing to do with template

@Ehco1996
Copy link
Contributor Author

it's get-config task, nothing to do with template

but we already have get-confing task cmd, so we need another alias for this cmd , do you have some suggestions?

@lance6716
Copy link
Contributor

it's get-config task, nothing to do with template

but we already have get-confing task cmd, so we need another alias for this cmd , do you have some suggestions?

the old get-config task can be replaced by this logic 🤔

@Ehco1996
Copy link
Contributor Author

the old get-config task can be replaced by this logic 🤔

you mean when user useget-config task we try get config from subtask in scheduler first, if there is no task we fallback to openapi.Task in etcd ?

I'm worried if there are two tasks with the same name: test, one in the scheduler and the other in etcd 😂

@lance6716
Copy link
Contributor

subtask is generated by task. Currently get-config task will merge subtasks to task but some information is lost. If we can save original task I think it's always better. @GMHDBJD PTAL

@GMHDBJD
Copy link
Contributor

GMHDBJD commented Dec 23, 2021

Prefer template <task|master|worker> <name>

@Ehco1996
Copy link
Contributor Author

/hold wait change api path to templates

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 23, 2021
@Ehco1996
Copy link
Contributor Author

Ehco1996 commented Jan 5, 2022

/run-dm-integration-tests

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2022

Codecov Report

Merging #3991 (69c8a71) into master (ab62e6b) will decrease coverage by 0.2517%.
The diff coverage is 44.7849%.

Flag Coverage Δ
cdc 59.1007% <55.5926%> (-0.5152%) ⬇️
dm 52.1050% <40.2387%> (+0.0395%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@               Coverage Diff                @@
##             master      #3991        +/-   ##
================================================
- Coverage   55.5183%   55.2665%   -0.2518%     
================================================
  Files           495        497         +2     
  Lines         61151      61321       +170     
================================================
- Hits          33950      33890        -60     
- Misses        23789      24021       +232     
+ Partials       3412       3410         -2     

@ti-chi-bot ti-chi-bot removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 5, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 10, 2022
@Ehco1996
Copy link
Contributor Author

could you please take another look for this pr ? thanks 🧡🧡🧡

/cc @GMHDBJD @okJiang @WizardXiao

Copy link
Member

@okJiang okJiang left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 380 to 384
# delete source success and clean data for other test
openapi_source_check "delete_source_with_force_success" "mysql-01"
openapi_source_check "delete_source_with_force_success" "mysql-02"
openapi_source_check "list_source_success" 0
openapi_task_check "get_task_list" 0
Copy link
Member

Choose a reason for hiding this comment

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

how about wrap these to one function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added in d5e9530 and 0f3dd42

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jan 17, 2022
@Ehco1996
Copy link
Contributor Author

/run-dm-integration-tests

@Ehco1996
Copy link
Contributor Author

/run-dm-integration-tests

@okJiang
Copy link
Member

okJiang commented Jan 17, 2022

/run-all-tests

@Ehco1996
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 3553334

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 17, 2022
@Ehco1996
Copy link
Contributor Author

/run-leak-test

@ti-chi-bot ti-chi-bot merged commit 4bfa080 into pingcap:master Jan 18, 2022
buchuitoudegou pushed a commit to buchuitoudegou/tiflow that referenced this pull request Jan 18, 2022
buchuitoudegou pushed a commit to buchuitoudegou/tiflow that referenced this pull request Jan 18, 2022
buchuitoudegou pushed a commit to buchuitoudegou/tiflow that referenced this pull request Jan 19, 2022
zhaoxinyu pushed a commit to zhaoxinyu/ticdc that referenced this pull request Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dm Issues or PRs related to DM. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. status/ptal Could you please take a look?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants