Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2024-11-16 03:16:54 +00:00
parent e9e2438781
commit c0d21a0fdf
7 changed files with 124 additions and 57 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -0,0 +1,100 @@
---
stage: Create
group: Editor Extensions
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
description: "Use the GitLab Workflow extension for VS Code to handle common GitLab tasks directly in VS Code."
---
# CI/CD pipelines in the VS Code extension
If your GitLab project uses CI/CD pipelines, you can start, watch, and debug CI/CD pipelines from the
GitLab Workflow extension for VS Code. When you work locally on a Git branch, the bottom status bar
shows the status of its most recent pipeline, or shows **No pipeline** if a pipeline hasn't run yet:
![The bottom status bar, showing the most recent pipeline has failed.](../img/status_bar_pipeline_v17_6.png)
Possible statuses include:
- **Pipeline canceled**
- **Pipeline failed**
- **Pipeline passed**
- **Pipeline pending**
- **Pipeline running**
- **Pipeline skipped**
## View pipeline information
Use this extension to start, monitor, and debug CI/CD pipelines in GitLab.
Prerequisites:
- Your project uses CI/CD pipelines.
- A merge request exists for your current Git branch.
- The most recent commit on your current Git branch has a CI/CD pipeline.
To view pipeline information:
1. In VS Code, on the bottom status bar, select the pipeline status to display actions in the Command Palette.
1. In the Command Palette, select your desired action:
- **Create New Pipeline From Current Branch**: Start a new pipeline.
- **Cancel Last Pipeline**
- **Download Artifacts from Latest Pipeline**: Download the pipeline artifact in ZIP or JSON format.
- **Retry Last Pipeline**
- **View Latest Pipeline on GitLab**: Open the pipeline's page in a browser tab.
## Show pipeline alerts
This extension can display an alert in VS Code when a pipeline for your current branch completes:
![Alert showing a pipeline failure](../img/pipeline_alert_v17_6.png)
To show alerts for your current Git branch:
1. In VS Code, on the top menu, select **Code > Settings > Settings**.
1. Depending on your configuration, select either **User** or **Workplace** settings.
1. In the main tab, select **Extensions > GitLab Workflow** to view this extension's settings.
1. Under **Show Pipeline Update Notifications**, select the **Show notification in VS Code when the pipeline status changes** checkbox.
## View CI/CD job output
To view the output for a CI/CD job for your current branch:
1. On the left vertical menu bar, select **GitLab Workflow** (**{tanuki}**) to display the extension sidebar.
1. On the sidebar, expand **For current branch** to show its most recent pipeline.
1. Select your desired job to open it in a new VS Code tab:
![A pipeline containing CI/CD jobs that are passing, allowed to fail, and failing.](../img/view_job_output_v17_6.png)
### Test GitLab CI/CD configuration
Use the `GitLab: Validate GitLab CI Config` command to test your project's GitLab CI/CD configuration locally.
1. In VS Code, open your `.gitlab-ci.yml` file, and ensure the file's tab is in focus.
1. Open the Command Palette:
- For macOS, press <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>.
- For Windows or Linux, press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>.
1. In the Command Palette, search for `GitLab: Validate GitLab CI Config` and press <kbd>Enter</kbd>.
The extension shows an alert if it detects a problem with your configuration.
### Show merged GitLab CI/CD configuration
Use this command to see a preview of your merged CI/CD configuration file, with all includes and references resolved.
1. In VS Code, open your `.gitlab-ci.yml` file, and ensure the file's tab is in focus.
1. On the top right, select **Show Merged GitLab CI/CD Configuration**:
![The VS Code application, showing the icon for viewing merged results.](../img/show_merged_configuration_v17_6.png)
VS Code opens a new tab (`.gitlab-ci (Merged).yml`) with full information.
### CI/CD variable autocompletion
Quickly find the CI/CD variable you are looking for with the CI/CD variable autocompletion:
1. In VS Code, open your `.gitlab-ci.yml` file, and ensure the file's tab is in focus.
1. Begin entering the name of a variable to display auto-complete options.
1. Select an option to use it:
![Autocomplete options shown for a string](../img/ci_variable_autocomplete_v16_6.png)

View File

@ -15,16 +15,13 @@ and extend your view with [custom queries](custom_queries.md).
This extension brings the GitLab features you use every day directly into your VS Code environment:
- [View issues](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#browse-issues-review-mrs) and merge requests.
- Run [common commands](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#commands)
from the Visual Studio Code [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette).
- Run [common commands](settings.md#command-palette-commands) from the Visual Studio Code Command Palette.
- Create and [review](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#merge-request-reviews)
merge requests.
- [Validate your GitLab CI/CD configuration](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#validate-gitlab-cicd-configuration).
- View [pipeline status](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#information-about-your-branch-pipelines-mr-closing-issue) and
[job outputs](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#view-the-job-output).
- [Create](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#create-snippet) and manage snippets.
- [Browse repositories](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow#browse-a-repository-without-cloning)
without cloning them.
- [Test your GitLab CI/CD configuration](cicd.md#test-gitlab-cicd-configuration).
- View [pipeline status](cicd.md) and [job outputs](cicd.md#view-cicd-job-output).
- [Create](#create-a-snippet) and manage snippets.
- [Browse repositories](remote_urls.md#browse-a-repository-in-read-only-mode) without cloning them.
- [View security findings](https://marketplace.visualstudio.com/items?itemName=gitlab.gitlab-workflow#security-findings).
The GitLab Workflow extension also streamlines your VS Code workflow with AI-assisted features:
@ -35,6 +32,13 @@ The GitLab Workflow extension also streamlines your VS Code workflow with AI-ass
Suggest completions to your current line of code, or write natural-language code comments to get
more substantive suggestions.
When you view a GitLab project in VS Code, the extension shows you information about your current branch:
- The status of the branch's most recent CI/CD pipeline.
- A link to the merge request for this branch.
- If the merge request includes an [issue closing pattern](../../user/project/issues/managing_issues.md#closing-issues-automatically),
a link to the issue.
## Set up the GitLab Workflow extension
This extension requires you to create a GitLab personal access token, and assign it to the extension:
@ -167,45 +171,6 @@ To view issues and merge requests for a specific project:
1. Select a file to view its diff in a VS Code tab.
## View pipeline information
Use this extension to start, monitor, and debug CI/CD pipelines in GitLab.
Prerequisites:
- Your project uses CI/CD pipelines.
- A merge request exists for your current Git branch.
- The most recent commit on your current Git branch has a CI/CD pipeline.
To view pipeline information:
1. In VS Code, on the bottom status bar, select the pipeline status to display actions in the Command Palette:
- **Pipeline canceled**
- **Pipeline failed**
- **Pipeline passed**
- **Pipeline pending**
- **Pipeline running**
- **Pipeline skipped**
1. In the Command Palette, select your desired action:
- **Create New Pipeline From Current Branch**: Start a new pipeline.
- **Cancel Last Pipeline**
- **Download Artifacts from Latest Pipeline**: Download the pipeline artifact in ZIP or JSON format.
- **Retry Last Pipeline**
- **View Latest Pipeline on GitLab**: Open the pipeline's page in a browser tab.
## View CI/CD job output
To view the output for a CI/CD job for your current branch:
1. On the left vertical menu bar, select **GitLab Workflow** (**{tanuki}**) to display the extension sidebar.
1. On the sidebar, expand **For current branch** to show its most recent pipeline.
1. Select your desired job to open it in a new VS Code tab:
![A pipeline containing CI/CD jobs that are passing, allowed to fail, and failing.](../img/view_job_output_v17_6.png)
## View security findings
Prerequisites:
@ -286,15 +251,6 @@ This search query looks for:
- Labels: `frontend` and `performance`
- Milestone: `17.5`
## Show pipeline alerts
To show an alert message in VS Code when a pipeline for your current branch completes:
1. In VS Code, on the top menu, select **Code > Settings > Settings**.
1. Depending on your configuration, select either **User** or **Workplace** settings.
1. In the main tab, select **Extensions > GitLab Workflow** to view this extension's settings.
1. Under **Show Pipeline Update Notifications**, select the **Show notification in VS Code when the pipeline status changes** checkbox.
## Related topics
- [Troubleshooting the GitLab Workflow extension for VS Code](troubleshooting.md)

View File

@ -37,7 +37,18 @@ In VS Code, trigger these commands from the
- `GitLab: Toggle Code Suggestions`
- `GitLab: Toggle Code Suggestions for current language`
- [`GitLab: Validate GitLab CI/CD Config`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/#validate-gitlab-cicd-configuration):
Validate the GitLab CI/CD configuration file `.gitlab-ci.yml`.
Test the GitLab CI/CD configuration file `.gitlab-ci.yml`.
### Command integrations
This extension also integrates with these commands:
- `Git: Clone`: Search for and clone projects for every GitLab instance you set up. For more information, see:
- [Clone GitLab projects](https://gitlab.com/gitlab-org/gitlab-vscode-extension/#clone-gitlab-projects)
in the extension documentation.
- [Cloning a repository](https://code.visualstudio.com/docs/sourcecontrol/overview#_cloning-a-repository)
in the VS Code documentation.
- `Git: Add Remote...`: Add existing projects as remotes from every GitLab instance you set up.
## Extension settings