提交 f3625fc3 编写于 作者: M Massimeddu Cireddu

Support multi-root workspaces. Closes #90

Signed-off-by: NMassimeddu Cireddu <massimeddu@gmail.com>
上级 facdebb3
{
"extends": ["airbnb-base", "prettier"],
"plugins": ["import", "prettier"],
"ignorePatterns": [
"node_modules/",
"src/webview/node_modules/",
"src/webview/dist/",
".vscode-test/",
"out"
],
"rules": {
"no-console": "off",
"no-return-await": "off",
......
......@@ -4,3 +4,4 @@ node_modules
.history
.DS_Store
src/webview/dist/*.hot-update.js*
out
package-lock.json
.history
package.json
.vscode-test
src/dist
out
# CHANGELOG
## v3.0.0 - TBD
- Support multi root workspaces.
- Enable custom queries in GitLab panel.
- Improvements to the issue and merge request webview.
- Adds gitlab icon as webview tab icon.
## v2.2.0 - 2019-11-06
- [Experimental Feature](https://gitlab.com/fatihacet/gitlab-vscode-extension#experimental-features): View Merge Request details and comments in VSCode. Click a Merge Request link from the sidebar and VSCode will open a new tab to show the Merge Request details. You can also directly comment on the Merge Request.
......@@ -7,209 +14,237 @@
## v2.1.1 - 2019-07-10
### Fixed
- Showing issue details and discussions in VSCode was not working properly. Extension was only showing loading screen.
- Showing issue details and discussions in VSCode was not working properly. Extension was only showing loading screen.
## v2.1.0 - 2019-05-10
### Fixed
- Ensure that WebView is fully loaded before sending message
- Fixed by [@Grafexy](https://gitlab.com/Grafexy) with [MR !39](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/39) 👍
- Create public snippet when there is no GitLab project in open workspace
- Fixed by [@ttilberg](https://gitlab.com/ttilberg) with [MR !38](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/38) 👍
### Documentation updates
- [@renestalder](https://gitlab.com/renestalder) improved documentation for additional custom domain information with [MR !35](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/35) 👍
- [@jparkrr](https://gitlab.com/jparkrr) fixed some typos with [MR !36](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/36) 👍
## v2.0.0 - 2019-02-14
- [Experimental Feature](https://gitlab.com/fatihacet/gitlab-vscode-extension#experimental-features): View issue details and comments right in the VSCode. Click an issue link from the sidebar and VSCode will open a new tab to show the issue details. You can also comment to the issue from VSCode.
## v1.9.3 - 2019-02-05
### Fixed
- Fix broken v1.9.2 by including require package
- Fixed by [@swiffer](https://gitlab.com/swiffer) with [MR !33](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/33) 👍
## v1.9.2 - 2019-02-05 (Please skip this version and upgrade to v1.9.3)
### Fixed
- Node 8.5/8.6 request bug, moved vscode to devDependencies and upgraded npm packages
- Fixed by [@swiffer](https://gitlab.com/swiffer) with [MR !32](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/32) 👍
### Changed
- [#85](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/85) Print URLs in "No token found" warning
- This was done for troubleshooting purposes. A lot of people are having hard time to configure the instance url and hopefully this will give them a clue to understand what's going wrong.
## v1.9.1 - 2019-01-18
### Fixed
- [#28](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/28) Creating a snippet doesn't work when only 2 lines selected
- Fixed by by [@joshanne](https://gitlab.com/joshanne) with [MR !30](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/30) 👍
## v1.9.0 - 2019-01-17
### Added
- Support for crt/key pair certificates for users that may use a *.p12 certificate
- Implemented by [@joshanne](https://gitlab.com/joshanne) with [MR !29](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/29) 👍
- Support for crt/key pair certificates for users that may use a \*.p12 certificate
- Implemented by [@joshanne](https://gitlab.com/joshanne) with [MR !29](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/29) 👍
## v1.8.0 - 2019-01-02
### Added
- A new panel in the GitLab sidebar to show all MRs in the current project
- Implemented by [@jkdufair](https://gitlab.com/jkdufair) with [MR !27](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/27) 👍
## v1.7.0 - 2018-12-13
### Added
- Ability to work with the non-root domains for self hosted GitLab instances.
- Implemented by [@tuomoa](https://gitlab.com/tuomoa) with [MR !11](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/11) 👍
- Special thanks to [@Turmio](https://gitlab.com/Turmio) for helping to test this. 👍
## v1.6.0 - 2018-12-12
### Security
- Fixed NPM security issues
### Added
- Pipeline notification on the status bar will now include the list of running and failed jobs
- Implemented by [@jduponchelle](https://gitlab.com/jduponchelle) with [MR !23](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/23) 👍
### Fixed
- Refresh buttons on the sidebar were visible for all panes and even for other extensions.
- Fixed by [@Logerfo](https://gitlab.com/Logerfo) with [MR !26](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/26) 👍
## v1.5.1 - 2018-11-28
### Fixed
- View in GitLab button in the pipeline updated notification was not visible
- Fixed by [@Clapfire](https://gitlab.com/Clapfire) with [MR !24](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/24) 👍
## v1.5.0 - 2018-11-08
### Added
- A new config option to fetch pipeline data from a different Git remote [Read more](https://gitlab.com/fatihacet/gitlab-vscode-extension#configuration-options)
- Implemented by [@jduponchelle](https://gitlab.com/jduponchelle) with [MR !22](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/22) and closes [Issue #59](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/59) 👍
## v1.4.0 - 2018-11-06
### Added
- A new config option to toggle pipeline status change notifications [Read more](https://gitlab.com/fatihacet/gitlab-vscode-extension#configuration-options)
### Changed
- Pipeline notifications introduced in v1.3.0 will not be on by default with this version. You need to manually set the option to true.
- Pipeline notifications introduced in v1.3.0 will not be on by default with this version. You need to manually set the option to true.
## v1.3.0 - 2018-11-05
### Added
- A new config option to set remote name manually [Read more](https://gitlab.com/fatihacet/gitlab-vscode-extension#configuration-options)
- Implemented by [@jduponchelle](https://gitlab.com/jduponchelle) with [MR !18](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/18) 👍
- Extension will show a notification after pipeline status changed
- Implemented by [@Clapfire](https://gitlab.com/Clapfire) with [MR !21](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/21) and closes [Issue #32](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/32) 👍
### Changed
- Pipeline action will not open the pipeline on the default browser
- Changed by [@Clapfire](https://gitlab.com/Clapfire) with [MR !20](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/20) and closes [#31](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/31) 👍
## v1.2.0 - 2018-10-03
### Added
- A new config option to toggle MR status on status bar [Read more](https://gitlab.com/fatihacet/gitlab-vscode-extension#configuration-options)
- Implemented by [@robinvoor](https://gitlab.com/robinvoor) with [MR !15](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/15) 👍
## v1.1.1 - 2018-10-03
### Fixed
- Invalid date parsing for unfinished pipelines.
- Invalid date parsing for unfinished pipelines.
## v1.1.0 - 2018-10-02
### Added
- A new config option to toggle GitLab related links on the status bar [Read more](https://gitlab.com/fatihacet/gitlab-vscode-extension#configuration-options)
- Implemented with [this commit](https://gitlab.com/fatihacet/gitlab-vscode-extension/commit/6318028f1d3959ee0f70d22bb31b68bcbc4a998c) closes [#58](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/58)
### Fixed
- [#57](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/57) Can't use extension with self-hosted gitlab - scope validity
- Fixed with [this commit](https://gitlab.com/fatihacet/gitlab-vscode-extension/commit/cf2fafec91df042ada35609848f251b6ebb02aeb)
## v1.0.0 - 2018-09-26
### Added
- A new panel on the sidebar to see the list of your issues and MRs alongside with the links and informations for your current branch. [Read more](https://gitlab.com/fatihacet/gitlab-vscode-extension#sidebar)
### Fixed
- [#41](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/41) Extension not opening the pipeline from command pallete
- Fixed with [this commit](https://gitlab.com/fatihacet/gitlab-vscode-extension/commit/080a8c609f57df19b093dcfd0ec44cf89e7f5790)
- Respect VSCode http.proxy settings
- Implemented by [@martianboy](https://gitlab.com/martianboy) with [MR !13](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/13) 👍
## v0.6.0 - 2018-03-02
### Added
- A new config option named `gitlab.ca` to set self signed certificates. [Read more](https://gitlab.com/fatihacet/gitlab-vscode-extension#configuration-options)
- A new config option named `gitlab.ignoreCertificateErrors` to ignore certificate errors while connecting and fetching data from GitLab instance. [Read more](https://gitlab.com/fatihacet/gitlab-vscode-extension#configuration-options)
### Fixed
- [#26](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/26) Support for on-premises GitLab instances with self-signed
- Fixed by [@piec](https://gitlab.com/piec) with [MR !8](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/8) 👍
- Possibily fixes [#23](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/23) and [#10](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/10)
- [#29](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/29) Support for on-premises GitLab instances with no certification (http)
## v0.5.2 - 2018-03-01
### Added
- GitLab Workflow now supports multiple instances.
- Implemented by [@csvn](https://gitlab.com/csvn) with [MR !5](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/5) 👍
- ESLint and Prettier integration for dev environment.
- Added by [@alpcanaydin](https://gitlab.com/alpcanaydin) with [MR !6](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/6) 👍
### Changed
- Private Access Token set and remove flow changed. We automatically migrate existing keys so this change shouldn't break your existing workflow or you shouln't need to do anyhing. Read more [here](https://gitlab.com/fatihacet/gitlab-vscode-extension#setup) and [here](https://gitlab.com/fatihacet/gitlab-vscode-extension#multiple-gitlab-instances).
- Private Access Token set and remove flow changed. We automatically migrate existing keys so this change shouldn't break your existing workflow or you shouln't need to do anyhing. Read more [here](https://gitlab.com/fatihacet/gitlab-vscode-extension#setup) and [here](https://gitlab.com/fatihacet/gitlab-vscode-extension#multiple-gitlab-instances).
## v0.5.1 - 2018-02-27
### Added
- Add an option to turn off the issue link in the status bar
- Add an option to turn off the issue link in the status bar
## v0.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.
## v0.4.3 - 2018-02-19
### Fixed
- [#19](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/19) Can't add token
- [#19](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/19) Can't add token
## v0.4.2 - 2018-02-18
### Added
- 🎉 [New logo](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/logo.png) _Special thanks to [@ademilter](https://twitter.com/ademilter) for his amazing work_ 👍
- 🎉 [New logo](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/logo.png) _Special thanks to [@ademilter](https://twitter.com/ademilter) for his amazing work_ 👍
### Fixed
- [#14](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/14) GitLab: Open active file on GitLab - workspace path not filtered out
- Fixed by [@swiffer](https://gitlab.com/swiffer) with [MR !1](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/1) 👍
- [#16](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/16) Does not work witch projects in subgroup
- Fixed by [@AmandaCameron](https://gitlab.com/AmandaCameron) with [MR !3](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/3) 👍
## v0.4.1 - 2018-02-10
### Fixed
- [#17](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/17) Cross project closing issue goes to wrong URL.
## v0.4.0 - 2018-02-02
### Added
- Added search feature for MRs and Issues. Supports basic and advanced search.
- For basic search, just type anything and hit Enter. Extension will search in title and description fields of MRs and issues.
- For advanced search, you can use multiple tokens to search issues and MRs where tokens can be `title`, `author`, `assignee`, `labels`, `label`, `milestone`, `state`, `scope`. Some example usages:
......@@ -221,56 +256,66 @@
- Added MIT License
### Changed
- Pipeline not found text on status bar will be hidden if there is no GL project.
- Significantly reduced timing of opening current MR from status bar.
## v0.3.4 - 2018-02-01
### Fixed
- [#12](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/12) Fix fetching git remote and tracking branch names.
- [#12](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/12) Fix fetching git remote and tracking branch names.
## v0.3.3 - 2018-02-01
### Fixed
- Fixed slient failing of status bar items and hide them on error.
- Fixed slient failing of status bar items and hide them on error.
## v0.3.2 - 2018-01-31
### Fixed
- Fixed fetching remote url. Thanks to @kushalpandya.
- Fixed fetching remote url. Thanks to @kushalpandya.
## v0.3.1 - 2018-01-30
### Changed
- Clicking the pipeline status text on status bar now opens Pipeline action picker.
- Clicking the pipeline status text on status bar now opens Pipeline action picker.
## v0.3.0 - 2018-01-30
### Added
- Pipeline actions picker
- View latest pipeline on GitLab.com
- Create a new pipeline for your current branch
- Retry last pipeline
- Cancel last pipeline
## v0.2.2 - 2018-01-29
### Added
- Added a new command to open current pipeline on GitLab.
- Added click handler to pipeline status text on status bar to open pipeline on GitLab.
- Added refresh interval for MR link on status bar.
### Fixed
- [#9](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/9) Branch names with slashes appear to break URL generation
- [#9](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/9) Branch names with slashes appear to break URL generation
## v0.2.1 - 2018-01-28
### Fixed
- Update pipeline status on status bar.
- Update pipeline status on status bar.
## v0.2.0 - 2018-01-27
### Added
- Added a new service layer to opearate git commands.
- Added a new service layer to talk with GitLab API.
- Added new methods to get info from Git and GitLab.
......@@ -283,10 +328,12 @@
- Implemented open GitLab to create new issue.
### Changed
- Deprecated `gitlab.userId`.
- Show assigned Issues and MRs now work project specific.
### Fixed
- [#7](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/7) Remove hardcoded origin in fetchGitRemote method.
- [#3](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/3) Assigned MR and issues openers should be project specific
- [#1](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/1) Local branch name and tracking remote branch name may not be the same
......@@ -295,8 +342,9 @@
- [#5](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/5) Pipeline info won't be visible in status bar if there is no MR
- [#2](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/4) Remove own MR requirement to find branch MR
## v0.1.1 - 2018-01-25
### Added
- Implemented show issues assigned to me.
- Implemented show merge requests assigned to me.
......@@ -83,6 +83,7 @@ Once project is cloned, open terminal within the project folder and run followin
```bash
yarn install
yarn webview
```
This command will install all necessary dependencies to run and debug extension in developer mode.
......@@ -92,6 +93,24 @@ This command will install all necessary dependencies to run and debug extension
Open VS Code and then open GitLab Workflow project and then you can follow [Running and debugging your extension](https://code.visualstudio.com/docs/extensions/developing-extensions#_running-and-debugging-your-extension)
section from VS Code documentation.
#### Step - 5 : Run tests
To run tests, open terminal within the project folder and run following;
```bash
yarn compile
yarn test
```
#### Step - 5 : Run linter
To run linters, open terminal within the project folder and run following;
```bash
yarn format
yarn eslint
```
### Code Contribution For Beginners
For newcomers to the project, you can take a look at issues labelled as `Contributions Welcome`
......
......@@ -4,12 +4,10 @@
This extension integrates GitLab to VSCode by adding a new GitLab sidebar where you can find issues and merge requests created by you or assigned to you. It also extends VSCode command palette and status bar to provide more information about your project.
## Screencast
[![video-cover](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/screencast-cover.jpg)](https://www.youtube.com/watch?v=XcxsF0lWBhA)
## Features
- See your issues and MRs on a dedicated panel in the VSCode sidebar. [Read more](#sidebar)
......@@ -31,6 +29,7 @@ This extension integrates GitLab to VSCode by adding a new GitLab sidebar where
- Open the merge request page to create a merge request.
- Set and remove your GitLab Personal Access Token. _Required step, see [Setup](#setup) section below._
- Supports multiple GitLab instances [Read more](#multiple-gitlab-instances).
- Supports custom custom queries [Read more](#custom-queries)
## Experimental Features
......@@ -44,12 +43,12 @@ GitLab Workflow allows you to view issue details and comments right in the VSCod
Updating assignees and labels are also not implemented. However, you can use [GitLab Slash Commands](https://docs.gitlab.com/ee/integration/slash_commands.html) to perform actions directly from VSCode. For example, to assign an issue to `@fatihacet`, simply add a comment `/assign @fatihacet` inside VSCode.
## Setup
To use this extension, you need to create a GitLab Personal Access Token and give it to the extension.
##### Step 1: Create your Personal Access Token
- If you are using
- GitLab.com [click to open Personal Access Tokens page](https://gitlab.com/profile/personal_access_tokens).
- Self-hosted GitLab instance go to "Settings" and click "Access Tokens" on the left navigation menu
......@@ -61,6 +60,7 @@ To use this extension, you need to create a GitLab Personal Access Token and giv
- Copy the token. _Remember you won't be able to see the value of this token ever again for security reasons._
##### Step 2: Add token to GitLab Workflow Extension
- Open up Command Palette by pressing `Cmd+Shift+P`.
- Search for "GitLab: Set GitLab Personal Access Token" and hit Enter.
- Enter the URL to the Gitlab instance the PAT should apply to and hit Enter.
......@@ -77,7 +77,6 @@ You can start using this extension right away. If your project has a pipeline fo
If you want to use multiple GitLab instances you may want to configure each workspace separately. See `gitlab.instanceUrl` config option in [Configuration Options](#configuration-options) section.
## Configuration options
**`gitlab.instanceUrl`** _(required: false, default: "https://gitlab.com")_
......@@ -110,7 +109,7 @@ If your self-hosted GitLab instance requires a custom cert/key pair you would pr
If your self-hosted GitLab instance requires a custom cert/key pair you would probably need to set this option in to point your certificate key file. Please also see `gitlab.cert` option. More information [here](https://gitlab.com/fatihacet/gitlab-vscode-extension/merge_requests/29#note_132284448).
**`gitlab.ignoreCertificateErrors`** _(required: false, default: false)_
**`gitlab.ignoreCertificateErrors`** _(required: false, default: false)_
If you are using a self-hosted GitLab instance with no SSL certificate or having certificate issues and unable to use the extension you may want to set this option to `true` to ignore certificate errors. More information can be found [here](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues/26#note_61312786).
......@@ -124,13 +123,98 @@ The name of the git remote link corresponding to the GitLab repositiory with you
The name of the git remote link corresponding to the GitLab repositiory with your pipelines. If no setting is provided, the extension will detect it. For example: origin.
**`gitlab.enableExperimentalFeatures`** _(required: false, default: false)_
**`gitlab.enableExperimentalFeatures`** _(required: false, default: false)_
To enable experimental features set this flag to `true`. List of experiemental features and details can be found [here](#experiemental-features)
**`gitlab.customQueries`** _(required: false)_
Defines the search queries that retrives the items shown on the Gitlab Panel. See [#custom-queries] for more details.
### Custom Queries
You can define custom queries in your VS Code configuration.
Example:
```json
{
"gitlab.customQueries": [
{
"name": "Issues assigned to me",
"type": "issues",
"scope": "assigned_to_me",
"noItemText": "There is no issue assigned to you.",
"state": "opened"
}
]
}
```
Each query is an entry of the json array. Each entry can have the following values:
**`name`** _(required: true)_ : The label to show in the GitLab panel
**`type`** _(required: false, default: merge\_requests)_ : The type of GitLab items to return. If snippets is selected, none of the other filter will work. Epics will work only on GitLab ultimate/gold. Possible values: issues, merge_requests, epics, snippets, vulnerabilities.
**`noItemText`** _(required: false, default: "No items found.")_ : The text to show if the query returns no items.
**`maxResults`** _(required: false, default: 20)_ : The maximum number of results to show
**`orderBy`** _(required: false, default: created\_at)_ : Return issues ordered by the selected value. It is not applicable for vulnerabilities. Possible values: created_at, updated_at, priority, due_date, relative_position, label_priority, milestone_due, popularity, weight.
**`sort`** _(required: false, default: desc)_ : Return issues sorted in ascending or descending order. It is not applicable for vulnerabilities. Possible values: asc, desc.
**`scope`** _(required: false, default: all)_ : Return Gitlab items for the given scope. It is not applicable for epics. Possible values: assigned_to_me, created_by_me, dismissed, all. "assigned_to_me" and "created_by_me" are not applicable for vulnerabilities. "dismissed" is not applicable for issues and merge requests.
**`state`** _(required: false, default: opened)_ : "Return "all" issues or just those that are "opened" or "closed". It is not applicable for vulnerabilities. Possible values: all, opened, closed.
**`labels`** _(required: false, default: [])_ : Array of label names, Gitlab item must have all labels to be returned. "None" lists all GitLab items with no labels. "Any" lists all GitLab issues with at least one label. Predefined names are case-insensitive. It is not applicable for vulnerabilities.
**`excludeLabels`** _(required: false, default: [])_ : Array of label names, Gitlab item must not have to be returned. Predefined names are case-insensitive. Works only with issues
**`milestone`** _(required: false)_ : The milestone title. None lists all GitLab items with no milestone. Any lists all GitLab items that have an assigned milestone. It is not applicable for epics and vulnerabilities.
**`excludeMilestone`** _(required: false)_ : The milestone title to exclude. Works only with issues.
**`author`** _(required: false)_ : Return GitLab items created by the given username. It is not applicable for vulnerabilities.
**`excludeAuthor`** _(required: false)_ : Return GitLab items not created by the given username. Works only with issues.
**`assignee`** _(required: false)_ : Returns GitLab items assigned to the given username. "None" returns unassigned GitLab items. "Any" returns GitLab items with an assignee. It is not applicable for epics and vulnerabilities.
**`excludeAssignee`** _(required: false)_ : ": Returns GitLab items not assigned to the given username. Works only with issues.
**`search`** _(required: false)_ : Search GitLab items against their title and description. It is not applicable for vulnerabilities.
**`excludeSearch`** _(required: false)_ : Search GitLab items that doesn't have the search key in their title or description. Works only with issues.
**`searchIn`** _(required: false, default: all)_ : Modify the scope of the search attribute. It is not applicable for epics and vulnerabilities. Possible values: all, title, description.
**`searchIn`** _(required: false, default: all)_ : Modify the scope of the excludeSearch attribute. Works only with issues. Possible values: all, title, description.
**`createdAfter`** _(required: false)_ : Return GitLab items created after the given date. It is not applicable for vulnerabilities.
**`createdBefore`** _(required: false)_ : Return GitLab items created before the given date. It is not applicable for vulnerabilities.
**`updatedAfter`** _(required: false)_ : Return GitLab items updated after the given date. It is not applicable for vulnerabilities.
**`updatedBefore`** _(required: false)_ : Return GitLab items updated before the given date. It is not applicable for vulnerabilities.
**`wip`** _(required: false, default: no)_ : Filter merge requests against their wip status. "yes" to return only WIP merge requests, "no" to return non WIP merge requests. Works only with merge requests.
**`confidential`** _(required: false, default: false)_ : Filter confidential or public issues. Works only with issues.
**`reportTypes`** _(required: false)_ : Returns vulnerabilities belonging to specified report types. Works only with vulnerabilities. Possible values: sast, dast, dependency_scanning, container_scanning.
**`severityLevels`** _(required: false)_ : Returns vulnerabilities belonging to specified severity levels. Defaults to all. Works only with vulnerabilities. Possible values: undefined, info, unknown, low, medium, high, critical.
**`confidenceLevels`** _(required: false)_ : Returns vulnerabilities belonging to specified confidence levels. Defaults to all. Works only with vulnerabilities. Possible values: undefined, ignore, unknown, experimental, low, medium, high, confirmed.
**`pipelineId`** _(required: false)_ : Returns vulnerabilities belonging to specified pipeline. "branch" returns vulnerabilities belonging to latest pipeline of the current branch. Works only with vulnerabilities.
## Usage
- Open up Command Palette by pressing `Cmd+Shift+P`.
- Search for `GitLab:` and you will see all the commands provided by the extension.
......@@ -138,19 +222,18 @@ To enable experimental features set this flag to `true`. List of experiemental f
![https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/pipeline-actions.png](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/pipeline-actions.png)
## Features in-depth
### Sidebar
Extension will add a GitLab Workflow panel to sidebar of your VSCode. The dedicated panel will allow you to see the list of your issues and MRs. Also you will be able to see pipeline, MR and issue links for your current branch.
In the current version, clicking the links will open them on your default browser but the next version will allow you to interact with your issues and MRs right in your VSCode. With the upcoming versions, the extension will allow you to see the MR changes and discussions in VSCode.
![_sidebar.gif](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/_sidebar.gif)
### Pipeline actions
One of the real power features of this extension is pipeline actions. This feature can be accessible from the status bar by clicking the pipeline status text or command palette and allows you to,
- View the latest pipeline on GitLab
......@@ -160,8 +243,8 @@ One of the real power features of this extension is pipeline actions. This featu
![_pipeline_actions.gif](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/_pipeline_actions.gif)
### Status bar
If your current project is a GitLab project, the extension will do the following things:
- Fetch pipeline of the last commit and show it on the status bar. Clicking this item will open the pipeline actions menu.
......@@ -170,70 +253,71 @@ If your current project is a GitLab project, the extension will do the following
![_status_bar.gif](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/_status-bar.gif)
### Advanced Search
GitLab Workflow extension provides you two types of search. Basic and advanced search. Basic search is quick however advanced search is more powerful which allows you to filter issues by author, assignee, milestone, title etc.
To use the basic search, in the search input, you can type your search term and hit Enter. This will search issues/MRs against their title and description fields. Example: `Inconsistent line endings for HEX files` or `Pipelines should ignore retried builds`.
You can perform advanced issue/MR search by using some predefined tokens. Full list below.
|Token|Description|Example|
|-|-|-|
|title|Search issues/MRs against their title and description. You don't need to add quotes around multiple words. See Important notes section.|discussions refactor|
|labels|Comma separated label list for multiple labels.|`labels: frontend, Discussion, performance`|
|label|To search with a single label. You can also have multiple `label` tokens.|`label: frontend` or `label:frontend label: Discussion`
|milestone|Milestone title without `%`.|`milestone: 9.5`|
|scope|Searches issues/MRs for the given scope. Values can be `created-by-me`, `assigned-to-me` or `all`. Defaults to `created-by-me`.|`scope: created-by-me` or `scope: assigned-to-me` or `scope: all`.|
|author|Username of the author without `@`.|`author: fatihacet`|
|assignee|Username of the assignee without `@`.|`assignee: timzallmann`|
| Token | Description | Example |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| title | Search issues/MRs against their title and description. You don't need to add quotes around multiple words. See Important notes section. | discussions refactor |
| labels | Comma separated label list for multiple labels. | `labels: frontend, Discussion, performance` |
| label | To search with a single label. You can also have multiple `label` tokens. | `label: frontend` or `label:frontend label: Discussion` |
| milestone | Milestone title without `%`. | `milestone: 9.5` |
| scope | Searches issues/MRs for the given scope. Values can be `created-by-me`, `assigned-to-me` or `all`. Defaults to `created-by-me`. | `scope: created-by-me` or `scope: assigned-to-me` or `scope: all`. |
| author | Username of the author without `@`. | `author: fatihacet` |
| assignee | Username of the assignee without `@`. | `assignee: timzallmann` |
**Examples**
- `title: new merge request widget author: fatihacet assignee: jschatz1 labels: frontend, performance milestone: 10.5`
- `title: multiple group page author: annabeldunstone assignee: timzallmann label: frontend`
**Important notes**
- `:` after the token name is necessary. `label :` is not a valid token name and may return parsing error. Hence `label:` should be used. However, space after the token name is optional. Both `label: frontend` and `label:frontend` is valid. This rule is valid for all tokens above.
- You don't need to add quotes around multiple words for `title` token. `title:"new merge request widget"` may return parsing error. `title: new merge request widget` should be used.
- You can have `labels` and `label` tokens at the same time. `labels: fronted discussion label: performance` is a valid query and all labels will be included in your search query. It's equal with `labels: fronted discussion performance`. You can also have multiple `label` tokens. `label: frontend label: discussion label: performance` is valid and equals to `labels: fronted discussion performance`.
![_advanced-search.gif](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/_advanced-search.gif)
### Create snippet
You can create a snippet from selection or entire file. You can also select visibility level of your snippet.
![_create-snippet.gif](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/_create-snippet.gif)
### Compare with master
You can see changes in your branch by comparing with `master` and see them on GitLab.
![_compare-with-master.gif](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/_compare-with-master.gif)
> Soon extension will support comparing your current branch with other branches.
### Open active file
This command allows you to see active file on GitLab. Extension sends active line number and selected text block to GitLab UI so you can see them highlighted.
![_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)
### Caveats and known issues
- The current version of the extension doesn't support multi-root workspaces. If you want to know more about limitations and read recent developments, please check [multi-root-workspace](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues?scope=all&utf8=%E2%9C%93&state=all&label_name[]=multi-root-workspace) labeled issues.
-----
- The current version of the extension doesn't support multi-root workspaces. If you want to know more about limitations and read recent developments, please check [multi-root-workspace](https://gitlab.com/fatihacet/gitlab-vscode-extension/issues?scope=all&utf8=%E2%9C%93&state=all&label_name[]=multi-root-workspace) labeled issues.
---
## Contribution
This extension is open source and [hosted on GitLab](https://gitlab.com/fatihacet/gitlab-vscode-extension). Contributions are more than welcome. Feel free to fork and add new features or submit bug reports.
[Here](https://gitlab.com/fatihacet/gitlab-vscode-extension/blob/master/CONTRIBUTORS.md) is the list of great people who contributed this project and make it even more awesome. Thank you all 🎉
此差异已折叠。
......@@ -10,7 +10,7 @@
"url": "https://gitlab.com/fatihacet/gitlab-vscode-extension"
},
"engines": {
"vscode": "^1.19.0"
"vscode": "^1.41.0"
},
"categories": [
"Other"
......@@ -114,7 +114,7 @@
"view/title": [
{
"command": "gl.refreshSidebar",
"when": "view =~ /(issuesAssignedToMe|issuesCreatedByMe|mrsCreatedByMe|mrsAssignedToMe|allProjectMrs|currentBranchInfo)/",
"when": "view =~ /(currentBranchInfo|issuesAndMrs)/",
"group": "navigation"
}
]
......@@ -131,25 +131,8 @@
"views": {
"gitlab-workflow": [
{
"id": "issuesAssignedToMe",
"name": "Issues assigned to me"
},
{
"id": "issuesCreatedByMe",
"name": "Issues created by me"
},
{
"id": "mrsCreatedByMe",
"name": "Merge Requests created by me"
},
{
"id": "mrsAssignedToMe",
"name": "Merge Requests assigned to me"
},
{
"id": "allProjectMrs",
"name": "All Project Merge Requests",
"when": "config.gitlab.showProjectMergeRequests"
"id": "issuesAndMrs",
"name": "Issues and Merge Requests"
},
{
"id": "currentBranchInfo",
......@@ -224,36 +207,317 @@
"type": "boolean",
"default": false,
"description": "Enable experimental features including showing Issue details in VSCode"
},
"gitlab.customQueries": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"title": "Custom GitLab Quety",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The label to show in the GitLab panel"
},
"maxResults": {
"type": "number",
"description": "The maximum number of results to show",
"default": 20,
"maximum": 100,
"minItems": 1
},
"orderBy": {
"type": "string",
"description": "Return issues ordered by the selected value. It is not applicable for vulnerabilities",
"enum": [
"created_at",
"updated_at",
"priority",
"due_date",
"relative_position",
"label_priority",
"milestone_due",
"popularity",
"weight"
],
"default": "created_at"
},
"sort": {
"type": "string",
"description": "Return issues sorted in ascending or descending order. It is not applicable for vulnerabilities",
"enum": [
"asc",
"desc"
],
"default": " desc"
},
"scope": {
"type": "string",
"description": "Return Gitlab items for the given scope. It is not applicable for epics. \"assigned_to_me\" and \"created_by_me\" are not applicable for vulnerabilities. \"dismissed\" is not applicable for issues and merge requests",
"enum": [
"assigned_to_me",
"created_by_me",
"dismissed",
"all"
],
"default": "all"
},
"type": {
"type": "string",
"description": "The type of GitLab items to return. If snippets is selected, none of the other filter will work. Epics will work only on GitLab ultimate/gold.",
"enum": [
"issues",
"merge_requests",
"epics",
"snippets",
"vulnerabilities"
],
"default": "merge_requests"
},
"noItemText": {
"type": "string",
"description": "The text to show if the query returns no items",
"default": "No items found."
},
"state": {
"type": "string",
"description": "Return \"all\" issues or just those that are \"opened\" or \"closed\". It is not applicable for vulnerabilities",
"enum": [
"all",
"opened",
"closed"
],
"default": "opened"
},
"labels": {
"type": "array",
"description": "Array of label names, Gitlab item must have all labels to be returned. \"None\" lists all GitLab items with no labels. \"Any\" lists all GitLab issues with at least one label. Predefined names are case-insensitive. It is not applicable for vulnerabilities",
"items": {
"type": "string"
}
},
"milestone": {
"type": "string",
"description": "The milestone title. \"None\" lists all GitLab items with no milestone. \"Any\" lists all GitLab items that have an assigned milestone. It is not applicable for epics and vulnerabilities"
},
"author": {
"type": "string",
"description": "Return GitLab items created by the given username. It is not applicable for vulnerabilities"
},
"assignee": {
"type": "string",
"description": "Returns GitLab items assigned to the given username. \"None\" returns unassigned GitLab items. \"Any\" returns GitLab items with an assignee. It is not applicable for epics and vulnerabilities"
},
"search": {
"type": "string",
"description": "Search GitLab items against their title and description. It is not applicable for vulnerabilities"
},
"searchIn": {
"type": "string",
"description": "Modify the scope of the search attribute. It is not applicable for epics and vulnerabilities",
"enum": [
"all",
"title",
"description"
],
"default": "all"
},
"createdAfter": {
"type": "string",
"format": "date",
"description": "Return GitLab items created after the given date. It is not applicable for vulnerabilities"
},
"createdBefore": {
"type": "string",
"format": "date",
"description": "Return GitLab items created before the given date. It is not applicable for vulnerabilities"
},
"updatedAfter": {
"type": "string",
"format": "date",
"description": "Return GitLab items updated after the given date. It is not applicable for vulnerabilities"
},
"updatedBefore": {
"type": "string",
"format": "date",
"description": "Return GitLab items updated before the given date. It is not applicable for vulnerabilities"
},
"wip": {
"type": "string",
"enum": [
"yes",
"no"
],
"description": "Filter merge requests against their wip status. \"yes\" to return only WIP merge requests, \"no\" to return non WIP merge requests. Works only with merge requests",
"default": "no"
},
"confidential": {
"type": "boolean",
"description": "Filter confidential or public issues. Works only with issues",
"default": false
},
"excludeLabels": {
"type": "array",
"description": "Array of label names, Gitlab item must not have to be returned. Predefined names are case-insensitive. Works only with issues",
"items": {
"type": "string"
}
},
"excludeMilestone": {
"type": "string",
"description": "The milestone title to exclude. Works only with issues"
},
"excludeAuthor": {
"type": "string",
"description": "Return GitLab items not created by the given username. Works only with issues"
},
"excludeAssignee": {
"type": "string",
"description": "Returns GitLab items not assigned to the given username. Works only with issues"
},
"excludeSearch": {
"type": "string",
"description": "Search GitLab items that doesn't have the search key in their title or description. Works only with issues"
},
"excludeSearchIn": {
"type": "string",
"description": "Modify the scope of the excludeSearch attribute. Works only with issues",
"enum": [
"all",
"title",
"description"
],
"default": "all"
},
"reportTypes": {
"type": "array",
"description": "Returns vulnerabilities belonging to specified report types. Works only with vulnerabilities",
"items": {
"type": "string",
"enum": [
"sast",
"dast",
"dependency_scanning",
"container_scanning"
]
}
},
"severityLevels": {
"type": "array",
"description": "Returns vulnerabilities belonging to specified severity levels. Defaults to all. Works only with vulnerabilities",
"items": {
"type": "string",
"enum": [
"undefined",
"info",
"unknown",
"low",
"medium",
"high",
"critical"
]
}
},
"confidenceLevels": {
"type": "array",
"description": "Returns vulnerabilities belonging to specified confidence levels. Defaults to all. Works only with vulnerabilities",
"items": {
"type": "string",
"enum": [
"undefined",
"ignore",
"unknown",
"experimental",
"low",
"medium",
"high",
"confirmed"
]
}
},
"pipelineId": {
"type": "string",
"description": "Returns vulnerabilities belonging to specified pipeline. \"branch\" returns vulnerabilities belonging to latest pipeline of the current branch. Works only with vulnerabilities"
}
}
},
"default": [
{
"name": "Issues assigned to me",
"type": "issues",
"scope": "assigned_to_me",
"state": "opened",
"noItemText": "There is no issue assigned to you."
},
{
"name": "Issues created by me",
"type": "issues",
"scope": "created_by_me",
"state": "opened",
"noItemText": "There is no issue created by you."
},
{
"name": "Merge requests assigned to me",
"type": "merge_requests",
"scope": "assigned_to_me",
"state": "opened",
"noItemText": "There is no MR assigned to you."
},
{
"name": "Merge requests created by me",
"type": "merge_requests",
"scope": "created_by_me",
"state": "opened",
"noItemText": "There is no MR created by you."
},
{
"name": "All project merge requests",
"type": "merge_requests",
"scope": "all",
"state": "opened",
"noItemText": "The project has no merge requests"
}
],
"description": "Custom views in the GitLab panel"
}
}
}
},
"scripts": {
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "node ./node_modules/vscode/bin/test",
"eslint": "eslint --max-warnings 0 --ext .js .",
"format": "prettier --write '**/*.{js,json}'",
"publish": "vsce publish",
"webview": "cd src/webview ; yarn build --watch"
"vscode:prepublish": "yarn run compile",
"compile": "node_modules/.bin/tsc -p ./",
"watch": "node_modules/.bin/tsc -watch -p ./",
"test": "node ./out/runTest.js",
"eslint": "node_modules/.bin/eslint --max-warnings 0 --ext .js .",
"format": "node_modules/.bin/prettier --write '**/*.{js,json}'",
"publish": "node_modules/.bin/vsce publish",
"webview": "cd src/webview ; yarn install ; yarn watch"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.21",
"rewire": "^4.0.0",
"eslint": "^4.18.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-prettier": "^2.6.0",
"prettier": "^1.11.0",
"typescript": "^3.3.1",
"vscode": "^1.1.26"
"@types/mocha": "^7.0.1",
"@types/node": "^13.7.0",
"@types/vscode": "^1.41.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-prettier": "^3.1.2",
"mocha": "^7.0.1",
"prettier": "^1.19.1",
"rewire": "^4.0.1",
"typescript": "^3.7.5",
"vsce": "^1.72.0",
"vscode-test": "^1.3.0"
},
"dependencies": {
"eslint-plugin-vue-libs": "^4.0.0",
"execa": "^1.0.0",
"moment": "^2.24.0",
"request": "^2.88.0",
"request-promise": "^4.2.2",
"request-promise": "^4.2.5",
"url": "^0.11.0"
}
}
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#C5C5C5" fill-rule="evenodd" d="M8,8.17157 L13,3.17157 L13,3 L3,3 L3,3.17157 L8,8.17157 Z M7.49796,15.8664 L9.49796,14.718 C9.80851,14.5396 10,14.2089 10,13.8508 L10,9 L14.7071,4.29289 C14.8946,4.10536 15,3.851 15,3.58579 L15,2 C15,1.44772 14.5523,1 14,1 L2,1 C1.44772,1 1,1.44772 1,2 L1,3.58579 C1,3.851 1.10536,4.10536 1.29289,4.29289 L6,9 L6,14.9992 C6,15.768 6.8313,16.2492 7.49796,15.8664 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#C5C5C5" fill-rule="evenodd" d="M12.3911376,1.00166302 C12.8433376,1.00174802 13.2392376,1.30536402 13.3566376,1.74212402 L14.9691376,7.74209402 C15.1399376,8.37744402 14.6611376,9.00172402 14.0032376,9.00163402 L3.00103757,9.00016402 L3.00103757,10.003784 L13.0010376,10.003784 C13.5533376,10.003784 14.0010376,10.451484 14.0010376,11.003784 C14.0010376,11.556084 13.5533376,12.003784 13.0010376,12.003784 L4.00103757,12.003784 L4.00103757,13.003784 L12.0010376,13.003784 C12.5533376,13.003784 13.0010376,13.451484 13.0010376,14.003784 C13.0010376,14.556084 12.5533376,15.003784 12.0010376,15.003784 L4.00103757,15.003784 C2.89646757,15.003784 2.00103757,14.108384 2.00103757,13.003784 L2.00103757,11.736184 C1.40323757,11.390384 1.00103757,10.744084 1.00103757,10.003784 L1.00103757,8.04725402 C0.996438566,7.94705402 1.00702757,7.84391402 1.03481757,7.74048402 L2.64732757,1.74046402 C2.76474757,1.30356402 3.16084757,1 3.61324757,1 L12.3911376,1.00166302 Z M11.6241376,3.00151402 L12.6991376,7.00145402 L3.30473757,7.00020402 L4.37975757,3.00014402 L11.6241376,3.00151402 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#C5C5C5" fill-rule="evenodd" d="M1,3 C1,1.89543 1.89543,1 3,1 L9,1 C9.96059,1 10.763,1.6772 10.9559,2.58023 L13.9947,4.33469 C14.9513,4.88698 15.279,6.11016 14.7267,7.06674 C13.4456,9.28574 11,13.5146 10.8452,13.7866 C10.457,14.4688 9.81319,15 9,15 L3,15 C1.89543,15 1,14.1046 1,13 L1,3 Z M3,3 L9,3 L9,13 L3,13 L3,3 Z M11,9.52164 L12.9947,6.06674 L11,4.91511 L11,9.52164 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#C5C5C5" fill-rule="evenodd" d="M10,0 L10,2.60002 C12.2108812,3.04881281 13.8920863,4.95644867 13.9950026,7.27443311 L14,7.5 L14,11.2676 C14.5978,11.6134 15,12.2597 15,13 C15,14.1046 14.1046,15 13,15 C11.8954,15 11,14.1046 11,13 C11,12.3166462 11.342703,11.713387 11.8656124,11.3526403 L12,11.2676 L12,7.5 C12,6.259091 11.246593,5.19415145 10.1722389,4.73766702 L10,4.67071 L10,7 L6,3.5 L10,0 Z M3,1 C4.10457,1 5,1.89543 5,3 C5,3.68333538 4.65729704,4.28663574 4.13438762,4.6473967 L4,4.73244 L4,11.2676 C4.5978,11.6134 5,12.2597 5,13 C5,14.1046 4.10457,15 3,15 C1.89543,15 1,14.1046 1,13 C1,12.3166462 1.34270296,11.713387 1.86561238,11.3526403 L2,11.2676 L2,4.73244 C1.4022,4.38663 1,3.74028 1,3 C1,1.89543 1.89543,1 3,1 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#C5C5C5" fill-rule="evenodd" d="M8,0 C12.4183,0 16,3.58172 16,8 C16,12.4183 12.4183,16 8,16 C3.58172,16 0,12.4183 0,8 C0,3.58172 3.58172,0 8,0 Z M8.99665,2.0824 C8.95475,2.59614 8.52454,3 8,3 C7.47546,3 7.04525,2.59614 7.00335,2.0824 C6.20919,2.21517 5.46786,2.50394 4.81194,2.91613 C4.93028,3.08041 5,3.28206 5,3.5 C5,4.05228 4.55228,4.5 4,4.5 C3.74005,4.5 3.50327,4.40081 3.32544,4.23822 C2.89297,4.77495 2.55104,5.3877 2.32287,6.05327 C2.71672,6.18755 3,6.56069 3,7 C3,7.55228 2.55228,8 2,8 C2,11.3137 4.68629,14 8,14 C11.3137,14 14,11.3137 14,8 C13.4477,8 13,7.55228 13,7 C13,6.56069 13.2833,6.18755 13.6771,6.05327 C13.449,5.3877 13.107,4.77495 12.6746,4.23822 C12.4967,4.40081 12.2599,4.5 12,4.5 C11.4477,4.5 11,4.05228 11,3.5 C11,3.28206 11.0697,3.08041 11.1881,2.91613 C10.5321,2.50394 9.79081,2.21517 8.99665,2.0824 Z M8,4 L9,5 L9,8.26756 C9.5978,8.61337 10,9.25972 10,10 C10,11.1046 9.10457,12 8,12 C6.89543,12 6,11.1046 6,10 C6,9.25972 6.4022,8.61337 7,8.26756 L7,5 L8,4 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#C5C5C5" fill-rule="evenodd" d="M3,1 L9.17157,1 C9.64307222,1 10.0973893,1.16648691 10.4559723,1.46691468 L10.5858,1.58579 L13.4142,4.41421 C13.7476222,4.74761444 13.9511481,5.18659519 13.9922598,5.65257532 L14,5.82843 L14,14 C14,14.51285 13.613973,14.9355092 13.1166239,14.9932725 L13,15 L3,15 C2.48716857,15 2.06449347,14.613973 2.0067278,14.1166239 L2,14 L2,2 C2,1.48716857 2.38604429,1.06449347 2.88337975,1.0067278 L3,1 L9.17157,1 L3,1 Z M9,3 L4,3 L4,13 L12,13 L12,6 L10,6 C9.48715929,6 9.06449214,5.61395571 9.00672766,5.11662025 L9,5 L9,3 Z M6,10 L8,10 C8.55228,10 9,10.4477 9,11 C9,11.51285 8.61395571,11.9355092 8.11662025,11.9932725 L8,12 L6,12 C5.44772,12 5,11.5523 5,11 C5,10.48715 5.38604429,10.0644908 5.88337975,10.0067275 L6,10 Z M10,7 C10.5523,7 11,7.44772 11,8 C11,8.55228 10.5523,9 10,9 L6,9 C5.44772,9 5,8.55228 5,8 C5,7.44772 5.44772,7 6,7 L10,7 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3-.795 0-1.545-.311-2.107-.868-.563-.567-.873-1.317-.873-2.111 0-1.431 1.007-2.632 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012l3.061-2.582-4.919-4.1h-1.137v2.404c-3.429.318-6.121 3.211-6.121 6.721 0 1.809.707 3.508 1.986 4.782 1.277 1.282 2.976 1.988 4.784 1.988 3.722 0 6.75-3.028 6.75-6.75 0-1.245-.349-2.468-1.007-3.536z" fill="#2D2D30"/><path d="M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4-1.098 0-2.093-.445-2.817-1.164-.718-.724-1.163-1.718-1.163-2.815 0-2.206 1.794-4 4-4l.351.025v1.85s1.626-1.342 1.631-1.339l1.869-1.577-3.5-2.917v2.218l-.371-.03c-3.176 0-5.75 2.574-5.75 5.75 0 1.593.648 3.034 1.695 4.076 1.042 1.046 2.482 1.694 4.076 1.694 3.176 0 5.75-2.574 5.75-5.75-.001-1.106-.318-2.135-.859-3.012z" fill="#C5C5C5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<path fill="#2D2D30" d="M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3-.795 0-1.545-.311-2.107-.868-.563-.567-.873-1.317-.873-2.111 0-1.431 1.007-2.632 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012l3.061-2.582-4.919-4.1h-1.137v2.404c-3.429.318-6.121 3.211-6.121 6.721 0 1.809.707 3.508 1.986 4.782 1.277 1.282 2.976 1.988 4.784 1.988 3.722 0 6.75-3.02 6.75-6.75 0-1.245-.349-2.468-1.007-3.536z"/>
<path fill="#C5C5C5" d="M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4-1.098 0-2.093-.445-2.817-1.164-.718-.724-1.163-1.718-1.163-2.815 0-2.206 1.794-4 4-4l.351.025v1.85s1.626-1.342 1.631-1.339l1.869-1.577-3.5-2.917v2.218l-.371-.03c-3.176 0-5.75 2.574-5.75 5.75 0 1.593.648 3.034 1.695 4.076 1.042 1.046 2.482 1.694 4.076 1.694 3.176 0 5.75-2.574 5.75-5.75-.001-1.106-.318-2.135-.859-3.012z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#C5C5C5" fill-rule="evenodd" d="M11.168,0.945405629 C11.4743,0.485877629 12.0952,0.361703629 12.5547,0.668055629 C13.0142,0.974408629 13.1384,1.59527663 12.8321,2.05480663 L9.37707,7.23729663 L11.3107,9.91461663 C11.3445,9.96146663 11.3737,10.0103066 11.3984,10.0604066 C11.5927,10.0209066 11.7939,10.0001066 12,10.0001066 C13.6569,10.0001066 15,11.3432066 15,13.0001066 C15,14.6570066 13.6569,16.0001066 12,16.0001066 C10.34315,16.0001066 9,14.6570066 9,13.0001066 C9,12.2726066 9.25896,11.6056066 9.68974,11.0862066 L8.19288,9.01358663 L7.83207,9.55480663 C7.52571,10.0143066 6.90484,10.1385066 6.44532,9.83215663 C5.98579,9.52580663 5.86161,8.90493663 6.16797,8.44540663 L6.94296,7.28291663 L3.18933,2.08559663 C2.86598,1.63787663 2.9668,1.01278663 3.41452,0.689428629 C3.86225,0.366070629 4.48733,0.466890629 4.81069,0.914616629 L8.12715,5.50663663 L11.168,0.945405629 Z M11,13.0001066 C11,13.5524066 11.4477,14.0001066 12,14.0001066 C12.5523,14.0001066 13,13.5524066 13,13.0001066 C13,12.4478066 12.5523,12.0001066 12,12.0001066 C11.4477,12.0001066 11,12.4478066 11,13.0001066 Z M4,10.0001066 C5.65685,10.0001066 7,11.3432066 7,13.0001066 C7,14.6570066 5.65685,16.0001066 4,16.0001066 C2.34315,16.0001066 1,14.6570066 1,13.0001066 C1,11.3432066 2.34315,10.0001066 4,10.0001066 Z M3,13.0001066 C3,13.5524066 3.44772,14.0001066 4,14.0001066 C4.55228,14.0001066 5,13.5524066 5,13.0001066 C5,12.4478066 4.55228,12.0001066 4,12.0001066 C3.44772,12.0001066 3,12.4478066 3,13.0001066 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#C5C5C5" fill-rule="evenodd" d="M4.667 3h6.666C12.253 3 13 3.746 13 4.667v6.666c0 .92-.746 1.667-1.667 1.667H4.667C3.747 13 3 12.254 3 11.333V4.667C3 3.747 3.746 3 4.667 3z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#C5C5C5" d="M8,0 L15,2 L15,5.68629 C15,7.80802 14.1571,9.84285 12.6569,11.3431 L8,16 L3.34314,11.3431 C1.84285,9.84285 1,7.80802 1,5.68629 L1,2 L8,0 Z M8,2.08003 L3,3.5086 L3,5.68629 C3,7.27759 3.63214,8.80371 4.75736,9.92893 L8,13.1716 L11.2426,9.92893 C12.3679,8.80371 13,7.27759 13,5.68629 L13,3.5086 L8,2.08003 Z M8,4 L8,10.3594 L6.18269,8.55626 C5.42575,7.80523 5,6.78306 5,5.71676 L5,5 L8,4 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#424242" fill-rule="evenodd" d="M8,8.17157 L13,3.17157 L13,3 L3,3 L3,3.17157 L8,8.17157 Z M7.49796,15.8664 L9.49796,14.718 C9.80851,14.5396 10,14.2089 10,13.8508 L10,9 L14.7071,4.29289 C14.8946,4.10536 15,3.851 15,3.58579 L15,2 C15,1.44772 14.5523,1 14,1 L2,1 C1.44772,1 1,1.44772 1,2 L1,3.58579 C1,3.851 1.10536,4.10536 1.29289,4.29289 L6,9 L6,14.9992 C6,15.768 6.8313,16.2492 7.49796,15.8664 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#424242" fill-rule="evenodd" d="M12.3911376,1.00166302 C12.8433376,1.00174802 13.2392376,1.30536402 13.3566376,1.74212402 L14.9691376,7.74209402 C15.1399376,8.37744402 14.6611376,9.00172402 14.0032376,9.00163402 L3.00103757,9.00016402 L3.00103757,10.003784 L13.0010376,10.003784 C13.5533376,10.003784 14.0010376,10.451484 14.0010376,11.003784 C14.0010376,11.556084 13.5533376,12.003784 13.0010376,12.003784 L4.00103757,12.003784 L4.00103757,13.003784 L12.0010376,13.003784 C12.5533376,13.003784 13.0010376,13.451484 13.0010376,14.003784 C13.0010376,14.556084 12.5533376,15.003784 12.0010376,15.003784 L4.00103757,15.003784 C2.89646757,15.003784 2.00103757,14.108384 2.00103757,13.003784 L2.00103757,11.736184 C1.40323757,11.390384 1.00103757,10.744084 1.00103757,10.003784 L1.00103757,8.04725402 C0.996438566,7.94705402 1.00702757,7.84391402 1.03481757,7.74048402 L2.64732757,1.74046402 C2.76474757,1.30356402 3.16084757,1 3.61324757,1 L12.3911376,1.00166302 Z M11.6241376,3.00151402 L12.6991376,7.00145402 L3.30473757,7.00020402 L4.37975757,3.00014402 L11.6241376,3.00151402 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#424242" fill-rule="evenodd" d="M1,3 C1,1.89543 1.89543,1 3,1 L9,1 C9.96059,1 10.763,1.6772 10.9559,2.58023 L13.9947,4.33469 C14.9513,4.88698 15.279,6.11016 14.7267,7.06674 C13.4456,9.28574 11,13.5146 10.8452,13.7866 C10.457,14.4688 9.81319,15 9,15 L3,15 C1.89543,15 1,14.1046 1,13 L1,3 Z M3,3 L9,3 L9,13 L3,13 L3,3 Z M11,9.52164 L12.9947,6.06674 L11,4.91511 L11,9.52164 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#424242" fill-rule="evenodd" d="M10,0 L10,2.60002 C12.2108812,3.04881281 13.8920863,4.95644867 13.9950026,7.27443311 L14,7.5 L14,11.2676 C14.5978,11.6134 15,12.2597 15,13 C15,14.1046 14.1046,15 13,15 C11.8954,15 11,14.1046 11,13 C11,12.3166462 11.342703,11.713387 11.8656124,11.3526403 L12,11.2676 L12,7.5 C12,6.259091 11.246593,5.19415145 10.1722389,4.73766702 L10,4.67071 L10,7 L6,3.5 L10,0 Z M3,1 C4.10457,1 5,1.89543 5,3 C5,3.68333538 4.65729704,4.28663574 4.13438762,4.6473967 L4,4.73244 L4,11.2676 C4.5978,11.6134 5,12.2597 5,13 C5,14.1046 4.10457,15 3,15 C1.89543,15 1,14.1046 1,13 C1,12.3166462 1.34270296,11.713387 1.86561238,11.3526403 L2,11.2676 L2,4.73244 C1.4022,4.38663 1,3.74028 1,3 C1,1.89543 1.89543,1 3,1 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#424242" fill-rule="evenodd" d="M8,0 C12.4183,0 16,3.58172 16,8 C16,12.4183 12.4183,16 8,16 C3.58172,16 0,12.4183 0,8 C0,3.58172 3.58172,0 8,0 Z M8.99665,2.0824 C8.95475,2.59614 8.52454,3 8,3 C7.47546,3 7.04525,2.59614 7.00335,2.0824 C6.20919,2.21517 5.46786,2.50394 4.81194,2.91613 C4.93028,3.08041 5,3.28206 5,3.5 C5,4.05228 4.55228,4.5 4,4.5 C3.74005,4.5 3.50327,4.40081 3.32544,4.23822 C2.89297,4.77495 2.55104,5.3877 2.32287,6.05327 C2.71672,6.18755 3,6.56069 3,7 C3,7.55228 2.55228,8 2,8 C2,11.3137 4.68629,14 8,14 C11.3137,14 14,11.3137 14,8 C13.4477,8 13,7.55228 13,7 C13,6.56069 13.2833,6.18755 13.6771,6.05327 C13.449,5.3877 13.107,4.77495 12.6746,4.23822 C12.4967,4.40081 12.2599,4.5 12,4.5 C11.4477,4.5 11,4.05228 11,3.5 C11,3.28206 11.0697,3.08041 11.1881,2.91613 C10.5321,2.50394 9.79081,2.21517 8.99665,2.0824 Z M8,4 L9,5 L9,8.26756 C9.5978,8.61337 10,9.25972 10,10 C10,11.1046 9.10457,12 8,12 C6.89543,12 6,11.1046 6,10 C6,9.25972 6.4022,8.61337 7,8.26756 L7,5 L8,4 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#424242" fill-rule="evenodd" d="M3,1 L9.17157,1 C9.64307222,1 10.0973893,1.16648691 10.4559723,1.46691468 L10.5858,1.58579 L13.4142,4.41421 C13.7476222,4.74761444 13.9511481,5.18659519 13.9922598,5.65257532 L14,5.82843 L14,14 C14,14.51285 13.613973,14.9355092 13.1166239,14.9932725 L13,15 L3,15 C2.48716857,15 2.06449347,14.613973 2.0067278,14.1166239 L2,14 L2,2 C2,1.48716857 2.38604429,1.06449347 2.88337975,1.0067278 L3,1 L9.17157,1 L3,1 Z M9,3 L4,3 L4,13 L12,13 L12,6 L10,6 C9.48715929,6 9.06449214,5.61395571 9.00672766,5.11662025 L9,5 L9,3 Z M6,10 L8,10 C8.55228,10 9,10.4477 9,11 C9,11.51285 8.61395571,11.9355092 8.11662025,11.9932725 L8,12 L6,12 C5.44772,12 5,11.5523 5,11 C5,10.48715 5.38604429,10.0644908 5.88337975,10.0067275 L6,10 Z M10,7 C10.5523,7 11,7.44772 11,8 C11,8.55228 10.5523,9 10,9 L6,9 C5.44772,9 5,8.55228 5,8 C5,7.44772 5.44772,7 6,7 L10,7 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3-.795 0-1.545-.311-2.107-.868-.563-.567-.873-1.317-.873-2.111 0-1.431 1.007-2.632 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012l3.061-2.582-4.919-4.1h-1.137v2.404c-3.429.318-6.121 3.211-6.121 6.721 0 1.809.707 3.508 1.986 4.782 1.277 1.282 2.976 1.988 4.784 1.988 3.722 0 6.75-3.028 6.75-6.75 0-1.245-.349-2.468-1.007-3.536z" fill="#F6F6F6"/><path d="M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4-1.098 0-2.093-.445-2.817-1.164-.718-.724-1.163-1.718-1.163-2.815 0-2.206 1.794-4 4-4l.351.025v1.85s1.626-1.342 1.631-1.339l1.869-1.577-3.5-2.917v2.218l-.371-.03c-3.176 0-5.75 2.574-5.75 5.75 0 1.593.648 3.034 1.695 4.076 1.042 1.046 2.482 1.694 4.076 1.694 3.176 0 5.75-2.574 5.75-5.75-.001-1.106-.318-2.135-.859-3.012z" fill="#424242"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<path fill="#F6F6F6" d="M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3-.795 0-1.545-.311-2.107-.868-.563-.567-.873-1.317-.873-2.111 0-1.431 1.007-2.632 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012l3.061-2.582-4.919-4.1h-1.137v2.404c-3.429.318-6.121 3.211-6.121 6.721 0 1.809.707 3.508 1.986 4.782 1.277 1.282 2.976 1.988 4.784 1.988 3.722 0 6.75-3.028 6.75-6.75 0-1.245-.349-2.468-1.007-3.536z"/>
<path fill="#424242" d="M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4-1.098 0-2.093-.445-2.817-1.164-.718-.724-1.163-1.718-1.163-2.815 0-2.206 1.794-4 4-4l.351.025v1.85s1.626-1.342 1.631-1.339l1.869-1.577-3.5-2.917v2.218l-.371-.03c-3.176 0-5.75 2.574-5.75 5.75 0 1.593.648 3.034 1.695 4.076 1.042 1.046 2.482 1.694 4.076 1.694 3.176 0 5.75-2.574 5.75-5.75-.001-1.106-.318-2.135-.859-3.012z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#424242" fill-rule="evenodd" d="M11.168,0.945405629 C11.4743,0.485877629 12.0952,0.361703629 12.5547,0.668055629 C13.0142,0.974408629 13.1384,1.59527663 12.8321,2.05480663 L9.37707,7.23729663 L11.3107,9.91461663 C11.3445,9.96146663 11.3737,10.0103066 11.3984,10.0604066 C11.5927,10.0209066 11.7939,10.0001066 12,10.0001066 C13.6569,10.0001066 15,11.3432066 15,13.0001066 C15,14.6570066 13.6569,16.0001066 12,16.0001066 C10.34315,16.0001066 9,14.6570066 9,13.0001066 C9,12.2726066 9.25896,11.6056066 9.68974,11.0862066 L8.19288,9.01358663 L7.83207,9.55480663 C7.52571,10.0143066 6.90484,10.1385066 6.44532,9.83215663 C5.98579,9.52580663 5.86161,8.90493663 6.16797,8.44540663 L6.94296,7.28291663 L3.18933,2.08559663 C2.86598,1.63787663 2.9668,1.01278663 3.41452,0.689428629 C3.86225,0.366070629 4.48733,0.466890629 4.81069,0.914616629 L8.12715,5.50663663 L11.168,0.945405629 Z M11,13.0001066 C11,13.5524066 11.4477,14.0001066 12,14.0001066 C12.5523,14.0001066 13,13.5524066 13,13.0001066 C13,12.4478066 12.5523,12.0001066 12,12.0001066 C11.4477,12.0001066 11,12.4478066 11,13.0001066 Z M4,10.0001066 C5.65685,10.0001066 7,11.3432066 7,13.0001066 C7,14.6570066 5.65685,16.0001066 4,16.0001066 C2.34315,16.0001066 1,14.6570066 1,13.0001066 C1,11.3432066 2.34315,10.0001066 4,10.0001066 Z M3,13.0001066 C3,13.5524066 3.44772,14.0001066 4,14.0001066 C4.55228,14.0001066 5,13.5524066 5,13.0001066 C5,12.4478066 4.55228,12.0001066 4,12.0001066 C3.44772,12.0001066 3,12.4478066 3,13.0001066 Z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#424242" d="M4.667 3h6.666C12.253 3 13 3.746 13 4.667v6.666c0 .92-.746 1.667-1.667 1.667H4.667C3.747 13 3 12.254 3 11.333V4.667C3 3.747 3.746 3 4.667 3z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#424242" d="M8,0 L15,2 L15,5.68629 C15,7.80802 14.1571,9.84285 12.6569,11.3431 L8,16 L3.34314,11.3431 C1.84285,9.84285 1,7.80802 1,5.68629 L1,2 L8,0 Z M8,2.08003 L3,3.5086 L3,5.68629 C3,7.27759 3.63214,8.80371 4.75736,9.92893 L8,13.1716 L11.2426,9.92893 C12.3679,8.80371 13,7.27759 13,5.68629 L13,3.5086 L8,2.08003 Z M8,4 L8,10.3594 L6.18269,8.55626 C5.42575,7.80523 5,6.78306 5,5.71676 L5,5 L8,4 Z"/>
</svg>
......@@ -13,9 +13,9 @@ class DataProvider {
this.mr = null;
}
async fetchProject() {
async fetchProject(workspaceFolder) {
try {
this.project = await gitLabService.fetchCurrentProject();
this.project = await gitLabService.fetchCurrentProject(workspaceFolder);
} catch (e) {
this.project = null;
this.children.push(
......@@ -26,11 +26,11 @@ class DataProvider {
}
}
async fetchPipeline() {
async fetchPipeline(workspaceFolder) {
let message = 'No pipeline found.';
let url = null;
if (this.project) {
const pipeline = await gitLabService.fetchLastPipelineForCurrentBranch();
let message = 'No pipeline found.';
let url = null;
const pipeline = await gitLabService.fetchLastPipelineForCurrentBranch(workspaceFolder);
if (pipeline) {
const statusText = pipeline.status === 'success' ? 'passed' : pipeline.status;
......@@ -48,38 +48,42 @@ class DataProvider {
message = `Pipeline #${pipeline.id} ${statusText} · ${actionText} ${timeAgo}`;
url = `${this.project.web_url}/pipelines/${pipeline.id}`;
}
this.children.push(new SidebarTreeItem(message, url));
}
this.children.push(new SidebarTreeItem(message, url, 'pipelines', null, workspaceFolder));
}
async fetchMR() {
async fetchMR(workspaceFolder) {
this.mr = null;
let url = null;
let message = 'No merge request found.';
if (this.project) {
const mr = await gitLabService.fetchOpenMergeRequestForCurrentBranch();
let message = 'No merge request found.';
let url = null;
const mr = await gitLabService.fetchOpenMergeRequestForCurrentBranch(workspaceFolder);
if (mr) {
this.mr = mr;
message = `MR: !${mr.iid} · ${mr.title}`;
url = mr.web_url;
}
this.children.push(new SidebarTreeItem(message, url));
}
this.children.push(new SidebarTreeItem(message, url, 'merge_requests', null, workspaceFolder));
}
async fetchClosingIssue() {
async fetchClosingIssue(workspaceFolder) {
if (this.project) {
if (this.mr) {
const issues = await gitLabService.fetchMRIssues(this.mr.iid);
const issues = await gitLabService.fetchMRIssues(this.mr.iid, workspaceFolder);
if (issues.length) {
issues.forEach(issue => {
this.children.push(
new SidebarTreeItem(`Issue: #${issue.iid} · ${issue.title}`, issue.web_url),
new SidebarTreeItem(
`Issue: #${issue.iid} · ${issue.title}`,
issue,
'issues',
null,
workspaceFolder,
),
);
});
} else {
......@@ -88,14 +92,17 @@ class DataProvider {
} else {
this.children.push(new SidebarTreeItem('No closing issue found.'));
}
} else {
this.children.push(new SidebarTreeItem('No closing issue found.'));
}
}
async getChildren() {
await this.fetchProject();
await this.fetchPipeline();
await this.fetchMR();
await this.fetchClosingIssue();
const workspaceFolder = await gitLabService.getCurrenWorkspaceFolder();
await this.fetchProject(workspaceFolder);
await this.fetchPipeline(workspaceFolder);
await this.fetchMR(workspaceFolder);
await this.fetchClosingIssue(workspaceFolder);
return this.children;
}
......
......@@ -3,29 +3,88 @@ const gitLabService = require('../gitlab_service');
const { SidebarTreeItem } = require('../sidebar_tree_item');
class DataProvider {
constructor({ fetcher, issuableType, noItemText }) {
constructor() {
this._onDidChangeTreeData = new vscode.EventEmitter();
this.onDidChangeTreeData = this._onDidChangeTreeData.event;
this.fetcher = fetcher;
this.issuableSign = issuableType === 'merge_request' ? '!' : '#';
this.noItemText = noItemText || 'Nothing to show.';
}
async getChildren() {
async getProjectIssues(parameters, project_uri) {
const items = [];
const issues = await gitLabService[this.fetcher]();
parameters.noItemText = parameters.noItemText ? parameters.noItemText : 'No items found.';
const issues = await gitLabService.fetchIssuables(parameters, project_uri);
let issuableSign = '!';
if (parameters.type === 'issues') {
issuableSign = '#';
} else if (parameters.type === 'epics') {
issuableSign = '&';
} else if (parameters.type === 'snippets') {
issuableSign = '$';
} else if (parameters.type === 'vulnerabilities') {
issuableSign = '-';
}
if (issues.length) {
issues.forEach(issue => {
const title = `${this.issuableSign}${issue.iid} · ${issue.title}`;
items.push(new SidebarTreeItem(title, issue));
let title = `${issuableSign}${issue.iid} · ${issue.title}`;
if (issuableSign === '$') {
title = `${issuableSign}${issue.id} · ${issue.title}`;
} else if (issuableSign === '-') {
title = `[${issue.severity}] - ${issue.name}`;
}
items.push(new SidebarTreeItem(title, issue, parameters.type, null, project_uri));
});
} else {
items.push(new SidebarTreeItem(this.noItemText));
items.push(new SidebarTreeItem(parameters.noItemText));
}
return items;
}
async getChildren(el) {
let items = [];
const { customQueries } = vscode.workspace.getConfiguration('gitlab');
const projects = await gitLabService.getAllGitlabProjects();
if (el) {
if (el.contextValue && el.contextValue.startsWith('custom-query-')) {
const customQuery = el.contextValue.split('custom-query-')[1];
const parameters = {};
customQuery.split(';').forEach(cq => {
const key = cq.split(':')[0];
const value = cq.split(':')[1];
parameters[key] = value;
});
if (parameters.project_uri) {
items = await this.getProjectIssues(parameters, parameters.project_uri);
} else if (projects.length > 1) {
projects.forEach(project => {
items.push(
new SidebarTreeItem(
project.label,
parameters,
'project',
vscode.TreeItemCollapsibleState.Collapsed,
project.uri,
),
);
});
} else if (projects.length === 1) {
items = await this.getProjectIssues(parameters, projects[0].uri);
} else {
items.push(new SidebarTreeItem(this.noItemText));
}
}
} else {
customQueries.forEach(customQuery => {
items.push(
new SidebarTreeItem(
customQuery.name,
customQuery,
'custom_query',
vscode.TreeItemCollapsibleState.Collapsed,
null,
),
);
});
}
return items;
}
......
......@@ -17,33 +17,7 @@ vscode.gitLabWorkflow = {
};
const registerSidebarTreeDataProviders = () => {
const assignedIssuesDataProvider = new IssuableDataProvider({
fetcher: 'fetchIssuesAssignedToMe',
noItemText: 'There is no issue assigned to you.',
});
const createdIssuesDataProvider = new IssuableDataProvider({
fetcher: 'fetchIssuesCreatedByMe',
noItemText: 'There is no issue created by you.',
});
const assignedMrsDataProvider = new IssuableDataProvider({
fetcher: 'fetchMergeRequestsAssignedToMe',
issuableType: 'merge request',
noItemText: 'There is no MR assigned to you.',
});
const createdMrsDataProvider = new IssuableDataProvider({
fetcher: 'fetchMergeRequestsCreatedByMe',
issuableType: 'merge request',
noItemText: 'There is no MR created by you.',
});
const allProjectMrsDataProvider = new IssuableDataProvider({
fetcher: 'fetchAllProjectMergeRequests',
issuableType: 'merge request',
noItemText: 'The project has no merge requests',
});
const issuableDataProvider = new IssuableDataProvider();
const currentBranchDataProvider = new CurrentBranchDataProvider();
......@@ -52,11 +26,7 @@ const registerSidebarTreeDataProviders = () => {
vscode.gitLabWorkflow.sidebarDataProviders.push(provider);
};
register('issuesAssignedToMe', assignedIssuesDataProvider);
register('issuesCreatedByMe', createdIssuesDataProvider);
register('mrsAssignedToMe', assignedMrsDataProvider);
register('mrsCreatedByMe', createdMrsDataProvider);
register('allProjectMrs', allProjectMrsDataProvider);
register('issuesAndMrs', issuableDataProvider);
register('currentBranchInfo', currentBranchDataProvider);
};
......
......@@ -2,21 +2,30 @@ const vscode = require('vscode');
const execa = require('execa');
const url = require('url');
const getWorkspaceRootPath = () => vscode.workspace.workspaceFolders[0].uri.fsPath;
const currentInstanceUrl = () => vscode.workspace.getConfiguration('gitlab').instanceUrl;
async function fetch(cmd) {
async function fetch(cmd, workspaceFolder) {
const [git, ...args] = cmd.split(' ');
const output = await execa.stdout(git, args, {
cwd: getWorkspaceRootPath(),
});
let currentWorkspaceFolder = workspaceFolder;
if (currentWorkspaceFolder == null) {
currentWorkspaceFolder = '';
}
let output = null;
try {
output = await execa.stdout(git, args, {
cwd: currentWorkspaceFolder,
});
} catch (ex) {
// Fail siletly
}
return output;
}
async function fetchBranchName() {
async function fetchBranchName(workspaceFolder) {
const cmd = 'git rev-parse --abbrev-ref HEAD';
const output = await fetch(cmd);
const output = await fetch(cmd, workspaceFolder);
return output;
}
......@@ -28,12 +37,12 @@ async function fetchBranchName() {
* Fixes #1 where local branch name is renamed and doesn't exists on remote but
* local branch still tracks another branch on remote.
*/
async function fetchTrackingBranchName() {
const branchName = await fetchBranchName();
async function fetchTrackingBranchName(workspaceFolder) {
const branchName = await fetchBranchName(workspaceFolder);
try {
const cmd = `git config --get branch.${branchName}.merge`;
const ref = await fetch(cmd);
const ref = await fetch(cmd, workspaceFolder);
if (ref) {
return ref.replace('refs/heads/', '');
......@@ -47,9 +56,9 @@ async function fetchTrackingBranchName() {
return branchName;
}
async function fetchLastCommitId() {
async function fetchLastCommitId(workspaceFolder) {
const cmd = 'git log --format=%H -n 1';
const output = await fetch(cmd);
const output = await fetch(cmd, workspaceFolder);
return output;
}
......@@ -71,7 +80,7 @@ const escapeForRegExp = str => {
const parseGitRemote = remote => {
if (remote.startsWith('git@')) {
remote = 'ssh://' + remote
remote = 'ssh://' + remote;
}
const { protocol, host, pathname } = url.parse(remote);
......@@ -89,23 +98,23 @@ const parseGitRemote = remote => {
return [protocol, host, ...match.slice(1, 3)];
};
async function fetchRemoteUrl(name) {
async function fetchRemoteUrl(name, workspaceFolder) {
let remoteUrl = null;
let remoteName = name;
try {
const branchName = await fetchBranchName();
const branchName = await fetchBranchName(workspaceFolder);
if (!remoteName) {
remoteName = await fetch(`git config --get branch.${branchName}.remote`);
remoteName = await fetch(`git config --get branch.${branchName}.remote`, workspaceFolder);
}
remoteUrl = await fetch(`git ls-remote --get-url ${remoteName}`);
remoteUrl = await fetch(`git ls-remote --get-url ${remoteName}`, workspaceFolder);
} catch (err) {
try {
remoteUrl = await fetch('git ls-remote --get-url');
remoteUrl = await fetch('git ls-remote --get-url', workspaceFolder);
} catch (e) {
const remote = await fetch('git remote');
const remote = await fetch('git remote', workspaceFolder);
remoteUrl = await fetch(`git ls-remote --get-url ${remote}`);
remoteUrl = await fetch(`git ls-remote --get-url ${remote}`, workspaceFolder);
}
}
......@@ -118,16 +127,16 @@ async function fetchRemoteUrl(name) {
return null;
}
async function fetchGitRemote() {
async function fetchGitRemote(workspaceFolder) {
const { remoteName } = vscode.workspace.getConfiguration('gitlab');
return await fetchRemoteUrl(remoteName);
return await fetchRemoteUrl(remoteName, workspaceFolder);
}
async function fetchGitRemotePipeline() {
async function fetchGitRemotePipeline(workspaceFolder) {
const { pipelineGitRemoteName } = vscode.workspace.getConfiguration('gitlab');
return await fetchRemoteUrl(pipelineGitRemoteName);
return await fetchRemoteUrl(pipelineGitRemoteName, workspaceFolder);
}
exports.fetchBranchName = fetchBranchName;
......
const vscode = require('vscode');
const gitLabService = require('./gitlab_service');
async function showPicker(additionalEntries = [], placeHolder = 'Select a Gitlab Project') {
const workspaceFolderOptions = await gitLabService.getAllGitlabProjects();
additionalEntries.forEach(additionalEntry => {
workspaceFolderOptions.push(additionalEntry);
});
if (workspaceFolderOptions.length === 0) {
return null;
} else if (workspaceFolderOptions.length === 1) {
return workspaceFolderOptions[0];
}
const workspaceFolder = await vscode.window.showQuickPick(workspaceFolderOptions, {
placeHolder,
});
if (workspaceFolder) {
return workspaceFolder.uri;
}
return null;
}
exports.show = showPicker;
此差异已折叠。
......@@ -19,11 +19,11 @@ const openUrl = url => {
*
* @param {string} link
*/
async function openLink(link) {
async function openLink(link, workspaceFolder) {
const user = await gitLabService.fetchUser();
if (user) {
const project = await gitLabService.fetchCurrentProject();
const project = await gitLabService.fetchCurrentProject(workspaceFolder);
if (project) {
openUrl(link.replace('$userId', user.id).replace('$projectUrl', project.web_url));
......@@ -40,23 +40,25 @@ async function openLink(link) {
}
async function showIssues() {
openLink('$projectUrl/issues?assignee_id=$userId');
const workspaceFolder = await gitLabService.getCurrentWorkspaceFolderOrSelectOne();
openLink('$projectUrl/issues?assignee_id=$userId', workspaceFolder);
}
async function showMergeRequests() {
openLink('$projectUrl/merge_requests?assignee_id=$userId');
const workspaceFolder = await gitLabService.getCurrentWorkspaceFolderOrSelectOne();
openLink('$projectUrl/merge_requests?assignee_id=$userId', workspaceFolder);
}
async function openActiveFile() {
const editor = vscode.window.activeTextEditor;
const workspaceFolder = vscode.workspace.getWorkspaceFolder(editor.document.uri).uri.fsPath;
if (editor) {
const currentProject = await gitLabService.fetchCurrentProject();
const currentProject = await gitLabService.fetchCurrentProject(workspaceFolder);
if (currentProject) {
const branchName = await gitService.fetchTrackingBranchName();
const workspaceFolder = vscode.workspace.getWorkspaceFolder(editor.document.uri);
const filePath = editor.document.uri.path.replace(`${workspaceFolder.uri.path}/`, '');
const branchName = await gitService.fetchTrackingBranchName(workspaceFolder);
const filePath = editor.document.uri.path.replace(`${workspaceFolder}/`, '');
const fileUrl = `${currentProject.web_url}/blob/${branchName}/${filePath}`;
let anchor = '';
......@@ -81,7 +83,8 @@ async function openActiveFile() {
}
async function openCurrentMergeRequest() {
const mr = await gitLabService.fetchOpenMergeRequestForCurrentBranch();
const workspaceFolder = await gitLabService.getCurrentWorkspaceFolderOrSelectOne();
const mr = await gitLabService.fetchOpenMergeRequestForCurrentBranch(workspaceFolder);
if (mr) {
openUrl(mr.web_url);
......@@ -89,14 +92,17 @@ async function openCurrentMergeRequest() {
}
async function openCreateNewIssue() {
openLink('$projectUrl/issues/new');
const workspaceFolder = await gitLabService.getCurrentWorkspaceFolderOrSelectOne();
openLink('$projectUrl/issues/new', workspaceFolder);
}
async function openCreateNewMr() {
const project = await gitLabService.fetchCurrentProject();
const workspaceFolder = await gitLabService.getCurrentWorkspaceFolderOrSelectOne();
const project = await gitLabService.fetchCurrentProject(workspaceFolder);
if (project) {
const branchName = await gitService.fetchTrackingBranchName();
const branchName = await gitService.fetchTrackingBranchName(workspaceFolder);
openUrl(`${project.web_url}/merge_requests/new?merge_request%5Bsource_branch%5D=${branchName}`);
} else {
......@@ -107,14 +113,15 @@ async function openCreateNewMr() {
}
async function openProjectPage() {
openLink('$projectUrl');
const workspaceFolder = await gitLabService.getCurrentWorkspaceFolderOrSelectOne();
openLink('$projectUrl', workspaceFolder);
}
async function openCurrentPipeline() {
const project = await gitLabService.fetchCurrentPipelineProject();
async function openCurrentPipeline(workspaceFolder) {
const project = await gitLabService.fetchCurrentPipelineProject(workspaceFolder);
if (project) {
const pipeline = await gitLabService.fetchLastPipelineForCurrentBranch();
const pipeline = await gitLabService.fetchLastPipelineForCurrentBranch(workspaceFolder);
if (pipeline) {
openUrl(`${project.web_url}/pipelines/${pipeline.id}`);
......@@ -125,10 +132,11 @@ async function openCurrentPipeline() {
async function compareCurrentBranch() {
let project = null;
let lastCommitId = null;
const workspaceFolder = await gitLabService.getCurrentWorkspaceFolderOrSelectOne();
try {
project = await gitLabService.fetchCurrentProject();
lastCommitId = await gitService.fetchLastCommitId();
project = await gitLabService.fetchCurrentProject(workspaceFolder);
lastCommitId = await gitService.fetchLastCommitId(workspaceFolder);
} catch (e) {
console.log('Failed to run compareCurrentBranch command', e);
}
......
......@@ -22,15 +22,17 @@ async function showPicker() {
},
];
const workspaceFolder = await gitLabService.getCurrentWorkspaceFolderOrSelectOne();
const selected = await vscode.window.showQuickPick(items);
if (selected) {
if (selected.action === 'view') {
openers.openCurrentPipeline();
openers.openCurrentPipeline(workspaceFolder);
return;
}
gitLabService.handlePipelineAction(selected.action);
gitLabService.handlePipelineAction(selected.action, workspaceFolder);
}
}
......
......@@ -92,8 +92,10 @@ async function showSearchInputFor(noteableType) {
placeHolder: 'Search in title or description. (Check project page for advanced usage)',
});
const workspaceFolder = await gitLabService.getCurrentWorkspaceFolderOrSelectOne();
const queryString = await parseQuery(query, noteableType);
const project = await gitLabService.fetchCurrentProject();
const project = await gitLabService.fetchCurrentProject(workspaceFolder);
if (project) {
openers.openUrl(`${project.web_url}/${noteableType}${queryString}`);
......
const vscode = require('vscode');
const path = require('path');
class SidebarTreeItem extends vscode.TreeItem {
constructor(title, data) {
super(title);
constructor(title, data = null, type = 'merge_requests', collapsibleState = null, uri) {
super(title, collapsibleState);
const { enableExperimentalFeatures } = vscode.workspace.getConfiguration('gitlab');
let iconPathLight = `/assets/images/light/stop.svg`;
let iconPathDark = `/assets/images/dark/stop.svg`;
if (data) {
let command = 'gl.showRichContent';
let arg = data;
let arg = [data, uri];
iconPathLight = `/assets/images/light/${type}.svg`;
iconPathDark = `/assets/images/dark/${type}.svg`;
if (!enableExperimentalFeatures) {
if (type === 'custom_query' || data == null) {
command = '';
arg = null;
} else if (type === 'pipelines') {
command = 'vscode.open';
arg = vscode.Uri.parse(data.web_url);
arg = [vscode.Uri.parse(data)];
} else if (type === 'vulnerabilities' && data.location) {
command = 'vscode.open';
const file = `${vscode.workspace.rootPath}/${data.location.file}`;
arg = [vscode.Uri.file(file)];
} else if ((type !== 'issues' && type !== 'merge_requests') || !enableExperimentalFeatures) {
command = 'vscode.open';
arg = [vscode.Uri.parse(data.web_url)];
}
this.command = {
command,
arguments: [arg],
};
if (type === 'custom_query' || type === 'project') {
this.contextValue = 'custom-query-';
Object.entries(data).forEach(entry => {
if (Array.isArray(entry[1])) {
this.contextValue += `${entry[0]}:${entry[1].join(',')};`;
} else {
this.contextValue += `${entry[0]}:${entry[1]};`;
}
});
if (type === 'project') {
this.contextValue += `project_uri:${uri};`;
}
} else {
this.command = {
command,
arguments: arg,
};
}
}
this.iconPath = {
light: path.join(__dirname, iconPathLight),
dark: path.join(__dirname, iconPathDark),
};
}
}
......
const vscode = require('vscode');
const openers = require('./openers');
const gitLabService = require('./gitlab_service');
const gitlabProjectInput = require('./gitlab_project_input');
const visibilityOptions = [
{
......@@ -46,8 +47,8 @@ async function createSnippet(project, editor, visibility, context) {
let data = {
title: fileName,
file_name: fileName,
visibility,
}
visibility,
};
if (project) {
data.id = project.id;
......@@ -63,9 +64,26 @@ async function createSnippet(project, editor, visibility, context) {
async function showPicker() {
const editor = vscode.window.activeTextEditor;
const project = await gitLabService.fetchCurrentProject();
let workspaceFolder = null;
let project = null;
if (editor) {
workspaceFolder = await gitLabService.getCurrenWorkspaceFolder();
project = await gitLabService.fetchCurrentProject(workspaceFolder);
if (project == null) {
workspaceFolder = await gitlabProjectInput.show(
[
{
label: "User's Snippets",
uri: '',
},
],
"Select a Gitlab Project or use the User's Snippets",
);
project = await gitLabService.fetchCurrentProject(workspaceFolder);
}
const visibility = await vscode.window.showQuickPick(visibilityOptions);
if (visibility) {
......
此差异已折叠。
......@@ -3,23 +3,26 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit"
"serve": "node_modules/.bin/vue-cli-service serve",
"build": "node_modules/.bin/vue-cli-service build",
"watch": "node_modules/.bin/vue-cli-service build --watch",
"test:unit": "node_modules/.bin/vue-cli-service test:unit"
},
"dependencies": {
"markdown-it": "^8.4.2",
"markdown-it": "^10.0.0",
"markdown-it-checkbox": "^1.1.0",
"vue": "^2.5.17"
"moment-timezone": "^0.5.27",
"vue": "^2.6.11",
"v-tooltip": "^2.0.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.1",
"@vue/cli-plugin-unit-mocha": "^3.0.1",
"@vue/cli-service": "^3.0.1",
"@vue/test-utils": "^1.0.0-beta.20",
"chai": "^4.1.2",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue-template-compiler": "^2.5.17"
"@vue/cli-plugin-babel": "^4.1.2",
"@vue/cli-plugin-unit-mocha": "^4.1.2",
"@vue/cli-service": "^4.1.2",
"@vue/test-utils": "^1.0.0-beta.31",
"chai": "^4.2.0",
"node-sass": "^4.13.1",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
}
}
......@@ -2,10 +2,10 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src vscode-resource: https:; script-src 'nonce-{{nonce}}'; style-src 'nonce-{{nonce}}';">
<meta http-equiv="Content-Security-Policy" content="img-src vscode-resource: https:; script-src 'nonce-{{nonce}}';">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>GitLab Workflow</title>
<link nonce="{{nonce}}" href="{{styleUri}}" rel="stylesheet" type="text/css">
<link href="{{styleUri}}" rel="stylesheet" type="text/css">
</head>
<body>
<div id="app"></div>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
import Vue from 'vue';
import VTooltip from 'v-tooltip';
import App from './App.vue';
Vue.config.productionTip = false;
Vue.use(VTooltip);
new Vue({
render: h => h(App),
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册