New issue
Advanced search Search tips

Issue 865021 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Allow to trigger a job on a cron schedule but still have revision set

Project Member Reported by serg...@chromium.org, Jul 18

Issue description

Currently, there are two ways to trigger a job in luci-scheduler:
 - via gitiles trigger which will only trigger jobs when there are new commits and will configure build to run on the revision of the new commmit (e.g. buildset tag, and probably revision property)
 - via 'schedule' parameter on a job, which will simply run a job based on that schedule and does not configure job as being run on a specific revision

What we'd like is the combination of these two options:

  trigger {
    id: "v8-trigger-on-schedule"
    gitiles {
      repo: "https://chromium.googlesource.com/v8/v8"
      refs: "refs/heads/master"
    }
    allow_trigger_when_no_new_commits: true
    schedule: "0,15,30,45 * * * *"

    triggers: "v8_canary_detector"
  }

which will trigger v8_canary_detector every 15 minutes regardless whether there are new commits or not and will configure the triggered builds with the latest revision.
 
Components: Infra>Platform>Scheduler
Labels: -Pri-2 Pri-3
Status: Available (was: Untriaged)
Sounds reasonable.
Description: Show this description
Description: Show this description
You can do this already:

job {
  id: "job-id"
  schedule: "*/30 * * * *"
  buildbucket: {
   ...
  }
}

trigger {
  id: "repo-poller"
  gitiles: {
    ...
  }
  triggers: "job-id"
}
IIUC this config will generate a job with buildset tag on every commit and another job without buildset tag every 30 minutes. What we need is to have a job every 30 minutes with buildset tag pointing to last commit regardlesa whether there were new commits since last job or not.
You can put this logic into the recipe?
A recipe is not able to change swarming tags of the task it is running in, can it?
No, it can't.
P.S. We need buildset tag to have build correctly displayed on Milo console.
Milo console can be changed to display builds without buildset tag. See also https://crbug.com/851474#c2
Yes, I think that will work too, but it's not supported yet, is it? In fact this bug report is based on tAndrii's suggestion on that same bug: https://bugs.chromium.org/p/chromium/issues/detail?id=851474#c3. Whichever is implemented first will be sufficient for us.
re: https://crbug.com/851474#c3
I think I no longer like that proposal (and this bug) quite as much, because it adds complexity to scheduler.

But it still possible to do what you wanted with simple recipe which runs every 15 minutes and then does something like this:

revision = api.gitiles.resolve_head(repo, ref)
api.scheduler.emit_trigger(...revision...)

Sign in to add a comment