The manifest checksum check has become a bit annoying. It's not required, so a failing check doesn't block a PR, but it very often creates merge conflicts, requiring extra work to rebase PRs that should would otherwise allow automatic rebasing. I have a couple of ideas for how to get around these issues while also keeping the information they provide.
Background
Skip this section if you know what the manifest checksums are and their purpose.
The checksums and the CI test were introduced in #1380. For anyone who's not familiar with the need for the checks, but also as a reminder for everyone else, the purpose of the checksums is to signal to patch authors and reviewers that a certain commit has an effect on one or more generated manifests. This can be very useful in two scenarios:
- A contributor is authoring a commit that refactors some part of manifest generation to make the code easier to read, but should be functionally identical. The commit or PR should have no changes in the checksum file, because manifests should not be affected by the change. The CI test verifies that the checksums are valid.
- A contributor is authoring a commit that changes specific image types, or test configurations. Each commit that affects a manifest should be accompanied by a change in the checksums file and should be limited to just the configurations it has affected, i.e. there were no unintended side effects that changed unrelated images or configs.
In the past, we used to have full manifests checked into the repository for this same purpose. Commits that changed manifests showed the exact change in the generated manifest itself for reviewing and tracing. However, the people who remember those times do not have fond memories of it. I (I think it was me) proposed checksums as a way to have a signal that something changed without needing big manifests checked into the repository and also big, hard to read patches that eventually get ignored.
Ideas for replacement
1. Replace manifest checksums file and check with a CI check and GitHub action
I think with a bit of engineering we can automate the notification that manifests have changed. This is also something we tried in the past but got rid of because it was a bit useless. The old solution was simply a comment on the PR by Schutzbot that mentioned that manifests changed, without any extra information. I think a solution that might work is something that integrates with GitHub's annotations, or a comment that lists every commit in a PR that affects a manifest along with a link to a diff of the actual manifest (or a folded codeblock). This can be done in a way that blocks the PR and forces reviewing, so reviewers are encouraged to check each diff and dismiss it if it's valid.
Benefits:
- Requires no interaction by authors and no knowledge for external contributors.
- Enforces reviewing of changes in manifests with more information than the current system.
Drawbacks:
- Can get cumbersome to check large changes, especially if presented as diffs of json. It's still, in the worst case, as good as the current solution though in terms of information provided (i.e. "this commit changed these images"). The json diff can be mitigated by converting to yaml instead (more diffable).
- Will require some engineering.
2. Split the manifest checksums file into multiple files, one per line
This idea addresses the merge conflict issue directly, but doesn't make it go away completely. It simply gets rid of the issue where some manifest changes in main and a PR may create merge/rebase conflicts in the file but could be avoided if they are in different manifests. This doesn't get rid of the issue where two PRs conflict based on changes in the same file, which does happen. But it would solve the problem where a PR makes changes in separate manifests from the ones changed in main (see the current state of #1565, for example, which introduces new images and the lines can't be cleanly merged into the modified file in main).
Benefits:
- Very little engineering required.
Drawbacks:
- Can create inconsistent states in main (which is also possible with the current approach). For example, if a PR gets merged that changes all rpm repo snapshot URLs, it affects all manifests. Then if another PR introduces new images, with new files for the checksums, they will be created with the old repo snapshots. The PR can be merged cleanly, but the new manifests will have checksums computed with the old snapshots, so essentially some checksums in main are invalid and will require a change in any PR that gets created afterwards (which can be confusing since the change comes from a different PR).
The manifest checksum check has become a bit annoying. It's not required, so a failing check doesn't block a PR, but it very often creates merge conflicts, requiring extra work to rebase PRs that should would otherwise allow automatic rebasing. I have a couple of ideas for how to get around these issues while also keeping the information they provide.
Background
Skip this section if you know what the manifest checksums are and their purpose.
The checksums and the CI test were introduced in #1380. For anyone who's not familiar with the need for the checks, but also as a reminder for everyone else, the purpose of the checksums is to signal to patch authors and reviewers that a certain commit has an effect on one or more generated manifests. This can be very useful in two scenarios:
In the past, we used to have full manifests checked into the repository for this same purpose. Commits that changed manifests showed the exact change in the generated manifest itself for reviewing and tracing. However, the people who remember those times do not have fond memories of it. I (I think it was me) proposed checksums as a way to have a signal that something changed without needing big manifests checked into the repository and also big, hard to read patches that eventually get ignored.
Ideas for replacement
1. Replace manifest checksums file and check with a CI check and GitHub action
I think with a bit of engineering we can automate the notification that manifests have changed. This is also something we tried in the past but got rid of because it was a bit useless. The old solution was simply a comment on the PR by Schutzbot that mentioned that manifests changed, without any extra information. I think a solution that might work is something that integrates with GitHub's annotations, or a comment that lists every commit in a PR that affects a manifest along with a link to a diff of the actual manifest (or a folded codeblock). This can be done in a way that blocks the PR and forces reviewing, so reviewers are encouraged to check each diff and dismiss it if it's valid.
Benefits:
Drawbacks:
2. Split the manifest checksums file into multiple files, one per line
This idea addresses the merge conflict issue directly, but doesn't make it go away completely. It simply gets rid of the issue where some manifest changes in main and a PR may create merge/rebase conflicts in the file but could be avoided if they are in different manifests. This doesn't get rid of the issue where two PRs conflict based on changes in the same file, which does happen. But it would solve the problem where a PR makes changes in separate manifests from the ones changed in main (see the current state of #1565, for example, which introduces new images and the lines can't be cleanly merged into the modified file in main).
Benefits:
Drawbacks: