-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Infrastructure
-
None
-
Python Drivers
-
Not Needed
-
None
-
None
-
None
-
None
-
None
-
None
Detailed steps to reproduce the problem?
Pass a documented Evergreen task field to shrub.v3.evg_task.EvgTask that the model does not declare, for example allowed_requesters:
from shrub.v3.evg_task import EvgTask from shrub.v3.evg_project import EvgProject from shrub.v3.shrub_service import ShrubService t = EvgTask(name="my-task", commands=[], allowed_requesters=["commit"]) out = ShrubService.generate_yaml(EvgProject(tasks=[t])) print(out) print("allowed_requesters present:", "allowed_requesters" in out)
Output with shrub.py 3.11.0 and pydantic 2.14.3:
tasks:
- name: my-task
commands: []
allowed_requesters present: False
The constructor accepts the keyword, pydantic drops it because the model ignores extra fields, and no error surfaces. The field never reaches the generated YAML.
Impact
Configurations that set allowed_requesters on a task silently lose the restriction. In mongo-python-driver, the backport-pr task passes allowed_requesters=["commit"], and the generated .evergreen/generated_configs/tasks.yml contains no allowed_requesters entry, so the task can run for requesters it was meant to exclude. Found while wiring PYTHON-6178, where the same field was the planned way to keep a nightly task out of PR patch builds.
Definition of done: what must be done to consider the task complete?
- EvgTask accepts allowed_requesters and serializes it into generated YAML, matching the Evergreen task schema.
- Unknown constructor keywords fail loudly instead of being dropped, so other unmodeled Evergreen fields cannot disappear silently.
Environment
shrub.py 3.11.0 (latest), pydantic 2.14.3, Python 3.11. Observed in mongo-python-driver's config generator, which requires shrub.py>=3.10.0.
- is depended on by
-
PYTHON-6283 Adopt shrub.py allowed_requesters support in the Evergreen config generator
-
- Blocked
-