提交 7bb5b051 编写于 作者: T Tomas Vik

Merge branch '247-depracation-warning' into 'main'

feat: warn user about deprecating custom certificate logic

See merge request gitlab-org/gitlab-vscode-extension!116
const vscode = require('vscode');
const { openUrl } = require('./openers');
const WARNED_FLAG_NAME = 'warnedAboutCertDeprecation';
const checkDeprecatedCertificateSettings = async context => {
const { ignoreCertificateErrors, ca, cert, certKey } = vscode.workspace.getConfiguration(
'gitlab',
);
if (
(ignoreCertificateErrors || ca || cert || certKey) &&
!context.globalState.get(WARNED_FLAG_NAME)
) {
const response = await vscode.window.showWarningMessage(
`
You are using settings to set custom certificate for connecting to your GitLab instance.
This configuration is going to get removed in the next major version of GitLab Workflow extension.`,
'See more details',
"Don't show again",
);
if (response === "Don't show again") {
context.globalState.update(WARNED_FLAG_NAME, true);
} else if (response === 'See more details') {
openUrl('https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/247');
}
}
};
module.exports = checkDeprecatedCertificateSettings;
......@@ -13,6 +13,7 @@ const webviewController = require('./webview_controller');
const IssuableDataProvider = require('./data_providers/issuable').DataProvider;
const CurrentBranchDataProvider = require('./data_providers/current_branch').DataProvider;
const { initializeLogging, handleError } = require('./log');
const checkDeprecatedCertificateSettings = require('./check_deprecated_certificate_settings');
vscode.gitLabWorkflow = {
sidebarDataProviders: [],
......@@ -81,6 +82,7 @@ const activate = context => {
webviewController.addDeps(context);
tokenService.init(context);
tokenServiceWrapper.init(context);
checkDeprecatedCertificateSettings(context);
};
exports.activate = activate;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册