Skip to content

fix: Retrieve maxAccessLevel separately in ProtectedBranchProvider

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you can request access to GitLab Duo.

Description

Merge request !1990 (merged) expanded the GraphQL query to always fetch the maxAccessLevel property, but this was only added in GitLab 16.9 (this was not in the API documentation). The current supported minumum version for the VS Code extension is GitLab 16.1.

This MR will fetch the maxAccessLevel separately in the ProtectedBranchProvider, in which case a failure will only cause this specific feature to not work (instead of the entire extension).

Related Issues

Resolves #1606 (closed)

How has this been tested?

It should work the same as !1990 (merged):

This can be tested by opening any repository as a user without full access rights. Creating a repository and setting protected branches with "Allowed to Push and Merge" to "No one" also works.

Changing branch protection rules in GitLab requires reopening the folder in VS Code to apply the latest settings.

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading