Closed Bug 1349667 Opened 3 years ago Closed 3 years ago

we conditionally run jsreftest and jittest, unfortunately all the time


(Taskcluster :: General, defect)

Not set


(Not tracked)



(Reporter: jmaher, Assigned: jmaher)



(1 file)

for cron tasks like code coverage, and things like mozilla-central/aurora/beta, we will only run jsreftests andjittest when we change js/src/*||js/public/* code.  I would think that we only want to exclude these on inbound/try/autoland.

What options do we have to do branch support or other conditional support for a when clause?
:dustin, you might have some ideas here :)
Flags: needinfo?(dustin)
I have a few thoughts that might help get you going in the right direction here.

First, it's possible on a per-branch basis to enable or disable optimization of tasks in the target task set. If these particular tasks are in the target task sets for cron tasks, and that parameter is enabled, that might do the trick.

Second, "files changed" really only applies to a push.  In the case of a cron task, there's no push involved -- there's a revision, but the pushlog-id parameter is -1 [1].  So there is no list of files that have changed, so consulting that at all doesn't make much sense.  It would be reasonable for that optimization to always return False, None when params['pushlog-id'] is -1.

Flags: needinfo?(dustin)
My attempt at interpreting this:
diff --git a/taskcluster/taskgraph/ b/taskcluster/taskgraph/
--- a/taskcluster/taskgraph/
+++ b/taskcluster/taskgraph/
@@ -223,14 +223,18 @@ def opt_seta(task, params):
         # Always optimize away low-value tasks
         return True, None
         return False, None

 def opt_files_changed(task, params, file_patterns):
+    # pushlog_id == -1 - this is the case when run from a cron.yml job
+    if params.get('pushlog_id') == -1:
+        return True, None
     changed = files_changed.check(params, file_patterns)
     if not changed:
         logger.debug('no files found matching a pattern in `when.files-changed` for ' +
         return True, None
     return False, None

:dustin, does that look right?
if we should look at doing this for other optimizations, let me know as well.
Assignee: nobody → jmaher
Attachment #8851054 - Flags: review?(dustin)
Attachment #8851054 - Flags: review?(dustin) → review+
Pushed by
do not used files-changed to conditionally exclude tasks when run from a cron job. r=dustin
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.