Use no-content manifests to decide if rebuilds are needed #443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EXPERIMENTAL PR FOR CI SHENANIGANS
The idea behind this is that we can generate manifests without resolving content and be reasonably certain¹ that any changes in these manifests reflect changes in the real ones.
¹ This is based on the assumption that the content doesn't change if the address is the same. When gen-manifests is asked to not resolve content,
--packages=false
,--commits=false
, and/or--containers=false
, instead of depsolving, fetching the commit ID, or resolving the container ID, it generates a checksum of each item based on the provided info (name, url, etc). This is a safe alternative under certain conditions:Note here that in the current example there's no CI cache to compare against. Instead we just generate manifests on both the tip of the branch (HEAD of the PR) and the merge-base with the base ref (i.e.
git merge-base HEAD main
). Right now, with the CI cache, we have a file lifetime that sort of ensures that images will be rebuilt even if nothing changes after a certain time (10 days currently). Realistically, changes always happen much more frequently, but if manifests don't change for a while for whatever reason, they wont be rebuilt and the cache will expire. Whether this is a problem or not depends on whether we intend to reuse the cache for other things (like tests in osbuild-composer).Generate manifests without content to decide if we should trigger builds
in GitLab CI.
If there are no differences exit with 0, otherwise print a message.
The real version of this job will write a file or set a variable to make
the gitlab trigger skip the gitlab CI if no builds are needed.
Alternatively, it can create the top-level gitlab CI file so that we
don't need to have two nested dynamic pipelines in gitlab. It can
probably even generate the whole low level one so we don't need to have
dynamic pipelines there and it would make thing a tiny bit saner.
It should also take into account the other things that affect builds: