-
Notifications
You must be signed in to change notification settings - Fork 36
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
Watch taskrun and open debug if taskrun is running with debug mode #636
Conversation
Codecov Report
@@ Coverage Diff @@
## master #636 +/- ##
==========================================
+ Coverage 68.33% 68.36% +0.03%
==========================================
Files 111 114 +3
Lines 6483 6534 +51
Branches 1138 1149 +11
==========================================
+ Hits 4430 4467 +37
- Misses 2053 2067 +14
Continue to review full report at Codecov.
|
@@ -65,7 +71,8 @@ async function startTaskRunWithDebugger(taskRun: TektonNode, commandId?: string) | |||
generateName: `${taskRun.getName()}-` | |||
} | |||
} | |||
const taskRunContent = await TaskRun.getTaskRunData(taskRun.getName()); | |||
const taskRunContent = await getTaskRunData(taskRun.getName()); | |||
if (!taskRunContent) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better if you indicate that this function can return null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the return type for taskRunContent
src/tekton/pipelinerun.ts
Outdated
@@ -19,6 +19,7 @@ export class PipelineRun extends TektonItem { | |||
static async restart(pipelineRun: TektonNode, commandId?: string): Promise<void> { | |||
if (!pipelineRun) return null; | |||
const trigger = await pipelineRunData(pipelineRun); | |||
if (!trigger) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function already return void
, so returning null
is ambiguous
src/util/task-run-data.ts
Outdated
import { tkn } from '../tkn'; | ||
|
||
|
||
export async function getTaskRunData(taskRunName: string): Promise<TknTaskRun>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this not an utility function, this file should be in another folder
src/util/watchResources.ts
Outdated
@@ -89,6 +94,15 @@ export class WatchResources { | |||
treeRefresh.set('treeRefresh', false); | |||
pipelineExplorer.refresh(); | |||
} | |||
} else if (run.kind === 'TaskRun' && run.spec?.['debug'] && semver.satisfies('0.26.0', `<=${getNewELSupport.pipeline}`) && run.status?.conditions[0]?.status === 'Unknown') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'0.26.0'
should be constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, except first review comment
Fix #637