diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-16 03:09:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-16 03:09:18 +0300 |
commit | 21fc10ad5a7c829e64112fac37727f31f072ef33 (patch) | |
tree | 7336c449a92b4e580b54af26a6fe7256b035692c | |
parent | 9fe33f71995d8e3e83f0a30cb776aaa4a3ab4d70 (diff) |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | .rubocop_todo/rails/content_tag.yml | 62 | ||||
-rw-r--r-- | GITLAB_ELASTICSEARCH_INDEXER_VERSION | 2 | ||||
-rw-r--r-- | app/models/users/callout.rb | 3 | ||||
-rw-r--r-- | doc/api/graphql/reference/index.md | 1 | ||||
-rw-r--r-- | doc/api/merge_requests.md | 3 | ||||
-rw-r--r-- | doc/development/testing_guide/flaky_tests.md | 3 | ||||
-rw-r--r-- | doc/development/testing_guide/index.md | 2 | ||||
-rw-r--r-- | doc/user/packages/composer_repository/index.md | 57 | ||||
-rw-r--r-- | doc/user/packages/conan_repository/index.md | 112 | ||||
-rw-r--r-- | doc/user/packages/maven_repository/index.md | 204 | ||||
-rw-r--r-- | doc/user/packages/npm_registry/index.md | 101 | ||||
-rw-r--r-- | doc/user/packages/nuget_repository/index.md | 44 | ||||
-rw-r--r-- | doc/user/packages/pypi_repository/index.md | 143 | ||||
-rw-r--r-- | spec/scripts/failed_tests_spec.rb | 2 | ||||
-rw-r--r-- | spec/scripts/pipeline_test_report_builder_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/rspec_order_todo.yml | 10 |
16 files changed, 65 insertions, 686 deletions
diff --git a/.rubocop_todo/rails/content_tag.yml b/.rubocop_todo/rails/content_tag.yml index 33f6dd36008..d54bd97cc08 100644 --- a/.rubocop_todo/rails/content_tag.yml +++ b/.rubocop_todo/rails/content_tag.yml @@ -1,63 +1,9 @@ --- -# Cop supports --auto-correct. +# Cop supports --autocorrect. Rails/ContentTag: - # Offense count: 163 - # Temporarily disabled due to too many offenses - Enabled: false + Details: grace period Exclude: - - 'app/controllers/concerns/wiki_actions.rb' - - 'app/helpers/appearances_helper.rb' - - 'app/helpers/application_helper.rb' - 'app/helpers/avatars_helper.rb' - - 'app/helpers/blob_helper.rb' - - 'app/helpers/breadcrumbs_helper.rb' - - 'app/helpers/button_helper.rb' - - 'app/helpers/ci/pipelines_helper.rb' - - 'app/helpers/ci/runners_helper.rb' - - 'app/helpers/ci/status_helper.rb' - - 'app/helpers/clusters_helper.rb' - - 'app/helpers/commits_helper.rb' - - 'app/helpers/diff_helper.rb' - - 'app/helpers/dropdowns_helper.rb' - - 'app/helpers/emails_helper.rb' - - 'app/helpers/environment_helper.rb' - - 'app/helpers/events_helper.rb' - - 'app/helpers/groups_helper.rb' - - 'app/helpers/hooks_helper.rb' - - 'app/helpers/icons_helper.rb' - - 'app/helpers/issuables_helper.rb' - - 'app/helpers/issues_helper.rb' - - 'app/helpers/labels_helper.rb' - - 'app/helpers/listbox_helper.rb' - - 'app/helpers/markup_helper.rb' - - 'app/helpers/notes_helper.rb' - - 'app/helpers/projects_helper.rb' - - 'app/helpers/repository_languages_helper.rb' - - 'app/helpers/search_helper.rb' - - 'app/helpers/tab_helper.rb' - - 'app/helpers/timeboxes_helper.rb' - - 'app/helpers/todos_helper.rb' - - 'app/helpers/users_helper.rb' - - 'app/helpers/version_check_helper.rb' - - 'app/helpers/wiki_helper.rb' - - 'app/presenters/ci/pipeline_presenter.rb' - - 'app/presenters/merge_request_presenter.rb' - - 'app/presenters/project_presenter.rb' - - 'app/serializers/analytics/cycle_analytics/stage_entity.rb' - - 'app/serializers/entity_date_helper.rb' - - 'app/services/system_notes/base_service.rb' - - 'app/services/system_notes/commit_service.rb' - - 'ee/app/helpers/ee/button_helper.rb' - - 'ee/app/helpers/ee/geo_helper.rb' - - 'ee/app/helpers/ee/groups_helper.rb' - - 'ee/app/helpers/ee/issuables_helper.rb' - - 'ee/app/helpers/ee/lock_helper.rb' - - 'ee/app/helpers/ee/namespaces_helper.rb' - - 'ee/app/helpers/ee/search_helper.rb' - - 'ee/lib/gitlab/expiring_subscription_message.rb' - - 'lib/banzai/filter/autolink_filter.rb' - - 'lib/banzai/filter/gollum_tags_filter.rb' - - 'lib/gitlab/emoji.rb' - - 'lib/gitlab/form_builders/gitlab_ui_form_builder.rb' + - 'app/helpers/page_layout_helper.rb' - 'lib/gitlab/middleware/go.rb' - - 'spec/frontend/fixtures/tabs.rb' + - 'spec/helpers/avatars_helper_spec.rb' diff --git a/GITLAB_ELASTICSEARCH_INDEXER_VERSION b/GITLAB_ELASTICSEARCH_INDEXER_VERSION index 75a22a26ac4..fd2a01863fd 100644 --- a/GITLAB_ELASTICSEARCH_INDEXER_VERSION +++ b/GITLAB_ELASTICSEARCH_INDEXER_VERSION @@ -1 +1 @@ -3.0.3 +3.1.0 diff --git a/app/models/users/callout.rb b/app/models/users/callout.rb index ae6950d800c..b037d07658d 100644 --- a/app/models/users/callout.rb +++ b/app/models/users/callout.rb @@ -62,7 +62,8 @@ module Users namespace_storage_limit_banner_error_threshold: 58, # EE-only project_quality_summary_feedback: 59, # EE-only merge_request_settings_moved_callout: 60, - new_top_level_group_alert: 61 + new_top_level_group_alert: 61, + artifacts_management_page_feedback_banner: 62 } validates :feature_name, diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 2eb935b229e..a8e48a952c0 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -22369,6 +22369,7 @@ Name of the feature that the callout is for. | Value | Description | | ----- | ----------- | | <a id="usercalloutfeaturenameenumactive_user_count_threshold"></a>`ACTIVE_USER_COUNT_THRESHOLD` | Callout feature name for active_user_count_threshold. | +| <a id="usercalloutfeaturenameenumartifacts_management_page_feedback_banner"></a>`ARTIFACTS_MANAGEMENT_PAGE_FEEDBACK_BANNER` | Callout feature name for artifacts_management_page_feedback_banner. | | <a id="usercalloutfeaturenameenumbuy_pipeline_minutes_notification_dot"></a>`BUY_PIPELINE_MINUTES_NOTIFICATION_DOT` | Callout feature name for buy_pipeline_minutes_notification_dot. | | <a id="usercalloutfeaturenameenumcanary_deployment"></a>`CANARY_DEPLOYMENT` | Callout feature name for canary_deployment. | | <a id="usercalloutfeaturenameenumci_deprecation_warning_for_types_keyword"></a>`CI_DEPRECATION_WARNING_FOR_TYPES_KEYWORD` | Callout feature name for ci_deprecation_warning_for_types_keyword. | diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 0197705ff33..4b4d36ec23e 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -641,8 +641,7 @@ Supported attributes: | `first_contribution` | boolean | Indicates if the merge request is the first contribution of the author. | | `first_deployed_to_production_at` | datetime | Timestamp of when the first deployment finished. | | `force_remove_source_branch` | boolean | Indicates if the project settings will lead to source branch deletion after merge. | -| `has_conflicts` | boolean | Indicates if merge request has conflicts and cannot be merged. Dependent on the `merge_status` property. Returns - `false` unless `merge_status` is `cannot_be_merged`. | +| `has_conflicts` | boolean | Indicates if merge request has conflicts and cannot be merged. Dependent on the `merge_status` property. Returns `false` unless `merge_status` is `cannot_be_merged`. | | `head_pipeline` | object | Pipeline running on the branch HEAD of the merge request. Contains more complete information than `pipeline` and should be used instead of it. | | `id` | integer | ID of the merge request. | | `iid` | integer | Internal ID of the merge request. | diff --git a/doc/development/testing_guide/flaky_tests.md b/doc/development/testing_guide/flaky_tests.md index a06f2cf6570..cc62a0ebf03 100644 --- a/doc/development/testing_guide/flaky_tests.md +++ b/doc/development/testing_guide/flaky_tests.md @@ -31,6 +31,9 @@ it's reset to a pristine test after each test. inconsistent state, so that following tests might not know about certain columns. - [Example 2](https://gitlab.com/gitlab-org/gitlab/-/issues/368500): A test modifies data that is used by a following test. +- [Example 3](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103434#note_1172316521): A test for a database query passes in a fresh database, but in a + CI/CD pipeline where the database is used to process previous test sequences, the test fails. This likely + means that the query itself needs to be updated to work in a non-clean database. ### Ordering assertion diff --git a/doc/development/testing_guide/index.md b/doc/development/testing_guide/index.md index ab235f8ba08..5008564de01 100644 --- a/doc/development/testing_guide/index.md +++ b/doc/development/testing_guide/index.md @@ -53,7 +53,7 @@ tips and tricks to get the most out of white-box testing. What are flaky tests, the different kind of flaky tests we encountered, and what we do about them. -## [GitLab pipelines](../pipelines.md) +## [GitLab pipelines](../pipelines/index.md) How GitLab test suite is run in the CI context: setup, caches, artifacts, parallelization, monitoring. diff --git a/doc/user/packages/composer_repository/index.md b/doc/user/packages/composer_repository/index.md index 283ba61c13b..49c54ec191e 100644 --- a/doc/user/packages/composer_repository/index.md +++ b/doc/user/packages/composer_repository/index.md @@ -25,58 +25,7 @@ client uses, see the [Composer API documentation](../../../api/packages/composer Composer v2.0 is recommended. Composer v1.0 is supported, but it has lower performance when working in groups with very large numbers of packages. -## Create a Composer package - -If you do not have a Composer package, create one and check it in to -a repository. This example shows a GitLab repository, but the repository -can be any public or private repository. - -WARNING: -If you are using a GitLab repository, the project must have been created from -a group's namespace, rather than a user's namespace. Composer packages -[can't be published to projects created from a user's namespace](https://gitlab.com/gitlab-org/gitlab/-/issues/235467). - -1. Create a directory called `my-composer-package` and change to that directory: - - ```shell - mkdir my-composer-package && cd my-composer-package - ``` - -1. Run [`composer init`](https://getcomposer.org/doc/03-cli.md#init) and answer the prompts. - - For namespace, enter your unique [namespace](../../../user/namespace/index.md), like your GitLab username or group name. - - A file called `composer.json` is created: - - ```json - { - "name": "<namespace>/composer-test", - "description": "Library XY", - "type": "library", - "license": "GPL-3.0-only", - "authors": [ - { - "name": "John Doe", - "email": "john@example.com" - } - ], - "require": {} - } - ``` - -1. Run Git commands to tag the changes and push them to your repository: - - ```shell - git init - git add composer.json - git commit -m 'Composer package test' - git tag v1.0.0 - git remote add origin git@gitlab.example.com:<namespace>/<project-name>.git - git push --set-upstream origin main - git push origin v1.0.0 - ``` - -The package is now in your GitLab Package Registry. +Learn how to [build a Composer package](../workflows/build_packages.md#composer). ## Publish a Composer package by using the API @@ -110,7 +59,7 @@ To publish the package with a personal access token: - `<personal-access-token>` is your personal access token. - `<project_id>` is your project ID. - `<tag>` is the Git tag name of the version you want to publish. - To publish a branch, use `branch=<branch>` instead of `tag=<tag>`. + To publish a branch, use `branch=<branch>` instead of `tag=<tag>`. To publish the package with a deploy token: @@ -125,7 +74,7 @@ To publish the package with a deploy token: - `<deploy-token>` is your deploy token - `<project_id>` is your project ID. - `<tag>` is the Git tag name of the version you want to publish. - To publish a branch, use `branch=<branch>` instead of `tag=<tag>`. + To publish a branch, use `branch=<branch>` instead of `tag=<tag>`. You can view the published package by going to **Packages and registries > Package Registry** and selecting the **Composer** tab. diff --git a/doc/user/packages/conan_repository/index.md b/doc/user/packages/conan_repository/index.md index a226c4f7086..3d3fe35fd65 100644 --- a/doc/user/packages/conan_repository/index.md +++ b/doc/user/packages/conan_repository/index.md @@ -29,105 +29,7 @@ Package Registry. For documentation of the specific API endpoints that the Conan package manager client uses, see the [Conan API documentation](../../../api/packages/conan.md). -## Build a Conan package - -This section explains how to install Conan and build a package for your C/C++ -project. - -If you already use Conan and know how to build your own packages, go to the -[next section](#add-the-package-registry-as-a-conan-remote). - -### Install Conan - -Download the Conan package manager to your local development environment by -following the instructions at [conan.io](https://conan.io/downloads.html). - -When installation is complete, verify you can use Conan in your terminal by -running: - -```shell -conan --version -``` - -The Conan version is printed in the output: - -```plaintext -Conan version 1.20.5 -``` - -### Install CMake - -When you develop with C++ and Conan, you can select from many available -compilers. This example uses the CMake build system generator. - -To install CMake: - -- For Mac, use [Homebrew](https://brew.sh/) and run `brew install cmake`. -- For other operating systems, follow the instructions at [cmake.org](https://cmake.org/install/). - -When installation is complete, verify you can use CMake in your terminal by -running: - -```shell -cmake --version -``` - -The CMake version is printed in the output. - -### Create a project - -To test the Package Registry, you need a C++ project. If you don't already have -one, you can clone the Conan [hello world starter project](https://github.com/conan-io/hello). - -### Build a package - -To build a package: - -1. Open a terminal and navigate to your project's root folder. -1. Generate a new recipe by running `conan new` with a package name and version: - - ```shell - conan new Hello/0.1 -t - ``` - -1. Create a package for the recipe by running `conan create` with the Conan user - and channel: - - ```shell - conan create . mycompany/beta - ``` - - NOTE: - If you use an [instance remote](#add-a-remote-for-your-instance), you must - follow a specific [naming convention](#package-recipe-naming-convention-for-instance-remotes). - -A package with the recipe `Hello/0.1@mycompany/beta` is created. - -For more details about creating and managing Conan packages, see the -[Conan documentation](https://docs.conan.io/en/latest/creating_packages.html). - -#### Package without a username and a channel - -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/345055) in GitLab 14.6. - -Even though they are [recommended](https://docs.conan.io/en/latest/reference/conanfile/attributes.html#user-channel) -to distinguish your package from a similarly named existing package, -the username and channel are not mandatory fields for a Conan package. - -You can create a package without a username and channel by removing them from -the `create` command: - -```shell -conan create . -``` - -The username _and_ the channel must be blank. If only one of these fields is -blank, the request is rejected. - -NOTE: -Empty usernames and channels can only be used if you use a [project remote](#add-a-remote-for-your-project). -If you use an [instance remote](#add-a-remote-for-your-instance), the username -and the channel must be set. +Learn how to [build a Conan package](../workflows/build_packages.md#conan). ## Add the Package Registry as a Conan remote @@ -193,12 +95,12 @@ recipe `user` must be the plus sign (`+`) separated project path. Example recipe names: -| Project | Package | Supported | -| ---------------------------------- | ----------------------------------------------- | --------- | -| `foo/bar` | `my-package/1.0.0@foo+bar/stable` | Yes | -| `foo/bar-baz/buz` | `my-package/1.0.0@foo+bar-baz+buz/stable` | Yes | -| `gitlab-org/gitlab-ce` | `my-package/1.0.0@gitlab-org+gitlab-ce/stable` | Yes | -| `gitlab-org/gitlab-ce` | `my-package/1.0.0@foo/stable` | No | +| Project | Package | Supported | +| ---------------------- | ---------------------------------------------- | --------- | +| `foo/bar` | `my-package/1.0.0@foo+bar/stable` | Yes | +| `foo/bar-baz/buz` | `my-package/1.0.0@foo+bar-baz+buz/stable` | Yes | +| `gitlab-org/gitlab-ce` | `my-package/1.0.0@gitlab-org+gitlab-ce/stable` | Yes | +| `gitlab-org/gitlab-ce` | `my-package/1.0.0@foo/stable` | No | [Project remotes](#add-a-remote-for-your-project) have a more flexible naming convention. diff --git a/doc/user/packages/maven_repository/index.md b/doc/user/packages/maven_repository/index.md index 2ae2607f950..2aa71e111fb 100644 --- a/doc/user/packages/maven_repository/index.md +++ b/doc/user/packages/maven_repository/index.md @@ -14,177 +14,7 @@ Then, install the packages whenever you need to use them as a dependency. For documentation of the specific API endpoints that the Maven package manager client uses, see the [Maven API documentation](../../../api/packages/maven.md). -## Build a Maven package - -This section explains how to install Maven and build a package. - -If you already use Maven and know how to build your own packages, go to the -[next section](#authenticate-to-the-package-registry-with-maven). - -Maven repositories work well with Gradle, too. To set up a Gradle project, see [get started with Gradle](#build-a-java-project-with-gradle). - -### Install Maven - -The required minimum versions are: - -- Java 11.0.5+ -- Maven 3.6+ - -Follow the instructions at [maven.apache.org](https://maven.apache.org/install.html) -to download and install Maven for your local development environment. After -installation is complete, verify you can use Maven in your terminal by running: - -```shell -mvn --version -``` - -The output should be similar to: - -```shell -Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T20:00:29+01:00) -Maven home: /Users/<your_user>/apache-maven-3.6.1 -Java version: 12.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home -Default locale: en_GB, platform encoding: UTF-8 -OS name: "mac os x", version: "10.15.2", arch: "x86_64", family: "mac" -``` - -### Create a project - -Follow these steps to create a Maven project that can be -published to the GitLab Package Registry. - -1. Open your terminal and create a directory to store the project. -1. From the new directory, run this Maven command to initialize a new package: - - ```shell - mvn archetype:generate -DgroupId=com.mycompany.mydepartment -DartifactId=my-project -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false - ``` - - The arguments are: - - - `DgroupId`: A unique string that identifies your package. Follow - the [Maven naming conventions](https://maven.apache.org/guides/mini/guide-naming-conventions.html). - - `DartifactId`: The name of the `JAR`, appended to the end of the `DgroupId`. - - `DarchetypeArtifactId`: The archetype used to create the initial structure of - the project. - - `DinteractiveMode`: Create the project using batch mode (optional). - -This message indicates that the project was set up successfully: - -```shell -... -[INFO] ------------------------------------------------------------------------ -[INFO] BUILD SUCCESS -[INFO] ------------------------------------------------------------------------ -[INFO] Total time: 3.429 s -[INFO] Finished at: 2020-01-28T11:47:04Z -[INFO] ------------------------------------------------------------------------ -``` - -In the folder where you ran the command, a new directory should be displayed. -The directory name should match the `DartifactId` parameter, which in this case, -is `my-project`. - -## Build a Java project with Gradle - -This section explains how to install Gradle and initialize a Java project. - -If you already use Gradle and know how to build your own packages, go to the -[next section](#authenticate-to-the-package-registry-with-maven). - -### Install Gradle - -If you want to create a new Gradle project, you must install Gradle. Follow -instructions at [gradle.org](https://gradle.org/install/) to download and install -Gradle for your local development environment. - -In your terminal, verify you can use Gradle by running: - -```shell -gradle -version -``` - -To use an existing Gradle project, in the project directory, -on Linux execute `gradlew`, or on Windows execute `gradlew.bat`. - -The output should be similar to: - -```plaintext ------------------------------------------------------------- -Gradle 6.0.1 ------------------------------------------------------------- - -Build time: 2019-11-18 20:25:01 UTC -Revision: fad121066a68c4701acd362daf4287a7c309a0f5 - -Kotlin: 1.3.50 -Groovy: 2.5.8 -Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019 -JVM: 11.0.5 (Oracle Corporation 11.0.5+10) -OS: Windows 10 10.0 amd64 -``` - -### Create a Java project - -Follow these steps to create a Maven project that can be -published to the GitLab Package Registry. - -1. Open your terminal and create a directory to store the project. -1. From this new directory, run this Maven command to initialize a new package: - - ```shell - gradle init - ``` - - The output should be: - - ```plaintext - Select type of project to generate: - 1: basic - 2: application - 3: library - 4: Gradle plugin - Enter selection (default: basic) [1..4] - ``` - -1. Enter `3` to create a new Library project. The output should be: - - ```plaintext - Select implementation language: - 1: C++ - 2: Groovy - 3: Java - 4: Kotlin - 5: Scala - 6: Swift - ``` - -1. Enter `3` to create a new Java Library project. The output should be: - - ```plaintext - Select build script DSL: - 1: Groovy - 2: Kotlin - Enter selection (default: Groovy) [1..2] - ``` - -1. Enter `1` to create a new Java Library project that is described in Groovy DSL, or `2` to create one that is described in Kotlin DSL. The output should be: - - ```plaintext - Select test framework: - 1: JUnit 4 - 2: TestNG - 3: Spock - 4: JUnit Jupiter - ``` - -1. Enter `1` to initialize the project with JUnit 4 testing libraries. The output should be: - - ```plaintext - Project name (default: test): - ``` - -1. Enter a project name or press <kbd>Enter</kbd> to use the directory name as project name. +Learn how to build a [Maven](../workflows/build_packages.md#maven) or [Gradle](../workflows/build_packages.md#gradle) package. ## Authenticate to the Package Registry with Maven @@ -561,11 +391,11 @@ for download. **Only packages that have the same path as the project** are exposed by the instance-level endpoint. -| Project | Package | Instance-level endpoint available | -| ------- | ------- | --------------------------------- | -| `foo/bar` | `foo/bar/1.0-SNAPSHOT` | Yes | -| `gitlab-org/gitlab` | `foo/bar/1.0-SNAPSHOT` | No | -| `gitlab-org/gitlab` | `gitlab-org/gitlab/1.0-SNAPSHOT` | Yes | +| Project | Package | Instance-level endpoint available | +| ------------------- | -------------------------------- | --------------------------------- | +| `foo/bar` | `foo/bar/1.0-SNAPSHOT` | Yes | +| `gitlab-org/gitlab` | `foo/bar/1.0-SNAPSHOT` | No | +| `gitlab-org/gitlab` | `gitlab-org/gitlab/1.0-SNAPSHOT` | Yes | This example shows how relevant `repository` section of your `pom.xml`. You still need a project-specific URL in the `distributionManagement` section. @@ -838,7 +668,7 @@ dependencies { ### Request forwarding to Maven Central -> [Introduced](<https://gitlab.com/gitlab-org/gitlab/-/issues/362657>) behind a [feature flag](../../feature_flags.md), disabled by default in GitLab 15.4 +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/362657) behind a [feature flag](../../feature_flags.md), disabled by default in GitLab 15.4 FLAG: On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `maven_central_request_forwarding`. @@ -1053,20 +883,20 @@ that you can use when performing tasks with GitLab CI/CD. - Specify where to find the `pom.xml` file (`-f,--file`): - ```yaml - package: - script: - - 'mvn --no-transfer-progress -f helloworld/pom.xml package' - ``` + ```yaml + package: + script: + - 'mvn --no-transfer-progress -f helloworld/pom.xml package' + ``` - Specify where to find the user settings (`-s,--settings`) instead of [the default location](https://maven.apache.org/settings.html). There's also a `-gs,--global-settings` option: - ```yaml - package: - script: - - 'mvn -s settings/ci.xml package' - ``` + ```yaml + package: + script: + - 'mvn -s settings/ci.xml package' + ``` ### Verify your Maven settings diff --git a/doc/user/packages/npm_registry/index.md b/doc/user/packages/npm_registry/index.md index b9cd8245b32..5d2efc52ba9 100644 --- a/doc/user/packages/npm_registry/index.md +++ b/doc/user/packages/npm_registry/index.md @@ -20,72 +20,7 @@ WARNING: Never hardcode GitLab tokens (or any tokens) directly in `.npmrc` files or any other files that can be committed to a repository. -## Build an npm package - -This section covers how to install npm or Yarn and build a package for your -JavaScript project. - -If you already use npm and know how to build your own packages, go to -the [next section](#authenticate-to-the-package-registry). - -### Install npm - -Install Node.js and npm in your local development environment by following -the instructions at [npmjs.com](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm/). - -When installation is complete, verify you can use npm in your terminal by -running: - -```shell -npm --version -``` - -The npm version is shown in the output: - -```plaintext -6.10.3 -``` - -### Install Yarn - -As an alternative to npm, you can install Yarn in your local environment by following the -instructions at [classic.yarnpkg.com](https://classic.yarnpkg.com/en/docs/install). - -When installation is complete, verify you can use Yarn in your terminal by -running: - -```shell -yarn --version -``` - -The Yarn version is shown in the output: - -```plaintext -1.19.1 -``` - -### Create a project - -To create a project: - -1. Create an empty directory. -1. Go to the directory and initialize an empty package by running: - - ```shell - npm init - ``` - - Or if you're using Yarn: - - ```shell - yarn init - ``` - -1. Enter responses to the questions. Ensure the **package name** follows - the [naming convention](#package-naming-convention) and is scoped to the - project or group where the registry exists. - -A `package.json` file is created. +Learn how to build an [npm](../workflows/build_packages.md#npm) or [yarn](../workflows/build_packages.md#yarn) package. ## Use the GitLab endpoint for npm packages @@ -244,15 +179,15 @@ In this case, the `@scope` needs to be `@registries-group` and not `@source-code For example, if your project is `https://gitlab.example.com/my-org/engineering-group/team-amazing/analytics`, the root namespace is `my-org`. When you publish a package, it must have `my-org` as the scope. -| Project | Package | Supported | -| ---------------------- | ----------------------- | --------- | -| `my-org/bar` | `@my-org/bar` | Yes | -| `my-org/bar/baz` | `@my-org/baz` | Yes | -| `My-Org/Bar/baz` | `@my-org/Baz` | Yes | -| `My-Org/Bar/baz` | `@My-Org/Baz` | Yes | -| `my-org/bar/buz` | `@my-org/anything` | Yes | -| `gitlab-org/gitlab` | `@gitlab-org/gitlab` | Yes | -| `gitlab-org/gitlab` | `@foo/bar` | No | +| Project | Package | Supported | +| ------------------- | -------------------- | --------- | +| `my-org/bar` | `@my-org/bar` | Yes | +| `my-org/bar/baz` | `@my-org/baz` | Yes | +| `My-Org/Bar/baz` | `@my-org/Baz` | Yes | +| `My-Org/Bar/baz` | `@My-Org/Baz` | Yes | +| `my-org/bar/buz` | `@my-org/anything` | Yes | +| `gitlab-org/gitlab` | `@gitlab-org/gitlab` | Yes | +| `gitlab-org/gitlab` | `@foo/bar` | No | In GitLab, this regex validates all package names from all package managers: @@ -290,7 +225,9 @@ You can also define `"publishConfig"` for your project in `package.json`. For ex ```json { -"publishConfig": { "@foo:registry":" https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/" } + "publishConfig": { + "@foo:registry": " https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/" + } } ``` @@ -342,13 +279,13 @@ To publish and install with the project-level npm endpoint, set the following co ```yaml npmScopes: foo: - npmRegistryServer: "https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/" - npmPublishRegistry: "https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/" + npmRegistryServer: 'https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/' + npmPublishRegistry: 'https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/' npmRegistries: //gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/: npmAlwaysAuth: true - npmAuthToken: "<your_token>" + npmAuthToken: '<your_token>' ``` For the instance-level npm endpoint, use this Yarn 2 configuration in `.yarnrc.yml`: @@ -356,12 +293,12 @@ For the instance-level npm endpoint, use this Yarn 2 configuration in `.yarnrc.y ```yaml npmScopes: foo: - npmRegistryServer: "https://gitlab.example.com/api/v4/packages/npm/" + npmRegistryServer: 'https://gitlab.example.com/api/v4/packages/npm/' npmRegistries: //gitlab.example.com/api/v4/packages/npm/: npmAlwaysAuth: true - npmAuthToken: "<your_token>" + npmAuthToken: '<your_token>' ``` In this configuration: @@ -561,7 +498,7 @@ should look like: { "name": "@foo/my-package", "version": "1.0.0", - "description": "Example package for GitLab npm registry", + "description": "Example package for GitLab npm registry" } ``` diff --git a/doc/user/packages/nuget_repository/index.md b/doc/user/packages/nuget_repository/index.md index 60dd0b8f97c..956202bb990 100644 --- a/doc/user/packages/nuget_repository/index.md +++ b/doc/user/packages/nuget_repository/index.md @@ -22,47 +22,7 @@ The Package Registry works with: For documentation of the specific API endpoints that these clients use, see the [NuGet API documentation](../../../api/packages/nuget.md). -## Install NuGet - -The required minimum versions are: - -- [NuGet CLI 5.1 or later](https://www.nuget.org/downloads). If you have - [Visual Studio](https://visualstudio.microsoft.com/vs/), the NuGet CLI is - probably already installed. -- Alternatively, you can use [.NET SDK 3.0 or later](https://dotnet.microsoft.com/download/dotnet/3.0), - which installs the NuGet CLI. -- NuGet protocol version 3 or later. - -Verify that the [NuGet CLI](https://www.nuget.org/) is installed by running: - -```shell -nuget help -``` - -The output should be similar to: - -```plaintext -NuGet Version: 5.1.0.6013 -usage: NuGet <command> [args] [options] -Type 'NuGet help <command>' for help on a specific command. - -Available commands: - -[output truncated] -``` - -### Install NuGet on macOS - -For macOS, you can use [Mono](https://www.mono-project.com/) to run the -NuGet CLI. - -1. If you use Homebrew, to install Mono, run `brew install mono`. -1. Download the Windows C# binary `nuget.exe` from the [NuGet CLI page](https://www.nuget.org/downloads). -1. Run this command: - - ```shell - mono nuget.exe - ``` +Learn how to [install NuGet](../workflows/build_packages.md#nuget). ## Use the GitLab endpoint for NuGet Packages @@ -162,6 +122,7 @@ To use the [project-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet en 1. In the **NuGet** section, select **Sources** to view a list of all your NuGet sources. 1. Select **Add**. 1. Complete the following fields: + - **Name**: Name for the source. - **Location**: `https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/nuget/index.json`, where `<your_project_id>` is your project ID, and `gitlab.example.com` is @@ -191,6 +152,7 @@ To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endp 1. In the **NuGet** section, select **Sources** to view a list of all your NuGet sources. 1. Select **Add**. 1. Complete the following fields: + - **Name**: Name for the source. - **Location**: `https://gitlab.example.com/api/v4/groups/<your_group_id>/-/packages/nuget/index.json`, where `<your_group_id>` is your group ID, and `gitlab.example.com` is diff --git a/doc/user/packages/pypi_repository/index.md b/doc/user/packages/pypi_repository/index.md index 984558f063d..f6ed9654882 100644 --- a/doc/user/packages/pypi_repository/index.md +++ b/doc/user/packages/pypi_repository/index.md @@ -20,148 +20,7 @@ The Package Registry works with: For documentation of the specific API endpoints that the `pip` and `twine` clients use, see the [PyPI API documentation](../../../api/packages/pypi.md). -## Build a PyPI package - -This section explains how to create a PyPI package. - -If you already use PyPI and know how to build your own packages, go to the -[next section](#authenticate-with-the-package-registry). - -### Install pip and twine - -Install a recent version of [pip](https://pypi.org/project/pip/) and -[twine](https://pypi.org/project/twine/). - -### Create a project - -Create a test project. - -1. Open your terminal. -1. Create a directory called `MyPyPiPackage`, and then go to that directory: - - ```shell - mkdir MyPyPiPackage && cd MyPyPiPackage - ``` - -1. Create another directory and go to it: - - ```shell - mkdir mypypipackage && cd mypypipackage - ``` - -1. Create the required files in this directory: - - ```shell - touch __init__.py - touch greet.py - ``` - -1. Open the `greet.py` file, and then add: - - ```python - def SayHello(): - print("Hello from MyPyPiPackage") - return - ``` - -1. Open the `__init__.py` file, and then add: - - ```python - from .greet import SayHello - ``` - -1. To test the code, in your `MyPyPiPackage` directory, start the Python prompt. - - ```shell - python - ``` - -1. Run this command: - - ```python - >>> from mypypipackage import SayHello - >>> SayHello() - ``` - -A message indicates that the project was set up successfully: - -```plaintext -Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18) -[Clang 6.0 (clang-600.0.57)] on darwin -Type "help", "copyright", "credits" or "license" for more information. ->>> from mypypipackage import SayHello ->>> SayHello() -Hello from MyPyPiPackage -``` - -### Create a package - -After you create a project, you can create a package. - -1. In your terminal, go to the `MyPyPiPackage` directory. -1. Create a `pyproject.toml` file: - - ```shell - touch pyproject.toml - ``` - - This file contains all the information about the package. For more information - about this file, see [creating `pyproject.toml`](https://packaging.python.org/en/latest/tutorials/packaging-projects/#creating-pyproject-toml). - Because GitLab identifies packages based on - [Python normalized names (PEP-503)](https://www.python.org/dev/peps/pep-0503/#normalized-names), - ensure your package name meets these requirements. See the [installation section](#authenticate-with-a-ci-job-token) - for details. - -1. Open the `pyproject.toml` file, and then add basic information: - - ```toml - [build-system] - requires = ["setuptools>=61.0"] - build-backend = "setuptools.build_meta" - - [project] - name = "mypypipackage" - version = "0.0.1" - authors = [ - { name="Example Author", email="author@example.com" }, - ] - description = "A small example package" - requires-python = ">=3.7" - classifiers = [ - "Programming Language :: Python :: 3", - "Operating System :: OS Independent", - ] - - [tool.setuptools.packages] - find = {} - ``` - -1. Save the file. -1. Install the package build library: - - ```shell - pip install build - ``` - -1. Build the package: - - ```shell - python -m build - ``` - -The output should be visible in a newly-created `dist` folder: - -```shell -ls dist -``` - -The output should appear similar to the following: - -```plaintext -mypypipackage-0.0.1-py3-none-any.whl mypypipackage-0.0.1.tar.gz -``` - -The package is now ready to be published to the Package Registry. +Learn how to [build a PyPI package](../workflows/build_packages.md#pypi). ## Authenticate with the Package Registry diff --git a/spec/scripts/failed_tests_spec.rb b/spec/scripts/failed_tests_spec.rb index 92eae75b3be..b99fd991c55 100644 --- a/spec/scripts/failed_tests_spec.rb +++ b/spec/scripts/failed_tests_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require_relative '../../scripts/failed_tests' RSpec.describe FailedTests do diff --git a/spec/scripts/pipeline_test_report_builder_spec.rb b/spec/scripts/pipeline_test_report_builder_spec.rb index 198cdefc530..b51b4dc4887 100644 --- a/spec/scripts/pipeline_test_report_builder_spec.rb +++ b/spec/scripts/pipeline_test_report_builder_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require_relative '../../scripts/pipeline_test_report_builder' RSpec.describe PipelineTestReportBuilder do diff --git a/spec/support/rspec_order_todo.yml b/spec/support/rspec_order_todo.yml index b0c4a8b8ca5..f9d61117ef6 100644 --- a/spec/support/rspec_order_todo.yml +++ b/spec/support/rspec_order_todo.yml @@ -9451,16 +9451,6 @@ - './spec/routing/projects/security/configuration_controller_routing_spec.rb' - './spec/routing/routing_spec.rb' - './spec/routing/uploads_routing_spec.rb' -- './spec/scripts/changed-feature-flags_spec.rb' -- './spec/scripts/determine-qa-tests_spec.rb' -- './spec/scripts/failed_tests_spec.rb' -- './spec/scripts/lib/glfm/parse_examples_spec.rb' -- './spec/scripts/lib/glfm/shared_spec.rb' -- './spec/scripts/lib/glfm/update_example_snapshots_spec.rb' -- './spec/scripts/lib/glfm/update_specification_spec.rb' -- './spec/scripts/pipeline_test_report_builder_spec.rb' -- './spec/scripts/setup/find_jh_branch_spec.rb' -- './spec/scripts/trigger-build_spec.rb' - './spec/serializers/accessibility_error_entity_spec.rb' - './spec/serializers/accessibility_reports_comparer_entity_spec.rb' - './spec/serializers/accessibility_reports_comparer_serializer_spec.rb' |