Page MenuHomePhabricator

[components-api] reuse_from components are not explicitly re-created in jobs-api
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Make a change which causes the image to be rebuilt

What happens?:

The component that 'owns' the build gets re-created in jobs (restarted)

What should have happened instead?:

All components referencing the build should get re-created in jobs (restarted)

Real Example:

tools.cluebotng-monitoring@tools-bastion-13:~$ toolforge components deployment show
Warning: You are using a beta feature of Toolforge.
Deployment ID: 20250829-162852-u3l0smc04s
Created: 20250829-162852
Status: successful
Long status: 
  Finished at 2025-08-29 16:31:31.204940

Builds:
  alertmanager(skipped): id:no-build-needed Component re-uses build from prometheus
  blackbox-exporter(skipped): id:no-build-needed Component re-uses build from prometheus
  checker(skipped): id:cluebotng-monitoring-buildpacks-pipelinerun-bqqsv Reusing existing build
  grafana(skipped): id:no-build-needed Component re-uses build from prometheus
  prometheus(successful): id:cluebotng-monitoring-buildpacks-pipelinerun-v2j52 You can see the logs with `toolforge build logs cluebotng-monitoring-buildpacks-pipelinerun-v2j52`
  wiki-update-receiver(skipped): id:no-build-needed Component re-uses build from prometheus

Runs:
  alertmanager(successful): [info] (Job alertmanager is already up to date)
  blackbox-exporter(successful): [info] (Job blackbox-exporter is already up to date)
  checker(successful): [info] (Job checker is already up to date)
  grafana(successful): [info] (Job grafana is already up to date)
  prometheus(successful): [info] (Job prometheus created)
  wiki-update-receiver(successful): [info] (Job wiki-update-receiver created)

Everything except checker uses that same build and should have been restarted

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
components-api: bump to 0.0.158-20250918112802-f7efa728repos/cloud/toolforge/toolforge-deploy!974group_203_bot_f4d95069bb2675e4ce1fff090c1c1620bump_components-apimain
Ensure reuse_from components are re-runrepos/cloud/toolforge/components-api!125damianfeature/ensure-reused-components-are-re-createdmain
Customize query in GitLab

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Need to do some testing with this but don't have time right now.

/cc @dcaro as the previous reviewer.

Added a test case - currently there is no test coverage of the delete + recreate logic (jobs is always [] due to the builds response being used in the mocker, so the jobs are always just created).

In the medium term it would be better to refactor the code especially for testing, for example the parts around how builds are linked to components and how components to job definitions/actions are done

fgiunchedi triaged this task as Medium priority.Sep 1 2025, 2:36 PM

Any chance of getting https://gitlab.wikimedia.org/repos/cloud/toolforge/components-api/-/merge_requests/125 reviewed soon? It's a relatively simple change and I've hit this issue 3 times today, alternatively I can roll-back to using jobs directly until T402568 unblocks doing this without reuse_from

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

components-api: bump to 0.0.158-20250918112802-f7efa728

dcaro assigned this task to DamianZaremba.
dcaro edited projects, added Toolforge (Toolforge iteration 24); removed Toolforge.
dcaro moved this task from Next Up to Done on the Toolforge (Toolforge iteration 24) board.

Up and running in prod :)