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

[feature] Allow task platform configuration to be used when a task is extended #1693

Closed
sharpepd opened this issue Oct 17, 2024 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@sharpepd
Copy link

Is your feature request related to a problem? Please describe.

I am trying to define a task that is used as the base for other tasks. It is important that all the tasks that extend from it have the same "platform" configuration, as it is not the same as the project "language".

But I have found when I tried this that the platform parameter is not being used when extending and I have to specify it on each task separately.

e.g.

tasks:
  base_task: "echo"
    args:
      - "Hello"
    platform: system

  ext_task:
    extends: bask_task
    args:
      - "World"

Describe the solution you'd like

The extended task to have the platform paremeter of the base task, unless overriden.

Describe alternatives you've considered

It may be acceptable to define the platform in the tasks.yml similar to taskOptions, so it applies to all tasks in that configuration file.

Additional context

None

@sharpepd sharpepd added the enhancement New feature or request label Oct 17, 2024
@milesj
Copy link
Collaborator

milesj commented Oct 17, 2024

Yeah this seems like a bug/oversight. Let me dig into it.

@milesj
Copy link
Collaborator

milesj commented Oct 18, 2024

So we do have some logic to inherit the platform: https://github.com/moonrepo/moon/blob/master/crates/task-builder/src/tasks_builder.rs#L388

Something else may be going on, digging further.

Edit: I can't seem to reproduce this. Given this config:

tasks:
  base_task:
    command: 'echo'
    args:
      - 'Hello'
    platform: rust

  ext_task:
    extends: base_task
    args:
      - 'World'

The platform is correct in moon task:

 WEBSITE:EXT_TASK

Task: ext_task
Project: website
Platform: rust
Type: test

What version of moon are you using @sharpepd ? Or is there a more complex config setup required?

@milesj
Copy link
Collaborator

milesj commented Nov 2, 2024

@sharpepd Any update here?

@sharpepd
Copy link
Author

sharpepd commented Nov 4, 2024

@milesj Sorry, I lost track that I had not responded. I am using 1.29.1+patch.2. So not an official version. This is using some experimental patches from @harlequin related to pull request #1694 and I was trying with platform set to "python". So, it is possible there is an issue with that specific case, rather than a general issue.

@milesj
Copy link
Collaborator

milesj commented Nov 4, 2024

Ah yeah that makes sense. I noticed the python platform stuff land recently, so it was probably that. Will close this for now.

@milesj milesj closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants