Staging Bot

Pull requests to the project are tested using a bot running via github actions. It writes all build recipes for the images to a branch and creates a staging project on https://build.opensuse.org/ under the user defolos (private account of Dan Čermák). The bot will then write a comment in the pull request for each OS version that had changes with the branch name, the staging project URL and wait for the builds in the staging project to finish. Once they have finished, it will update the comment with the build results and either pass or fail the CI job depending on how the containers built on OBS. The bot will delete the previously created staging project and branches on each new push or when the PR is closed/merged.

For further details, see StagingBot or refer to the help of the command poetry run scratch-build-bot.

Branch setup

The source code of the generator and all utilities lives in the main branch, while the build recipes are written into separate, so called, deployment branches in this repository. For openSUSE Tumbleweed that is the tumbleweed branch and for SLE these are sle15-sp$SERVICE_PACK_NUMBER. All of these branches are protected on Github and only allow to be updated via pull requests.

The staging bot uses the deployment branches as a base to run test builds and will create new branches with the name $deployment_branch-$random_ASCII for pull requests against main. The bot will write the new build recipes once a pull request for main has been merged into the branch for-deploy-$deployment_branch and create a pull request against the respective deployment branch. Here we leverage OBS’ SCM CI to branch the packages from the CR project (continuous_rebuild_project_name) using the .obs/workflows.yml generated by the staging bot (obs_workflows_yml).

Project Setup

The current CI setup includes the following projects:

  • devel:BCI:${OS_VERSION}: The final build recipes reside in this project. Each package is created via scratch-build-bot.py setup_obs_package which sets up the package to scmsync the contents from a subdirectory in the deployment branch.

  • home:defolos:CR:${OS_VERSION}: A test project, which has a project wide scmsync to the deployment branch. Therefore it will automatically pick up every new package without manual intervention and it will also use the correct prjconf via the _config (this file is populated in write_all_image_build_recipes()).

  • home:defolos:Staging:${OS_VERSION}:${branch_name}-${random}: The scratch build project created for each pull request against main by the staging bot in scratch_build()

  • home:defolos:BCI:CR:${OS_VERSION}:Staging:SUSE:BCI-dockerfile-generator:PR-${PR_NUM}: projects created by OBS’ SCM CI from home:defolos:CR:${OS_VERSION} for every pull request against the deployment branches.