Skip to content

Update frontend versioning

Laura Montemayor requested to merge frontend-changes-latest into master

This is the FE companion to this: !145519 (merged)

We are essentially getting rid of the latestVersion object in favor of using the versions array to fetch our latest version.

How to set this up

In a project that is marked as a catalog project, create three releases in the following order: 10.0.0 -> 3.1.1 -> 2.1.6. Previously, this would've shown up in the order they were created, so 2.1.6 would be "latest" because it was using released_at. Now the order of versions should be semantic. Example query:

query  {
  ciCatalogResource(id: "gid://gitlab/Ci::Catalog::Resource/15") {
    versions {
      edges {
        node {
          id
          releasedAt
        }
      }
    }
  }
}

Response shows the latest at the top, even though 2.1.6 was created today. The rest of the versions are in the correct order (this will be what is used for the FE versions dropdown):

{
  "data": {
    "ciCatalogResource": {
      "versions": {
        "edges": [
          {
            "node": {
              "name": "10.0.0",
              "createdAt": "2024-02-26T12:01:56Z"
            }
          },
          {
            "node": {
              "name": "3.1.1",
              "createdAt": "2024-02-14T10:40:37Z"
            }
          },
          {
            "node": {
              "name": "2.1.6",
              "createdAt": "2024-02-28T14:28:26Z"
            }
          }
        ]
      }
    }
  }
}

You can also test this by include ing the latest component.

Edited by Briley Sandlin

Merge request reports