Move auto-deploy tagging outside of the coordinator pipeline

ReleaseTools::Tasks::AutoDeploy::Tag has a very complex design, it detects if it's running inside a coordinator pipeline or not and behaves differently.

  • Outside the coordinator pipeline, it will check for something to tag, but it will tag release-tools instead (generating a coordinator pipeline)
  • Inside the coordinator pipeline, it will tag the packagers and publish the release-metadata information

This complex design could expose to the Time-of-check Time-of-use race condition, as well as having known bugs like #4053 (closed).

By moving all the tagging logic outside of the coordinator pipeline, ReleaseTools::Tasks::AutoDeploy::Tag will now have a single responsibility.

  • It will verify if the condition to generate a new package are met,
  • it will tag both packagers even if the changes are only in one of them (fixing #4053 (closed))
  • it will produce the release-metadata of the package
  • it will tag release-tools with the product version associated with the above metadata

With the above information, we could remove the tagging operation from the release coordinator and use the first job only to produce the necessary artifact with the environment variables needed to continue the deployment.