Skip to content

Revert reusing processable in Seed::Build evaluation

Fabio Pitino requested to merge revert-reusing-processable-in-seed-build into master

What does this MR do and why?

Related to Backend: Decouple scoped variables from the job... (#350057)

This MR reverts the changed added in !105492 (merged) because while it brought a small performance improvement to the pipeline creation, it introduced a bug with the evaluation of environment variables.

The bug was caused by the fact that we always memoize variables in the processable object. The logic was:

  1. Create a processable object (build or bridge).
  2. Reuse this object in Seed::Build::Context in order to evaluate rules:, instead of initializing a stub processable just for that.
  3. Assign the attributes that have changed after the evaluation of rules.
  4. Now, when calculating variables, some of them may have been memoized during the evaluation of rules (in step 2) and don't take in consideration the new values assigned in step 3.

The previous MR already added some complexity for this performance optimization and fixing this memoization bug could add even more complexity.

Reverting the change for now, (the FF is disabled on production anyway) and re-evaluate solutions if needed.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Fabio Pitino

Merge request reports