You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This milestone we have refactored the branch protection code in the vscode.git extension to expose extension api that other extensions can leverage in order to provide branch protection information. This enables the GitHub extension to query repository rules and surface branch protection information in the workbench.
Since we have refactored the branch protection code, apart from testing the new capabilities we also want to confirm that we did not introduce any regressions.
Prerequisites
Launch VS Code Insiders and open a folder/workspace that contains a git repository
Open Settings, and reset the following settings: git.branchProtection, github.branchProtection
Git
Launch VS Code Insiders and open a folder/workspace that contains a git repository
Open Settings, and use the git.branchProtection setting to define protected branches (ex: main, release/*)
Switch between branches that are protected, and ones that are not
Confirm that for protected branches a "lock" icon is being shown in the taskbar
Switch to a protected branch, open settings and clear all items from the git.branchProtection setting
Confirm that the "lock" icon disappears after the setting has been updated
GitHub
The GitHub extension is using the recently announced repository rules to contribute branch protection information. As of right now, repositories rules are only read once, when the repository is opened as we still trying to determine when these rules should be refreshed.
Create a new GitHub repository, or use an existing repository
Enable the GitHub branch protection by setting github.branchProtection to true
Use the documentation to create a new repository rule for "all branches" as target
Open the git repository in VS Code
Confirm that no lock icon is being displayed in the status bar for any of the branches
Edit the ruleset on GitHub, check the "Require a pull request before merging", and "Save Changes"
Reload the window (this is needed as we only read repository rules when the repository is opened)
Confirm that the lock icon is being displayed in the status bar for all branches
Edit the ruleset on GitHub, delete "all branches", add "default branch", and "Save Changes"
Reload the window (this is needed as we only read repository rules when the repository is opened)
Confirm that the lock icon is being displayed for the default branch, but not the other branches
Edit the ruleset on GitHub, add include/exclude patterns, and "Save Changes"
Confirm that the lock icon is being displayed for the branches that match the include patterns and do not match the exclude patterns
Edit the ruleset on GitHub, change the "Enforcement status" from "Active" to "Disabled"
Reload the window (this is needed as we only read repository rules when the repository is opened)
Confirm that the lock icon is not being displayed in the status bar for any of the branches
The text was updated successfully, but these errors were encountered:
Refs: #178990
Complexity: 4
Create Issue
This milestone we have refactored the branch protection code in the vscode.git extension to expose extension api that other extensions can leverage in order to provide branch protection information. This enables the GitHub extension to query repository rules and surface branch protection information in the workbench.
Since we have refactored the branch protection code, apart from testing the new capabilities we also want to confirm that we did not introduce any regressions.
Prerequisites
git.branchProtection
,github.branchProtection
Git
git.branchProtection
setting to define protected branches (ex:main
,release/*
)git.branchProtection
settingGitHub
The GitHub extension is using the recently announced repository rules to contribute branch protection information. As of right now, repositories rules are only read once, when the repository is opened as we still trying to determine when these rules should be refreshed.
github.branchProtection
totrue
The text was updated successfully, but these errors were encountered: