Repository navigation
RFC: Automated Patching Proposal #4360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
t-lo
wants to merge
1
commit into
main
Choose a base branch
from
t-lo/proposal-automated-patching
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Flatcar automated patch ingestion | ||
|
|
||
| * status: proposal | ||
| * next step: discussion, changes / updates, collect approvals | ||
| * final destination: `docs/flatcar-automated-patch-ingestion.md` | ||
|
|
||
| The document discusses automatically ingesting package updates and patches via the Gentoo submodule. | ||
| Packages in coreos-overlay are out of scope. | ||
|
|
||
| ## Ingesting Updates | ||
|
|
||
| Flatcar uses Gentoo in a git submodule in [`sdk_container/src/third_party`](../sdk_container/src/third_party). | ||
| The submodule tracks Gentoo's master branch (via an [intermediate mirror](https://github.com/flatcar-hub/gentoo/tree/master) under Flatcar control, for robustness reasons). | ||
| Updates / upgrades that arrived in Gentoo can be ingested simply by rebasing the Gentoo git submodule to latest `master`. | ||
|
|
||
| The update ingestion and patching document covers two distinct areas: | ||
| 1. **The `main` branch.** | ||
| This branch receives updates to latest+greatest for all its packages, i.e. the latest package release marked `stable` in Gentoo will be ingested. | ||
| 2. **Release branches.** | ||
| Release branches receive patch-level updates for all packages the release includes. | ||
| Major and minor versions of all packages in release branches will be frozen when the branch is created from `main`, i.e. at the time of the Alpha release. | ||
|
|
||
| ## Automated Updates for the `main` Branch | ||
|
|
||
| Main ingests new package versions from Gentoo in a daily cadence and can be triggered manually on demand (e.g. to fix emergent critical CVEs outside the daily rhythm). | ||
| Details on ingesting these updates are outlined in "Ingestion Workflow". | ||
| * Main always gets latest+greatest. | ||
| * If desired, package unmasks can be added to the Flatcar profile to allow-list package versions deemed unstable in Gentoo. | ||
| This is handy for helping to stabilise packages we maintain - or plan to maintain - upstream, e.g. docker/containerd/runc. | ||
| * In exceptional cases, versions can be frozen by temporarily moving packages from Gentoo to coreos-overlay. | ||
| This should be rare and well justified (e.g. SELinux profiles). | ||
|
|
||
| This allows for an "upstream first" development flow in which we upgrade packages and fix issues directly in upstream Gentoo. | ||
|
|
||
| ## Automated Patching of Release Branches | ||
|
|
||
| Release branches ingest patch level updates of all packages on a daily cadence, using the same workflows and mechanisms as `main`. | ||
|
t-lo marked this conversation as resolved.
Resolved
|
||
| This is implemented by "freezing" all package major and minor versions when a new Alpha branch is created. | ||
| The freeze is implemented via adding package major and minor versions to package masks / package keywords automatically at branch creation time. | ||
|
t-lo marked this conversation as resolved.
Resolved
t-lo marked this conversation as resolved.
Resolved
|
||
| The package major and minor versions reflect the most current versions shipped when the branch is created. | ||
|
|
||
| As a result, the Gentoo git submodule will automatically be rebased in release branches too, as outlined in "Ingestion Workflow", while ensuring only patch level updates will be ingested to the maintenance branches. | ||
|
|
||
| If a package major.minor version is discontinued by Gentoo upstream, Flatcar distro maintainers need to make a qualified decision: | ||
| 1. Move the latest available patch level version before discontinuation to coreos-overlay. | ||
| The maintenance branch will then carry that version in coreos-overlay for the lifetime of this respective major release. | ||
| 2. Ship a minor (or major) version upgrade of the affected package with the next OS patch-level release. | ||
| This may be more desirable than 1. if the package upgrade | ||
| 1. is considered low impact, e.g. shipping a new major VIM version. | ||
| 2. ships important security fixes not available for older releases. | ||
|
|
||
|
|
||
| ## Ingestion Workflow | ||
|
|
||
| The ingestion workflow is: | ||
| 1. Rebase to latest Gentoo upstream in our Gentoo mirror clone via https://github.com/flatcar-hub/gentoo/actions/workflows/auto-update.yaml. | ||
| 2. Create a new branch and update the Gentoo git submodule to latest mirror `master`. | ||
| 3. create a PR in the `scripts` repo using that branch. | ||
| 4. run an OS image build and qemu tests for both AMD64 and ARM64. | ||
| Test results will be posted to the PR. | ||
| 5. create a package version diff between | ||
| 1. the current build and the latest nightly | ||
| 2. the current build and the latest release of the target release branch (or the latest Alpha release for `main`) | ||
| and add it to the PR. | ||
| 6. create an OS filesystem contents diff | ||
| 1. the current build and the latest nightly | ||
| 2. the current build and the latest release of the target release branch (or the latest Alpha release for `main`) | ||
| and add it to the PR. | ||
| 7. The PR is approved and merged by a maintainer based on the information provided in the PR. | ||
| 1. If build or tests failed, the PR will remain open and automation will re-use the same PR for updated builds. | ||
|
|
||
| Follow-up: The package version diffs generated in 5. may be used as a base for generating release changelog information. | ||
| However, this is out of scope of this document. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.