Page MenuHomePhabricator

[components-api] handle non-passed arguments and defaults consistently
Closed, ResolvedPublic

Description

Similar to T402569: [jobs-api] handle non-passed arguments and defaults consistently, handle all the fields for tool config like this:

  • Make them non-nullabale
  • Add dummy defaults for them, they don't matter, will never be persisted or passed along
  • When storing the config, strip fields that were unset model_dump(exclude_unset=True) (see https://docs.pydantic.dev/1.10/usage/exporting_models/ for difference with exclude_defaults)
  • When returning the config, strip unset

This helps keep all the config fields non-nullable, and still use the builds-api/jobs-api defaults when the fields are not passed by the user.

Event Timeline

dcaro triaged this task as Medium priority.Aug 25 2025, 11:44 AM
dcaro updated the task description. (Show Details)
dcaro updated the task description. (Show Details)
dcaro changed the task status from Open to In Progress.Aug 27 2025, 9:44 AM
dcaro assigned this task to Raymond_Ndibe.
dcaro moved this task from Next Up to In Progress on the Toolforge (Toolforge iteration 23) board.
dcaro moved this task from Next Up to In Progress on the Toolforge (Toolforge iteration 24) board.

group_203_bot_f4d95069bb2675e4ce1fff090c1c1620 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/999

components-api: bump to 0.0.168-20251014130725-6239a491

dcaro moved this task from In Review to Done on the Toolforge (Toolforge iteration 24) board.

group_203_bot_f4d95069bb2675e4ce1fff090c1c1620 opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/1063

components-api: bump to 0.0.178-20251110181950-c253f049