projectsyn / modulesync-control

Archived. We now manage component templates via https://github.com/projectsyn/commodore-component-template. ModuleSync configuration and template repository for Commodore components
0 stars 0 forks source link

Add logic to generate Renovate `postUpgradeTasks` #62

Closed simu closed 2 years ago

simu commented 2 years ago

Until now, the test matrix has been defined in a local variable for the .github/workflows/test.yaml template. To allow us to generate Renovate postUpgradeTasks and a list of test instances in a make variable, we need to be able to access the matrix test configuration in other templates.

This PR moves the test matrix configuration to global variable testMatrix. For now, the GitHub actions template will continue to read the test matrix from the file-level variable matrix, but will fall back to the global variable testMatrix if the file-level variable is missing.

Additionally, the PR adds new make targets golden-diff-all and gen-golden-all. These targets use a static list of test instances in make variable test_instances. The contents of this variable are generated from the modulesync parameter testMatrix.entries.

We use a generic recursive make target based on the test_instances make variable to implement the new targets. This allows us to reuse the existing golden-diff and gen-golden targets.

The new targets are only added for components which have matrix tests configured and which have migrated their matrix test configuration to modulesync parameter testMatrix.

Finally, this PR adds logic to generate section postUpgradeTasks in renovate.json for components which have golden tests enabled. To determine the command to execute, we check if the component has matrix tests configured (based on parameter testMatrix). We use the make gen-golden-all as the command for components with matrix tests and make gen-golden for other components.

Commodore component-template PR: https://github.com/projectsyn/commodore/pull/424

Checklist

simu commented 2 years ago

Something like make gen-golden-all would speed up the workflow considerably for some components. Bonus: Less complicated json rendering for renovate tasks.

I actually already implemented this for a component at some point, but forgot about it until you mentioned it. I'll redo the PR to implement the gen-golden-all and golden-diff-all targets for all components and use gen-golden-all for the postUpgradeTasks.