Use 'jobs-from' filename in the label for source-test tasks

RESOLVED FIXED in mozilla57

Status

task
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: ahal, Assigned: ahal)

Tracking

unspecified
mozilla57

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I'd like the filename of the jobs-from config (e.g, mozlint.yml, python-tests.yml, doc.yml, etc) to show up in the final task label (sans extension).

This will make it much easier to select all tasks within a file with |mach try fuzzy|. Currently if you want to run all "python-test" tasks, you need to remember what's defined in python-tests.yml and hunt them all down manually. With this change we could just run:
./mach try fuzzy -q "'python-test"

It might make sense for these filenames to be part of the label in other types of tasks too, but for now let's just limit it to source-test.
Comment on attachment 8903316 [details]
Bug 1395717 - Use filename source-test tasks are defined in as part of their label,

https://reviewboard.mozilla.org/r/175108/#review180544

If this could just be a key in the job dictionary, I'd prefer that..

::: taskcluster/taskgraph/loader/transform.py:44
(Diff revision 1)
>  
> +        for filename in config.get('jobs-from', []):
> +            for name, job in load_yaml(path, filename).iteritems():
> +                if defaults:
> +                    job = merge(defaults, job)
> +                job.setdefault('attributes', {})['from'] = filename

Why not just `job['job-from'] = filename` here?  Why does this need to be an attribute?
Sure that's fine. I was mostly just trying to avoid updating all the schemas :p (and attributes looked like they contained similar types of information)
Comment on attachment 8903316 [details]
Bug 1395717 - Use filename source-test tasks are defined in as part of their label,

https://reviewboard.mozilla.org/r/175108/#review181412

::: taskcluster/taskgraph/loader/transform.py:37
(Diff revision 2)
> -        jobs_from = itertools.chain.from_iterable(
> -            load_yaml(path, filename).iteritems()
> -            for filename in config.get('jobs-from', {}))
> -        for name, job in itertools.chain(jobs, jobs_from):
>              if defaults:
>                  job = merge(defaults, job)

Shouldn't this have `job-from` too?
Attachment #8903316 - Flags: review?(dustin) → review+
Comment on attachment 8903316 [details]
Bug 1395717 - Use filename source-test tasks are defined in as part of their label,

https://reviewboard.mozilla.org/r/175108/#review181412

> Shouldn't this have `job-from` too?

Yeah, I suppose so. Should it just be `kind.yml`? Is that guaranteed to be the name of the file?
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f366810cead4
Use filename source-test tasks are defined in as part of their label, r=dustin
https://hg.mozilla.org/mozilla-central/rev/f366810cead4
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Product: TaskCluster → Firefox Build System
You need to log in before you can comment on or make changes to this bug.