Daily collection¶
A GitHub Actions workflow collects jobs once a day, ranks them for each
tester of the demo, and sends each one a
daily email. It checks that every job source still works,
and it remembers which jobs each tester got so no pick
repeats. It doesn't keep the jobs it collects
(ADR 0004). It keeps
only keyed hashes of picked job IDs, in D1
(ADR 0012). The maintainer is a tester
too, with the maintainer role
(ADR 0013).
The workflow is defined in .github/workflows/collect.yml, and the per-tester
steps in daily/daily_run.py. Its steps:
- Guard (
daily/once_a_day.py, a job of its own): if any run today (UTC) already started Collect jobs, even one that failed later, stop before any job source is read. The collect job checks again in its first step, for re-runs (Daily trigger). - Install PyYAML from
requirements.txt. - Read testers (
daily_run.py prepare): delete unconfirmed sign-ups older than 7 days and sent-job hashes older than 60 days, read the active testers from D1, and check each profile with the ranking rules. It writes three files to the runner's temporary folder:testers.json: each tester's ID, email address, role, and profilecountries.txt: the Himalayas country queries. At least one country of every tester, picked so the fewest queries cover everyone, then their other countries, most shared first, up to 10hide_ai_training.txt:trueonly if every tester'sai_trainingishide
- Collect jobs once, with
--include-restricted, so jobs limited to some countries reach the ranker, one--himalayas-countryper line ofcountries.txt(ADR 0008), and--himalayas-hide-ai-trainingif the file saystrue(ADR 0009). - Rank and email each tester (
daily_run.py send). For each tester: read their sent-job hashes, rank the jobs against their profile, send the email with their unsubscribe link, and only if it was sent, save keyed hashes of the picks. A failed email doesn't stop the others. The step fails at the end if any email failed. - Write the summary and fail the run if a source failed.
When it runs¶
Every day at 10:37 UTC. A Cloudflare Cron Trigger starts the run through GitHub's API (Daily trigger, ADR 0015), because GitHub's own schedule started runs up to 8 hours late. GitHub's schedule, at 15:37 UTC, is a fallback for a day the Cron Trigger fails. On other days, the guard stops it.
The times follow the source rules:
- Himalayas and Remote OK may be read at most once a day. The guard makes sure of it, whatever starts the run.
- Jobicy must not be read at minute 00.
If no run started, see The daily run didn't start.
Check a run¶
- On GitHub, open the repository and click Actions.
- In the list of workflows, click Daily collection.
- Click a run. A run that the guard stopped says so in its summary, and
its collect job is skipped. Otherwise, the summary shows:
- how many postings each source returned. Himalayas has a row for the
worldwide query and one for each country query, numbered:
Himalayas (country query 1). The country isn't named, because it comes from testers' profiles. - how many jobs were kept after filtering, and how many of them are
labelled
worldwide,restricted, andunclear, and how many are tagged as AI-training gigs - how many testers there were, how many emails were sent, skipped because an earlier run already emailed that tester the same day, and failed, how many picks were sent in all, and how many emails were sent but their picks couldn't be saved
- why jobs weren't picked: how many jobs each rule removed, such as
location not open to youorsenior title, added up over all testers
- how many postings each source returned. Himalayas has a row for the
worldwide query and one for each country query, numbered:
The Collect jobs step's log also shows how each source's postings were
labelled, for example
[himalayas] fetched 120 postings (worldwide 40, restricted 50, unclear 30).
The summary shows counts only. Logs and summaries of a public repository are public, so they never contain job details, keys, email addresses, profiles, or testers' countries.
When a run fails¶
A run fails when the guard can't read GitHub's API, when a source fails or
returns no postings (a Himalayas country query only when it fails, because
a day without such jobs is normal), when D1 can't be read, or when any tester's email can't be sent. A tester whose
stored profile breaks the ranking rules gets no email; the Read testers
step counts them as Profiles skipped. GitHub then emails the
person who last changed the schedule in collect.yml.
If an email isn't sent, that tester's picks aren't remembered, so the next run can pick them again. If an email is sent but saving its picks fails, the summary counts it as Sent but not remembered, and those jobs may come again.
To find the cause:
- For a source problem, follow A job source returns no jobs.
- For an email problem, see When sending fails.
Run it by hand¶
- Click Actions, and then click Daily collection.
- Click Run workflow.
- Under mode, choose one:
daily: the full run. Collects, ranks, emails every tester, and remembers the picks.test email: sends a test email built from fictional sample jobs, to the maintainer only. It reads no job source and doesn't change the memory. See Send a test email.
- Click the green Run workflow button.
A daily run reads Himalayas, emails every tester, and adds the picks to
the memory. If any run today already reached Collect jobs, even one
that failed, the guard stops it before it reads any source, so a click
can't read the sources twice. After such a failure, fix the cause and wait
for the next day's run. Running the collector on your computer reads
Himalayas too. While you work on the code, run the tests
or a test email run instead: neither reads a job source.
If the schedule stops¶
GitHub turns off scheduled workflows in a public repository after 60 days with no activity in the repository. A workflow that's turned off can't be started by the Cron Trigger either. To turn it back on, open Actions, click Daily collection, and click Enable workflow.