SCM Integration: Step by Step

Branching packages is not enough for you? Let’s go step by step 😉
OBS moves forward on its integration with GitHub/GitLab by adding two new steps: link_package and configure_repositories. Starting today, you can set up your OBS workflows to create a package linked to an existing one. You can also configure the repositories of a project in which you want to build packages. And as if that weren’t enough, you are now able to manage the tokens through the web UI. Join the beta program and keep reading to discover all you can do.

We started off the continuous integration between OBS and GitHub/GitLab in May 2021, then made some improvements in June 2021. We introduced advanced features like reporting filters and support for self-hosted SCM together with a list of common pitfalls in July 2021 and in August 2021, we continued with two new steps and a UI for tokens. In September 2021, we supported more actions for pull/merge requests, improved the UI for tokens, and added support for push events and a rebuild step. In November 2021, we presented the user documentation and further improvements for the UI for tokens and workflow runs and more. We worked on UI and reporting improvements in February 2022, followed by a step to trigger services and the improvement of the error messages in April 2022. Afterwards, we clarified the separation between incoming webhooks and status reports in May 2022, then sharing tokens was made possible in June 2022. Later in July 2022, we added support for the SCM Bridge feature. Around September 2022, the feature was considered stable, so we enabled it for all the OBS users, but that wasn’t the end; later in September we reached the milestone of supporting Gitea on top of GitHub and GitLab. In December 2022 we introduced placeholder variables in addition to a customizable configuration file location. And now, we bring notifications for failed workflow runs.

This feature is documented in the SCM/CI Workflow Integration chapter of the OBS User Guide.

Tokens on the Web User Interface

In our first blog post regarding the SCM integration with OBS, we explained how to handle workflow tokens via API.

As we strive to make your work easier, from now on you can manage any kind of OBS tokens through the web interface.

Go to your profile page and click on the action Manage Your Tokens in the left-hand side menu.

Link to Manage Your Tokens in the web UI
Link to "Manage Your Tokens" in the web UI
Managing tokens in the web UI
Managing tokens in the web UI

For now, only workflow tokens can be updated to change the SCM token attached to them. This is in case you had to regenerate the SCM token if you, for example, lost it.

You probably tested the first step we implemented: branch_package. You configured the workflow and … 💣 boom! a new project/package appeared in OBS and the result of its builds were reported back to your pull/merge request.

What if you want to do the same but instead of branching the package you simply want to link it? Now you can.

Follow these easy steps for that:

  • Set up the integration between GitHub/GitLab and OBS. If you have not yet, please refer to this blog post.
  • Add the new step to .obs/workflows.yml
    - link_package:
        source_project: games
        source_package: ctris
        target_project: games:devel

Depending on the webhook event, OBS will link the package games/ctris to a different project or package. In the case of a pull request event, games/ctris will be linked to games:devel:$SCM_ORGANIZATION:$SCM_PROJECT:PR-$PR_NUMBER/ctris. For a push event, games/ctris will be linked to games:devel/ctris-$COMMIT_SHA.

This step is equivalent to osc linkpac. Unlike the branch_package step, the link_package step creates a new package but does not copy the files nor the repositories from the source package.

The configure_repositories Step

You can not imagine how versatile workflows could be with this new step!

Inside the SCM configuration file, simply indicate which repositories you want for a project in which you’ll build your packages for. Easy peasy!

  • Set up the integration between GitHub/GitLab and OBS. If you have not yet, please refer to this blog post.
  • Add the new step to .obs/workflows.yml as explained in the user documentation.

More to Come!

Do not miss upcoming blog posts, there are a lot of features to come:

  • Reporting results for multiple packages
  • New workflow steps apart from the branch_package, link_package and configure_repositories
  • Filtering by branch or SCM event
  • Multiple workflows
  • Integrate with more SCM services like Pagure
  • OBS triggering webhooks on some other services

How To Give Us Feedback

There are two ways to reach us:

Please note that we favor GitHub to gather feedback as it allows us to easily keep track of the discussions.