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

Fix converting of task with custom type #5591

Merged
merged 1 commit into from
Jul 4, 2019
Merged

Conversation

RomanNikitenko
Copy link
Contributor

@RomanNikitenko RomanNikitenko commented Jun 27, 2019

What it does

The PR allows to fix converting of a task configuration with custom type which has 'execution' field.

How to test

  1. Tests was provided within the PR.

  2. 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

@@ -651,7 +651,8 @@ export function toTask(taskDto: TaskDto): theia.Task {
result.execution = getProcessExecution(taskDto as ProcessTaskDto);
Copy link
Contributor

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" ?

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
@RomanNikitenko
Copy link
Contributor Author

@akosyakov @benoitf @evidolob
is it OK for you?
thanks in advance!

@akosyakov
Copy link
Member

@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.

@RomanNikitenko
Copy link
Contributor Author

@RomanNikitenko how do you test it?

I added 'How to test' section for my PR.

Copy link
Member

@akosyakov akosyakov left a 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)) {
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

ok, please merge

Copy link
Contributor Author

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!

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.

4 participants