idproject
int64
7.76k
28.8M
issuekey
int64
675k
128M
created
stringlengths
19
32
title
stringlengths
4
226
description
stringlengths
2
154k
storypoints
float64
0
300
5,261,717
90,241,604
2021-07-14 08:13:26.478
Move documentation images away from the `main` branch
### Problem to solve We currently store all documentation images in [`src/assets` on the `main` branch](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/tree/main/src/assets). The images currently take about 13 MB. This has several problems: - It increases the size of the repository for cloning - All pictures need to be referenced in `README.md` with absolute URLs (because [the README is also rendered in the Marketplace](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow)) - this means that we need to use links in a format like https://gitlab.com/gitlab-org/gitlab-vscode-extension/raw/main/src/assets/_diff-comments.gif in the MR, but they don't work till the MR gets merged to `main` - The images are in the wrong folder (I'd expect `src/` folder to contain files needed for the extension runtime) - some of these images get packaged with the extension, where they increase the download size without any purpose (this could be "fixed"[^1] without removing the images from `main`) <details> ``` ~/.v/e/g/s/assets ❯❯❯ ll Permissions Size User Date Modified Name .rw-r--r-- 27k tomas 13 Jul 15:01 gitlab-logo.png .rw-r--r-- 207k tomas 13 Jul 15:01 gitlab-vscode.png drwxr-xr-x - tomas 13 Jul 15:01 images .rw-r--r-- 892k tomas 13 Jul 15:01 insert-multi-file-snippet.gif .rw-r--r-- 149k tomas 13 Jul 15:01 logo.png .rw-r--r-- 44k tomas 13 Jul 15:01 pipeline-actions.png .rw-r--r-- 74k tomas 13 Jul 15:01 screencast-cover.jpg ~/.v/e/g/s/assets ❯❯❯ pwd /Users/tomas/.vscode-insiders/extensions/gitlab.gitlab-workflow-3.26.0/src/assets ``` This is controled by the expression in [`.vsignore` file](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/main/.vscodeignore) </details> ### Proposal There are two options I can think of: - put the images outside of git (e.g. imgur.com) - put the images into a separate git branch (e.g. `images` or `documentation-assets`) and make this branch protected My preference would be the `images` protected branch. ### Further details The migration must happen in several steps: 1. copy the images outside of the `main` branch and change the links in `README.md` 1. **Wait for a few months** (because older versions of the README still reference the resources in `main` branch) 1. Remove the images from the main brach. ### Links / references [^1]: Fixed is in quotes because, without some automated checking, we are bound to forget to put the `_` prefix to some future documentation image.
1
5,261,717
89,521,269
2021-06-30 08:18:49.815
Change behaviour of the extension based on GitLab version
### Problem to solve Currently we support all GitLab versions from 13.5 onwards [1](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/359). But sometimes we either need to introduce a new feature that's only supported in newer versions of GitLab or we need to fix a bug (https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/397) in different ways for the latest GitLab version and the older versions. ### Proposal We are parsing the version for the GitLab instance since https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/252. We can reuse this logic and create a branching based on it: ```js function getSnippetContent(){ if (semver.lte(version, '14.1.0') { return getSnippetContentLegacy(); } return getSnippetContentNew(); } /* REMOVE AT 14.1.x: deprecated, doesn't work for versions lower than 14.1.0, remove when we stop supporting 14.0.x */ function getSnippetContentLegacy(){ } ``` ### Further details This might be tricky when we change GraphQL queries to match the new functionality. When GraphQL receives a query for a parameter that doesn't exist, it errors out instead of ignoring that parameter. This is going to be problem if we want to only introduce a feature for newer GitLab versions but the older instances would start returning errors for the whole query. ### Links / references
2
5,261,717
89,425,150
2021-06-28 17:46:40.512
Pipelines progress and logs views
I use most of the features in gitlab and found gitlab vscode intact with all the features except gitlab CI is the best service and awesome tool that I use everyday in every project. ### Problem to solve As a developer who spend all working hours in vscode, I would love to see all pipelines with logs and jobs. ![test-unit___1391199576____Jobs___GitLab_org___gitlab-vscode-extension___GitLab_and_fish__Users_tomas_and_Slack_____Google_Calendar___GitLab](/uploads/be4ae16fe815adc6da8550ac67b637c2/test-unit___1391199576____Jobs___GitLab_org___gitlab-vscode-extension___GitLab_and_fish__Users_tomas_and_Slack_____Google_Calendar___GitLab.png) ### Proposal <!-- How are we going to solve the problem? --> ### Further details <!-- Include examples, use cases, benefits, goals, or any other details that will help us understand the problem better. --> ### Links / references
2
5,261,717
88,764,313
2021-06-15 17:57:16.515
Spike: Implement remote repositories similar to GitHub
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "feature" label: - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?label_name%5B%5D=feature and verify the issue you're about to submit isn't a duplicate. ---> ### Problem to solve <!-- What problem do we solve? Try to define the who/what/why of the opportunity as a user story. For example, "As a (who), I want (what), so I can (why/value)." --> Microsoft recently [introduced](https://code.visualstudio.com/blogs/2021/06/10/remote-repositories) a new RemoteHub extension which made it possible to view and edit GitHub repositories without cloning them. It will be a very good idea to implement the same functionality in this extension in regard to GitLab. ### Proposal <!-- How are we going to solve the problem? --> There is a [documentation](https://github.com/microsoft/vscode/wiki/Virtual-Workspaces) about the underlying Virtual Workspaces API which is used to implement that extension. Unfortunately, the original extension is not open source, but there is an [issue](https://github.com/microsoft/vscode/issues/123115) about Virtual Workspaces API proposals and questions. ### Further details <!-- Include examples, use cases, benefits, goals, or any other details that will help us understand the problem better. --> ### Links / references
2
5,261,717
88,756,354
2021-06-15 14:58:02.756
POC: Include GitLab CI code quality feedback in the MR diff view
### Problem to solve GitLab allows code quality tools to display results in the diff view: https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html#code-quality-in-diff-view The VS Code extension doesn't surface code quality. ### Proposal Create POC that would expose some code quality metrics in the MR review view in GitLab Workflow # Result of the POC This document shows the proof of concept of how we could integrate Code Quality reports into VS Code. In this document I'll look at the available code quality report, available VS Code API for surfacing this report and then I'll suggest possible implementations. ## TL;DR - Check out the videos of possible implementations for normal editor view and MR diff view. - The POC uses downloaded json artefact, there's no API ATM. - If we want to enrich the normal editor view (not MR diff), we'll have a hard time showing the errors if the text files have added/removed lines since the report was generated. - code is in [`code-quality-poc` branch](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/commits/code-quality-poc) ## Code Quality Report I used the `gl-code-quality-report.json` JSON artefact from [`code_quality`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/jobs/1455192063) job The report is an array of error messages: ``` json { "engine_name": "structure", "fingerprint": "a54cbeb36914a3fde6c04a1f5fb57155", "categories": [ "Complexity" ], "check_name": "method_complexity", "content": { "body": "# Cognitive Complexity\nCognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.\n\n### A method's cognitive complexity is based on a few simple rules:\n* Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one\n* Code is considered more complex for each \"break in the linear flow of the code\"\n* Code is considered more complex when \"flow breaking structures are nested\"\n\n### Further reading\n* [Cognitive Complexity docs](https://docs.codeclimate.com/v1.0/docs/cognitive-complexity)\n* [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf)\n" }, "description": "Function `parseQuery` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.", "location": { "path": "src/search_input.js", "lines": { "begin": 6, "end": 88 } }, "other_locations": [], "remediation_points": 250000, "severity": "minor", "type": "issue" }, ``` Each error message contains `description`, `severity`, and `location` of the problem amongst a few extra details. ## VS Code API Diagnostic](https://code.visualstudio.com/api/references/vscode-api#Diagnostic) interface allows us to put error/warning/info messages on any location in any file (including MR diff), this is the [Errors & Warnings](https://code.visualstudio.com/docs/editor/editingevolved#_errors-warnings) feature from the user perspective. Diagnostic consists of location in the code, severity, message and source. All visible on the following screenshot: ![_Extension_Development_Host_-_status_bar_test_ts___gitlab-vscode-extension-TEST_1627460731204_0](/uploads/a2995397186df78a7539dc72a02198ae/_Extension_Development_Host_-_status_bar_test_ts___gitlab-vscode-extension-TEST_1627460731204_0.png) ## Possible implementation ### MR diff view We would show the code quality information in the MR review Diff. Showing every error from the `gl-code-quality-report.json` doesn't make sense here because the MR author is not responsible for most of the issues. Here we would **need an API endpoint** that exposes the diff (existing/new errors) for each MR. (We could also download the artefact from `main` branch and from the MR branch and diff them, but that sounds like a lot of effort.) ![mr-diff-view](/uploads/453348f5b29f215ab20b96ab1b6ea17a/mr-diff-view.mp4) ### Normal editor view We can also just add all the Code Quality errors directly into user's editor which will highlight problems in the file tree, show them in the editor and also in the "Problems" output panel at the bottom. This works well even with the whole `gl-code-quality-report.json` (except for causing too much noise). - We could have a right-click context menu (e.g. "show code quality") on each pipeline with `code-quality` job. This right-click would download the artefact and show all the errors. - We could only download the errors that are newly introduced by the MR (when there's an API endpoint) and show them. ![normal-editor-view](/uploads/7c2b1928525300d19f21c8cb463cb528/normal-editor-view.webm) ## General problems ### Too much noise Highlighting whole blocks of code is very intrusive compared to normal warnings (e.g. eslint) | very targetted warning by most of the extensions | code quality marking the whole file as having too many lines | | ------ | ------ | | ![process_code_quality_ts___gitlab-vscode-extension_1627395552714_0](/uploads/0d391f1d4e78063c7fcc915039a4d873/process_code_quality_ts___gitlab-vscode-extension_1627395552714_0.png) | ![_Extension_Development_Host__-_gitlab_new_service_ts___gitlab-vscode-extension-TEST](/uploads/f9b197ef7c6121ffe1916fae9b8f310f/_Extension_Development_Host__-_gitlab_new_service_ts___gitlab-vscode-extension-TEST.png) | On top of highlighting the whole blocks, the `gl-code-quality-report.json` only contains lines on which the problem occurs, not columns. So if an error applies only to a symbol or two, we still highlight the whole line. ``` json { "location": { "path": "src/search_input.js", "lines": { "begin": 6, "end": 88 } }, } ``` #### Possible solutions to the "Too Much Noise" problem - show the error/warning on the first line of the complexity issue, contributed by @KevSlashNull (https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/410#note_638971740) - not showing complexity errors (and other kinds that would highlight 10+ lines) or at least not by default - add an easy way to toggle the visibility of these errors (adding a button to the editor or to the status bar) ### Making sure the report is are up to date VS Code handles moving the `Diagnostic` highlights with changes, but it incorrectly highlights if the changes happened before we generated the `Diagnostic` | Diagnostic objects generated before changes | Diagnostic object generated after changes | | ------ | ------ | | ![errors-before-changes](/uploads/1cc1544a04b7e396d2a91c722ddf87d8/errors-before-changes.webm) | ![errors-after-changes](/uploads/58adb7d2da6a3d75fd79e871d4ea261b/errors-after-changes.webm) | | VS Code can automatically track the error even when there are new/removed lines | VS Code highlights wrong lines, because it can't know that we are giving diagnostic for different version of the file | ## Mapping Code Quality report error on diagnostic There are a few attributes in the code quality report, which don't have a natural place in the `Diagnotic` object. - `engine_name` - `check_name` - `categories` would have to be somehow included in the message or the source. `eslint` includes this in the source part ( `@typescript-eslint/no-unused-vars` ) ![process_code_quality_ts___gitlab-vscode-extension_1627461501748_0](/uploads/136375bd780938bb08bbd7fbcb33fd5f/process_code_quality_ts___gitlab-vscode-extension_1627461501748_0.png) ### Severity It seems that we've got only two severities in the report `minor` / `major` but VS Code offers four: | severity | visual | | ------ | ------ | | error | ![_Extension_Development_Host_-_create_snippet_ts___gitlab-vscode-extension-TEST_1627461073097_0](/uploads/2819bcb6408f26a848acb1eb18f2f8eb/_Extension_Development_Host_-_create_snippet_ts___gitlab-vscode-extension-TEST_1627461073097_0.png) | | warning | ![_Extension_Development_Host_-_status_bar_test_ts___gitlab-vscode-extension-TEST_1627460731204_0](/uploads/828813a7f569d315422462fca93e1886/_Extension_Development_Host_-_status_bar_test_ts___gitlab-vscode-extension-TEST_1627460731204_0.png) | | info | ![command_names_ts___gitlab-vscode-extension_1627461188785_0](/uploads/2e9b8299042b7a5e8667d696471b9699/command_names_ts___gitlab-vscode-extension_1627461188785_0.png) | | tip | ![Screenshot_2021-07-28_at_10.34.30_1627461351258_0](/uploads/3a4cd61facb4e61a6cd55c7490e9d26d/Screenshot_2021-07-28_at_10.34.30_1627461351258_0.png) |
2
5,261,717
88,741,500
2021-06-15 11:45:09.945
Context menu shows when trying to add an MR comment + duplicated comments
### Summary Opening MR item multiple times in different places in the side-panel registers multiple comment controllers. That results in UX that lets the user choose which controller to use (context menu) and it will cause every MR diff comment to show twice. ![Screenshot_2021-06-15_at_15_30_27](/uploads/458a8c2e1aa8661e8ebe229833601a5a/Screenshot_2021-06-15_at_15_30_27.png) ![double-comment-controller-2](/uploads/4f2f3f1f6697e47cd0b5bbba324e0902/double-comment-controller-2.mp4) ### Steps to reproduce 1. Click on an MR in the extension side panel in multiple places: - For example, you open "Merge requests assigned to me" and "All project merge requests", and open the same MR in both views 1. Open one changed file in this MR 1. Try to add a comment - you'll see a context menu 1. If the MR contains comments on the MR diff, you'll see them twice. ### What is the current *bug* behavior? - You have to choose which controller to use from the context menu - You see comments on the diff twice ![Screenshot_2021-06-15_at_13_35_06](/uploads/1d895af1d4fedc9edd9246baa499a87d/Screenshot_2021-06-15_at_13_35_06.png) ### What is the expected *correct* behavior? - A new comment thread should open as usual. - Each comment shows only once ### Workaround for adding comments Choosing one of the options will work fine: ![choosing-controller](/uploads/782a11432e74d9ff5762327e39570265/choosing-controller.gif) ### Possible fixes We must ensure that only one commenting controller gets initialized.
1
5,261,717
88,666,251
2021-06-14 11:24:09.472
Add "View as Tree" option
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "feature" label: - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?label_name%5B%5D=feature and verify the issue you're about to submit isn't a duplicate. ---> ### Problem to solve Right now the extension shows the changes of an MR as flat list. Each element in the list has the path next to it. This works pretty well but for bigger mono repos it is hard to review. VSCode itself support the "View as Tree" option in the git diff view. This will show the changes within it's directories ![image](/uploads/8ed7bada1003b5887270555457f873c5/image.png) GitLab support this as well :wink: ### Proposal Add a button (View as Tree) similar to VSCode diff view to switch between this 2 variants. This would make reviewing in some cases much easier. ### Further details Checkout the git diff view of VSCode with some sub directories to see the effect in action. ### Links / references
2
5,261,717
88,515,812
2021-06-10 11:12:43.200
MR Review: indicate which changed files have MR discussions
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "feature" label: - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?label_name%5B%5D=feature and verify the issue you're about to submit isn't a duplicate. ---> ### Problem to solve When I'm reviewing MR's I don't know which files have MR discussions before I show the diff and scroll to the comment. ### Proposal I propose the same solution as GitHub Pull Request extension uses. Add a text bubble emoji decoration the same way we add decoration for the type of change. ![_Extension_Development_Host__-_webview_controller_js___gitlab-vscode-extension-TEST_and_extension_js___gitlab-vscode-extension](/uploads/6841da534bdc198ad2e900b47d75fd33/_Extension_Development_Host__-_webview_controller_js___gitlab-vscode-extension-TEST_and_extension_js___gitlab-vscode-extension.png) ### Further details #### GitHub Pull Request Screenshot ![Getting_Started___github-test-repository](/uploads/7352c18bfca0eb1d41c0e29fdfe4f6d2/Getting_Started___github-test-repository.png) ### Links / references I created a POC, the change seems fairly simple https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/commits/commenting-decorator-poc /cc @phikai @pedroms
2
5,261,717
88,038,534
2021-06-01 13:00:18.553
MR Review: improve UX when extension fails to create new comment
### Problem to solve We implemented creating comments on MR diff in https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/342. The happy-path scenario works well, but when the comment fails to send (network failure, GitLab API unavailable) the UX is not great. We show the user an error message and store the comment text in extension logs, but we don't offer an easy way to retry sending the comment. Each failure has to be followed by copy-pasting the comment text from logs and trying again. ### Proposal We should handle the failure similarly to the GitHub Pull Request extension. We should create a new type of comment (failed comment) which would have a button to retry. 1. Creating comment fails 1. Extension creates a failed comment and puts it into the diff discussion 1. The failed comment has a "Retry" button which lets users try to resend it ### Current UX ![new-comment-error](/uploads/74717853ba06403865b21dda8b03a57a/new-comment-error.mp4)
2
5,261,717
87,978,417
2021-05-31 13:44:00.609
Inserting snippets is broken for newly created snippets
### Summary Newly created snippets can't be inserted. Applies only to `gitlab.com` (and soon to `14.0`) This issue is caused by GitLab switching to `main` branch name. ### Steps to reproduce 1. Create a project snippet 1. Try to insert it with `GitLab: Insert snippet` command ### What is the current *bug* behavior? When calling API to get the snippet blob, you get 404 ### What is the expected *correct* behavior? inserting the snippet ### Relevant logs and/or screenshots The extension makes a call like: ```sh curl -H "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/api/v4/projects/20486274/snippets/2128747/files/master/blah.patch/raw" ``` (notice the **master** branch in the request) We should instead make call to ```sh curl -H "PRIVATE-TOKEN: $TOKEN" "https://gitlab.com/api/v4/projects/20486274/snippets/2128747/files/main/blah.patch/raw" ``` (notice the **main** branch in the request)
1
5,261,717
87,800,877
2021-05-27 08:53:39.276
create snippet from git patch and apply patch stored in a snippet
### Problem to solve When I review MR, sometimes I want to suggest changes that span multiple lines in multiple files and the "suggestions" GitLab feature is not powerful enough for that. Then I result in creating the changes locally, running `git diff > suggestions.patch` and including this patch to one of my MR comments. ### Proposal Introduce two new commands: `Create patch snippet` and `Apply patch snippet`. ![poc video](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/93f89519e56c165c63b08d2e6658b9cb/snippet-patch-poc.mp4) #### `Create patch snippet` 1. run the command 1. VS Code asks for the patch name and visibility 1. VS Code runs `git diff` to get the patch 1. project snippet with name `patch: <name submitted by the user>` is created #### `Apply patch snippet` 1. run the command 1. VS Code shows a list of all snippets with `patch: ` name prefix 1. select one patch 1. VS Code runs `git apply` to apply the patch ### Further details ### Links / references /cc @phikai
2
5,261,717
87,293,716
2021-05-18 15:56:33.145
Add support to open local file during MR reviews (file diff view)
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "feature" label: - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?label_name%5B%5D=feature and verify the issue you're about to submit isn't a duplicate. ---> ### Problem to solve When reviewing a merge request sometimes it's better to have better insights on the file like the file path, checkout neighboring files and folder etc.. and sometimes we might even need to open the file in the local to make a small change to see if it would workout or not. ### Proposal Utilize a native feature in VScode to open a diff view while knowing the local path of that file, that will enable few features in VScode like (open file) button, the breadcrump and will allow some of "gitlens" extension features get activated ### Further details <!-- Include examples, use cases, benefits, goals, or any other details that will help us understand the problem better. --> Current GitLab Workflow MR file diff view actions: ![GL](/uploads/191f1af9864a2981ca6bb5d726375a23/GL.png) Assumed to be an achievable behavior (Notice the breadcrumb and the "open file" action on the left): ![GH](/uploads/2d0fa14bfa6f3f4cecba92f63ff1c7c8/GH.png) I'm aware that the file path is already available on hover, but that doesn't exactly give the features of a breadcrumb found in VScode. ![GL_path](/uploads/af995896ee05058dc535cc7d89e75c8c/GL_path.png) Some of the features activated by gitlens when a local file with history is diffed (Git blame, refs navigation): ![GH_gitlens](/uploads/adc8a3abe931a22b154dc605df16d849/GH_gitlens.png) ### Links / references (I've no knowledge of the VScode APIs)
1
5,261,717
87,279,951
2021-05-18 12:16:23.128
Inserting snippet into user's snippets fails (multi-repository workspaces)
### Summary When a user tries to add a snippet to their user snippets (rather than project snippets) the command fails. ### Steps to reproduce User tries to add a snippet to their user snippets (rather than project snippets): 1. Open folder containing multiple repositories 2. Open file from one of the repositories 3. Trigger the `GitLab: Create snippet` command 4. Select `User's Snippets` in the project selection 5. See the command fail ### Possible fixes I added all caps comments to the following snippet from [create_snippet.js](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/ca514167e28766b74c24faba255802920468ce05/src/commands/create_snippet.js#L66-111) ```ts async function createSnippet() { const editor = vscode.window.activeTextEditor; let repositoryRoot = null; let project = null; if (editor) { const repository = gitExtensionWrapper.getActiveRepository(); repositoryRoot = repository && repository.rootFsPath; try { project = repository && (await repository.getProject()); } catch (e) { logError(e); } // FIXME: the empty `uri` representing user's snippets is not correctly handled if (!project) { repositoryRoot = await gitlabProjectInput.show( [ { label: "User's Snippets", uri: '', // HERE WE RETURN EMPTY STRING }, ], "Select a Gitlab Project or use the User's Snippets", ); try { const selectedRepository = gitExtensionWrapper.getRepository(repositoryRoot); // HERE WE EXPECT SOME VALID URL project = selectedRepository && (await selectedRepository.getProject()); } catch (e) { logError(e); } } const visibility = await vscode.window.showQuickPick(visibilityOptions); if (visibility) { const context = await vscode.window.showQuickPick(contextOptions); if (context) { uploadSnippet(project, editor, visibility.type, context.type, repositoryRoot); // THIS FUNCTION NEEDS VALID repositoryRoot } } } else { vscode.window.showInformationMessage('GitLab Workflow: No open file.'); } } ```
1
5,261,717
86,774,523
2021-05-10 10:48:43.380
Change TreeView to list repositories first and then filters
Follow-up from https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/345#note_569008314 ### Problem to solve As a user, I want to navigate my issues and <abbr title="merge request">MR</abbr>s using a “repository-first” hierarchy, so that its hierarchy matches other VS Code views and it doesn't make me think. ### Proposal Change the extension's “Issues and merge requests” view to show repositories first and then the filters. ### Further details | Current GitLab Workflow | explorer | source control | GitHub extension | |----------|----------------|-----------------|-| | ![settings_json___workspace](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/9a839aad560ebc8960a23c15e6430334/settings_json___workspace.png) | ![settings_json___workspace](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/785c11d232b242892b71bd444eb55cef/settings_json___workspace.png) | ![settings_json___workspace](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/4c68c4228d3bd0d15a3934c71d557de7/settings_json___workspace.png) | ![image](/uploads/3464d2984cf890c1b1122364bcbdf45d/image.png) | ### Links / references
1
5,261,717
86,556,184
2021-05-06 00:40:05.842
Add command to show merged YAML for CI config
### Problem to solve As a developer, I want to be able to view the merged YAML for my GitLab CI configuration inside my VSCode workspace, so that I don't have to leave my IDE and navigate through a web browser to see the results. ### Proposal Utilize the API endpoint to [Validate a CI YAML configuration with a namespace](https://docs.gitlab.com/ee/api/lint.html#validate-a-ci-yaml-configuration-with-a-namespace), retrieve the `merged_yaml` attribute from the response, and display the results in a separate editor. ### Further details For complex pipelines, it can be very challenging to know whether the resulting merged YAML is going to look as desired/expected. Having the ability to view this directly in the developer's IDE would be extremely valuable. ### Links / references Might be blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/320778. We can use virtual documents to show the merged result: https://code.visualstudio.com/api/extension-guides/virtual-documents. - We'd define a `TextDocumentContentProvider` that will serve documents on a custom scheme URI (e.g. `gitlab-merged-ci-yaml`) - this provider would somehow have to store the API response - We'd show the file by running `vscode.workspace.openTextDocument(customUri)`
2
5,261,717
86,520,187
2021-05-05 12:36:34.312
Integrate with YAML extension to provide .gitlab-ci.yml autocompletion
### Problem to solve Since ci files are not created many times we never get to memorize all the **keys** to achieve what we need. When creating a new gitlab-ci file I normally have to copy stuff from an existing file or open the documentation to see what are the yaml keys to get things done. ### Proposal Add code completions to the actual yaml keys allowed by the gitlab-ci file schema, along with their description. This can be achieved already by making the following steps: 1. install the [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension 1. change your `settings.json` associate the `.gitlab-ci.yml` file with the correct JSON Schema ```json { "yaml.schemas": { "https://json.schemastore.org/gitlab-ci.json": ".gitlab-ci.yml" } } ``` We should simplify the integration with YAML extension to make it even easier for the users to enable `.gitlab-ci.yml` auto-completion. We can recognize that the YAML extension is installed (`vscode.extensions.getExtension<GitExtension>('redhat.vscode-yaml')`). If it is, we can somehow suggest to the user, that we can add configuration to enable the autocompletion. ```json { "yaml.schemas": { "https://json.schemastore.org/gitlab-ci.json": ".gitlab-ci.yml" } } ``` ### Further details We should agree on the UX before implementation. - Do we do this change automatically and only inform user that we've done it? - Are we going to show pop-up message with a button which will add the configuration? - If users dismisses this message, should we show it again, or never suggest it again? - What if they've already have some configuration in their `yaml.schemas`? We must ensure it won't get lost <details> <summary>This snippet shows the changes we could do to edit YAML's config</summary> ```diff diff --git a/package.json b/package.json index a17bd0c..8ab2ea9 100644 --- a/package.json +++ b/package.json @@ -353,6 +353,9 @@ "configuration": { "title": "GitLab Workflow (GitLab VSCode Extension)", "properties": { + "yaml.schemas": { + "type":"object" + }, "gitlab.instanceUrl": { "type": [ "string", diff --git a/src/extension.js b/src/extension.js index 7d81215..bebf082 100644 --- a/src/extension.js +++ b/src/extension.js @@ -107,7 +107,7 @@ const registerCiCompletion = context => { context.subscriptions.push(subscription); }; -const activate = context => { +const activate = async context => { const outputChannel = vscode.window.createOutputChannel('GitLab Workflow'); initializeLogging(line => outputChannel.appendLine(line)); vscode.workspace.registerTextDocumentContentProvider(REVIEW_URI_SCHEME, new GitContentProvider()); @@ -120,6 +120,9 @@ const activate = context => { gitExtensionWrapper.init(); context.subscriptions.push(gitExtensionWrapper); vscode.window.registerFileDecorationProvider(fileDecorationProvider); + await vscode.workspace + .getConfiguration() + .update('yaml.schemas', { 'https://json.schemastore.org/gitlab-ci.json': '.gitlab-ci.yml' }); }; exports.activate = activate; ``` </details>
1
5,261,717
86,314,631
2021-05-01 08:05:11.012
Replace Node Sass (node-sass) with Dart Sass (sass) in JavaScript
Part of &5923
2
5,261,717
85,455,078
2021-04-19 13:13:14.834
Support suggestions in VS Code diff comments
### Problem to solve GitLab supports a custom suggestion Markdown code blocks ```suggestion:-0+0 suggested text ``` Which gets rendered on the web as ![Update_new-file2_txt___9____Merge_requests___Tomas_Vik___test_project___GitLab](/uploads/6c6285cd99149ac0b2201b1bab5cad3b/Update_new-file2_txt___9____Merge_requests___Tomas_Vik___test_project___GitLab.png) but in VS Code it renders as a generic text block: ![_Extension_Development_Host__-_new-file2_txt___9____test-project](/uploads/c141d97dfaf0ae44e25b5a5aba370575/_Extension_Development_Host__-_new-file2_txt___9____test-project.png) ### Proposal Implement a post-processing of comments in VS Code to convert the custom suggestion into a diff block: ~~~markdown ```suggestion:-1+0 ,--, ``` ~~~ changes to ~~~markdown Suggestion: ```diff - - ,,, + ,--, ``` ~~~ rendered as ![_Extension_Development_Host__-_new-file2_txt___9____test-project](/uploads/99be510904a9514adc31334844d4b08b/_Extension_Development_Host__-_new-file2_txt___9____test-project.png) ### Further details - This would be quite complex because as seen in the previous example, suggestion can span multiple lines (`suggestion:-1+0`) and so the logic would have to work not only on comments but also access the text file to have the full context. ### Links / references
3
5,261,717
84,688,797
2021-04-06 08:17:34.525
Warn users that they should use supported GitLab version
### Problem to solve The extension doesn't work correctly with older GitLab versions (13.4 and older) (e.g. #347 #358). But the users don't have any way of finding this information and so the process currently looks like this: 1. GitLab instance returns an error 1. User creates a bug in extension issues 1. We try to help the user debug the issue 1. Eventually we ask about the GitLab version 1. User tells us an old version 1. We mark the issue as ~wontfix and explain to the user that we don't support old versions ### Proposal #### Passive solutions Passive solutions to the problem are trivial to implement, but they are not going to be as effective, because they rely on user reading the documentation for the extension. - Add a note to the top of the README, that explains that the extension supports GitLab 13.5 and above. - Add a section to the [Bug issue template](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/main/.gitlab/issue_templates/Bug.md) #### Active solution - When we start the extension, we can check the `/api/v4/version` response and if we find out that the version is lower than 13.5, we'll show the user a warning saying that they are connected to an unsupported version of GitLab instance and the extension won't fully work. ### Further details - We already make use of the `version` endpoint: https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/c484feb48d44d8492a54be61b51637c781ef2b53/src/gitlab_service.ts#L170-181 ### Links / references /cc @phikai
1
5,261,717
81,188,307
2021-03-18 13:37:06.043
Use repositories instead of workspace folders
# Use repositories instead of workspace folders TL;DR: We use the wrong abstraction in the code. If we change the abstraction, we'll simplify the code significantly, make future work on the codebase much easier. ## What is a workspace? Workspace is the content of an open VS Code window. It can either contain one open folder or multiple folders if you use [Multi-root Workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces). | single foldre in the workspace | mutli-root workspace | | ---- | ---- | | ![e3c8ae52e5a24d82bfd88b406d150871](/uploads/828ff723636f899733269b1e1e2eb2f6/e3c8ae52e5a24d82bfd88b406d150871.png) | ![2e96f2863e554495b225c1770e775aa4](/uploads/305198895c82e53256e795ae03ef36d4/2e96f2863e554495b225c1770e775aa4.png) | GitLab Workflow uses the workspace folder to run the `git` command. The most common use case is this: ```mermaid graph TD; A[Obtains workspaceFolder from VS Code] --"/workspace/extension"--> B["Run git remote -v in that folder to get remote URL"] B --"git@gitlab.com:gitlab-org/gitlab-vscode-extension.git"--> C["parse namespace and project from the remote"] C --"gitlab-org/gitlab-vscode-extension"--> D["Run API queries for this project"] ``` ### The problem with using `workspaceFolders` The problem with this approach is that **the `workspaceFolder` doesn't have 1:1 relationship with repository**. You can open the VS Code in any folder (`code .` in the command line). If we have the following folder structure: ``` . └── workspace/ ├── projectA/ │ ├── .git │ ├── frontend/ │ │ └── src │ └── backend └── projectB/ ├── .git └── src/ ``` This structure allows for the following three scenarios: 1. Open `projectB` (`cd workspace/projectB && code .`) - ✅ This will work fine because the `workspaceFolder` is a git repository at the same time 2. Open `frontend` (`cd workspace/projectA/frontend && code .`) - ⚠️This now works, because there is still only one repository for the `workspaceFolder`. But it caused us trouble in the past: - 🐞 [Open active file on GitLab does not resolve from git repository root](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/327) 3. Open `workspace` (`cd workspace && code .`) - ❌ The extension will run `git` command in the folder called `worskpace` and think that there are no repositories. `workspace` folder contains two repositories. - 🐞 [Does not support workspace folders containing multiple repositories](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/216) ## Better approach: Using repositories The key insight is that the `workspaceFolder` <--> git repository 1:n relationship makes it very hard to keep the extension git information in sync with VS Code. We've recently introduced the VS Code Git extension to our codebase ([Support VSCode "git clone" command](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/222)) and now we can use the way VS Code recognizes repositories. ### Folder that contains multiple repositories | explorer| source control (git) tree view | GitLab Workflow tree view | | -- | -- | -- | | ![cbdebfffbbb54267b27496f93ffd4718](/uploads/567e82034650e94b0b2e07499ec3acbf/cbdebfffbbb54267b27496f93ffd4718.png) | ![74b38c20d8b544f99efe3a0b4ed18367](/uploads/d157e0084e1c5dcc7b410da04f28c75c/74b38c20d8b544f99efe3a0b4ed18367.png) | ![0197b75bb9b6465bab9c1459eb5fcd84](/uploads/2813581eb23320951549eeab427c6f88/0197b75bb9b6465bab9c1459eb5fcd84.png) | ### Benefits of switching to repositories - Benefits of changing the abstraction - Clear abstraction. GitLab project = git repository. Easy to understand for new and existing contributors. - Benefits of switching to the VS Code git extension - **Single source of truth for the git information**, if user sees 4 repostiories in the SCM tree view, they'll see up to 4 in the GitLab Workflow TreeView - Less dependency on `execa` module to run our custom `git` commands and parse them. Running the git commands ourselves is tricky from a security perspective (e.g. [Client side code execution](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/170)) ### Drawbacks of switching to repositories There is no drawback (that I can think of) of **changing the abstraction**. However, there is a drawback of using the VS Code Git extension: - Dependency on the VS Code Git extension means that if there is a bug or a missing feature, we are not fully in control, and we can only contribute the fix upstream and wait for a release. - There is plenty of popular extensions (GitHub Pull Request, Git Lenses) depending on the same API, the "severe bug" scenario is not very likely. - We can still use `execa` for any missing git commands/features, but I don't know of any. ## Getting technical **(some experience with the extension code is recommended)** I have implemented a POC of this change in [refactor-to-use-git-repositories](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/tree/refactor-to-use-git-repositories) branch. The potential for simplifying the code got me excited enough to write this issue. ### Opportunity for simplifying the codebase The way we now obtain information about the git repository or how we call API is quite complex. If we create a wrapper around the `Repository` that we get from VS Code Git extension, we can reduce a significant amount of code and complexity from the extension[^1]. <details> <summary>Good example</summary> In this example, we already built the GitLabNewService to be decoupled from the repository logic. [Getting the `GitLabNewService`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/42ba142134b0ace97ae56a36f2f1131eba212a39/src/service_factory.ts#L16-18) ```ts export async function createGitLabNewService(workspaceFolder: string): Promise<GitLabNewService> { return new GitLabNewService(await getInstanceUrl(workspaceFolder)); } ``` [Using the new service](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/c012837326fca58ec4dcf4e85fe94f3483a261f3/src/commands/insert_snippet.ts#L34-37): ``` const gitService = createGitService(workspaceFolder); const gitLabService = await createGitLabNewService(workspaceFolder); const remote = await gitService.fetchGitRemote(); const snippets = await gitLabService.getSnippets(`${remote.namespace}/${remote.project}`); ``` </details> <details> <summary>Bad example</summary> The old GitLabService is incredibly coupled with the workspace and git logic: ```ts export async function getAllGitlabWorkspaces(): Promise<GitLabWorkspace[]> { if (!vscode.workspace.workspaceFolders) { return []; } const projectsWithUri = vscode.workspace.workspaceFolders.map(async workspaceFolder => { const uri = workspaceFolder.uri.fsPath; try { const currentProject = await fetchCurrentProject(uri); return { label: currentProject?.name ?? basename(uri), uri, }; } catch (e) { logError(e); return { label: basename(uri), uri, error: true }; } }); return Promise.all(projectsWithUri); } ``` ```ts export async function fetchCurrentProject(workspaceFolder: string): Promise<GitLabProject | null> { try { const remote = await createGitService(workspaceFolder).fetchGitRemote(); return await fetchProjectData(remote, workspaceFolder); } catch (e) { throw new ApiError(e, 'get current project'); } } ``` </details> I imagine the new repository centric approach like this: ```js const activeEditor = vscode.workspace.activeEditor; const gitlabRepository = repositoryManager.getRepositoryForFile(activeEditor.document.uri); const snippets = await gitlabRepository.gitlabService.getSnippets(); const activeBranch = await gitlabRepository.git.getActiveBranch(); ``` ## Related - [Consistent handling of remotes, instances and branches](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/260) - [Replace the library for interacting with git](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/203) [^1]: I'm confident that even with covering the new logic with unit tests, we'll end up with less code in total.
3
5,261,717
81,119,370
2021-03-17 15:51:58.781
MR Review: track changed lines on the diff
### Problem to solve This issue is a follow up for https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/340 that might be not necessary to implement if the https://gitlab.com/gitlab-org/gitlab/-/issues/325161 gets fixed. This issue implements logic related to tracking which lines in the diff have been added/removed/unchanged. This feature needs to be behind a feature flag because we'll implement submitting new comments in a subsequent issue. #### Commenting ranges To be able to create new comments (not replies to a thread) we need to create a [`CommentingRangeProvider`](https://code.visualstudio.com/api/references/vscode-api#CommentingRangeProvider). We implement a function that receives a file URI and returns all the lines that the user can comment on. Without these ranges, the user can only respond to existing comments (#339). #### Track changed lines on the diff To be able to submit comments on unchanged lines, we also need to be able to track position of unchanged lines across both old and new diff version. The `createDiffNote` GraphQL mutation requires both `oldLine` and `newLine` for unchanged lines (this is an issue tracked in https://gitlab.com/gitlab-org/gitlab/-/issues/325161). The following image explains the information we must compute: ![_Extension_Development_Host__-_gitlab_comment_thread_test_ts___197____gitlab-vscode-extension-TEST](/uploads/1d7b3ca4f7a9cfc00d91d5a6379156f5/_Extension_Development_Host__-_gitlab_comment_thread_test_ts___197____gitlab-vscode-extension-TEST.png) To be able to submit a comment for the `it('deletes a comment', async () => {` line, we need to compute that the line has the number `133` on the old version but `149` on the new. ### Proposal We'll need to use the textual diff that we retrieve from the [MR Diff version API endpoint](https://docs.gitlab.com/ee/api/merge_requests.html#get-a-single-mr-diff-version). ```json { "old_path": "new_file.ts", "new_path": "new_file.ts", "a_mode": "0", "b_mode": "100644", "new_file": true, "renamed_file": false, "deleted_file": false, "diff": "@@ -0,0 +1,3 @@\n+export class NewFile{\n+ private property: string;\n+}\n" } ``` We'll have to praise the `diff` property to find all changed lines. ### Further details Example: | no ranges | with ranges | | ------ | ------ | | ![gitlab_comment_thread_test_ts___197____gitlab-vscode-extension](/uploads/68d82d72b633a1cd187b1dbbb1973363/gitlab_comment_thread_test_ts___197____gitlab-vscode-extension.png) | ![_Extension_Development_Host__-_gitlab_comment_thread_test_ts___197____gitlab-vscode-extension-TEST](/uploads/f64380715c20a6a230e17dd8c95f00ce/_Extension_Development_Host__-_gitlab_comment_thread_test_ts___197____gitlab-vscode-extension-TEST.png) | ### Links / references
2
5,261,717
81,037,359
2021-03-16 17:25:01.077
MR Review: create a new comment on the diff
### Problem to solve The extension only allows creating new comments on the "Details" `webview` which means they are not related to any particular position. To replicate the GitLab web experience, this ~feature implements creating new comments in the MR diff view. ### Proposal ![new_comments](/uploads/cd27d196a2c53b0698650baf587d23e5/new_comments.mp4) Implement a command that will be triggered when the user clicks "Add comment now" button: ![_Extension_Development_Host__-_test_ts___5____test-project](/uploads/0f1044ee573794ef21ec8f976982b545/_Extension_Development_Host__-_test_ts___5____test-project.png) This command will create a new comment. It will support unchanged, removed, and added lines. ### Further details #### Creating comments GraphQL mutation ```graphql mutation CreateDiffNote5 { createDiffNote( input: { noteableId: "gid://gitlab/MergeRequest/87196674" body: "new note" position: { baseSha: "5e6dffa282c5129aa67cd227a0429be21bfdaf80" headSha: "a2616e0fea06c8b5188e4064a76d623afbf97b0c" startSha: "5e6dffa282c5129aa67cd227a0429be21bfdaf80" paths: { oldPath: "/test.js", newPath: "/test.ts" } newLine: 15 } } ) { errors } } ``` All attributes are mandatory, except for the following exception regarding `newLine` and `oldLine`: | type of line we comment on | newLine, oldLine explained | | ------ | ------ | | added line (right-hand-side of the diff) | We only submit `newLine` | | removed line (left-hand-side of the diff) | We only submit `oldLine` | | unchanged line | Both `newLine` and `oldLine` are **required**. If the unchanged line has a different index on each side of the diff, these attributes need to [reflect that different index](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/340#track-changed-lines-on-the-diff). | #### Representing the new comment in VS Code The `createDiffNote` mutation gives us only the new note as a response. But we need the full `discussion` response because only the discussion contains `replyId` attribute that allows us to submit replies. In other words, without knowing the `replyId`, we can create a new thread, but the user can't reply to that thread. The only way how we can get it now is to ask for **all discussions on MR** and filter out the one that contains our new note. ### Links / references
4
5,261,717
81,036,147
2021-03-16 17:05:56.897
MR Review: Introduce global MR cache
### Problem to solve When we submit a new comment on the diff, we need to calculate `newLine` and `oldLine` position. The trickiest scenario is when we comment on an unchanged line and we need to calculate the `newLine` and `oldLine` (https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/340#track-changed-lines-on-the-diff). We currently can't get all information we need because there is a disconnect between the data available to the `MrItemModel` and the code diff - `MrItemModel` - we have all the API responses for MR, Discussions and MR Diff (version) - code diff (VS Code Diff view) - we have only the URI and what we can put into `query` parameter When we create a new comment (new `CommentThread`) the **only** information available to us is the URI. We need access to **much more MR information** when we create a new comment. #### URI example ``` "gl-review:/src/commands/mr_discussion_commands.ts?%7B%22commit%22%3A%2265d828eb07558c8dfe03da797f6778fc18eece8b%22%2C%22workspacePath%22%3A%22%2FUsers%2Ftomas%2Fworkspace%2Ftest-projects%2Fgitlab-vscode-extension-TEST%22%2C%22projectId%22%3A5261717%7D" ``` The cryptical `query` string is encoded JSON: ```json { "commit": "65d828eb07558c8dfe03da797f6778fc18eece8b", "workspacePath": "/Users/tomas/workspace/test-projects/gitlab-vscode-extension-TEST", "projectId": 5261717 } ``` #### Why more information? This is the full query to create a new note (notice the input): ```graphql mutation CreateDiffNoteNonChanged { createDiffNote( input: { noteableId: "gid://gitlab/MergeRequest/87196674" body: "new note" position: { baseSha: "5e6dffa282c5129aa67cd227a0429be21bfdaf80" headSha: "a2616e0fea06c8b5188e4064a76d623afbf97b0c" startSha: "5e6dffa282c5129aa67cd227a0429be21bfdaf80" paths: { oldPath: "test.js", newPath: "test.ts" } newLine: 8 oldLine: 8 } } ) { errors } } ``` We could still put most of the information into the URL. The only information that would be missing is the lines. ### Proposal We can introduce a cache, through which we'll be able to retrieve all necessary MR information. Each MR is going to be uniquely identified by `workspaceFolder` (i.e. the local git repository) and `mergeRequest.id` the database numerical ID that is unique for GitLab instance. The trickiest part of this cache is going to be designing the lifecycle of the cached MR (i.e. when will the cache get invalidated). Currently, we fetch all issues and MRs when the user triggers the `GitLab: Refresh Sidebar` command. (that would equal to cache invalidation). ### Further details Sketch of how this cache could look like is implemented in the POC (#293) branch [`293-new-comments-poc`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/tree/293-new-comments-poc) (`MrRepository`) ### Links / references
2
5,261,717
81,033,227
2021-03-16 16:24:56.101
MR Review: add commenting ranges
### Problem to solve This issue implements logic related to tracking which lines in the diff have been added/removed/unchanged. This feature needs to be behind a feature flag because we'll implement submitting new comments in a subsequent issue. #### Commenting ranges To be able to create new comments (not replies to a thread) we need to create a [`CommentingRangeProvider`](https://code.visualstudio.com/api/references/vscode-api#CommentingRangeProvider). We implement a function that receives a file URI and returns all the lines that the user can comment on. Without these ranges, the user can only respond to existing comments (#339). ### Proposal We'll need to use the textual diff that we retrieve from the [MR Diff version API endpoint](https://docs.gitlab.com/ee/api/merge_requests.html#get-a-single-mr-diff-version). ```json { "old_path": "new_file.ts", "new_path": "new_file.ts", "a_mode": "0", "b_mode": "100644", "new_file": true, "renamed_file": false, "deleted_file": false, "diff": "@@ -0,0 +1,3 @@\n+export class NewFile{\n+ private property: string;\n+}\n" } ``` We'll have to praise the `diff` property to find all changed lines. ### Further details There is a follow up issue that might have to build on the logic implemented here: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/344 Example: | no ranges | with ranges | | ------ | ------ | | ![gitlab_comment_thread_test_ts___197____gitlab-vscode-extension](/uploads/68d82d72b633a1cd187b1dbbb1973363/gitlab_comment_thread_test_ts___197____gitlab-vscode-extension.png) | ![_Extension_Development_Host__-_gitlab_comment_thread_test_ts___197____gitlab-vscode-extension-TEST](/uploads/f64380715c20a6a230e17dd8c95f00ce/_Extension_Development_Host__-_gitlab_comment_thread_test_ts___197____gitlab-vscode-extension-TEST.png) | ### Links / references
2
5,261,717
81,028,861
2021-03-16 15:27:01.346
MR Review: Respond to a diff thread
### Problem to solve The extension shows us comment threads on the diff, but doesn't allow us to comment in the thread. This issue is to enable and implement responses to diff threads. ![index_md___56749____gitlab](/uploads/14cdcc1b9d790da59ddc3bb36e119c3b/index_md___56749____gitlab.png) ### Proposal 1. [Enable responses](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/d1d744624080dea35d6a5d61b28239aafb67747a/src/review/gitlab_comment_thread.ts#L50) 1. Extend the [`createNote` method](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/d1d744624080dea35d6a5d61b28239aafb67747a/src/gitlab/gitlab_new_service.ts#L532-538) to return notes (with positions), instead of `void` 1. Implement `reply()` function on the [`gitlab_comment_thread`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/d1d744624080dea35d6a5d61b28239aafb67747a/src/review/gitlab_comment_thread.ts) 1. Add a `Create comment now` command and add it to the [`comments/commentThread/context` menu](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/e09ab184e876b79f7648865c4e18272ec1802a98/package.json#L240) ### Further details Example: ![respond-example](/uploads/7c71d116f0d4f48e286e1d418694e1d2/respond-example.mp4) This feature is implemented (not production-ready at all) in the POC (#293) branch [`293-new-comments-poc`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/tree/293-new-comments-poc) ### Links / references
2
5,261,717
80,124,523
2021-03-02 21:21:19.707
Error 400 when on a branch that has special chars
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "bug" label: - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. If you are facing issues around configuring Token from your GitLab.com account, see the list of already addressed Token related issues: https://gitlab.com/gitlab-org/gitlab-vscode-extension/issues?scope=all&utf8=%E2%9C%93&state=closed&label_name[]=token-issue ---> ### Summary <!-- Summarize the bug encountered concisely --> When in a branch with a special name the extensions simply goes haywire. It keeps trying to communicate with Gitlab but keeps receiving a ton of 400 errors. ### Steps to reproduce <!-- How one can reproduce the issue - this is very important --> Right now I'm in a branch called `feature/ch38/add-fn-para-criar-novo-usuário` (which is in Portuguese and has an accent in one of the words). - Moving to a branch that has special chars already does the job ### What is the current *bug* behavior? <!-- What actually happens --> Told above. ### What is the expected *correct* behavior? <!-- What you should see instead --> It should work as any other branch, regardless of the name. ### Relevant logs and/or screenshots <!-- Logs can be found by running `GitLab: Show extension logs` command (using `cmd+shift+p`) --> <details> ``` Found https://gitlab.com in the PAT list and git remotes, using it as the instanceUrl { "userMessage": "Failed to parse GitLab API response", "errorMessage": "Unexpected token < in JSON at position 0", "stack": [ "SyntaxError: Unexpected token < in JSON at position 0", "\tat JSON.parse (<anonymous>)", "\tat Object.config.transform (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/out/src/gitlab_service.js:63:36)", "\tat /home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/request-promise-core/lib/plumbing.js:94:46", "\tat Promise.cancellationExecute [as _execute] (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/debuggability.js:406:9)", "\tat Promise._resolveFromExecutor (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/promise.js:518:18)", "\tat new Promise (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/promise.js:103:10)", "\tat Request.plumbing.callback (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/request-promise-core/lib/plumbing.js:93:18)", "\tat Request.RP$callback [as _callback] (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/request-promise-core/lib/plumbing.js:46:31)", "\tat Request.self.callback (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/request/request.js:185:22)", "\tat Request.emit (events.js:315:20)", "\tat Request.<anonymous> (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/request/request.js:1154:10)", "\tat Request.emit (events.js:315:20)", "\tat IncomingMessage.<anonymous> (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/request/request.js:1076:12)", "\tat Object.onceWrapper (events.js:421:28)", "\tat IncomingMessage.emit (events.js:327:22)", "\tat endReadableNT (_stream_readable.js:1220:12)", "\tat processTicksAndRejections (internal/process/task_queues.js:84:21)" ], "additionalInfo": "Response body: <!DOCTYPE html>\n<html>\n<head>\n <meta content=\"width=device-width, initial-scale=1, maximum-scale=1\" name=\"viewport\">\n <title>400 Bad Request</title>\n <style>...</style>\n</head>\n\n<body>\n <h1>\n <img src=\"...\" alt=\"GitLab Logo\" /><br />\n 400\n </h1>\n <div class=\"container\">\n <h3>Your browser sent an invalid request.</h3>\n <hr />\n <p>Please contact your GitLab administrator if you think this is a mistake.</p>\n </div>\n</body>\n</html>\n<html>\n\nRequest URL: https://gitlab.com/api/v4/projects/.../pipelines?ref=feature/ch38/add-fn-para-criar-novo-usuário" } 400 - "<!DOCTYPE html>\n<html>\n<head>\n <meta content=\"width=device-width, initial-scale=1, maximum-scale=1\" name=\"viewport\">\n <title>400 Bad Request</title>\n <style>\n body {\n color: #666;\n text-align: center;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n margin: auto;\n font-size: 14px;\n }\n\n h1 {\n font-size: 56px;\n line-height: 100px;\n font-weight: normal;\n color: #456;\n }\n\n h2 {\n font-size: 24px;\n color: #666;\n line-height: 1.5em;\n }\n\n h3 {\n color: #456;\n font-size: 20px;\n font-weight: normal;\n line-height: 28px;\n }\n\n hr {\n max-width: 800px;\n margin: 18px auto;\n border: 0;\n border-top: 1px solid #EEE;\n border-bottom: 1px solid white;\n }\n\n img {\n max-width: 40vw;\n }\n\n .container {\n margin: auto 20px;\n }\n </style>\n</head>\n\n<body>\n <h1>\n <img src=\"...\" alt=\"GitLab Logo\" /><br />\n 400\n </h1>\n <div class=\"container\">\n <h3>Your browser sent an invalid request.</h3>\n <hr />\n <p>Please contact your GitLab administrator if you think this is a mistake.</p>\n </div>\n</body>\n</html>\n<html>\n" StatusCodeError: 400 - "<!DOCTYPE html>\n<html>\n<head>\n <meta content=\"width=device-width, initial-scale=1, maximum-scale=1\" name=\"viewport\">\n <title>400 Bad Request</title>\n <style>... </style>\n</head>\n\n<body>\n <h1>\n <img src=\"...\" alt=\"GitLab Logo\" /><br />\n 400\n </h1>\n <div class=\"container\">\n <h3>Your browser sent an invalid request.</h3>\n <hr />\n <p>Please contact your GitLab administrator if you think this is a mistake.</p>\n </div>\n</body>\n</html>\n<html>\n" at new StatusCodeError (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/request-promise-core/lib/errors.js:32:15) at /home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/request-promise-core/lib/plumbing.js:97:41 at tryCatcher (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromiseCtx (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/promise.js:641:10) at _drainQueueStep (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/async.js:97:12) at _drainQueue (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/home/johnny/.vscode/extensions/gitlab.gitlab-workflow-3.13.0/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:456:21) ``` </details> ### Possible fixes <!-- If you can, link to the line of code that might be responsible for the problem --> - Possibly it's lacking url-encode the branch name before sending the message
1
5,261,717
79,651,105
2021-02-23 16:47:16.734
Remote Code Execution after cloning a malicious repository [ VSCode Extension ]
**[HackerOne report #1094381](https://hackerone.com/reports/1094381)** by `rapt00r` on 2021-02-04, assigned to @dcouture: [Report](#report) | [Attachments](#attachments) | [How To Reproduce](#how-to-reproduce) ## Report ### Summary Hi there! I've found a critical vulnerability on the VSCode Extension `gitlab` that allows an attacker to execute malicious binary on the victim's machine after they cloning a repository. ### Description The vulnerability occurs because the gitlab extension for VSCode doesn't specify where the binary `git.exe` on the windows, must be called. This will make the Windows search for the `git.exe` inside of the current directory after cloning a repository, allowing a custom git.exe binary to be executed after the clone. ##### Why this happen? When a user execute a command, Windows first will check on the current directory, then it's will verify each path in the `%PATH%` variable and finally checks the system locations, for example `%WINDIR%`. By knowing this, when a user clone a new repository, Windows will check if the `git.exe` file exists on the current directory (cloned repository) and if found, it will be executed. As the malicious repository have the `git.exe` file and any 'allowed paths' are not defined, Windows will check the repository and will execute, allowing to execute our binaries. ### Steps to Reproduce 1. Create a new Repository. 2. Rename a Window's binary to `git.exe` and upload to the repository (in this example, I used the calculator.exe) 3. Open the VSCode and install the gitlab extension. 4. Clone the repository 5. The binary will be executed after the clone. #### Demo 1. Creating a new repository: ![gitlab-00.png](https://h1.sec.gitlab.net/a/8bd8c78a-d94f-4f07-88c1-33effc758a21/gitlab-00.png) 2. Upload the calculator binary inside of the repository (remember to renamee it to git.exe before upload): ![gitlab-04.png](https://h1.sec.gitlab.net/a/4ad59212-4e14-4c0c-9ff5-1a0b1370f29f/gitlab-04.png) 3. Clone the repository (can be via VSCode directly too): ![gitlab-05.png](https://h1.sec.gitlab.net/a/68638e99-c1ec-4bc3-996e-5a32d8ac4d8d/gitlab-05.png) 4. Open the repository in the VSCode: ![gitlab-07.png](https://h1.sec.gitlab.net/a/7af90f90-7316-4912-98bb-4ba9b1d2a458/gitlab-07.png) 5. The calculator binary will be executed: ![gitlab-08.png](https://h1.sec.gitlab.net/a/ea2b0d7e-09a3-45b3-b76c-908ba118c79d/gitlab-08.png) Video PoC: ![gitlab-rce.mp4](https://h1.sec.gitlab.net/a/a40b55d6-9f04-46f9-8882-fca1c1e6bf47/gitlab-rce.mp4) #### Impact Attackers can run malicious binary on user's machine that cloned the malicious repository ## Attachments **Warning:** Attachments received through HackerOne, please exercise caution! * [gitlab-00.png](https://h1.sec.gitlab.net/a/8bd8c78a-d94f-4f07-88c1-33effc758a21/gitlab-00.png) * [gitlab-05.png](https://h1.sec.gitlab.net/a/68638e99-c1ec-4bc3-996e-5a32d8ac4d8d/gitlab-05.png) * [gitlab-04.png](https://h1.sec.gitlab.net/a/4ad59212-4e14-4c0c-9ff5-1a0b1370f29f/gitlab-04.png) * [gitlab-08.png](https://h1.sec.gitlab.net/a/ea2b0d7e-09a3-45b3-b76c-908ba118c79d/gitlab-08.png) * [gitlab-07.png](https://h1.sec.gitlab.net/a/7af90f90-7316-4912-98bb-4ba9b1d2a458/gitlab-07.png) * [gitlab-rce.mp4](https://h1.sec.gitlab.net/a/a40b55d6-9f04-46f9-8882-fca1c1e6bf47/gitlab-rce.mp4) ## How To Reproduce Please add [reproducibility information] to this section: 1. 1. 1. [reproducibility information]: https://about.gitlab.com/handbook/engineering/security/#reproducibility-on-security-issues
2
5,261,717
79,060,575
2021-02-14 22:49:27.795
Subpath in self-hosted gitlab is not used
### Summary When self-hosted gitlab is in a subpath (such as https://my.domain/gitlab/) all results return "Project failed to load" with a 404 error. Initially discussed in #297 but you asked me to open as its own ticket. ### Steps to reproduce * Install self-hosted gitlab in a subpath like https://my.domain/gitlab/ * Configure `gitlab.instanceUrl` to be `https://my.domain/gitlab/` * Set PAT * Open the Gitlab Workflow tab ### What is the current *bug* behavior? * "Issues and merge requests" shows "Project failed to load" * "For Current Branch" shows "Error occurred, please try to refresh" * Error 404 logged in console * Looking in fiddler, see a request being made to https://my.domain/api/graphql ### What is the expected *correct* behavior? * Proper values, not error messages. * API query should be sent to https://my.domain/gitlab/api/graphql instead of https://my.domain/api/graphql ### Relevant logs and/or screenshots output of `git remote show origin`: ``` * remote origin Fetch URL: https://my.domain/gitlab/myname/keyboard.git Push URL: https://my.domain/gitlab/myname/keyboard.git HEAD branch: master Remote branch: master tracked ``` Configuration file: ``` { "gitlab.instanceUrl": "https://my.domain/gitlab/", } ``` In the log: ``` GraphQL Error (Code: 404): {"response":{"error":"<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n","status":404},"request":{"query":"\n query GetProject($projectPath: ID!) {\n project(fullPath: $projectPath) {\n id\n name\n fullPath\n webUrl\n group {\n id\n }\n }\n }\n","variables":{"projectPath":"myname/keyboard"}}} Error: GraphQL Error (Code: 404): {"response":{"error":"<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n","status":404},"request":{"query":"\n query GetProject($projectPath: ID!) {\n project(fullPath: $projectPath) {\n id\n name\n fullPath\n webUrl\n group {\n id\n }\n }\n }\n","variables":{"projectPath":"myname/keyboard"}}} at GraphQLClient.<anonymous> (c:\Users\myname\.vscode\extensions\gitlab.gitlab-workflow-3.12.0\node_modules\graphql-request\dist\index.js:172:35) at step (c:\Users\myname\.vscode\extensions\gitlab.gitlab-workflow-3.12.0\node_modules\graphql-request\dist\index.js:63:23) at Object.next (c:\Users\myname\.vscode\extensions\gitlab.gitlab-workflow-3.12.0\node_modules\graphql-request\dist\index.js:44:53) at fulfilled (c:\Users\myname\.vscode\extensions\gitlab.gitlab-workflow-3.12.0\node_modules\graphql-request\dist\index.js:35:58) at processTicksAndRejections (internal/process/task_queues.js:97:5) { "message": "API request failed when trying to get current project because: GraphQL Error (Code: 404): {\"response\":{\"error\":\"<html>\\r\\n<head><title>404 Not Found</title></head>\\r\\n<body>\\r\\n<center><h1>404 Not Found</h1></center>\\r\\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\\r\\n</body>\\r\\n</html>\\r\\n\",\"status\":404},\"request\":{\"query\":\"\\n query GetProject($projectPath: ID!) {\\n project(fullPath: $projectPath) {\\n id\\n name\\n fullPath\\n webUrl\\n group {\\n id\\n }\\n }\\n }\\n\",\"variables\":{\"projectPath\":\"myname/keyboard\"}}}", "stack": [ "Error: API request failed when trying to get current project because: GraphQL Error (Code: 404): {\"response\":{\"error\":\"<html>\\r\\n<head><title>404 Not Found</title></head>\\r\\n<body>\\r\\n<center><h1>404 Not Found</h1></center>\\r\\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\\r\\n</body>\\r\\n</html>\\r\\n\",\"status\":404},\"request\":{\"query\":\"\\n query GetProject($projectPath: ID!) {\\n project(fullPath: $projectPath) {\\n id\\n name\\n fullPath\\n webUrl\\n group {\\n id\\n }\\n }\\n }\\n\",\"variables\":{\"projectPath\":\"myname/keyboard\"}}}", "\tat Object.<anonymous> (c:\\Users\\myname\\.vscode\\extensions\\gitlab.gitlab-workflow-3.12.0\\out\\src\\gitlab_service.js:91:19)", "\tat Generator.throw (<anonymous>)", "\tat rejected (c:\\Users\\myname\\.vscode\\extensions\\gitlab.gitlab-workflow-3.12.0\\out\\src\\gitlab_service.js:6:65)", "\tat processTicksAndRejections (internal/process/task_queues.js:97:5)" ] } ```
1
5,261,717
78,741,410
2021-02-09 18:13:27.892
MR Review: Resolve discussion, Edit and Delete comment
### Problem to solve Currently, users can only view comments on MRs. If they want to interact with these comments, they'll have to switch to the web interface. ### Proposal Implement resolving discussions, editing and deleting comments as described in detail in #269. #### Resolving/unresolving discussions ![poc-resolve-thread](/uploads/50243d6f171f20f3f2e26e033cf2b5db/poc-resolve-thread.gif) #### Edit comment ![poc-editing-comments](/uploads/7b16d501872a1734ab58d9e3fec50b2e/poc-editing-comments.gif) #### Delete comment ![delete-confirmation](/uploads/5eb7158f06c0361e45141c6f2f31c232/delete-confirmation.gif) #### Stretch: Open the comment in the browser ![poc-comment-on-the-web](/uploads/0d9652783c487deefc61ed2c1727e98a/poc-comment-on-the-web.gif) ### Further details The ["POC Result" section of the POC issue](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/269#poc-result) provides a detailed technical description of the features ### Links / references
3
5,261,717
78,361,685
2021-02-03 13:52:24.669
Deprecate custom query with pipeline id
### Problem to solve Custom queries are used in the sidebar view (e.g. showing "MRs assigned to me"). Custom query is a VS Code configuration object. One of the custom query properties is `pipelineId` and it's defined as follows: ```json { "pipelineId": { "type": "number | string", "description": "Returns vulnerabilities belonging to specified pipeline. \"branch\" returns vulnerabilities belonging to latest pipeline of the current branch. Works only with vulnerabilities" } } ``` The `branch` part has been broken for at least 3 months, probably more (I found that when working on https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/174). And I don't see users hardcoding a numeric `pipelineId` into their VS Code config. ### Proposal Remove this option altogether. ### Further details ### Links / references
1
5,261,717
78,196,311
2021-02-01 11:04:18.911
Error loading Merge Requests - "Cannot read property 'startsWith' of null"
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "bug" label: - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. If you are facing issues around configuring Token from your GitLab.com account, see the list of already addressed Token related issues: https://gitlab.com/gitlab-org/gitlab-vscode-extension/issues?scope=all&utf8=%E2%9C%93&state=closed&label_name[]=token-issue ---> ### Summary <!-- Summarize the bug encountered concisely --> When trying to load MRs from a private GitLab I'm getting the error "Cannot read property 'startsWith' of null". However, I can see issues for example. ### Steps to reproduce <!-- How one can reproduce the issue - this is very important --> I'm not sure but all I've done is install the extension, connect it to a privat gitlab (where we use SSH for connection), set the Personal Access Token, and add the instanceUrl, remoteName and pipelineGitRemoteName as it is reached via SSH and there is a known issue with that. (https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/79#note_495879565) ### What is the current *bug* behavior? <!-- What actually happens --> I was able to see MRs at first after setting the Extension up. However, I had to set "gitlab.instanceUrl" , "gitlab.remoteName" and "gitlab.pipelineGitRemoteName" for it to work. The next time I wanted to see a MR it didn't work giving me the error from the title with the following behavior: When selecting "Issues assigned to me" in the extension tab, I can see the expected issues, when I select "Merge requests assigned to me" or "All project merge requests" I get the "Cannot read property 'startsWith' of null" error and I don't see any MRs. ### What is the expected *correct* behavior? <!-- What you should see instead --> I should be able to see MRs assigned to me or all MRs depending on which tab I'm opening. ### Relevant logs and/or screenshots <!-- Logs can be found by running `GitLab: Show extension logs` command (using `cmd+shift+p`) --> I'm only getting the VS Code "Cannot read property 'startsWith' of null" Error without any further information. ### Possible fixes <!-- If you can, link to the line of code that might be responsible for the problem -->
1
5,261,717
77,691,377
2021-01-22 15:01:42.258
Fetching issue/merge request description not working in VS Code Insiders
### Summary Fetching the issue/merge request description has stopped working in the last few weeks. ### Steps to reproduce 1. Open *GitLab Workflow* sidebar. 1. Expand a dropdown to reveal an issue or merge request. 1. Expand the issue or merge request options. 1. Click "Description". 1. Observe a new editor launch saying that it's "Fetching issuable details and discussions. This may take a while." 1. Observe that the editor never populates with the issuable details and discussions. ### What is the current *bug* behavior? Description editor never populates with details. ### What is the expected *correct* behavior? Description editor should show issue or merge request details. ### Relevant info and screenshots The editor simply shows this indefinitely: ![image](/uploads/12d4f6665d02745e9cb636bf6cead63d/image.png) - I'm currently running version v3.10.0 of the *GitLab Workflow* extension, but I believe this issue started happening a few releases prior. - In previous versions, I was able to switch to a different editor tab and then switch back to the *Description* tab and the issue/merge request details would then populate. ### VSCode version information - Version: 1.53.0-insider (user setup) - Commit: 4f2341834e646360e603953b62bf6c6020b07a29 - Date: 2021-01-22T08:57:22.447Z - Electron: 11.2.0 - Chrome: 87.0.4280.141 - Node.js: 12.18.3 - V8: 8.7.220.31-electron.0 - OS: Windows_NT x64 10.0.16299
1
5,261,717
77,619,224
2021-01-21 15:35:23.441
MR Review: Relative links in comments don't work.
### Summary When we receive comments from the Graph QL endpoint, they might contain relative URLs. VS Code needs to have access to full URLs. For example This comment https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/156#note_482777098 contains link ```md ![_Extension_Development_Host__-_gitlab_new_service_ts___gitlab-vscode-extension-TEST](/uploads/a262ea24dc5da36de0fb49aca7622881/_Extension_Development_Host__-_gitlab_new_service_ts___gitlab-vscode-extension-TEST.png) ``` and in VS Code it looks like: ![current_branch_js___156____gitlab-vscode-extension](/uploads/0db5eb29c8c7437a664fb2ca268b3b14/current_branch_js___156____gitlab-vscode-extension.png) ### Steps to reproduce Open https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/156#note_482777098 in VS Code. You can find the MR by adding this [custom query](https://gitlab.com/gitlab-org/gitlab-vscode-extension#custom-queries) to you VS Code `settings.json`. ```json { "name": "Merged MRs assigned to viktomas", "type": "merge_requests", "noItemText": "There is no issue assigned to viktomas.", "state": "merged", "assignee": "viktomas" }, ``` ### What is the current *bug* behavior? VS Code displays links and images incorrectly. ### What is the expected *correct* behavior? The extension is going to prepend the instance URL to each relative link.
1
5,261,717
77,216,120
2021-01-14 10:42:13.775
Support Multiple Accounts per GitLab Instance
### Problem to solve As a Freelancer, I want to be able to set the GitLab Personal Token per Git Repository / Project, so I can work with different accounts on GitLab.com ### Proposal In general within Git it's possible to specify Identity Files specifying which ssh key to use. These can referenced per repo in the repos git config so I'm able to use different ssh keys for the same host. It would be great to have a similar functionality for the Gitlab Workflow Extension, so it's possible to set e.g. a Company and Private Accounts Secret Token for gitlab.com ### Links / references
2
5,261,717
76,936,742
2021-01-08 16:38:36.365
MR review: new comments and reviews POC
### Problem to solve This issue is a continuation of the #269 investigation. The #269 investigated how te work with existing comments and this POC is validating implementation for creating new comments and managing reviews. We had a few issues when integrating with the GitLab API(https://gitlab.com/gitlab-org/gitlab/-/issues/281143, https://gitlab.com/gitlab-org/gitlab/-/issues/282476, https://gitlab.com/gitlab-org/gitlab/-/issues/282481). Part of the validation is going to be checking that all GitLab endpoints are now working as expected. ### Proposal Create POC that answers the following questions: - How are we going to create a comment? What's going to be the VS Code behaviour if we fail to send the comment (on the web the text area remembers the comment) - How are we going to contribute to a thread? - How can we represent MR review in progress? What is the API for showing unsubmitted reviews? - How can we edit and delete existing comments? - What happens when we submit a review that is out of date? In other words: somebody committed changes since we started the review. ### Result ![new_comments](/uploads/42fd96a62b757e3356cf8e3a0becbc35/new_comments.mp4) Try the POC extension: [gitlab-workflow-4.0.0.vsix](/uploads/2658d339a155a2c8513125a82dcbad2a/gitlab-workflow-4.0.0.vsix) The POC is implemented in a branch: [`293-new-comments-poc`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/tree/293-new-comments-poc) #### TL;DR Creating new comments is possible, however, there are several API deficiencies[1][2] that will make extension implementation harder requiring several workarounds. Fixing the deficiencies would simplify the implementation a lot. #### Overview of the work: - [MR Review: Respond to a diff thread](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/339) - relatively simple because we don't need to pass in a position for the new note, we'll just send `discussion.replyId` with the request to explain what we are responding to - *the only issue that can't be made simpler by fixing the GraphQL API* - [MR Review: add commenting ranges](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/340) - We need to compute what lines have been added, based on text diff hunks that we get from the API. - We then use this information to show commenting ranges (gutters) that allow users to comment on certain lines. - [MR Review: track changed lines on the diff](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/344) - This issue is to track the line index of an unchanged line. The unchanged line can be "pushed down" or "pulled up" relative to the new version of the diff and we must track that difference to be able to submit a comment on unchanged line. - There are some unnecessary constraints introduced by the API that make it extra hard for us the create notes on unchanged lines[1]. *If we fix [1], we don't have to implement this issue.* - [MR Review: Introduce global MR cache](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/341) - thanks to [1] and [2] we need much more information for creating new notes than what can fit in the URI (which VS Code uses to communicate between the extension and the diff view). - we need to introduce a global cache so we can easily get all the MR information just by knowing its ID - *It would be possible to get away without implementing this issue if [1] and [2] get fixed, but I think it's still worth simplifying the way we handle MR information (GitHub Pull Request does something similar). But if [1][2] get fixed, this is not a blocker.* - [MR Review: create a new comment on the diff](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/342) - This is the final issue, it's going to be quite a lot of effort and has got weight of `4` - We'll have to implement a workaround for [2] #### Dependencies Only the last issue ([MR Review: create a new comment on the diff](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/342)) is dependent on all the previous issues. ```mermaid graph LR A["Respond to a diff thread"] --> D["create a new comment on the diff"] B["add commenting ranges"] --> E["track changed lines on the diff"] E --> D C["Introduce global MR cache"] --> D ``` [1]: [GraphQL `createDiffNote` forces clients to compute redundant information](https://gitlab.com/gitlab-org/gitlab/-/issues/325161) [2]: [GraphQL `createDiffNote` mutation doesn't fully support interactive clients](https://gitlab.com/gitlab-org/gitlab/-/issues/325155)
2
5,261,717
76,107,661
2020-12-15 23:22:24.728
Add MR's I'm Reviewing to Sidebar Lists
## Problem to Solve [Merge Request Reviewers](https://gitlab.com/groups/gitlab-org/-/epics/5072) was added to GitLab. This allows people to be placed in the `Reviewers` role for Merge Requests. If you're a `Reviewer` those items won't be surfaced in VS Code. ## Proposal We should add a `Merge Requests I'm Reviewing` filter to the sidebar in VS Code that retrieves a list of MR's where I'm listed as a Reviewer. ## Technical details - We define default queries (that show in the sidebar) in [package.json](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/658a0c8bccc425bd046b5de4d1ef78a3fb7f2250/package.json#L483-489) - The `CustomQuery` type is defined in [`custom_query.ts`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/a2b3f881f8de9c30bce5e423b51506a9935d6188/src%2Fgitlab%2Fcustom_query.ts#L2-3) - Same way as we use [`assignee_username`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/a2b3f881f8de9c30bce5e423b51506a9935d6188/src%2Fgitlab_service.ts#L298) we would want to use `reviewer_username`. ## Possible improvements to the existing code - Use [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) or similar method to replace the current `queryString += '&key=value'` mutations that the `gitlab_service.ts`.`fetchIssuables()` method uses. - Increase the test coverage for the same `fetchIssuables()` method. - There are a few happy path integration test scenarios in `test/integration/tree_view.test.js` - We could potentially introduce a Jest uni test because there is a lot of logic branching in the method.
2
5,261,717
76,072,720
2020-12-15 09:49:42.795
Use windows CI runner to run integration tests
### Problem to solve At GitLab, using Windows for development is [strictly prohibited](https://about.gitlab.com/handbook/business-ops/team-member-enablement/onboarding-access-requests/#laptop-configurations). The extension is heavily working with the host machine file system. But the extension is rarely (if ever) tested on non-POSIX system before the release. In some cases, this development process results in bugs (e.g. #284) that could be caught by running the integration tests on Windows. ### Proposal Dog feed our [shared Windows runners](https://about.gitlab.com/blog/2020/01/21/windows-shared-runner-beta/). ### Further details We would introduce another CI task similar to the `test-integration` but run by a windows CI runner. ```yaml test-integration: stage: test variables: DISPLAY: ':99.0' script: - apt-get update - apt-get install -y xvfb libxtst6 libnss3 libgtk-3-0 libxss1 libasound2 libsecret-1-0 git - npm ci - echo $DISPLAY - /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - npm run test-integration ``` ### Links / references
2
5,261,717
75,817,200
2020-12-09 09:18:19.790
Use welcome view when the extension can't show TreeView
### Problem to solve There are several scenarios when the extension can't do any useful work: - New VS Code window (no workspace is open) - None of the open workspaces contains a configured GitLab project - The personal access token hasn't been set up - There workspace folder doesn't have initialized git repository #321 For example, attempt to use the extension when there is no open project now results in an error message: ![image](/uploads/18b16f548b566c4e715efec3cc205bfb/image.png) ### Proposal Utilise the [Welcome view](https://code.visualstudio.com/api/references/contribution-points#contributes.viewsWelcome) available in for VS Code extensions: ![poc-welcome](/uploads/e7eb40ec6996d372afa767cb7ae902b5/poc-welcome.gif) #### Scenario 1: No token ```txt Hey. Welcome to the GitLab Workflow extension. It seems that you have not yet set up your access token. If you use GitLab.com, click [here](https://gitlab.com/profile/personal_access_tokens). If you have a self-managed GitLab, then: 1. Go to 'Settings' 2. Click 'Access Tokens' on the left navigation menu 3. Click on 'Add a personal access token' Now you can set your token by clicking on the following button [Set Personal Access Token](command:gl.setToken) To learn more, please [read our docs](https://gitlab.com/gitlab-org/gitlab-vscode-extension#setup). ``` - [ ] mention that the token needs `read_user` and `api` scopes to fix https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/230 **Once this scenario is implemented, we should not show the "add token" info message during every extension startup. It was bothering users: #279** #### Scenario 2: No GitLab project ```txt It seems like your current workspace doesn't contain a GitLab project (or the project has been moved). ``` #### Scenario 3: No open project ```txt In order to use the GitLab Worfklow extension, please open a folder containing a GitLab project. [Open GitLab project folder](command:vscode.open) ``` ### Further details There is a small POC implemented in [`welcome-poc` branch](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/compare/main...welcome-poc). ### Examples | extension | screenshot | | ------ | ------ | | source control (no open workspace) | ![Welcome](/uploads/676ed2698d424024945391d4e342834c/Welcome.png) | | source control (no git repository) | ![Welcome___Music](/uploads/a9d6fd9928ba19e51e4038a14621d256/Welcome___Music.png) | | debugger | ![Welcome___Music](/uploads/36ca0ffadab097b21ae3b32bf09f12be/Welcome___Music.png) |
2
5,261,717
75,629,820
2020-12-04 17:23:38.430
Unpubished Branch on Remote generates Error
When a branch exists locally, but has not been published to GitLab there is an error in the logs: ``` Command failed with exit code 1: git config --get branch.phikai-code-review-dec-pi-update.merge Error: Command failed with exit code 1: git config --get branch.phikai-code-review-dec-pi-update.merge at makeError (/Users/phikai/.vscode-insiders/extensions/gitlab.gitlab-workflow-3.6.2/node_modules/execa/lib/error.js:59:11) at handlePromise (/Users/phikai/.vscode-insiders/extensions/gitlab.gitlab-workflow-3.6.2/node_modules/execa/index.js:114:26) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:94:5) ```
1
5,261,717
75,498,628
2020-12-02 16:36:50.115
MR Review: Show change type for each changed file
### Problem to solve This is a follow-up to #263. Currently, we are indicating the type of git change by prepending `[added]`, `[deleted]`, `[renamed]` to the item description. ![_Extension_Development_Host__-_Welcome___gitlab-vscode-extension-TEST](/uploads/79eaf122b3480c71793ca31084ef6c52/_Extension_Development_Host__-_Welcome___gitlab-vscode-extension-TEST.png) But once the `FileDecoration`s are [generally available in the next VS Code release](https://github.com/microsoft/vscode/issues/54938), we should use them instead: ![mr_item_ts___gitlab-vscode-extension](/uploads/a362e564c6ef5b289aa0194cbc729e35/mr_item_ts___gitlab-vscode-extension.png) ### Proposal Implement the `FileDecorationProvider` once at least 90% of the users are on the latest version (`^1.52.0`). ### Further details I looked into the logs today (2020-12-02) and I saw that roughly 90% of extension requests on `gitlab.com` are made by the latest VS Code version. [Today is 21 days since the latest VS Code version has been released](https://github.com/microsoft/vscode/releases/tag/1.51.1). These numbers can be checked in the logs https://log.gprd.gitlab.net/ (only GitLab team members). - index: `pubsub-workhorse-inf-gprd-*` - query: `json.user_agent : "vs-code-gitlab-workflow/3.6.2 VSCode/"` AND NOT `json.user_agent : "vs-code-gitlab-workflow/3.6.2 VSCode/1.51.1"` (replace versions by the latest) ### Links / references
1
5,261,717
75,467,458
2020-12-02 07:39:12.650
Multi-root workspace with a non-GitLab project doesn't work: Error: 404 Project Not Found
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "bug" label: - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. If you are facing issues around configuring Token from your GitLab.com account, see the list of already addressed Token related issues: https://gitlab.com/gitlab-org/gitlab-vscode-extension/issues?scope=all&utf8=%E2%9C%93&state=closed&label_name[]=token-issue ---> ### Summary <!-- Summarize the bug encountered concisely --> Ext is going to be useless if project could not be fetched by API. ### Steps to reproduce <!-- How one can reproduce the issue - this is very important --> 1. Clone [gitlabhq/terraform-provider-gitlab](https://github.com/gitlabhq/terraform-provider-gitlab) from GitHub to folder on the workstation. 2. Clone [gitlab-org/gitlab-vscode-extension](https://gitlab.com/gitlab-org/gitlab-vscode-extension) from GitLan to folder on the workstation. 3. Add both repos to VS Code and save workspace configuration. 4. Go to GitLab sidebar. 5. Click on **refresh** icon. 6. Gitlab Extension fails with error notification. Clone git repo with valid git remote url. Change git remote url to something else. Go to sidebar and refresh your issues / merge requests. ### What is the current *bug* behavior? <!-- What actually happens --> GitLab Ext tries to fetch project info by given group name extracted from git remote url, and fails when project could not found. API request failed when trying to get current project because: 404 - "{\"message\":\"404 Project Not Found\"}" ### What is the expected *correct* behavior? <!-- What you should see instead --> Ext shouldn't fail in case if project does not exist by given group name, or added git repo is originally from Github, Bitbucket, etc. ### Relevant logs and/or screenshots ![image](/uploads/ddb7df56f55eed8cd30667e17c98323f/image.png) ![image](/uploads/86b9bcd45c9b0b5c8bcc195838b59559/image.png) <!-- Logs can be found by running `GitLab: Show extension logs` command (using `cmd+shift+p`) --> ### Possible fixes <!-- If you can, link to the line of code that might be responsible for the problem -->
1
5,261,717
74,332,669
2020-11-13 15:56:30.656
MR review: interacting with existing comments - POC
### Problem to solve The #243 proof of concept work didn't validate the workflows for creating and updating comments on the MR diff. The VS Code API for creating/editing comments is not documented and so we have to result to try to copy a reference implementation like GitHub pull request extension. This issue is to create POC that validates the implementation of interacting with existing comments (responding, resolving, deleting, possibly reactions). Creating new comments and reviews is going to be out of scope for this POC. ### Proposal - Investigate VS Code API's for triggering actions on comments (edit, (un)resolve, delete, report abuse?) - Implement POC for editing comments. - Investigate VS Code API's for access control (i.e. only show users actions that are available to them (e.g. only the author can edit the comment). - validate that the GraphQL queries and mutations are in place - if time allows, investigate how to implement reactions (is the VS Code reaction API compatible with GitLab?) ### Further details - Explanation of how the current MR review POC works is here: #243 ## POC Result **TL;DR**: This POC implemented editing and resolving comments, validating the presence of all APIs (both GitLab and VS Code). The only feature that we are not able to implement straight away is emoji reactions. All code is available in the [`existing-comments-poc`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/tree/existing-comments-poc) branch. ### :white_check_mark: Editing comments ![poc-editing-comments](/uploads/e357e81ea6d25bbf1b882907533b4ff4/poc-editing-comments.gif) #### GitLab We'll use `adminNote` permission attribute (see Appendix 2) to decide whether the user can edit a note. GitLab GraphQL API provides an `updateNote` mutation that will change the note body. #### VS Code We will add a pencil-shaped icon to the comment title (see Appendix 1). Clicking this icon will change the note mode to `vscode.CommentMode.Editing`. We add two comment context action (see Appendix 1) `Submit` and `Cancel`. Submit will trigger the GraphQL mutation, cancel reverts any changes to the comment text. We also add the `canAdmin` permission attribute on the comment context so the VS Code can decide whether to show the edit button or not. #### :warning: Caveyats - **Comment drafts**: VS Code is not telling us when the comment editing is in progress. We only get notified when the user triggers one of the context actions (submit/cancel). If users close the editor or refresh the MR during editing, they'll lose the draft and we can't do anything about it. ### :heavy_check_mark: Deleting comments I've validated the API, but haven't implemented this feature. Very similar to editing comments without the need to switch comment into editing mode. We will show a warning message before removing the comment: ```js const shouldDelete = await vscode.window.showWarningMessage('Delete comment?', { modal: true }, 'Delete'); ``` ![delete-confirmation](/uploads/2ed0f0ca38dd3771f8999cc8f50a4bea/delete-confirmation.gif) ### :white_check_mark: Resolving/Unresolving discussions ![poc-resolve-thread](/uploads/3ed5bac48d482a3e9318651578da18bc/poc-resolve-thread.gif) #### GitLab We'll use `resolvable` permission attribute (see Appendix 2) to decide whether we can let user resolve/unresolve a discussion. GitLab GraphQL API provides a `discussionToggleResolve` mutation that will set the `resolved` attribute. #### VS Code We will add a `check` icon to the thread title (see Appendix 1). Clicking this icon will resolve the thread and it will set the thread context to `resolved`. VS Code recognises the context change and it will show `close` icon instead. #### :warning: Caveyats - The `cancel` and `check` icons might not accurately show the user what is going to happen. At least they have a tooltip that shows on hover ![Screenshot_2021-02-09_at_17.52.00](/uploads/4909d98d6d09dcf36d08e057543f0367/Screenshot_2021-02-09_at_17.52.00.png) *[List of all supported icions]([codicon](https://microsoft.github.io/vscode-codicons/dist/codicon.html))* ### :x: Emoji reactions Implementing reactions is going to be facing issues on both the GitLab and the VS Code side. #### :x: GitLab **We don't have a GraphQL endpoint to retrieve reactions for a note.** Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/320963 We do have an endpoint to add or remove a reaction: ```graphql mutation{ awardEmojiAdd(input:{awardableId: "gid://gitlab/DiffNote/447164415", name: "tada"}){ errors } } ``` #### :warning: VS Code The VS Code extension API is very much GitHub oriented. It is made to support half a dozen predefined reactions, not a full emoji selection as we have at GitLab. You can see that the emoji picker doesn't scale above maybe 10 emojis. Also, each emoji needs to have a PNG icon in the project. ![700face67d864dd78fb55f15934f39cc](/uploads/b2e2c7dadded662f057b976dd1864587/700face67d864dd78fb55f15934f39cc.png) ##### Implementation notes 1. add a `commentHandler` ```ts commentController.reactionHandler = async ( comment: vscode.Comment, reaction: vscode.CommentReaction, ): Promise<void> => {}; ``` 1. Each comment can have `reactions`. If they have `count === 0`, they don't show at the bottom of the comment ```js reactions: [ { label: '✅', iconPath: '$(check)', count: 1, authorHasReacted: true, }, ], ``` 3. Each [reaction has to have a PNG icon](https://github.com/microsoft/vscode-pull-request-github/blob/29955445c80ae5b3f06b27eb89886d1fd9e91a76/src/common/resources.ts#L13-L25) otherwise, it shows up as ![e8eecbc1d7624b87bf6f8ec3d951ca69](/uploads/20fc686815c1e0f0de7b2d1a0d155368/e8eecbc1d7624b87bf6f8ec3d951ca69.png) ### :heavy_check_mark: Bonus: Open the comment in a browser Since we are most likely not going to be adding the "Report Abuse" button and also because it might be difficult to introduce reactions from the get-go, I suggested we include `globe` button in the title of each note. When the user clicks this button, VS Code will open the comment permalink in the browser. ![poc-comment-on-the-web](/uploads/d0bdb3deb738236cf6e1803e88574de8/poc-comment-on-the-web.gif) The POC haven't fully implemented this feature, but all the necessary information (MR URL and note ID) is available. ### Appendix 1: Context menu on comment threads and comments Extensions can [contribute menus](https://code.visualstudio.com/api/references/contribution-points#contributes.menus). The important menus for the MR Review comments are: - The comment thread title menu bar - `comments/commentThread/title` ![_Extension_Development_Host__-_git_service_ts___173__—_gitlab-vscode-extension-TEST.png](/uploads/46586488ac139956c5b9903c760392c2/24d89816d1e7417abb1151a2d69bcefe.png) - The comment thread context menu - `comments/commentThread/context` ![_Extension_Development_Host__-_git_service_ts___173__—_gitlab-vscode-extension-TEST.png](/uploads/7b80203bf6f4425b46d2282f95de19ee/bc238157fa5e4436a1c6f48abd1d07d6.png) - The comment title menu bar - `comments/comment/title` ![comments/comment/title](/uploads/9058c42082b8c425218b763eb3bd2682/bdf8aff525fe442c98d046b2e8e9b71b.png) - The comment context menu - `comments/comment/context` ![_Extension_Development_Host__-_git_service_ts___173__—_gitlab-vscode-extension-TEST.png](/uploads/2a78ae8bc120c624d7c3e51a79d80ed0/78dde3979b754cc1bbdb1ddb245ea17c.png) ### Appendix 2: Access control #### on each note | Field | Type | Description | | -- | -- | -- | |adminNote | Boolean! | Indicates the user can perform admin_note on this resource | |awardEmoji | Boolean! | Indicates the user can perform award_emoji on this resource | |createNote | Boolean! | Indicates the user can perform create_note on this resource | |readNote | Boolean! | Indicates the user can perform read_note on this resource | |repositionNote | Boolean! | Indicates the user can perform reposition_note on this resource | |resolveNote | Boolean! | Indicates the user can perform resolve_note on this resource | #### on merge request We need the `createNote` value to know whether the user can respond to a discussion. ``` mergeRequest(iid: "3") { id webUrl userPermissions{ createNote } } ``` #### on a discussion A discussion contains a boolean field `resolvable` indicating whether the discussion can be resolved or not.
2
5,261,717
74,331,208
2020-11-13 15:32:05.973
Add the ability to show pipelines within vscode
### Problem to solve Currently, it's necessary to open the pipeline in the GitLab web interface to learn details about jobs. We show some rudimentary pipeline information in two places: | | | | ------ | ------ | | status bar | ![current_branch_ts___gitlab-vscode-extension](/uploads/62d29acd8ec085d24ffdf8ed9f320ab5/current_branch_ts___gitlab-vscode-extension.png) | | "For current branch" sidebar | ![current_branch_ts___gitlab-vscode-extension](/uploads/b5c0a3a2f2b7e63b7b5210bed72a8190/current_branch_ts___gitlab-vscode-extension.png) | ### Proposal Extend the tree item in the sidebar to show information about all jobs: | before | after | | ------ | ------ | | ![current_branch_ts___gitlab-vscode-extension](/uploads/efb1e59d5061b4a87146af8e3dba4bd9/current_branch_ts___gitlab-vscode-extension.png) | ![_Extension_Development_Host__-_README_md___test-project](/uploads/e9b76e1e5f5ff1a23694b307ee7d7c22/_Extension_Development_Host__-_README_md___test-project.png) | ### Further details The API information is available and it should be fairly simple to render the UI as shown above. This work would provide basis for: - starting/stopping/retrying jobs #97 - seeing job logs #423 - downloading job artifacts #106 The auto-update would be a great follow-up [Auto update "For Current Branch" tab in sidebar](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/60) <details> <summary>Original description</summary> Possible duplicate: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/97 ### Problem to solve It's very convenient having the ability to create, view, and comment on issues from within vscode. I understand there are a few open issues related to pipelines jobs that I'd assume would be tied into this solution. But I didn't see an open issue specifically requesting this feature, although https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/97 may actually be good enough honestly, if it would work like issues/MRs do. ### Proposal Curious if embedding `/-/pipelines/$Pipeline_ID` would be an option, similar to what the experience is when clicking an issue and how we can "View issue and MR details and comments in VS Code"? This would at least allow us to see which job failed, if nothing else. ### Further details It looks like @fatihacet did some work towards integrating jobs under pipelines in For Current Branch section of the sidebar and that's great!...not sure if that work/code transferred over with the project ownership shift. I'm not sure if the intent was clicking one of those jobs would have opened the build output?...that's what I would love to see! ### Links / references </details>
2
5,261,717
74,267,730
2020-11-12 16:05:07.992
MR Review: Show comments on changed file diff
### Problem to solve Users who perform MR review in VS Code can get additional context from commetns that are placed directly on the diff. ### Proposal ![_Extension_Development_Host__-_test_js__MR____test-project](/uploads/53a54bf961c2845edf5d527771348e5a/_Extension_Development_Host__-_test_js__MR____test-project.png) We are going to fetch all comments for the MR and show the non-outdated on the diff. ### Further details This issue is described in a detail on the POC work here: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/243#showing-existing-comments ### Out of scope - adding, editing or deleting comments - reactions ### Links / references
2
5,261,717
74,267,126
2020-11-12 15:54:10.556
MR Review: Show changed file diff (Git-provided)
### Problem to solve After implementing https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/264, user can see change diff for an MR file, but the change needs to be fetched from the GitLab API, putting additional load on the API but mainly decreasing the responsivness of the review. Often the file is going to be already present in the local Git repo and that's where we'll try to get it from. ### Proposal Implement a content provider that will be able to serve file content for a specific version. It will serve this content from the local git repository. ### Further details Showing the diff is explained in the [MR Review POC](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/243#file-diff-view). When we are done, we'll have a chain of content providers as shown in: ```mermaid graph LR A[VS Code] -- "gl-review: URI" --> B[LocalGitContentProvider] B --> C[RemoteApiContentProvider] ``` This issue implements the `LocalGitContentProvider` Good way to approach this is going to be to use the native Git extension that is always present as a part of VS Code. That way we'll have all git-related information in VS Code in sync. Eventually we might want to move away from executing the git command ourselves in other parts of the codebase as well. ### Links / references - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/243
3
5,261,717
74,266,031
2020-11-12 15:36:33.210
MR Review: Show changed file diff (API-provided)
### Problem to solve When reviewing MRs, users need to see changed files. This is going to be the first iteration of showing users the changes made in the file. ### Proposal ![Extension\_Development\_Host\_-\_terraform\_list\_vue\_\_MR\_\_\_\_gitlab\_and\_Add\_\_Ability\_to\_chec\_\_\_\_\_\_gitlab-vscode-extension\_and\_zsh](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/8731b1c3adb85de00977d0a4edbfdeb5/_Extension_Development_Host__-_terraform_list_vue__MR____gitlab_and_Add__Ability_to_chec______gitlab-vscode-extension_and_zsh.png) Once the user clicks on a changed file (see https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/263), VS Code will open a file diff showing the change. VS Code will get file content from the GitLab instance API. ### Further details Showing the diff is explained in the [MR Review POC](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/243#file-diff-view). When we are done, we'll have a chain of content providers as shown in: ```mermaid graph LR A[VS Code] -- "gl-review: URI" --> B[LocalGitContentProvider] B --> C[RemoteApiContentProvider] ``` This issue is going to implement the remote content provider. We'll start with the remote provider in the first iteration because the remote provider will always have the content and the local git provider is optimisation that we'll implement next. Showing diff for images and other binaries is out of scope. We need to have a look into how to show diffs of extra large text files like `package-lock.json`. ### Links / references
2
5,261,717
74,265,459
2020-11-12 15:24:48.558
MR Review: Show changed files for the MR
### Problem to solve As a part of MR review, users need to see what files changed. It's the initial step in selecting a chagned file and inspecting the MR diff view. ### Proposal ![_Extension_Development_Host__-_agents_spec_js___gitlab](/uploads/411e83788322641d0258bdf50b2ad547/_Extension_Development_Host__-_agents_spec_js___gitlab.png) Building on top of the work in https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/243 we would extend the MR items in the tree view as per the screenshot. For each MR user can click on the MR and see an item representing the description and all changed files. ### Further details - We would have a chance to deside what icons do we want to show and we could also redesign the tree structure (e.g. grouping issue queries and MR queries) - The current implementation of the tree view is mainly untested (except for a few integration tests) and it is not extensible in its current form. We will need to refactor the tree view a bit before we can start building on top of it. ### Links / references
2
5,261,717
73,785,128
2020-11-03 09:45:30.677
Consistent handling of remotes, instances and branches
### Problem to solve With the implementation of https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/90 we started discovering several classes of errors related to parsing information about the workspace git repository. The main issue is the complex edge cases that were never considered (sorted by how frequently they occur): - Mutiple remotes in one repository - here we can get a remote that is not matching the defined `instanceUrl` (more details: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/115#note_410341027) - Multi-root workspaces - Which remote, `instanceUrl` and branch to use when there are multiple git repositories in one workspace? - currently, we use the open file to find out what git repository should we use, but if there's no file open we have very inconsistent handling - Tracking branches - sometimes we ask for [tracking branch](https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches#_tracking_branches) which can again point to a different remote than what we use for rest of the requests ### Proposal Separate the current `GitService` into three modules with different responsibilities: - thin layer on top of the `git` shell command - instanceUrl service that would be responsible for matching git remotes and define tokens - GitLab-specific git logic (e.g. picking which remote to use based on an instanceUrl, creating GitLab API URL based on git remote) The last service would return an object with the following attributes: - `apiUrl` - where to send API requests - `namespace` - group or username - `project` - project name - `branch` (optional) - remote branch (e.g. to query for active pipelines) ### Further details The main benefit of the proposed solution is that we would have certainty that our `instanceUrl` matches the `namespace`, `project`, and `branch` information. This would reduce hard to remove issues and it would improve the environment for contributors because the current edge-case ridden code is very hard to understand. We also have two config options that override the aforementioned logic: ```json "gitlab.remoteName": { "type": "string", "default": null, "description": "Name of the git remote to use in order to locate the Gitlab project" }, "gitlab.pipelineGitRemoteName": { "type": "string", "default": null, "description": "Name of the git remote to use in order to locate the Gitlab project for your pipeline. Keep empty for default" }, ``` ### Links / references - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/34 - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/71
3
5,261,717
73,753,976
2020-11-02 18:26:09.487
403 Forbidden Error on Projects with Pipelines Disabled
### Summary When configuring the Gitlab Workflow Plugin with a repo that has Pipelines Disabled, the extension tosses a 403 when viewing Merge Requests. Enabling Pipelines allows Merge Requests to once again be polled and return results as expected. Gitlab in this bug report is self-hosted v13.4.2-ee and not on Gitlab.com (not sure if that matters). ### Steps to reproduce *Note: this happens on `gitlab.com` as well.* 1. Setup on-prem (non-gitlab.com) personal access token 2. Setup Settings to use the proper Gitlab Instance URL (gitlab.examplecompany.com) 3. Find/Create a repository with Merge Requests Enabled and Pipelines Disabled. ![General___Settings___Tomas_Vik___test_project___GitLab](/uploads/425b823650eb8e1842a0a89269d10709/General___Settings___Tomas_Vik___test_project___GitLab.png) 4. Attempt to use the VSCode Plugin to view MRs but receive a 403 ![Screenshot_2020-11-04_at_2.14.00_PM](/uploads/afadc494c8f938192e0af93ed6d59d62/Screenshot_2020-11-04_at_2.14.00_PM.png) ### What is the current *bug* behavior? 403 - Forbidden ### What is the expected *correct* behavior? Ability to see Active/Closed MRs, or MRs assigned to "me" ### Relevant logs and/or screenshots ``` 403 - "{\"message\":\"403 Forbidden\"}" StatusCodeError: 403 - "{\"message\":\"403 Forbidden\"}" at new StatusCodeError (/Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/request-promise-core/lib/errors.js:32:15) at /Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/request-promise-core/lib/plumbing.js:97:41 at tryCatcher (/Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromiseCtx (/Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/bluebird/js/release/promise.js:641:10) at _drainQueueStep (/Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/bluebird/js/release/async.js:97:12) at _drainQueue (/Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/Users/joel.vasallo/.vscode/extensions/gitlab.gitlab-workflow-3.6.0/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:439:21) ``` ### Possible fixes The fix for now is to enable Pipelines in the project settings. The [offending code in `current_branch.js`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/blob/a03468d9e525fa9c9835fa8466e48646b8369f18/src/data_providers/current_branch.js#L101-103): ```js async getChildren() { try { const workspaceFolder = await getCurrentWorkspaceFolder(); this.project = await gitLabService.fetchCurrentProject(workspaceFolder); await this.fetchPipeline(workspaceFolder); await this.fetchMR(workspaceFolder); await this.fetchClosingIssue(workspaceFolder); } catch (e) { handleError(e); this.children.push(new ErrorItem()); } return this.children; } ``` Since the fetching pipeline fails, the whole request fail. This code didn't consider that some of the calls could be still successful.
1
5,261,717
73,586,084
2020-10-29 15:41:41.379
Collecting MAU for GitLab Workflow (VS Code) Extension
## Problem to Solve The GitLab Workflow Extension is currently used outside of the main GitLab application and connects to GitLab instances via API to perform tasks. There is currently no standard way within GitLab to understand this usage and provide accurate usage statistics to aid in feature development, prioritization and continued investment in the extension. ## Additional Details GitLab has a series of [performance indicators](https://about.gitlab.com/handbook/product/performance-indicators/#structure) based around AMU (Active Monthly Users). In many cases these are measured as aggregate counts of users who engage with certain features over a period of time. An example of this is for the ~"group::editor" [`Git write operations from web editors`](https://about.gitlab.com/handbook/product/dev-section-performance-indicators/#createeditor---gmau---mau-conducting-git-write-operations-from-web-editors) are measured. ## Proposal Intercept some hook for all API calls or develop/use a rack middleware. This way we could log usage in Redis using Product Analytics HLL (distinct counts) or regular count APIs. <details><summary>Old Proposal</summary> ### Option 1 With the release of GitLab Workflow 3.6.0 a [User-Agent is included in all API requests](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/238) that identifies the extension and the version. If log collection and importing of specific data was available in the Data Warehouse ([other](https://gitlab.com/gitlab-data/analytics/-/issues/5305) [proposals](https://gitlab.com/gitlab-data/analytics/-/issues/5200) suggesting log usage) we could aggregate logs based on this user agent. We would need some way to get additional data to identify users in aggregate and not specifically, but this could be a foundation for getting usage numbers. ### Option 2 In an effort to [improve the onboarding flow](https://gitlab.com/groups/gitlab-org/-/epics/4363) a proposal is being considered to [implement OAuth](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/221) for using the extension. OAuth applications are [stored in the database](https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/structure.sql#L13981) of GitLab which would allow us to count the number of authorizations. **Lacking from this could be last used as that doesn't appear to be tracked.** Also important is that the level of effort required for Option 2 might be [quite significant](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/221#note_438407317) and is not the preferred path at this time. </details>
3
5,261,717
73,185,897
2020-10-22 17:16:52.757
Can't respond in comment thread in webview for MR/Issue
## Problem to solve Inside of Issues and Merge Requests you can comment in a new comment or via a threaded reply to a parent comment. The option to reply in a thread to a parent comment is not available inside of the webview for issues/merge requests. ![Screen_Shot_2020-10-22_at_12.13.09_PM](/uploads/6b7d158f17d3e5222e38ecc06f18c0be/Screen_Shot_2020-10-22_at_12.13.09_PM.png) ## Proposal The ability to respond via a threaded reply should be added so that conversations can be properly tracked and resolved.
2
5,261,717
72,274,320
2020-10-06 18:05:02.340
Create POC for MR review feature
### Problem to solve Before we implement #53, we'd like to validate certain assumptions like: - GitLab API provides us with the MR diff file content and comments in an easy-to-consume format - VS Code Extension API allows for easy integration of the GitLab API results with the diff view ### Proposal Implement POC that can: 1. Show files that have been changed in the MR 1. For each one of those files shows a diff view between merge-base and the MR branch 1. Display comments from the MR diff 1. Allow creating comments on the diff # Report from POC implementation This report is a summary of the POC work. It will try to explain what uncertainties we've removed and discovered. ![_Extension_Development_Host__-_test_js__MR____test-project_and_mr_item_js___gitlab-vscode-extension_and_zsh](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/e641142e889443c1118f8a5ab49a0f92/_Extension_Development_Host__-_test_js__MR____test-project_and_mr_item_js___gitlab-vscode-extension_and_zsh.png) ## Try it yourself Straight to the fun bit, try it yourself by installing the [packaged extension with POC](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/raw/mr-review-poc/gitlab-workflow-3.6.0.vsix?inline=false) ([how to install](https://stackoverflow.com/questions/37071388/how-can-i-install-visual-studio-code-extensions-offline)) **Caveat: All MR refs (commits) need to be available locally (run `git pull` before trying the POC)** I've tested the POC on `gitlab-org/gitlab` project and it seemed to work for most of the MR's. The messy code is available in [`mr-review-poc` branch](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/tree/mr-review-poc). ## Features: ### File tree: ![_Extension_Development_Host__-_index_md___gitlab](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/7dc75673aba70492f162abc2f095bf00/_Extension_Development_Host__-_index_md___gitlab.png) #### Certainty overview - Dependencies available and working: **4/5** - REST API ✅, GraphQL ❌ - VS Code API suits our needs: **4.5/5** - Only the Git Changed status indicator is unavailable to us. - The codebase is ready for implementation: **3/5** - Tree view cleanup necessary before starting #### Details There is no custom UI involved; we are going to utilise the VS Code API. We can get necessary information about the changed files from the REST API ([MR version](https://docs.gitlab.com/ee/api/merge_requests.html#get-a-single-mr-diff-version)). The GraphQL API can't provide us with the necessary information (https://gitlab.com/gitlab-org/gitlab/-/issues/280803). Creating the file tree seems straight forward, the only thing I wasn't able to achieve vas to show the Git Changed status indicator: ![_Extension_Development_Host__-_snippet_blob_actions_edit_vue___gitlab](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/3637bb847c89d94b70cc4157bdf9c3b7/_Extension_Development_Host__-_snippet_blob_actions_edit_vue___gitlab.png) The API seems not to be officially exposed. When talking about the design, we'll have to decide between two ways of showing the changes: | Tree | Path in the item detail | | ------ | ------ | | ![constants_ts___gitlab-vscode-extension](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/bc8cbe08ad4bc90054dca50a6ce9a525/constants_ts___gitlab-vscode-extension.png) | ![constants_ts___gitlab-vscode-extension](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/436d38db17c1a2d0d980c53a9eaabc43/constants_ts___gitlab-vscode-extension.png) | #### Known issues and uncertainty - The current code ([issuable.js](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/main/src/data_providers/issuable.js) and [sidebar\_tree\_item.js](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/main/src/data_providers/sidebar_tree_item.js) will need a cleanup before we can start build on topo of it. - We'll probably always work with the last MR version and will ignore the intermediate versions. - We might want to start showing Merge Requests differently from issues in the Tree View. Also we might want to choose icons for all tree items. ### File Diff View ![_Extension_Development_Host__-_terraform_list_vue__MR____gitlab_and_Add__Ability_to_chec______gitlab-vscode-extension_and_zsh](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/8731b1c3adb85de00977d0a4edbfdeb5/_Extension_Development_Host__-_terraform_list_vue__MR____gitlab_and_Add__Ability_to_chec______gitlab-vscode-extension_and_zsh.png) #### Certainty overview - Dependencies available and working: **3/5** - fetching remote content has not been tested - VS Code API suits our needs: **5/5** - The codebase is ready for implementation: **2/5** - It would be best to slowly shift Git related responsibility to VS Code (instead of running shell command) #### Details VS Code provides us with the diff functionality, the only thing we do is defining a custom document URI and then implement content providers for that URI. Uri: ``` "gl-review://authority/app/assets/javascripts/terraform/graphql/queries/get_states.query.graphql?commit%3D5fa9332d0cedb98b0095b34d01470e419d3a98ba%26workspace%3D%2FUsers%2Ftomas%2Fworkspace%2Fgitlab%2Fgitlab-development-kit%2Fgitlab%26version%3Dbase" ``` When VS Code tries to open our URI, it will invoke our content provider, which returns a `string` content of the file. The POC implements only the local git content provider, which means that the file version (correct commit) needs to be in the local git repository. The proper implementation is going to implement a fallback provider which will fetch the content from the API. ```mermaid graph LR A[VS Code] -- "gl-review: URI" --> B[LocalGitContentProvider] B --> C[RemoteApiContentProvider] ``` The future-proof way to interact with `git` is to use the VS Code core extension for Git (originally suggested in !54). It is how most of git-related extensions work. The added benefit is that everything git related (VS Code VCS view, other extensions, our extension) is going to be in sync. This will require a bit of plumbing implementation, potentially overlapping with [Consistent handling of remotes, instances and branches](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/260). #### Known issues and uncertainty - I haven't implemented the API file content provider and so we don't have 100% certainty that we can retrieve the content. - I'm not sure how are we going to react to remote changes. For example, when the user refreshes the file tree and all of a sudden the displayed diff doesn't correspond with the latest version. - I'm not sure if there is a difference in how we'll use API to fetch file content from forked projects - **Images** - VS Code can show images in tabs, but the POC haven't done any exploration of how that works. ### Showing existing comments ![_Extension_Development_Host__-_test_js__MR____test-project](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/53a54bf961c2845edf5d527771348e5a/_Extension_Development_Host__-_test_js__MR____test-project.png) #### Certainty overview - Dependencies available and working: **5/5** - VS Code API suits our needs: **4/5** - GitLab-specific highlighting like #243, !54 and @viktomas is not going to work - images and advanced Markdown syntax (mermaidjs) is not working out of the box and maybe not at all - The codebase is ready for implementation: **5/5** - This is going to be a greenfield development. #### Details This feature is going to use GraphQL, so far it seems to be the only endpoint that's going to work out of the box. <details> <summary>See the full GrapQL query</summary> ```graphql query GetDiscussions($projectPath: ID!, $iid: String!) { project(fullPath: $projectPath) { mergeRequest(iid: $iid) { discussions { nodes { notes { nodes { body author { name avatarUrl } position { diffRefs { baseSha headSha } filePath positionType newLine oldLine newPath oldPath } } } } } } } } ``` </details> The VS Code API allows us to add comments for our custom URI. This seems to work really well (and potentially handles automatically comments on outdated diffs). Each comment has a `body` (markdown string) and Author information. We create the commits as follows: ```js commentController.createCommentThread( getReviewUri({ path, commit, workspace: this.projectUri, version: old ? 'base' : 'head', }), new vscode.Range(vsPosition, vsPosition), comments, ); ``` #### Known issues and uncertainty - **I assumed the following about the GrapQL response** - Each GitLab comment has a `diffRefs` and I assume they always point to the latest MR version (even if the comment was made on the previous version). - The POC didn't validate editing or deleting existing comments. - Reactions to the comments are possible but weren't part of the POC. - As mentioned in the "Certainty overview", some markdown might be not rendering correctly - The comments can range over multiple files (according to the API) but it hasn't been tested ### ⚠️Creating new review comments⚠️ ![pullRequestNode_ts__Pull_Request____vscode-pull-request-github](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/d9dcfad2c415cfd1e651592733fbd400/pullRequestNode_ts__Pull_Request____vscode-pull-request-github.png) #### Certainty overview - Dependencies available and working: **1/5** - I wasn't able to reliably create a comment (note) on GitLab MR through our API. - VS Code API suits our needs: **3/5** - It should because other extensions work, but parts of the API are not officially documented. - The codebase is ready for implementation: **5/5** - This is going to be a greenfield development. #### Details First, we tell the VS Code where in the file can we create comments. VS Code provides an API for that: [CommentingRangeProvider](https://code.visualstudio.com/api/references/vscode-api#CommentingRangeProvider). This provider gets a URI and returns ranges of lines where it is possible to comment. My understanding is that on an MR Diff, we can comment on any (even not changed) line in the left-hand side of the diff and only on changed lines in the right-hand side: ![Update_test_js_take_2___2____Merge_Requests___Tomas_Vik___test_project___GitLab](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/5872be9dc8cd3e79bfa6b32adc34ffc7/Update_test_js_take_2___2____Merge_Requests___Tomas_Vik___test_project___GitLab.png) When we have the commenting ranges, the user can click on the commenting gutter and start a comment: ![_Extension_Development_Host__-_test_js__MR____test-project](https://gitlab.com/gitlab-org/gitlab-vscode-extension/uploads/3cb38bd8a5b1a7ac572c22b4a562d38d/_Extension_Development_Host__-_test_js__MR____test-project.png) The buttons on the comment are custom defined and can have arbitrary functionality (Comment now, Add to review). This configuration is done in [package.json](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/mr-review-poc/package.json#L142) and **it is not officially documented**. #### GitLab API problem We are not dogfooding our REST or GraphQL APIs for our code review on GitLab website. I wasn't able to create a new comment through our API in two days. Partly because I'm unfamiliar with the domain and partly because the documentation is quite brief. I faced several bugs (https://gitlab.com/gitlab-org/gitlab/-/issues/281143 and one similar to https://gitlab.com/gitlab-org/gitlab/-/issues/37066) that I need to debug further before I can report them. Without further investigation, I can't tell whether there is a way of implementing creating comments from VS Code or whether we need to implement/update/fix API endpoints first. #### Known issues and uncertainty - The POC didn't implement adding comments and so there is large uncertainty. - I'm also not familiar with the MR Review workflows to be able to foresee any edge cases. - Large part of the comment functionality is undocumented and we might result in using [vscode-pull-request-github](https://github.com/microsoft/vscode-pull-request-github) as documentation (it's good that it is under MIT license). ### Local git manipulation (e.g. Check out MR branch) I wasn't able to include this in POC. <!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION --> *This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.* <!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION -->
3
5,261,717
72,030,889
2020-10-01 16:41:36.586
The "Select a Gitlab Project" dialog gets stuck in a perpetual loop
### Summary I have a workspace with three GitLab projects in it. Sometimes when using the "Create a new merge request..." action, it stalls for a few seconds and then the "Select a Gitlab Project" dialog opens, but no amount of interacting with the dialog will get it to go away and complete the action. * MacOS 10.15.6 * VSCode 1.49.2 * GL extension: 3.3.0 * GL host/plan: Ultimate ### Steps to reproduce 1. Open a [Multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) 1. Open a non-project editor tab (easiest might be to open any extension page from the extension side panel, @joel.schou recommends diff view) 1. Use the keyboard command to open the Command Palette 1. Find "GitLab: Create new merge request on current project" and hit Enter 1. Wait for the "Select a Gitlab Project" dialog 1. Choose a project <details> <summary>Original steps</summary> 1. Add at least two projects to a single workspace 1. Make changes in one and commit the files locally, then push your branch up 1. Have a file open in the DIFF view 👈 **Edit: this might be the key** 1. Use the keyboard command to open the Command Palette 1. Find "Create a new merge request..." and hit Enter 1. Wait for the "Select a Gitlab Project" dialog 1. Choose a project </details> This doesn't happen every time I use "Create a new merge request...". Sometimes the extension makes a wise guess at the project I want it to choose and opens the new MR screen in GitLab. Other times the dialog comes up immediately and I can successfully choose the project. In the past couple days, though, I've been stuck in this loop. ### What is the current *bug* behavior? The extension stops working. After some time the "Select a Gitlab Project" dialog will show and it will not go away for good. Trying to escape from it or select a project on it simply closes it and then brings it back. ### What is the expected *correct* behavior? I should be able to use the dialog as normal. ### Relevant logs and/or screenshots I cannot get at the logs because any time the dialog loses focus, it closes and immediately opens again, stealing focus. ![Kapture_2020-10-05_at_11.47.33](/uploads/74a4a88808631a4166ac4f4d9f1a1f00/Kapture_2020-10-05_at_11.47.33.gif) <details> <summary>Logs</summary> ``` Command failed with exit code 128: git ls-remote --get-url fatal: No remote configured to list refs from. Error: Command failed with exit code 128: git ls-remote --get-url fatal: No remote configured to list refs from. at makeError (/Users/tomas/workspace/code/gitlab-vscode-extension/node_modules/execa/lib/error.js:59:11) at handlePromise (/Users/tomas/workspace/code/gitlab-vscode-extension/node_modules/execa/index.js:114:26) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:94:5) at async GitService._fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/git_service.js:31:26) at async GitService._fetchRemoteUrl (/Users/tomas/workspace/code/gitlab-vscode-extension/src/git_service.js:51:21) at async GitService.fetchGitRemote (/Users/tomas/workspace/code/gitlab-vscode-extension/src/git_service.js:65:12) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:160:20) at async Promise.all (index 1) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 2) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 2) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 2) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 2) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 2) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 2) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 2) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 2) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 2) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async Object.getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async openCreateNewMr (/Users/tomas/workspace/code/gitlab-vscode-extension/src/openers.js:112:27) at async /Users/tomas/workspace/code/gitlab-vscode-extension/src/extension.js:29:5 Command failed with exit code 128: git ls-remote --get-url fatal: No remote configured to list refs from. Error: Command failed with exit code 128: git ls-remote --get-url fatal: No remote configured to list refs from. at makeError (/Users/tomas/workspace/code/gitlab-vscode-extension/node_modules/execa/lib/error.js:59:11) at handlePromise (/Users/tomas/workspace/code/gitlab-vscode-extension/node_modules/execa/index.js:114:26) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:94:5) at async GitService._fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/git_service.js:31:26) at async GitService._fetchRemoteUrl (/Users/tomas/workspace/code/gitlab-vscode-extension/src/git_service.js:51:21) at async GitService.fetchGitRemote (/Users/tomas/workspace/code/gitlab-vscode-extension/src/git_service.js:65:12) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:160:20) at async Promise.all (index 1) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 1) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 1) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 1) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 1) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async fetch (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:63:5) at async fetchProjectData (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:148:28) at async fetchCurrentProject (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:162:12) at async Promise.all (index 1) at async Object.getAllGitlabProjects (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:228:20) at async Object.showPicker [as show] (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_project_input.js:5:34) at async Object.getCurrentWorkspaceFolderOrSelectOne (/Users/tomas/workspace/code/gitlab-vscode-extension/src/gitlab_service.js:52:23) at async openCreateNewMr (/Users/tomas/workspace/code/gitlab-vscode-extension/src/openers.js:112:27) at async /Users/tomas/workspace/code/gitlab-vscode-extension/src/extension.js:29:5 ``` </details> ### Possible fixes ¯\_(ツ)_/¯ - Break the circular dependency between `gitlabProjectInput.show()` and `gitlab_service`. ### Workaround - Always have a project file open in the editor when running GitLab Workflow commands. - The best option for using multi-root workspaces might be downgrading to [`3.2.1`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/main/CHANGELOG.md#321-2020-08-31) (previous version) until a fix is released. ![Screenshot_2020-10-05_at_12.10.07_PM](/uploads/e1ab63715c1ab173440b174fd320102c/Screenshot_2020-10-05_at_12.10.07_PM.png)
2
5,261,717
71,639,849
2020-09-24 15:48:54.308
Include User-Agent to all API requests
### Problem to solve We don't know how many of our users are using the extension and we managed to push some extension changes in the past that started hitting GitLab.com API hard (https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/211) ### Proposal Include [User-Agent header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) to all API requests made by the extension. This way we'll be able to see how many requests are coming from the extension. ```User-Agent: vs-code-gitlab-workflow/${packageJson.version}``` ### Further details <!-- Include examples, use cases, benefits, goals, or any other details that will help us understand the problem better. --> ### Links / references For GitLab team members, the access logs can be seen in https://log.gprd.gitlab.net/app/kibana
1
5,261,717
70,316,834
2020-08-26 11:45:34.784
Detached Pipeline Status
### Problem to solve As a developer in a company that uses only [Pipelines for Merge Requests](https://docs.gitlab.com/ee/ci/merge_request_pipelines/), I would still like to be able to see the status of my current pipeline in VSCode. Currently, it always reports "No pipeline found", because there is no pipeline associated with the branch. Only with the Merge Request. ### Proposal If a related merge request is detected, try fetching the status of the Merge Request Pipeline first, and if that does not exist fall back to fetching the pipeline for the branch. Maybe add a config option to toggle this behavior on/off ### Further details n/a ### Links / references - [REST API docs](https://docs.gitlab.com/ee/api/merge_requests.html#list-mr-pipelines)
2
5,261,717
69,366,225
2020-08-03 13:38:31.751
Improve onboarding by enabling users to get started via OAuth
### Problem to solve Right now a user has to set his personal access token (PAT) to login to the GitLab instance. So the user needs to go to the instance, go through the settings, grab the token, go back to VSCode and paste the token and hopefully it works. This works but the workflow could be much better here. ### Proposal After trigger the GitLab login command in VSCode 1. the user get asked for the GitLab instance url 2. the browser popup with a tab with the "authorize" application for ... 3. user get some kind of popup that login was successful This would make it also easier to setup multiple GitLab instances. ### Links / references - Documentation [GitLab as an OAuth2 provider](https://docs.gitlab.com/ee/api/oauth2.html#gitlab-as-an-oauth2-provider) - [Discussion: Streamlined GitHub authentication · Issue #93 · microsoft/vscode-pull-request-github](https://github.com/microsoft/vscode-pull-request-github/issues/93) #### Example of GitHub extension authentication ![Kapture_2020-08-04_at_13.50.59](/uploads/d5b71ee72819ca6748fc6a74a5215c97/Kapture_2020-08-04_at_13.50.59.gif)
2
5,261,717
69,354,629
2020-08-03 08:49:28.238
TS migration 2: migrate gitlab_service
### Problem to solve This is a followup issue for #219. `gitlab_service.js` has got 670 LOC and because we need to convert a JS file to TS in one go, we are creating a separate issue just for this conversion. The rest of the extension will be converted in the spirit "you touch it, you convert it". ### Proposal We are going to migrate the `gitlab_servic.js` to TypeScript. This service is providing the rest of the extension with information from the GitLab instance. ```mermaid graph TD A[rest of the extension] --> B D[status_bar] --> B[gitlab_service] --> C[git_service.ts] B --> D ``` ### Further details #### In scope - break the cyclic dependency so that `gitlab_service` isn't dependent on `status_bar` - write 3 - 5 integration tests touching the GitLab service - define types for `token_service` and `gitlab_project_input` (or migrate them to TS if it's trivial) - rewrite the `gitlab_service.js` to TypeScript - manual testing afterwards #### Out of scope - rewriting any other code to TypeScript - extensive test coverage with unit test (would take too long) - redesigning the `gitlab_service.js` (for easy review, the code branches and interfaces shouldn't change too much) ### Links / references - original decision to split the work this way: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/204#note_388292319 - example of the rewrite can be found in !53
2
5,261,717
69,354,151
2020-08-03 08:36:35.710
TS migration 1: configure TS and migrate git_service
### Problem to solve We decided to proceed with migrating the small codebase of this extension to TypeScript #204. We are going migrate the extension iteratively. This is the first step. ### Proposal We are going to migrate the `git_service.js` to typescript. This service is providing the extension with information about the project git repository (branches, remotes ..). The rest of the extension is dependent on this service and we can start immediately benefit from using autocomplete in code dependent on git. ```mermaid graph TD A[rest of the extension] --> B[gitlab_service] --> C[git_service] A --> C ``` ### Further details #### In scope - write integration tests touching the git service - namely, test functionality that uses: - branch name - tracking branch name - current commit SHA - remote repository URL - configure TypeScript compilation in a way that it works with the rest of the extension which is still in JavaScript - configure TypeScript linting and prettier - rewrite the `git_service.js` to TypeScript - introduce static `create()` method as described in https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/100#note_414925480 - manual testing afterwards #### Out of scope - rewriting any other code to TypeScript - extensive test coverage with unit test (would take too long) - redesigning the `git_service.js` (for easy review, the code branches and interfaces shouldn't change too much) ### Links / references - original decision to split the work this way: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/204#note_388292319 - example of the TS configuration and rewrite can be found in !53
3
5,261,717
55,905,406
2020-07-13 20:11:46.925
webview: extension sometimes posts same comment multiple times
### Summary Sometimes the extension sends the same entered message multiple times to the opened issue/MR when using the experimental webview. ### Steps to reproduce Note that in my experience this seems to be inconsistent. 1. Enable Experimental Features in Extension Settings (gitlab.enableExperimentalFeatures) 1. Open an issue in webview 1. Send a comment I should note that I have had more success getting this to happen when multiple webview-tabs are open simultaneously (I tested with two), though I had this happen even with only one webview tab open. Perhaps other tabs (like open files) also cause this or maybe doing the multiple tabs aren't strictly required for the bug to occur. The first time I encountered this behaviour was before GitLab officially adopted this extension, so it isn't a recent development. ### What is the current *bug* behavior? The same message is sent to the same issue multiple times instead of once. Quick actions seem to be applied multiple times, too. ### What is the expected *correct* behavior? The new comment and any included quick action should only be added/triggered once. ### Relevant logs and/or screenshots ![GitLab_Workflow_Message_duplication_glitch](/uploads/4f0c7cd0d1fbf3a8d1feffaf3d51b78d/GitLab_Workflow_Message_duplication_glitch.gif) ### Possible fixes No idea. ### Versions and OS * VSCode Version: 1.47.0 (commit d5e9aa0227e057a60c82568bf31c04730dc15dcd) * Extension Version: 3.0.4 (from official marketplace) * OS: Arch Linux x86_64 (all packages up-to-date)
2
5,261,717
55,518,070
2020-07-13 12:59:09.656
Change the default branch from `master` to `main`
In order to support the discussion and our initiative of changing the default branch name, we should follow this [GitLab Issue](https://gitlab.com/gitlab-org/gitlab/-/issues/221164) Let's rename `master` to `main` - [x] Make sure any branch name depending scripts are updated - [x] Make sure there are no blockers to make this change - [x] Change the contribution guidelines to reflect the non-standard default branch name - [x] Set `main` as default branch - [x] change target branch of all open merge requests to `main` - [x] unprotect `master`, delete it, and protect `master` branch again, allowing no one to create it - [x] propagate the changes to the [security repo](https://gitlab.com/gitlab-org/security/gitlab-vscode-extension) A similar project that just went through this change: https://gitlab.com/gitlab-org/gitlab-svgs/-/issues/127#note_378289361
1
5,261,717
53,959,952
2020-07-06 09:31:25.347
"Validate GitLab CI config" requires project for local file import
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "bug" label: - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary "Validate GitLab CI config" requires project for local file import. According to GitLab's online validator and documen tation this is incorrect ### Steps to reproduce Create two file config in single repo. Open .gitlab-ci.yml and run "GitLab: Validate GitLab CI config" //.gitlab-ci.yml ``` stages: - echo include: - local: child.gitlab-ci.yml ``` // child.gitlab-ci.yml ``` stages: - echo echo: stage: echo image: ruby:2.6 script: - echo "echo" ``` ### What is the current *bug* behavior? Validation fails with error "Local file `child.gitlab-ci.yml` does not have project!" ### What is the expected *correct* behavior? Should say "Your CI configuration is valid." ### Relevant logs and/or screenshots (Logs can be found by running `Developer: Show Logs ...` command (using `cmd+shift+p`) and selecting `Extension Host`) ### Possible fixes (If you can, link to the line of code that might be responsible for the problem)
1
5,261,717
53,883,289
2020-07-03 13:02:09.783
Poll for branch information only in active window
### Problem to solve If the user opens multiple extension windows, all of those windows are going to be polling pipeline information (each 30s) and open MR and closing issue (each 60s) for the current branch. This could result in increased load on the API and issues like #211 ### Proposal The polling should only happen when the extension window is [`focused`](https://code.visualstudio.com/api/references/vscode-api#WindowState). Same way as the native `git` extension polls for remote branch changes. We should also start to poll immediately after the window comes into focus ([`window.onDidChangeWindowState`](https://code.visualstudio.com/api/references/vscode-api#window.onDidChangeWindowState)). ### Further details - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/ec80a6f81d5d9b5b402dcf8ad50f5ad45c21800b/src/status_bar.js#L121 - https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/ec80a6f81d5d9b5b402dcf8ad50f5ad45c21800b/src/status_bar.js#L184 ### Links / references I assume the official `git` extension implementation to be somewhere here https://github.com/microsoft/vscode/blob/master/extensions/git/src/statusbar.ts The official VS Code extension API offers a [`WindowState`](https://code.visualstudio.com/api/references/vscode-api#WindowState) which allows us to find out whether the window is focused or not.
2
5,261,717
51,409,234
2020-06-29 10:34:46.691
Create a open-vsx account
In order to be allowed to publish to https://open-vsx.org/ we need a token and a publisher account. I would follow the same we use on the vscode marketplace. - [x] Create a GitHub account for open-vsx with the `vscode@gitlab.com` email address - [x] Create the `gitlab` publisher on open-vsx - [x] Make sure login credentials are in the shared 1Password vault - [x] Retrieve a token that can be used for publishing - [x] Add the token to CI/CD configuration of [this project](https://gitlab.com/gitlab-org/gitlab-vscode-extension) as `OPENVSX_ACCESS_TOKEN` (same settings as `AZURE_ACCESS_TOKEN`) - [x] Add the token to CI/CD configuration of the [security project](https://gitlab.com/gitlab-org/security/gitlab-vscode-extension) as `OPENVSX_ACCESS_TOKEN` - [x] Claim the `GitLab` publisher namespace https://github.com/eclipse/open-vsx.org/issues/103 /cc @viktomas @phikai
1
5,261,717
50,091,981
2020-06-25 18:59:08.694
Publish GitLab Workflow extension to Open VSX Registry
## Problem to Solve Currently there are users who use VS Code alternatives like [VS Codium](https://github.com/VSCodium/vscodium), [Theia](https://theia-ide.org/) and others which are generally OSS alternatives to VS Code. In most cases, these editors are able to run VS Code extensions, but the VS Code marketplace is unavailable for normal distribution. ## Additional Details [Open VSX](https://open-vsx.org) is an open-source registry for VS Code extensions. It can be used by any development environment that supports such extensions. Additional information on how to publish an extension to Open VSX can be obtained [here](https://github.com/eclipse/openvsx/wiki/Publishing-Extensions). ## Proposal In order to make the GitLab Workflow extension more accessible to more users we should also automate publishing of the extension to the Open VSX registry. <details><summary>Original Description</summary> I'm a [VS Codium](https://github.com/VSCodium/vscodium) user, a FLOSS version of VS Code. It's the same code but without Microsoft's telemetry, branding and licensing. I would like to request, if possible, to add the **GitLab** extension to the [open-vsx.org](https://open-vsx.org) market as it is unclear if it's legal to use the official Microsoft extension marketplace on VS Code forks, see [here](https://github.com/microsoft/vscode/issues/31168). Additional information on how to publish an extension to Open VSX can be obtained [here](https://github.com/eclipse/openvsx/wiki/Publishing-Extensions). </details>
2
5,261,717
50,023,153
2020-06-24 10:19:41.127
Update contribution guidelines
### Problem to solve The contribution guidelines are not in line with GitLab standards. ### Proposal - [x] Add DCO + License info at the top (see an example at https://gitlab.com/gitlab-org/gitlab-runner/-/blob/master/CONTRIBUTING.md) - [x] Remove the separate [code of conduct file](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/master/CODE_OF_CONDUCT.md). Just have a link to the [Code of conduct page](https://about.gitlab.com/community/contribute/code-of-conduct/) as a SSOT in the [CONTRIBUTING.md](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/master/CONTRIBUTING.md) file - [x] Remove "Reporting Issues" and "Proposing Features" sections and only point to the templates - [x] Revisit the practical setup sections ### Further details ### Links / references
2
5,261,717
50,018,411
2020-06-24 09:09:48.936
Automated testing strategy
### Problem to solve There are no automated tests for the extension (with exception of [unit test for `parseGitRemote` function](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/master/test/unit_tests/git_service.test.ts)). We need to increase our automated test coverage to be able to make changes to the extension without introducing regressions. ### Proposal Create a testing strategy for the extension. *Personal opinion: At the beginning, we should focus on the highest level tests (integration/e2e). There is a lot of suggested work that is taking out major parts of the codebase (!53 !54 ). Unit tests written for these soon-to-be-replaced parts might not be the best use of our efforts* ### Acceptance criteria - Testing pyramid for our VS Code Extension is described (i.e. what kind of tests we'll implement) - Implement at least one example test for each level of testing (e.g. If we'll have unit tests, functional tests, and E2E tests, then at least one unit test, functional test, and E2E test). - Example tests are reliably running in our CI ### Links / references - My personal extension having [integration and unit tests](https://gitlab.com/viktomas/gitlab-example-extension/-/blob/integration-tests/.gitlab-ci.yml#L13-29) - Testing guide in the official documentation https://code.visualstudio.com/api/working-with-extensions/testing-extension
3
5,261,717
50,016,385
2020-06-24 08:30:01.753
Automated CHANGELOG entries creation
### Problem to solve New entries are added to CHANGELOG ad-hoc, which results in more manual work and inconsistencies in the changelog entries. ### Proposal Implement a mechanism similar to the one used `gitlab-org/gitlab` (https://docs.gitlab.com/ee/development/changelog.html). Each MR that introduces significant user-facing change would create a changelog entry. These entries would get compiled into a version changelog during the release of the new version. Improving even further we could utilize the [releases](https://docs.gitlab.com/ee/user/project/releases/) feature which we've started using for GitLab. Example: https://gitlab.com/gitlab-org/gitlab/-/releases#v13.1.0-ee ### Links / references - Example changelog entries: https://gitlab.com/gitlab-org/gitlab/tree/master/changelogs/unreleased/ - Ruby script for generating changelog entries: https://gitlab.com/gitlab-org/gitlab/-/blob/master/bin/changelog
2
5,261,717
34,729,493
2020-05-19 10:31:24.545
Deprecated dependency: request-promise
In order to make requests towards GitLab `src/gitlab_service.js` makes use of the [`request-promise` library which is deprecated](https://github.com/request/request-promise#deprecated) since February 2020. This dependency should be changed as it won't receive any security updates in the future. Note that !53 still seems to include this dependency.
2
5,261,717
34,191,828
2020-05-06 09:04:42.223
Opening the same MR or Issue in webview multiple times causes duplicated tabs
I just noticed that when selecting an Issue or Merge Request I have already opened once, it opens another tab instead of showing the already existing tab. This can cause the tab-bar to get full very quickly if you don't track what you already opened and is not how VSCode itself handles these things, so it's a bit annoying. I know that the Issue and MR-Features are still experimental but wanted to point this strange behaviour out anyway. * VSCode Version: 1.44.2 (ff915844119ce9485abfe8aa9076ec76b5300ddd) * Extension version: 2.2.0 * OS: Arch Linux on 64bit Desktop-PC ## Screenshots ![Kapture_2020-06-29_at_10.06.24](/uploads/119fd679f949793d7ca7b4dfcc2d15d4/Kapture_2020-06-29_at_10.06.24.gif) ## Possible solution If we use the VS Code native [Uri](https://code.visualstudio.com/api/references/vscode-api#Uri) to identify each issue and MR webview, we could avoid duplication without us writing any custom code.
2
5,261,717
30,626,235
2020-02-11 11:38:40.803
Click on merge request in status bar should open the webview
Since one of the last versions, GitLab Workflow has this merge request detail view which opens when I click on a merge request from the list in the sidebar. For user interaction consistency, I think this should also be the case when I click on the merge request link in the status bar. *Note: the webview needs to be enabled as an [experimental feature](https://gitlab.com/gitlab-org/gitlab-vscode-extension#experimental-features).* ![Kapture_2020-06-25_at_11.10.06](/uploads/fb8ce39650c94975e314149b21f93f84/Kapture_2020-06-25_at_11.10.06.gif) ![image](/uploads/26516ec1c3bbac5070f5fedfbf156961/image.png)
1
5,261,717
30,251,516
2020-02-02 21:02:57.743
3.0.0 Release
## Summary Version `3.0.0` is the next major release of the extension. See details in the [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/master/CHANGELOG.md#v300-tbd). ## Testing strategy - Testing new features of this release. - [x] Multi-root workspaces - VS Code documentation: https://code.visualstudio.com/docs/editor/multi-root-workspaces - Tested: tree view with issues, snippets, custom queries - [x] New icon (lines instead of fill) - [x] Custom queries - :question: The custom queries completely replace the default queries - works well even with multi-root workspaces - Testing fixes in this release - [x] Creating snippets - [x] Improve remote URL parsing to support non-standard Gitlab usernames. - The implementatoin seems good to me. I don't have access to gitlab instance with different git user. - During testing weird names I discovered and fixed https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/197 - [x] Click on merge request "for current branch" doesn't do anything - [x] Sanity testing - this release introduces 16k changed lines of code, part of the testing should be generic happy-path testing of the extension's [Feature set](https://gitlab.com/gitlab-org/gitlab-vscode-extension#features). <details> <summary>Original descriptiom</summary> Hi @fatihacet we should be ready for 3.0.0 release. Before go ahead with the release_checklist.md, would you mind to test the attached packaged extension to be sure we are not breaking anything? Thank you [gitlab-workflow-3.0.0.vsix](/uploads/2b7ef51cb938ff5bd0b3b7afcabb6855/gitlab-workflow-3.0.0.vsix) </details>
4
6,206,924
34,343,651
2020-05-09 15:43:39.289
"Password found in breach" message for good password
# Bug Report <!-- Thank you for taking the time to report a bug! Before continuing, please make sure the bug hasn't been reported before by searching through the other issues. This will save both yourself and us some time. If you're sure there isn't another issue, continue through the template below. All the text between the opening and closing arrows (HTML comments) will not be shown in the end result. --> ## Platform <!-- When possible, please provide what version you're running. --> * Operating System: Linux Mint 19.3 Cinnamon * Browser: Firefox 76.0 ## What is happening and/or broken? <!-- Provide as many details as you can and if possible a little step-by-step guide so that we can reproduce the issue. Screenshots or a video that shows the problem also help immensely. --> I tried to change my password using an automatically-generated password from Bitwarden. I was shocked to receive the message that this password had been pwned. When I checked on https://haveibeenpwned.com/Passwords, though, it said this password has not been found in any breaches. Here it is: MZz7TbtdiVWW97 ## What is expected to happen? <!-- Explain what the expected result is if it's not clear from how it is broken. You can omit this if the expected result is just "It should work" or similar. --> Either give a message saying symbols are required or something, or allow me to use it if it's a valid password.
1
6,206,924
31,854,870
2020-03-11 05:33:02.409
tag autocompletion doesn't work for the second tag if you type a space between the tags
To reproduce: * start creating a new topic * enter the first characters of a tag in the tag box * use autocomplete to finish * type a space * type the first letters of a tag The cause wasn't apparent at first. I must have been typing a space out of habit.
2
6,206,924
30,698,882
2020-02-13 04:17:59.888
Un-pin and upgrade Salt in Vagrantfile
As described in [the message for the commit where I pinned the version](https://gitlab.com/tildes/tildes/-/commit/4dc99d9fda4b3282d7dc00a65e5196d8fc95b66e), a new version of Salt has been released but is currently buggy and breaks creating a Tildes dev environment since it can't handle `unless` checks. I've pinned Salt to the previous stable version for now, so this is just a reminder that it would probably be good to un-pin and upgrade eventually once the bugs are worked out.
2
6,206,924
29,924,702
2020-01-24 18:50:14.177
Add a “Post a new topic” button into the sidebar on the group search result page
<p> My current workflow when posting topics to groups always starts with searching if the link I am about to submit has already been submitted. E.g. I search withing ~music for the artist or the song name. But after that, I have to either push “Back”, or navigate to the group page again, as the “~music” in the page header “Search in ~music: Foo My Bar Tonight” is not a link back to ~music (an issue of its own). I would prefer if there was a “Post a new topic” button in the side-bar of the group search results. </p>
1
6,206,924
26,242,729
2019-10-23 15:46:55.860
Remove (or replace) quotes from search view query
When searching there is this text at the top that shows what you searched for: ![image](/uploads/7f059926262637efe30b50b02b291185/image.png) And now that double quotes have actual meaning because of the search upgrades that came with Postgresql 12, when doing a quoted search it looks a little weird: ![image](/uploads/ccb287d7b40b64448d8b1d9edd847914/image.png) To avoid confusion about what's actually being searched for, I think it would be good to remove these quotes (or replace them with something else).
1
6,206,924
26,117,272
2019-10-19 11:36:38.147
Colours mixing when quoting code
<p> See e.g. <a href="https://tildes.net/~comp/igx/fortnightly_programming_q_a_thread#comment-42sg">this comment</a>. In the black theme, both <code>&lt;blockquote&gt;</code> and <code>&lt;code&gt;</code>/<code>&lt;pre&gt;</code> have the <code>background-color</code> of <code>#222</code>, which means that there is no distinction between the quote text and the code or preformatted text within this quote. I think that <code>#444</code> would be a good colour for code inside quotes in the black theme, not sure about the rest. </p>
1
6,206,924
25,521,531
2019-10-01 21:58:43.816
Allow defining "important tags" for individual groups
Topic tags are hidden by default in listings pages now, but "important" ones are still shown. Currently, only `nsfw` and `spoiler` are considered important, but it would be useful to be able to define important tags for each group. For example, in ~news, it might be nice to always have the relevant country tag still shown on topics, but not all the other tags.
3
6,206,924
25,085,709
2019-09-22 10:48:41.128
Add a way to view all the topics and comments you've voted on
As suggested by [this topic](https://tildes.net/~tildes/hs1/filter_by_my_own_votes).
2
6,206,924
24,347,707
2019-08-31 13:28:19.026
Include/exclude operators for search
[Relevant comment](https://tildes.net/~tildes.official/7j9/minor_search_update_topic_tags_are_now_included_in_search#comment-224f).
3
6,206,924
24,175,625
2019-08-26 18:20:12.972
Update marshmallow to 3.0+
marshmallow, which Tildes uses for schema validation and some similar applications, has now released its 3.0 version, after a fairly long RC process. This will require some significant updates to the code, so I've pinned it to 2.x for now but should try to do these updates before too long, since 3.0 seems to have quite a few benefits. Here's the docs on upgrading: https://marshmallow.readthedocs.io/en/stable/upgrading.html
4
6,206,924
23,816,183
2019-08-15 19:04:39.564
Add a "demo" page for themes
It would be really nice to have a page where people can easily flip through all the themes and see what different site elements look like with them applied. It could have various "fake" site elements, like what a topic in listings looks like, a little fake comment tree showing how the different types of comments (e.g. exemplary, new) look, and so on, so you can get an overview of the theme in one spot. This should be fairly straightforward to implement - have a view that creates a `Topic` object, some `Comments` objects and so on (and don't add them to the database session), and then use them all in the template macros that are used to render real versions of those objects. That way the page will keep itself updated whenever any designs change, since it's using exactly the same macros and methods as other pages.
2
6,206,924
23,722,124
2019-08-13 03:40:22.009
Change comment voting so it doesn't replace the entire comment
Now that we have `<details>` blocks in comments, there can be some strange behavior when voting on a comment that contains them. Since voting results in the entire comment being replaced by intercooler, any `<details>` blocks in it end up getting reset back to their default expanded/collapsed state. It should be totally fine to just replace the vote button instead of the entire comment. I think originally I was replacing the entire comment because the vote count was inside it, but since it's in the button now there's not really any need to be replacing the whole comment any more.
2
6,206,924
22,100,284
2019-06-20 15:55:58.310
Link "Filtered topic tags" in user's sidebar to their respective ?tag= page
As suggested here: https://tildes.net/~news/enf/this_week_in_election_night_2020_week_13#comment-3h06
2
6,206,924
21,827,624
2019-06-12 08:02:25.081
Automatically linking /r/subreddit in comments.
Given how often subreddits are mentioned in Tildes comments, it would be nice if they were similarly auto-linked like tildes groups.
2
6,206,924
21,704,611
2019-06-09 01:46:16.644
Add [Collapse Read] button to top of comment section that works like "Collapse old comments" feature
As suggested here: https://tildes.net/~tildes/ea2/tildes_focus_a_greasemonkey_script_to_navigate_to_new_comments_on_tildes#comment-3ej3
3
6,206,924
21,613,959
2019-06-05 21:51:51.074
Make theme easier to change when logged in.
Which could be done by simply adding the theme switcher visible at the bottom of the page when logged out to the logged in version as well. As suggested here: https://tildes.net/~tildes/e6d/suggestion_make_theme_easier_to_change_when_logged_in
1
6,206,924
21,571,064
2019-06-04 14:27:45.646
Show link metadata on thread page as well
Link metadata such as word count, article date and youtube channels don't appear at all on the thread page. WDYT of adding them at the top near the submitter?
4
6,206,924
20,949,249
2019-05-16 05:13:36.341
Searching for "parenttag.subtag" results in no topics being found, but searching for "parenttag" or "subtag" alone does
null
3
6,206,924
20,827,669
2019-05-13 12:05:26.950
Add "unfollow" feature, allowing users to turn off notifications for replies to their comments/topics
This would allow users to more effectively disengage from arguments. It should probably be something disabled by default and only enabled on a case-by-case basis, not a global user setting though, IMO. edit: Feature also requested again, but for a slightly different reason (avoiding getting spammed on busy topics) - https://tildes.net/~tildes/dz7/suggestion_turn_off_reply_notifications_for_a_topic_or_comment_you_made
4
6,206,924
20,538,732
2019-05-02 19:22:30.642
Split up subgroup/parent group links in the topic view too
If you go to ~tildes.official, the header link is separated into `~tildes` and `official`, allowing you to jump to either the parent group or the subgroup. When viewing a topic in ~tildes.official, the link does not split like that, and only leads to ~tildes.official, but not to ~tildes.
1
6,206,924
20,403,102
2019-04-27 13:03:05.691
Bug with double clicking on a topic with "new comments"
When using the "mark new comments" feature, if there's a topic with new comments and you double click on the topic to go to the comments, when it loads no comments will be marked as new. My guess is that the first click is registering as the one where it should mark the new comments and the second click as just another visit with no new comments.
4
6,206,924
19,201,640
2019-03-18 09:36:21.478
Topic log changed links can go outside the sidebar
![image](/uploads/4a682175a9e9a282bd06ab1e8b7442fc/image.png)
1
6,206,924
18,745,477
2019-03-02 21:05:40.866
Indenting subgroups on the groups listing
As suggested here: https://tildes.net/~tildes/azr/indenting_subgroups_on_the_groups_listing
2
6,206,924
18,731,529
2019-03-01 20:45:19.323
Add ability to bookmark topics from the front page
https://tildes.net/~tildes/ayv/feature_suggestion_bookmark_posts_from_front_page
3
6,206,924
18,297,018
2019-02-17 13:29:10.519
Incorrect site favicons displayed
Sometimes the incorrect favicon for a website will be displayed: ![image](/uploads/f25700be1c1536752e6e00790ce677d3/image.png) ![image](/uploads/886d3aa146111093a2c411dd546986aa/image.png) Presumably this is a caching issue, but reloading the page doesn't fix it, and those two screenshots are from two different devices.
2
6,206,924
17,187,020
2019-01-08 22:51:20.268
Rework views and/or schemas to support webargs 5.0
As mentioned in https://gitlab.com/tildes/tildes/commit/664c6f67904631443bd275dd07f1bbabe1bdcb14, webargs 5.0 no longer sets values for optional arguments: https://github.com/marshmallow-code/webargs/issues/342 The above-linked commit pins webargs' version to avoid this behavior change for the moment, but to be able to upgrade will require some reworking of views/schemas to be able to handle the new approach.
4
6,206,924
16,586,509
2018-12-11 22:30:58.002
Update annotations to take advantage of delayed evaluation
Python 3.7 includes postponed evaluation of type annotations: https://docs.python.org/3/whatsnew/3.7.html#pep-563-postponed-evaluation-of-annotations This means that we will no longer need to write annotations as quoted strings when the type is defined later ([example](https://gitlab.com/tildes/tildes/blob/master/tildes/tildes/models/model_query.py#L43)). However, we will have to add a `from __future__ import annotations` to every file where the quoted strings were previously necessary. This change won't be possible until pyflakes updates to support it, since using it currently still causes a "undefined name" error from Prospector. This is the pull req that will need to be merged first: https://github.com/PyCQA/pyflakes/pull/374
2
6,206,924
15,732,986
2018-11-11 11:33:58.075
Invalid characters in the tag query parameter results in an uninformative error page
E.g. https://tildes.net/?tag=a-b. The current error page says "invalid path", which is confusing and not meaningful to most people.
1
6,206,924
15,152,119
2018-10-22 21:02:32.059
"Set as account default" button disappears after page reload
I searched for "theme" and "Set as account default" but haven't found a bug about this bug. Steps: 1. Go to the settings page. 2. Click on a different theme. The "Set as account default" button is there. 3. Reload the page. 4. I expected the button to still be there, but it isn't. If I switch to another theme and then back, it does appear.
2