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

Switch the regular scheduler to support global scheduling, and have Peril handle the hooking #361

Closed
orta opened this issue Aug 27, 2018 · 2 comments

Comments

@orta
Copy link
Member

orta commented Aug 27, 2018

Once I started to test out what scheduling looks like across many repos, I realized that what this does is set up an agenda queue per installations' scheduler settings. This won't scale, there needs to be a set number of queues that people can hook into instead.

Before

screen shot 2018-08-27 at 7 32 05 am

Where every org/scheduled task runs, which isn't going to scale, and I can't really delete old recurring jobs easily, instead offer only a few options:

For all days:

  • "monday-morning"
  • "monday-morning-est"
  • "monday-evening"
  • "tuesday-evening-est"
    ...

with GMT as default, maybe I could do: est, gmt, pdt and then try handle ust-1 from -12 to +12 onwards?

Then:

  • "hourly"
  • "daily"
  • "weekly"
  • "monthly"

Example JSON config:

{
  "$schema": "https://raw.githubusercontent.com/danger/peril/master/peril-settings-json.schema",

  "settings": {
    "modules": ["danger-plugin-spellcheck", "danger-plugin-yarn", "@slack/client", "semver-sort"]
  },
  "rules": {
    "create (ref_type == tag)": ["org/new_tag.ts", "org/updateDangerSystems.ts"],
    "pull_request.closed": "org/aeryn.ts",
    "pull_request": ["org/debug.ts", "org/changelog.ts"],
    "issue_comment": "org/markAsMergeOnGreen.ts",
    "issues.opened": "org/checkTemplate.ts",
    "status.success": "org/mergeOnGreen.ts"
  },
  "tasks": {
    "trigger-scheduler": "testing/trigger-scheduler.ts",
    "logger": "testing/logger.ts"
  },
  "scheduler": {
     "monday-morning": "logger",
     "daily": "trigger-scheduler"
  }
}

I might be able was able to make a query in mongo that can look for installations with the key match - so that can handle a lot of the work

screen shot 2018-09-02 at 11 39 41 am

@orta orta changed the title Switch the regul scheduler to support global scheduling, and have Peril handle the hooking Switch the regular scheduler to support global scheduling, and have Peril handle the hooking Aug 27, 2018
@jlengstorf
Copy link

jlengstorf commented Aug 28, 2018

A few use cases for what we're planning to do with the scheduler in the Gatsby org:

  • Checks for stale issues (daily)
  • Auto-closing stale issues
  • Checking for PRs and issues that haven't been responded to within X days

All of these would be daily checks, I think.

@orta
Copy link
Member Author

orta commented Aug 28, 2018

Perfect yeah, makes sense 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants