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

Decision task #14

Open
La0 opened this issue Apr 18, 2019 · 1 comment
Open

Decision task #14

La0 opened this issue Apr 18, 2019 · 1 comment
Labels
discussion Discuss ideas & features for TaskBoot

Comments

@La0
Copy link
Contributor

La0 commented Apr 18, 2019

We could use a common decision task protocol to add new tasks to the current Taskcluster group, after analyzing the target.
As we already have the logic to retrieve target's code and Taskcluster client's setup, we need 2 more things:

  1. Support some rules to decide if a task is added or not
  2. Create a new task for each approved one

The .taskcluster.yml file is built with json-e. We could leverage that, and add our own json-e functions while rendering the .taskcluster.yml file from any repository.

A common pattern is to trigger a task only if some file changed in the diff from current revision up to master.
To accomplish that, we could:

  • add a json-e function $files_changed(["pattern/*.cpp", "anything.txt"])
  • set the tasks_for variable to taskboot-decision
  • render the target .taskcluster.yml with these parameters
  • if any tasks payload is present in the rendered file, create those tasks.

On the target, the changes are:

  • add a taskboot decision task (using published image and command taskboot decision)
  • add the relevant tasks with the syntax:
tasks:
  - $if "tasks_for == 'taskboot-decision' and $files_changed(['**.py'])"
    then
     ...
@La0 La0 added the discussion Discuss ideas & features for TaskBoot label Apr 18, 2019
@marco-c
Copy link
Collaborator

marco-c commented Apr 19, 2019

We could wait for https://hg.mozilla.org/ci/taskgraph/ to be ready, so we don't have to implement something custom but re-use something developers are already used to.

If it takes too long, this seems like a good idea to me. I wonder if Taskcluster will complain about the absence of $files_changed function though (since it's going to be implemented in taskboot, Taskcluster won't know about it, no?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discuss ideas & features for TaskBoot
Projects
None yet
Development

No branches or pull requests

2 participants