Skip to content

Update GitLab project(s) Releases page when release posts are created/updated

Nathan Friend requested to merge nfriend-update-gitlab-releases-page into master

Why is this change being made?

This update allows us to begin dogfooding our Releases feature. Dogfooding is one of our values.

What does this MR do?

This MR adds a step to this project's pipeline that runs when a release post is published (or modified).

This pipeline step uses the release post content to update the gitlab-org/gitlab and gitlab-org/gitlab-foss projects' Releases pages. The format of these updates closely resembles the format we publish on https://about.gitlab.com/releases/.

How does it work?

This MR adds two new rake tasks:

  1. releases:ee:update_project_releases_page
  2. releases:foss:update_project_releases_page

At a high level, these tasks doing the following:

  1. Get a list of all existing project Releases using the Releases API
  2. Get a list of all features highlighted in each release using the existing ReleaseList class (which pulls content from source/releases/posts/*-released.html.md in this repository)
  3. Renders the release post's highlights into a GitLab Flavored Markdown block
  4. For each release post:
    1. If the project has no corresponding Releases, a new Release is created (using the Releases API)
    2. If a corresponding Release already exists, the existing Release is updated (also using the Releases API)
      • The Release is only updated if the content is out-of-date

Example

For testing purposes, I created two projects to mimic the gitlab-org/gitlab and gitlab-org/gitlab-foss projects:

Take a look at the Releases pages of these projects for a preview of what this will look like.

Other notes

API token

The pipeline step relies on a $GITLAB_BOT_TOKEN environment variable. This variable should be set to a Personal Access Token with api scope for @gitlab-bot. I have not yet added this environment variable to this project.

Releases older than 9.2

Similar to our current releases page, this pipeline step will only create/update Releases for version 9.2 and newer. 9.2 is the oldest GitLab version that used the current release post YAML format.

Releases older than 9.2 are listed in the projects' changelogs.

Releases older than 8.16 are listed in the archived changelog.

These old versions should be added to the Releases page in the future, but this is out of the scope of this MR. This will most likely be done through a one-time API script rather than a pipeline step.

Minor and patch releases

Also similar to our current releases page, this process will only publish major version releases (12.0.0, 12.1.0, 12.2.0, etc.). Minor and patch releases should also eventually be added to the Releases page, but this will be more difficult since we can't reuse the existing ReleaseList class. Because of this, this is out of scope for this MR.

Related issues

gitlab-org/distribution/team-tasks#460

Does this MR meet the acceptance criteria?

Assign to DRI

  • Did you assign this change to the correct DRI of the page or information you are changing?

Conformity

Edited by Nathan Friend

Merge request reports