Read big boards within the agents' reach: countries and remote from the enabled agents, Europe for favourites, filtered at the source by six hosts
app/jobs/reach.py derives each board's reach once per pull and the pull hands it to the runner through the batch payload. SmartRecruiters, Eightfold and SuccessFactors filter one country a request, Phenom a list, Workday and Oracle by host ids from facets. Remote beside countries is a series of its own, since two facets intersect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3adafd8950
commit
3462a4abe7
17 files changed
+1324
-116
No files matched your search
@@ -8,6 +8,18 @@ number is `CX_1001` or `CX_1` on the tenants read so far, and the site's own
|
||||
name (`SinchCareer`) is taken in its place. Written from live boards on
|
||||
2026-09-29 (Milestone Systems, Nokia, Danske Bank, Sinch); jobhunt-hq did not
|
||||
read Oracle.
|
||||
|
||||
Countries are filtered on the server by `selectedLocationsFacet`, the pod's
|
||||
geography ids (`Filters(country="ids")`), which `facets` reads off
|
||||
`locationsFacet`; several ids go in one request, joined with `;`, the way the
|
||||
site's own search sends a multiple choice. That list holds only the pod's ten
|
||||
biggest countries (fa-evmr's, 2026-09-30), so when it is full a country
|
||||
missing from it may still have roles: `facets` then maps every other country
|
||||
to `*`, and a series asking for one is read without a country filter. An id
|
||||
the pod does not know answers the whole board (review). Remote is
|
||||
`selectedWorkplaceTypesFacet=ORA_REMOTE` (`remote="one"`); two facets are an
|
||||
intersection (Finland and remote answered 0 on 2026-09-30), which is why the
|
||||
runner asks for remote in a series of its own.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -21,7 +33,8 @@ from urllib.parse import quote
|
||||
|
||||
from desk.sources import strip_html
|
||||
|
||||
from ._contract import Ask, Fields, Place, Reads
|
||||
from ._contract import Ask, Fields, Filters, Place, Reads
|
||||
from ._countries import NAMES, code_of
|
||||
from ._shared import Get, Page, Row, only, parse_dt
|
||||
|
||||
NAME = "oracle"
|
||||
@@ -41,7 +54,7 @@ PATTERNS = (
|
||||
|
||||
READS = Reads(
|
||||
scope="board", listing="paged", page_size=200, text="detail", teaser=True,
|
||||
complete="stated", places="many",
|
||||
complete="stated", places="many", filters=Filters(country="ids", remote="one"),
|
||||
fields=Fields(posted="trusted", remote="stated", country="stated"),
|
||||
robots=("read: robots.txt allows /hcmUI/CandidateExperience/en/sites/<site>/jobs "
|
||||
"(checked 2026-09-29)"),
|
||||
@@ -103,7 +116,7 @@ def page(get: Get, slug: str, cursor: Any, ask: Ask = Ask()) -> Page:
|
||||
data = json.loads(get(
|
||||
f"{_api(slug)}/recruitingCEJobRequisitions?onlyData=true"
|
||||
f"&expand=requisitionList.secondaryLocations"
|
||||
f"&finder=findReqs;siteNumber={site},limit={PAGE_SIZE},offset={offset}"))
|
||||
f"&finder=findReqs;siteNumber={site},{_selected(ask)}limit={PAGE_SIZE},offset={offset}"))
|
||||
search = (data.get("items") or [{}])[0]
|
||||
roles = search.get("requisitionList") or []
|
||||
# `_paged` counts `id`, which Oracle spells `Id`.
|
||||
@@ -111,6 +124,42 @@ def page(get: Get, slug: str, cursor: Any, ask: Ask = Ask()) -> Page:
|
||||
return search, results, search.get("TotalJobsCount"), offset + len(roles) if roles else None
|
||||
|
||||
|
||||
#: How many countries `locationsFacet` lists at most; a list this long may
|
||||
#: leave some out.
|
||||
FACET_LIMIT = 10
|
||||
|
||||
|
||||
def _selected(ask: Ask) -> str:
|
||||
"""The finder's facet parameters for `ask`, each ending in a comma: the
|
||||
location ids (none when one is `*`, a country the pod did not list) and
|
||||
remote."""
|
||||
out = ""
|
||||
ids = [i for i in ask.countries if re.fullmatch(r"\d+", i)]
|
||||
if ids and "*" not in ask.countries:
|
||||
out += f"selectedLocationsFacet={'%3B'.join(ids)},"
|
||||
if ask.remote:
|
||||
out += "selectedWorkplaceTypesFacet=ORA_REMOTE,"
|
||||
return out
|
||||
|
||||
|
||||
def facets(get: Get, slug: str) -> dict[str, dict[str, str]]:
|
||||
"""The pod's geography id of each country `locationsFacet` names, read
|
||||
with the facets and no roles. When the list is `FACET_LIMIT` long, every
|
||||
country it leaves out maps to `*`: its roles may be there, and a read
|
||||
for it goes unfiltered."""
|
||||
site = _parts(slug)[1]
|
||||
data = json.loads(get(
|
||||
f"{_api(slug)}/recruitingCEJobRequisitions?onlyData=true"
|
||||
f"&finder=findReqs;siteNumber={site},facetsList=LOCATIONS,limit=1,offset=0"))
|
||||
listed = (data.get("items") or [{}])[0].get("locationsFacet") or []
|
||||
country = {code: str(entry["Id"]) for entry in listed
|
||||
if isinstance(entry, dict) and entry.get("Id")
|
||||
and (code := code_of(str(entry.get("Name") or "")))}
|
||||
if len(listed) >= FACET_LIMIT:
|
||||
country = dict.fromkeys(NAMES, "*") | country
|
||||
return {"country": country}
|
||||
|
||||
|
||||
def parse(body: bytes, slug: str) -> list[Row]:
|
||||
return rows((json.loads(body).get("items") or [{}])[0], slug)
|
||||
|
||||
|
||||
Reference in new issue
Block a user