-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix converting of task with custom type #5591
Conversation
@@ -651,7 +651,8 @@ export function toTask(taskDto: TaskDto): theia.Task { | |||
result.execution = getProcessExecution(taskDto as ProcessTaskDto); |
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.
just wondering: do we need to use types.ProcessExecution.is(execution)
in the if-statement in line 650, since you added a "customType" ?
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.
thank you, I'll review it today
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.
@elaihau I updated the PR, please review.
about your question - we use types.ProcessExecution.is(execution)
when we do converting from theia.Task
to TaskDto
, but we don't need the same when we converting from TaskDto
to theia.Task
. For this case we use check by type only.
It's because at converting theia.Task
of 'process' type 'process' filed is converted to 'command' filed of TaskDto
. ProcessTaskRunner recognizes task by type and expects command field at the moment.
241d924
to
e9d530d
Compare
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
e9d530d
to
3fb6500
Compare
@akosyakov @benoitf @evidolob |
@RomanNikitenko how do you test it? If @azatsarynnyy @elaihau already somehow verified changes i am fine with merging. No need to wait for others approves. One approve with a good explanation covering all concerns from https://github.com/theia-ide/theia/pull/5616/files is enough. |
I added 'How to test' section for my PR. |
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.
thx, verified according to tests
@@ -651,7 +651,8 @@ export function toTask(taskDto: TaskDto): theia.Task { | |||
result.execution = getProcessExecution(taskDto as ProcessTaskDto); | |||
} | |||
|
|||
if (taskType === 'shell') { | |||
const execution = { command, args, options }; | |||
if (taskType === 'shell' || types.ShellExecution.is(execution)) { |
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 wonder whether we need similar check for taskType === 'process'
above?
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 think - no, the reasons I wrote here. But let me know if I should to reconsider that.
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.
ok, please merge
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.
OK, thanks for testing changes and review!
What it does
The PR allows to fix converting of a task configuration with custom type which has 'execution' field.
How to test
Tests was provided within the PR.
toTask method is used by TaskProviderAdapter, so I provided
the simple sample to have ability to test my changes.
So you can:
The sample provides logs in 'Test Channel' of 'Output' tab.
So you can see a task configuration which is provided within
=== PLUGIN === provide task:
It contains
execution
section.After task running you can see configuration for resolving within
=== PLUGIN === resolve task:
It does not contain
execution
section for master branch but contains this section for branch with my changes.Signed-off-by: Roman Nikitenko rnikiten@redhat.com