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

Tekton: Delete commands should show confirmation info message and run without terminal #98

Merged
merged 2 commits into from
Dec 12, 2019

Conversation

sudhirverma
Copy link
Contributor

Fix: #92

@sudhirverma sudhirverma changed the title Tekton: Delete commands should show confirmation info message and run without terminal Tekton: Delete commands should show confirmation info message and run without terminal [WIP] Dec 5, 2019
@codecov-io
Copy link

codecov-io commented Dec 5, 2019

Codecov Report

Merging #98 into master will increase coverage by 1.2%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #98     +/-   ##
=========================================
+ Coverage   72.57%   73.77%   +1.2%     
=========================================
  Files          19       19             
  Lines         999     1045     +46     
  Branches      148      148             
=========================================
+ Hits          725      771     +46     
  Misses        274      274
Impacted Files Coverage Δ
src/tekton/pipelineresource.ts 100% <100%> (ø) ⬆️
src/tekton/pipelinerun.ts 100% <100%> (ø) ⬆️
src/tekton/taskrun.ts 100% <100%> (ø) ⬆️
src/tekton/pipeline.ts 34.88% <100%> (+3.17%) ⬆️
src/tekton/clustertask.ts 88.23% <100%> (+10.45%) ⬆️
src/tkn.ts 78.22% <100%> (ø) ⬆️
src/tekton/task.ts 88.23% <100%> (+10.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5cced1d...a7c42c9. Read the comment docs.

@sudhirverma sudhirverma changed the title Tekton: Delete commands should show confirmation info message and run without terminal [WIP] Tekton: Delete commands should show confirmation info message and run without terminal Dec 6, 2019
@@ -16,8 +18,15 @@ export class ClusterTask extends TektonItem {
if (clustertasks) { ClusterTask.tkn.executeInTerminal(Command.listClusterTasksinTerminal()); }
}

static async delete(clustertask: TektonNode): Promise<void> {
if (clustertask) { ClusterTask.tkn.executeInTerminal(Command.deleteClusterTask(clustertask.getName())); }
static async delete(clustertask: TektonNode): Promise<string> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to be good request except some issues with messages:

  1. Every message should start with capital letter.
  2. Should use appropriate articles a/an/the.
  3. Message should finish with './?/!'
  4. Custom resource names should be in camel case: ClusterTask, TaskRun, PiplelineResource, PipelineRun, Task, Pipeline

Below is an example:

        const value = await window.showWarningMessage(`Do you want to delete the ClusterTask '${clustertask.getName()}\'?`, 'Yes', 'Cancel');
        if (value === 'Yes') {
            return Progress.execFunctionWithProgress(`Deleting the ClusterTask '${clustertask.getName()}'.`, () => 
                ClusterTask.tkn.execute(Command.deleteClusterTask(clustertask.getName())))
                .then(() => `The ClusterTask '${clustertask.getName()}' successfully deleted.`)
                .catch((err) => Promise.reject(`Failure to delete the ClusterTask '${clustertask.getName()}': '${err}'.`));

@dgolovin
Copy link
Contributor

Please rebase on top of origin/master.

@dgolovin dgolovin merged commit a993fef into redhat-developer:master Dec 12, 2019
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.

Tekton: Delete commands should show confirmation info message and run with -f without terminal
3 participants