Skip to content

Added composite command support and test coverage#639

Open
msivasubramaniaan wants to merge 40 commits intoche-incubator:mainfrom
msivasubramaniaan:feat-add-composite-command-support
Open

Added composite command support and test coverage#639
msivasubramaniaan wants to merge 40 commits intoche-incubator:mainfrom
msivasubramaniaan:feat-add-composite-command-support

Conversation

@msivasubramaniaan
Copy link
Collaborator

@msivasubramaniaan msivasubramaniaan commented Jan 28, 2026

What does this PR do?

This PR supports to run the composite commands in terminal

What issues does this PR fix?

eclipse-che/che#21859
eclipse-che/che#23726
eclipse-che/che#23709
eclipse-che/che#23725

How to test this PR?

Added workspace which has all commands of devfile. Run those commands from devfile.yaml.

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

@github-actions
Copy link

github-actions bot commented Jan 28, 2026

Click here to review and test in web IDE: Contribute

@github-actions
Copy link


// Single-component → join commands
const joiner = parallel ? " & " : " && ";
let compositeCmd = execs.map((e) => e.commandLine).join(joiner);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@RomanNikitenko , is string manipulation the only way to do this ? Using compound tasks on the vscode side still isn't possible ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I investigated that area more than 2 years ago, so I asked @msivasubramaniaan to double check that option when he started to work on the issue.
@msivasubramaniaan could you provide result of your investigation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I double-checked this again.

At the moment, yes — string manipulation is still the only practical way to achieve this.

VS Code does not support dynamically creating or chaining compound tasks programmatically from an extension. Compound tasks must be statically defined in tasks.json, and there’s no API to generate or invoke a compound task on the fly based on resolved components or runtime data.

Because of that limitation, joining commands using && / & (depending on parallel vs sequential execution) remains the only viable solution when the task needs to be assembled dynamically.

So the approach of building a composite command string is the only way

Copy link
Collaborator

@RomanNikitenko RomanNikitenko left a comment

Choose a reason for hiding this comment

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

@msivasubramaniaan
I tried to test the functionality using your samples
I run component-parallel-demo command:

Image

My understanding - it should run signal-frontend in the frontend container and signal-backend in the backend container.

Actual behaviour:

Moreover, the dependent commands just hanging without any output when I run them separately:

Image

Could you clarify:

  • what is expected behaviour there?
  • is it possible to detect which component is used for your test commands?
  • If commands are in the running state - why composite command reports that Composite multi-component execution completed?

thanks in advance!

@RomanNikitenko
Copy link
Collaborator

@msivasubramaniaan
I've prepared own sample and tested parallel and sequential uses cases for 2 components, I can confirm - it does not work, there is a bug - no output for both dependent commands and it's unclear if the commands are executed at all:

Screenshot 2026-02-02 at 23 17 53

@RomanNikitenko
Copy link
Collaborator

@msivasubramaniaan
I've detected one more bug : a command label should be displayed instead of id:

Screenshot 2026-02-02 at 23 29 09 Screenshot 2026-02-02 at 23 34 23

@msivasubramaniaan msivasubramaniaan marked this pull request as draft February 5, 2026 11:44
@RomanNikitenko
Copy link
Collaborator

RomanNikitenko commented Feb 5, 2026

@msivasubramaniaan
I see you've requested a new review, but image for testing is not ready.
Please let me know when you test all use cases we discussed and regressions are fixed.
Thanks!

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

@RomanNikitenko
Copy link
Collaborator

For one composite task there are at least 3 terminals
The first one shows mixed output for all dependent task.

Let's say dependent tasks build different modules:

  • do we really need all mixed output in the first terminal?
  • how it's going to be used? I guess it's hard to find any useful information because of tons mixed logs...
    wdyt?
mixed_output.mov

@RomanNikitenko
Copy link
Collaborator

RomanNikitenko commented Feb 24, 2026

Regarding dependent commands labels:

Screenshot 2026-02-24 at 12 43 41
  • a dependent task item does not look readable - devfile: parallel-ubi8-ubi9:ubi8-tools(web-nodejs-sample)
  • in the current implementation each command has its own terminal - do we really need that prefix for dependent tasks? (like: parallel-ubi8-ubi9- is id of a composite task - is it required for a dependent task item?)
  • I propose to use command label instead of id to get it more readable, like - devfile: ubi8 container echo seems clearer than devfile: parallel-ubi8-ubi9:ubi8-tools(web-nodejs-sample)

@RomanNikitenko
Copy link
Collaborator

RomanNikitenko commented Feb 24, 2026

I think there is inconsistent behavior related to the scanning task output prompt. This prompt is not displayed when I run a simple devfile task, but it is displayed when I run a composite task.

scanning-task-output.mov

@msivasubramaniaan
Copy link
Collaborator Author

For one composite task there are at least 3 terminals The first one shows mixed output for all dependent task.

Let's say dependent tasks build different modules:

  • do we really need all mixed output in the first terminal?
  • how it's going to be used? I guess it's hard to find any useful information because of tons mixed logs...
    wdyt?

mixed_output.mov

For a composite task running dependent tasks in parallel, there are indeed multiple terminals:

  • Each dependent task runs in its own terminal (isolated execution).

  • The first terminal shows aggregated output from all dependent tasks.

Why we keep the mixed output in the first terminal:

  • The composite task is treated as a single logical operation, so the main terminal provides a unified view of progress and results.
  • Users can monitor the overall execution without switching between multiple terminals.
  • It behaves similarly to many build tools (like Maven/Gradle/npm workspaces) where logs from multiple modules appear together.

How it can be used effectively:

  1. The aggregated output is tagged by component, for example:
[backend] build started
[frontend] build started
[backend] compiling...
[frontend] bundling...
[backend] done
[frontend] done

  1. This makes it possible to identify which component produced each log line.
  2. If detailed debugging is needed, users can still open the individual task terminals, which contain the full isolated logs.

Why this approach is useful:

  • Gives a quick overview of the composite execution.
  • Avoids constantly switching terminals.
  • Preserves full logs per component when needed.

So the first terminal is intended as a high-level monitoring view, while the individual terminals remain available for detailed investigation.

@RomanNikitenko
Copy link
Collaborator

RomanNikitenko commented Feb 25, 2026

How it can be used effectively:

  1. The aggregated output is tagged by component, for example:
[backend] build started
[frontend] build started
[backend] compiling...
[frontend] bundling...
[backend] done
[frontend] done
  1. This makes it possible to identify which component produced each log line.

Sorry - but in the current implementation there is no aggregated output is tagged by component
So - it's not true: This makes it possible to identify which component produced each log line.

@msivasubramaniaan
I understand that there is a technical issue and you are trying to workaround it
but
if you would have a choice - would you use the mixed output or separate?

my personal opinion - there are already separate terminals for each dependent task with the corresponding output - I would not use mixed output in the third terminal...

@github-actions
Copy link

1 similar comment
@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

1 similar comment
@github-actions
Copy link

@msivasubramaniaan msivasubramaniaan force-pushed the feat-add-composite-command-support branch from 22864fd to 73ad7de Compare February 25, 2026 19:45
@github-actions
Copy link

@msivasubramaniaan
Copy link
Collaborator Author

How it can be used effectively:

  1. The aggregated output is tagged by component, for example:
[backend] build started
[frontend] build started
[backend] compiling...
[frontend] bundling...
[backend] done
[frontend] done
  1. This makes it possible to identify which component produced each log line.

Sorry - but in the current implementation there is no aggregated output is tagged by component So - it's not true: This makes it possible to identify which component produced each log line.

@msivasubramaniaan I understand that there is a technical issue and you are trying to workaround it but if you would have a choice - would you use the mixed output or separate?

my personal opinion - there are already separate terminals for each dependent task with the corresponding output - I would not use mixed output in the third terminal...

@RomanNikitenko
Here is the reference of Parallel cross component used only equal no of terminals for the list of commands.
image

Also the inconsistency behavior issue also fixed and removed the unnecessary logs as well

@github-actions
Copy link


vscode.tasks.executeTask(childTask);
});
closeEmitter.fire(0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The most critical use case is support for Parallel Composite tasks.
In my view, the current implementation would be the best one:

  • it is aligned with the VS Code behavior for compound tasks
  • dependent tasks run in their own terminals
  • there is no mixed output in a single terminal (as in the previous implementation)
  • there are no extra terminals: number of terminals = number of dependent tasks (vs the previous approach, where it was number of dependent tasks + 1 parent terminal)

Unfortunately, the current approach has one significant drawback: if I understand correctly - actually a parent (extra) terminal is still created and then immediately closed. It looks like a bug on UI.

Screen.Recording.2026-02-27.at.11.29.26.mov

@RomanNikitenko
Copy link
Collaborator

RomanNikitenko commented Feb 27, 2026

@msivasubramaniaan
One more use case I detected is:

  • let's say there is a classical build and run sequential command
  • current behavior: the second command runs even when the first one fails
  • I expect: run command doesn't start - it does not make sense to run it when the previous one (build) fails
  • I checked that behavior for the vanilla VS Code compound task - VS Code doesn't start the second command if the first one fails

Please see on the video 2 behaviors:

  • the first one - for the che-code composite task
  • second one - for the vanilla VS Code compound task
build_and_run_bug.mov

@RomanNikitenko
Copy link
Collaborator

RomanNikitenko commented Feb 27, 2026

@msivasubramaniaan
Another problem for the sequential composite command support:

  • first command fails but second still runs
  • composite item is displayed as successful one
  • it's possible to detect that something went wrong only searching the corresponding logs
Screenshot 2026-02-27 at 14 06 55

Update: it does not matter first command fails or the second one - command item has incorrect status...
On the screenshot bellow the second command failed

Screenshot 2026-02-27 at 14 33 45

VS Code behavior, for example:

Screenshot 2026-02-27 at 14 10 07

@github-actions
Copy link

1 similar comment
@github-actions
Copy link

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.

3 participants