Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
一杯枸杞茶ya
csdn-workflow
提交
20082d4f
C
csdn-workflow
项目概览
一杯枸杞茶ya
/
csdn-workflow
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
csdn-workflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
20082d4f
编写于
2月 26, 2018
作者:
F
Fatih Acet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement CI config validation.
Closes #22
上级
e240d490
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
73 addition
and
10 deletion
+73
-10
CHANGELOG.md
CHANGELOG.md
+1
-0
README.md
README.md
+18
-10
package.json
package.json
+4
-0
src/assets/_validate-ci-config.gif
src/assets/_validate-ci-config.gif
+0
-0
src/ci_config_validator.js
src/ci_config_validator.js
+35
-0
src/extension.js
src/extension.js
+2
-0
src/gitlab_service.js
src/gitlab_service.js
+13
-0
未找到文件。
CHANGELOG.md
浏览文件 @
20082d4f
...
...
@@ -3,6 +3,7 @@
## [0.5.0] - 2018-02-25
### Added
-
[
#25
](
https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/25
)
Create snippet from selection or entire file.
-
[
#22
](
https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/22
)
Add support for .gitlab-ci.yml lint-ing
-
[
#20
](
https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/20
)
Added Read more and Set token now buttons to token ask notification.
...
...
README.md
浏览文件 @
20082d4f
...
...
@@ -15,6 +15,7 @@ This extension integrates GitLab to VSCode by adding GitLab specific options to
-
Create public, internal or private snippet from entire file or selection.
[
Read more
](
#create-snippet
)
.
-
Compare your branch with master and view changes on GitLab.
[
Read more
](
#compare-with-master
)
.
-
View active file on GitLab with highlighting active line number and selected text block.
[
Read more
](
#open-active-file
)
.
-
Validate GitLab CI configuration file
`.gitlab-ci.yml`
.
[
Read more
](
#validate-gitlab-ci-configuration
)
.
-
Open MR of current branch on GitLab.
-
Open issues assigned to you on GitLab.
-
Open MRs assigned to you on GitLab.
...
...
@@ -133,6 +134,12 @@ This command allows you to see active file on GitLab. Extension sends active lin
![
_open_active_file.gif
](
https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/_open_active_file.gif
)
### Validate GitLab CI Configuration
Using this command, you can quickly validate GitLab CI configuration.
![
_validate-ci-config.gif
](
https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/_validate-ci-config.gif
)
-----
...
...
@@ -147,21 +154,22 @@ If you are using GitLab on a custom domain, you should add this to your user set
## What's next?
-
Open last commit on GitLab.
-
GitLab CI config file
`(.gitlab-ci.yml)`
validation
-
MR actions picker which will allow you to
-
Go to specific MR tab, Discussions, Commits, Pipelines, Changes.
-
Assign MR to user.
-
View last commit.
-
[moonshot] GitLab Dashboard tab where you can see your issues, MRs, Todos all in one place in VSCode.
-
[moonshot] MR diff discussions on VSCode gutter with user avatars like we have in GitLab Changes tab.
-
`[Shipped in v0.2.2]`
Pipeline link to pipeline status bar item.
-
`[Shipped in v0.2.2]`
View last pipeline on GitLab.
-
`[Shipped in v0.3.0]`
Pipeline actions menu to quickly view, retry, cancel or create a new pipeline.
-
`[Shipped in v0.4.0]`
Issue and MR search.
-
`[Shipped in v0.4.0]`
Detailed issue and MR search.
-
**[moonshot]**
GitLab Dashboard tab where you can see your issues, MRs, Todos all in one place in VSCode.
-
**[moonshot]**
MR diff discussions on VSCode gutter with user avatars like we have in GitLab Changes tab.
-
**Already Shipped**
-
`[v0.2.2]`
Pipeline link to pipeline status bar item.
-
`[v0.2.2]`
View last pipeline on GitLab.
-
`[v0.3.0]`
Pipeline actions menu to quickly view, retry, cancel or create a new pipeline.
-
`[v0.4.0]`
Issue and MR search.
-
`[v0.4.0]`
Detailed issue and MR search.
-
`title:MR discussions refactor labels:frontend, discussions assignee:fatihacet`
-
`[Shipped in v0.4.0]`
Compare your changes with master on GitLab.
-
`[Shipped in v0.5.0]`
Create snippet from selected text
-
`[v0.4.0]`
Compare your changes with master on GitLab.
-
`[v0.5.0]`
Create snippet from selected text
-
`[v0.5.0]`
GitLab CI config file
`(.gitlab-ci.yml)`
validation
## Contribution
...
...
package.json
浏览文件 @
20082d4f
...
...
@@ -95,6 +95,10 @@
{
"command"
:
"gl.createSnippet"
,
"title"
:
"GitLab: Create snippet"
},
{
"command"
:
"gl.validateCIConfig"
,
"title"
:
"GitLab: Validate GitLab CI config"
}
],
"configuration"
:
{
...
...
src/assets/_validate-ci-config.gif
0 → 100644
浏览文件 @
20082d4f
696.5 KB
src/ci_config_validator.js
0 → 100644
浏览文件 @
20082d4f
const
vscode
=
require
(
'
vscode
'
);
const
gitLabService
=
require
(
'
./gitlab_service
'
);
const
{
showInformationMessage
,
showErrorMessage
}
=
vscode
.
window
;
async
function
validate
()
{
const
editor
=
vscode
.
window
.
activeTextEditor
;
if
(
!
editor
)
{
return
showInformationMessage
(
'
GitLab Workflow: No open file.
'
);
}
const
content
=
editor
.
document
.
getText
();
const
response
=
await
gitLabService
.
validateCIConfig
(
content
);
if
(
!
response
)
{
return
showInformationMessage
(
'
GitLab Workflow: Failed to validate CI configuration.
'
);
}
const
{
status
,
errors
,
error
}
=
response
;
if
(
status
===
'
valid
'
)
{
showInformationMessage
(
'
GitLab Workflow: Your CI configuration is valid.
'
);
}
else
if
(
status
===
'
invalid
'
)
{
if
(
errors
[
0
])
{
showErrorMessage
(
errors
[
0
]);
}
showErrorMessage
(
'
GitLab Workflow: Invalid CI configuration.
'
);
}
else
if
(
error
)
{
showErrorMessage
(
`GitLab Workflow: Failed to validate CI configuration. Reason:
${
error
}
`
);
}
}
exports
.
validate
=
validate
;
src/extension.js
浏览文件 @
20082d4f
...
...
@@ -7,6 +7,7 @@ const gitLabService = require('./gitlab_service');
const
pipelineActionsPicker
=
require
(
'
./pipeline_actions_picker
'
);
const
searchInput
=
require
(
'
./search_input
'
);
const
snippetInput
=
require
(
'
./snippet_input
'
);
const
ciConfigValidator
=
require
(
'
./ci_config_validator
'
);
let
context
=
null
;
...
...
@@ -33,6 +34,7 @@ const registerCommands = () => {
'
gl.mergeRequestSearch
'
:
searchInput
.
showMergeRequestSearchInput
,
'
gl.compareCurrentBranch
'
:
openers
.
compareCurrentBranch
,
'
gl.createSnippet
'
:
snippetInput
.
show
,
'
gl.validateCIConfig
'
:
ciConfigValidator
.
validate
,
}
Object
.
keys
(
commands
).
forEach
((
cmd
)
=>
{
...
...
src/gitlab_service.js
浏览文件 @
20082d4f
...
...
@@ -194,6 +194,18 @@ async function createSnippet(data) {
return
snippet
;
};
async
function
validateCIConfig
(
content
)
{
let
response
=
null
;
try
{
response
=
await
fetch
(
'
/ci/lint
'
,
'
POST
'
,
{
content
});
}
catch
(
e
)
{
vscode
.
window
.
showInformationMessage
(
'
GitLab Workflow: Failed to validate CI configuration.
'
);
}
return
response
;
}
/**
* @private
* @param {string} token GL PAT
...
...
@@ -210,4 +222,5 @@ exports.fetchCurrentProject = fetchCurrentProject;
exports
.
handlePipelineAction
=
handlePipelineAction
;
exports
.
fetchMRIssues
=
fetchMRIssues
;
exports
.
createSnippet
=
createSnippet
;
exports
.
validateCIConfig
=
validateCIConfig
;
exports
.
_setGLToken
=
_setGLToken
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录