## Containerd API extraction toolchain A [script](https://gist.github.com/akhilerm/330a603ec49e4c6cc51c722ec15f4e82) will be run on every tag push to the containerd repo. This script will extract the /api and associated directories and push them to containerd/api. It will also take care of tagging in the api repository. The above provided script is a POC that can do the same, which needs to be polished to handle a few more corner cases that can happen. ### What is needed? 1. A new github workflow will have to be added to containerd/containerd repo which runs only when a new tag is pushed 2. A new repo. `containerd/api`. This will have the extracted APIs and associated packages along with the go.mod. This repo will only have release branches and tags because its not recommended to use code from an untagged version from this repo. 3. The script can be either hosted in containerd/containerd repo, or some other repo in the containerd org, such as containerd/project-checks(maybe) ### What issue does this solve. This is the Option 4 mentioned in the [doc](https://docs.google.com/document/d/1qD0XphQ9NtrQT934Qv38ebMRnD2VQ-CE85TfPPAbiZo/edit?usp=sharing) by @kzys. ### Change in workflow for contributors There will not be a direct change in the workflow for contributors. The only change will be a github action that should be added as part of PR checks. This is needed because: we need to make sure that none of the packages from containerd/containerd get imported into the extracted repo which can cause go.mod issues (issues like the one mentioned below) ### Initial steps - A few [changes](https://github.com/akhilerm/containerd/commit/d88f173b335054e3d9a56a9d972bc8a61b9ea5fb) need to be done in [platforms](https://github.com/containerd/containerd/blob/main/platforms/cpuinfo.go#L28) package so that dependencies are not dragged over to the new repo. Once this is done the dependencies can be extracted to new repo. - If we are going with this approach, the script has to be first run by a maintainer and the changes pushed to containerd/api so that we can have the history till the current date. Later pushing to the repo will be done by the github action.