diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-16 21:09:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-16 21:09:52 +0000 |
commit | aa33f5d5bbdcfff893da23eebd95064b4fa2e453 (patch) | |
tree | 8e2bfae36374b5b3c79ab93ccf6e75bb62736bdb /doc | |
parent | bf1600d157465f9408aace91073954fd5790c054 (diff) | |
download | gitlab-ce-aa33f5d5bbdcfff893da23eebd95064b4fa2e453.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/.vale/gitlab/spelling-exceptions.txt | 1 | ||||
-rw-r--r-- | doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md | 2 | ||||
-rw-r--r-- | doc/ci/pipelines/index.md | 29 | ||||
-rw-r--r-- | doc/ci/troubleshooting.md | 238 | ||||
-rw-r--r-- | doc/development/adding_database_indexes.md | 68 | ||||
-rw-r--r-- | doc/development/migration_style_guide.md | 51 | ||||
-rw-r--r-- | doc/user/project/import/github.md | 36 | ||||
-rw-r--r-- | doc/user/project/repository/reducing_the_repo_size_using_git.md | 2 |
8 files changed, 358 insertions, 69 deletions
diff --git a/doc/.vale/gitlab/spelling-exceptions.txt b/doc/.vale/gitlab/spelling-exceptions.txt index f269d02c407..4648f892a70 100644 --- a/doc/.vale/gitlab/spelling-exceptions.txt +++ b/doc/.vale/gitlab/spelling-exceptions.txt @@ -403,6 +403,7 @@ sanitization sbt scatterplot scatterplots +Schemastore Sendmail Sentry serializer diff --git a/doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md b/doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md index 15dad1306fc..dd08f9248f6 100644 --- a/doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md +++ b/doc/ci/merge_request_pipelines/pipelines_for_merged_results/index.md @@ -127,5 +127,5 @@ unexpected timing. For example, when a source or target branch is advanced. In this case, the pipeline fails because of `fatal: reference is not a tree:` error, which indicates that the checkout-SHA is not found in the merge ref. -This behavior was improved at GitLab 12.4 by introducing [Persistent pipeline refs](../../pipelines/index.md#troubleshooting-fatal-reference-is-not-a-tree). +This behavior was improved at GitLab 12.4 by introducing [Persistent pipeline refs](../../troubleshooting.md#fatal-reference-is-not-a-tree-error). You should be able to create pipelines at any timings without concerning the error. diff --git a/doc/ci/pipelines/index.md b/doc/ci/pipelines/index.md index 1b526cabde2..1b9048089bd 100644 --- a/doc/ci/pipelines/index.md +++ b/doc/ci/pipelines/index.md @@ -535,32 +535,3 @@ GitLab provides API endpoints to: - Trigger pipeline runs. For more information, see: - [Triggering pipelines through the API](../triggers/README.md). - [Pipeline triggers API](../../api/pipeline_triggers.md). - -## Troubleshooting `fatal: reference is not a tree:` - -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17043) in GitLab 12.4. - -Previously, you'd have encountered unexpected pipeline failures when you force-pushed -a branch to its remote repository. To illustrate the problem, suppose you've had the current workflow: - -1. A user creates a feature branch named `example` and pushes it to a remote repository. -1. A new pipeline starts running on the `example` branch. -1. A user rebases the `example` branch on the latest `master` branch and force-pushes it to its remote repository. -1. A new pipeline starts running on the `example` branch again, however, - the previous pipeline (2) fails because of `fatal: reference is not a tree:` error. - -This is because the previous pipeline cannot find a checkout-SHA (which associated with the pipeline record) -from the `example` branch that the commit history has already been overwritten by the force-push. -Similarly, [Pipelines for merged results](../merge_request_pipelines/pipelines_for_merged_results/index.md) -might have failed intermittently due to [the same reason](../merge_request_pipelines/pipelines_for_merged_results/index.md#intermittently-pipelines-fail-by-fatal-reference-is-not-a-tree-error). - -As of GitLab 12.4, we've improved this behavior by persisting pipeline refs exclusively. -To illustrate its life cycle: - -1. A pipeline is created on a feature branch named `example`. -1. A persistent pipeline ref is created at `refs/pipelines/<pipeline-id>`, - which retains the checkout-SHA of the associated pipeline record. - This persistent ref stays intact during the pipeline execution, - even if the commit history of the `example` branch has been overwritten by force-push. -1. The runner fetches the persistent pipeline ref and gets source code from the checkout-SHA. -1. When the pipeline finished, its persistent ref is cleaned up in a background process. diff --git a/doc/ci/troubleshooting.md b/doc/ci/troubleshooting.md index 4f4311570e0..992b51b6b3d 100644 --- a/doc/ci/troubleshooting.md +++ b/doc/ci/troubleshooting.md @@ -7,48 +7,240 @@ type: reference # Troubleshooting CI/CD -## Pipeline warnings +GitLab provides several tools to help make troubleshooting your pipelines easier. -Pipeline configuration warnings are shown when you: +This guide also lists common issues and possible solutions. -- [Validate configuration with the CI Lint tool](yaml/README.md#validate-the-gitlab-ciyml). -- [Manually run a pipeline](pipelines/index.md#run-a-pipeline-manually). +## Verify syntax -### "Job may allow multiple pipelines to run for a single action" +An early source of problems can be incorrect syntax. The pipeline shows a `yaml invalid` +badge and does not start running if any syntax or formatting problems are found. -When you use [`rules`](yaml/README.md#rules) with a `when:` clause without -an `if:` clause, multiple pipelines may run. Usually -this occurs when you push a commit to a branch that has an open merge request associated with it. +### Edit `gitlab-ci.yml` with the Web IDE -To [prevent duplicate pipelines](yaml/README.md#prevent-duplicate-pipelines), use -[`workflow: rules`](yaml/README.md#workflowrules) or rewrite your rules -to control which pipelines can run. +The [GitLab Web IDE](../user/project/web_ide/index.md) offers advanced authoring tools, +including syntax highlighting for the `.gitlab-ci.yml`, and is the recommended editing +experience (rather than the single file editor). It offers code completion suggestions +that ensure you are only using accepted keywords. + +If you prefer to use another editor, you can use a schema like [the Schemastore `gitlab-ci` schema](https://json.schemastore.org/gitlab-ci) +with your editor of choice. + +### Verify syntax with CI Lint tool + +The [CI Lint tool](lint.md) is a simple way to ensure the syntax of a CI/CD configuration +file is correct. Paste in full `gitlab-ci.yml` files or individual jobs configuration, +to verify the basic syntax. + +When a `.gitlab-ci.yml` file is present in a project, you can also use the CI Lint +tool to [simulate the creation of a full pipeline](lint.md#pipeline-simulation). +It does deeper verification of the configuration syntax. + +## Verify variables + +A key part of troubleshooting CI/CD is to verify which variables are present in a +pipeline, and what their values are. A lot of pipeline configuration is dependent +on variables, and verifying them is one of the fastest ways to find the source of +a problem. + +[Export the full list of variables](variables/README.md#list-all-environment-variables) +available in each problematic job. Check if the variables you expect are present, +and check if their values are what you expect. + +## GitLab CI/CD documentation + +The [complete `gitlab-ci.yml` reference](yaml/README.md) contains a full list of +every keyword you may need to use to configure your pipelines. + +You can also look at a large number of pipeline configuration [examples](examples/README.md) +and [templates](examples/README.md#cicd-templates). + +### Documentation for pipeline types + +Some pipeline types have their own detailed usage guides that you should read +if you are using that type: + +- [Multi-project pipelines](multi_project_pipelines.md): Have your pipeline trigger + a pipeline in a different project. +- [Parent/child pipelines](parent_child_pipelines.md): Have your main pipeline trigger + and run separate pipelines in the same project. You can also + [dynamically generate the child pipeline's configuration](parent_child_pipelines.md#dynamic-child-pipelines) + at runtime. +- [Pipelines for Merge Requests](merge_request_pipelines/index.md): Run a pipeline + in the context of a merge request. + - [Pipelines for Merge Results](merge_request_pipelines/pipelines_for_merged_results/index.md): + Pipelines for merge requests that run on the combined source and target branch + - [Merge Trains](merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md): + Multiple pipelines for merged results that queue and run automatically before + changes are merged. + +### Troubleshooting Guides for CI/CD features + +There are troubleshooting guides available for some CI/CD features and related topics: + +- [Container Registry](../user/packages/container_registry/index.md#troubleshooting-the-gitlab-container-registry) +- [GitLab Runner](https://docs.gitlab.com/runner/faq/) +- [Merge Trains](merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md#troubleshooting) +- [Docker Build](docker/using_docker_build.md#troubleshooting) +- [Environments](environments/deployment_safety.md#ensure-only-one-deployment-job-runs-at-a-time) + +## Common CI/CD issues + +A lot of common pipeline issues can be fixed by analyzing the behavior of the `rules` +or `only/except` configuration. You shouldn't use these two configurations in the same +pipeline, as they behave differently. It's hard to predict how a pipeline runs with +this mixed behavior. + +If your `rules` or `only/except` configuration makes use of [predefined variables](variables/predefined_variables.md) +like `CI_PIPELINE_SOURCE`, `CI_MERGE_REQUEST_ID`, you should [verify them](#verify-variables) +as the first troubleshooting step. + +### Jobs or pipelines don't run when expected + +The `rules` or `only/except` keywords are what determine whether or not a job is +added to a pipeline. If a pipeline runs, but a job is not added to the pipeline, +it's usually due to `rules` or `only/except` configuration issues. + +If a pipeline does not seem to run at all, with no error message, it may also be +due to `rules` or `only/except` configuration, or the `workflow: rules` keyword. + +If you are converting from `only/except` to the `rules` keyword, you should check +the [`rules` configuration details](yaml/README.md#rules) carefully. The behavior +of `only/except` and `rules` is different and can cause unexpected behavior when migrating +between the two. + +The [common `if` clauses for `rules`](yaml/README.md#common-if-clauses-for-rules) +can be very helpful for examples of how to write rules that behave the way you expect. + +#### Two pipelines run at the same time + +Two pipelines can run when pushing a commit to a branch that has an open merge request +associated with it. Usually one pipeline is a merge request pipeline, and the other +is a branch pipeline. -## Merge request pipeline widget +This is usually caused by the `rules` configuration, and there are several ways to +[prevent duplicate pipelines](yaml/README.md#prevent-duplicate-pipelines). -The merge request pipeline widget shows information about the pipeline status in a Merge Request. It's displayed above the [merge request ability to merge widget](#merge-request-ability-to-merge-widget). +#### A job is not in the pipeline -There are several messages that can be displayed depending on the status of the pipeline. +GitLab determines if a job is added to a pipeline based on the [`only/except`](yaml/README.md#onlyexcept-basic) +or [`rules`](yaml/README.md#rules) defined for the job. If it didn't run, it's probably +not evaluating as you expect. -### "Checking pipeline status" +#### No pipeline or the wrong type of pipeline runs -This message is shown when the merge request has no pipeline associated with the latest commit yet. This might be because: +Before a pipeline can run, GitLab evaluates all the jobs in the configuration and tries +to add them to all available pipeline types. A pipeline does not run if no jobs are added +to it at the end of the evaluation. + +If a pipeline did not run, it's likely that all the jobs had `rules` or `only/except` that +blocked them from being added to the pipeline. + +If the wrong pipeline type ran, then the `rules` or `only/except` configuration should +be checked to make sure the jobs are added to the correct pipeline type. For +example, if a merge request pipeline did not run, the jobs may have been added to +a branch pipeline instead. + +It's also possible that your [`workflow: rules`](yaml/README.md#workflowrules) configuration +blocked the pipeline, or allowed the wrong pipeline type. + +### A job runs unexpectedly + +A common reason a job is added to a pipeline unexpectedly is because the `changes` +keyword always evaluates to true in certain cases. For example, `changes` is always +true in certain pipeline types, including scheduled pipelines and pipelines for tags. + +The `changes` keyword is used in combination with [`only/except`](yaml/README.md#onlychangesexceptchanges) +or [`rules`](yaml/README.md#ruleschanges)). It's recommended to use `changes` with +`rules` or `only/except` configuration that ensures the job is only added to branch +pipelines or merge request pipelines. + +### "fatal: reference is not a tree" error + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17043) in GitLab 12.4. + +Previously, you'd have encountered unexpected pipeline failures when you force-pushed +a branch to its remote repository. To illustrate the problem, suppose you've had the current workflow: + +1. A user creates a feature branch named `example` and pushes it to a remote repository. +1. A new pipeline starts running on the `example` branch. +1. A user rebases the `example` branch on the latest `master` branch and force-pushes it to its remote repository. +1. A new pipeline starts running on the `example` branch again, however, + the previous pipeline (2) fails because of `fatal: reference is not a tree:` error. + +This is because the previous pipeline cannot find a checkout-SHA (which is associated with the pipeline record) +from the `example` branch that the commit history has already been overwritten by the force-push. +Similarly, [Pipelines for merged results](merge_request_pipelines/pipelines_for_merged_results/index.md) +might have failed intermittently due to [the same reason](merge_request_pipelines/pipelines_for_merged_results/index.md#intermittently-pipelines-fail-by-fatal-reference-is-not-a-tree-error). + +As of GitLab 12.4, we've improved this behavior by persisting pipeline refs exclusively. +To illustrate its life cycle: + +1. A pipeline is created on a feature branch named `example`. +1. A persistent pipeline ref is created at `refs/pipelines/<pipeline-id>`, + which retains the checkout-SHA of the associated pipeline record. + This persistent ref stays intact during the pipeline execution, + even if the commit history of the `example` branch has been overwritten by force-push. +1. The runner fetches the persistent pipeline ref and gets source code from the checkout-SHA. +1. When the pipeline finishes, its persistent ref is cleaned up in a background process. + +### Merge request pipeline messages + +The merge request pipeline widget shows information about the pipeline status in +a merge request. It's displayed above the [ability to merge status widget](#merge-request-status-messages). + +#### "Checking pipeline status" message + +This message is shown when the merge request has no pipeline associated with the +latest commit yet. This might be because: - GitLab hasn't finished creating the pipeline yet. - You are using an external CI service and GitLab hasn't heard back from the service yet. - You are not using CI/CD pipelines in your project. - The latest pipeline was deleted (this is a [known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/214323)). -After the pipeline is created, the message will update with the pipeline status. +After the pipeline is created, the message updates with the pipeline status. + +### Merge request status messages + +The merge request status widget shows the **Merge** button and whether or not a merge +request is ready to merge. If the merge request can't be merged, the reason for this +is displayed. + +If the pipeline is still running, the **Merge** button is replaced with the +**Merge when pipeline succeeds** button. -## Merge request ability to merge widget +If [**Merge Trains**](merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md) +are enabled, the button is either **Add to merge train** or **Add to merge train when pipeline succeeds**. **(PREMIUM)** -The merge request status widget shows the **Merge** button and whether or not a merge request is ready to merge. If the merge request can't be merged, the reason for this is displayed. +#### "A CI/CD pipeline must run and be successful before merge" message -If the pipeline is still running, the **Merge** button is replaced with the **Merge when pipeline succeeds** button. +This message is shown if the [Pipelines must succeed](../user/project/merge_requests/merge_when_pipeline_succeeds.md#only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds) +setting is enabled in the project and a pipeline has not yet run successfully. +This also applies if the pipeline has not been created yet, or if you are waiting +for an external CI service. If you don't use pipelines for your project, then you +should disable **Pipelines must succeed** so you can accept merge requests. + +## Pipeline warnings + +Pipeline configuration warnings are shown when you: + +- [Validate configuration with the CI Lint tool](yaml/README.md#validate-the-gitlab-ciyml). +- [Manually run a pipeline](pipelines/index.md#run-a-pipeline-manually). + +### "Job may allow multiple pipelines to run for a single action" warning + +When you use [`rules`](yaml/README.md#rules) with a `when:` clause without an `if:` +clause, multiple pipelines may run. Usually this occurs when you push a commit to +a branch that has an open merge request associated with it. + +To [prevent duplicate pipelines](yaml/README.md#prevent-duplicate-pipelines), use +[`workflow: rules`](yaml/README.md#workflowrules) or rewrite your rules to control +which pipelines can run. -If [**Merge Trains**](merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md) are enabled, the button is either **Add to merge train** or **Add to merge train when pipeline succeeds**. **(PREMIUM)** +## How to get help -### "A CI/CD pipeline must run and be successful before merge" +If you are unable to resolve pipeline issues, you can get help from: -This message is shown if the [Pipelines must succeed](../user/project/merge_requests/merge_when_pipeline_succeeds.md#only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds) setting is enabled in the project and a pipeline has not yet run successfully. This also applies if the pipeline has not been created yet, or if you are waiting for an external CI service. If you don't use pipelines for your project, then you should disable **Pipelines must succeed** so you can accept merge requests. +- The [GitLab community forum](https://forum.gitlab.com/) +- GitLab [Support](https://about.gitlab.com/support/) diff --git a/doc/development/adding_database_indexes.md b/doc/development/adding_database_indexes.md index 7fe047b380b..03557491e68 100644 --- a/doc/development/adding_database_indexes.md +++ b/doc/development/adding_database_indexes.md @@ -121,3 +121,71 @@ may be affected by factors such as (but not limited to): In other words, this data is only reliable for a frequently used database with plenty of data and with as many GitLab features enabled (and being used) as possible. + +## Requirements for naming indexes + +Indexes with complex definitions need to be explicitly named rather than +relying on the implicit naming behavior of migration methods. In short, +that means you **must** provide an explicit name argument for an index +created with one or more of the following options: + +- `where` +- `using` +- `order` +- `length` +- `type` +- `opclass` + +### Considerations for index names + +Index names don't have any significance in the database, so they should +attempt to communicate intent to others. The most important rule to +remember is that generic names are more likely to conflict or be duplicated, +and should not be used. Some other points to consider: + +- For general indexes, use a template, like: `index_{table}_{column}_{options}`. +- For indexes added to solve a very specific problem, it may make sense + for the name to reflect their use. +- Identifiers in PostgreSQL have a maximum length of 63 bytes. +- Check `db/structure.sql` for conflicts and ideas. + +### Why explicit names are required + +As Rails is database agnostic, it generates an index name only +from the required options of all indexes: table name and column name(s). +For example, imagine the following two indexes are created in a migration: + +```ruby +def up + add_index :my_table, :my_column + + add_index :my_table, :my_column, where: 'my_column IS NOT NULL' +end +``` + +Creation of the second index would fail, because Rails would generate +the same name for both indexes. + +This is further complicated by the behavior of the `index_exists?` method. +It considers only the table name, column name(s) and uniqueness specification +of the index when making a comparison. Consider: + +```ruby +def up + unless index_exists?(:my_table, :my_column, where: 'my_column IS NOT NULL') + add_index :my_table, :my_column, where: 'my_column IS NOT NULL' + end +end +``` + +The call to `index_exists?` will return true if **any** index exists on +`:my_table` and `:my_column`, and index creation will be bypassed. + +The `add_concurrent_index` helper is a requirement for creating indexes +on populated tables. Since it cannot be used inside a transactional +migration, it has a built-in check that detects if the index already +exists. In the event a match is found, index creation is skipped. +Without an explicit name argument, Rails can return a false positive +for `index_exists?`, causing a required index to not be created +properly. By always requiring a name for certain types of indexes, the +chance of error is greatly reduced. diff --git a/doc/development/migration_style_guide.md b/doc/development/migration_style_guide.md index 2a49005da1b..207dd02d258 100644 --- a/doc/development/migration_style_guide.md +++ b/doc/development/migration_style_guide.md @@ -465,13 +465,17 @@ class MyMigration < ActiveRecord::Migration[6.0] disable_ddl_transaction! def up - remove_concurrent_index :table_name, :column_name + remove_concurrent_index :table_name, :column_name, name: :index_name end end ``` Note that it is not necessary to check if the index exists prior to -removing it. +removing it, however it is required to specify the name of the +index that is being removed. This can be done either by passing the name +as an option to the appropriate form of `remove_index` or `remove_concurrent_index`, +or more simply by using the `remove_concurrent_index_by_name` method. Explicitly +specifying the name is important to ensure the correct index is removed. For a small table (such as an empty one or one with less than `1,000` records), it is recommended to use `remove_index` in a single-transaction migration, @@ -512,11 +516,16 @@ class MyMigration < ActiveRecord::Migration[6.0] end def down - remove_concurrent_index :table, :column + remove_concurrent_index :table, :column, name: index_name end end ``` +You must explicitly name indexes that are created with more complex +definitions beyond table name, column name(s) and uniqueness constraint. +Consult the [Adding Database Indexes](adding_database_indexes.md#requirements-for-naming-indexes) +guide for more details. + If you need to add a unique index, please keep in mind there is the possibility of existing duplicates being present in the database. This means that should always _first_ add a migration that removes any duplicates, before adding the @@ -526,6 +535,42 @@ For a small table (such as an empty one or one with less than `1,000` records), it is recommended to use `add_index` in a single-transaction migration, combining it with other operations that don't require `disable_ddl_transaction!`. +## Testing for existence of indexes + +If a migration requires conditional logic based on the absence or +presence of an index, you must test for existence of that index using +its name. This helps avoids problems with how Rails compares index definitions, +which can lead to unexpected results. For more details, review the +[Adding Database Indexes](adding_database_indexes.md#why-explicit-names-are-required) +guide. + +The easiest way to test for existence of an index by name is to use the +`index_name_exists?` method, but the `index_exists?` method can also +be used with a name option. For example: + +```ruby +class MyMigration < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + INDEX_NAME = 'index_name' + + def up + # an index must be conditionally created due to schema inconsistency + unless index_exists?(:table_name, :column_name, name: INDEX_NAME) + add_index :table_name, :column_name, name: INDEX_NAME + end + end + + def down + # no op + end +end +``` + +Keep in mind that concurrent index helpers like `add_concurrent_index`, +`remove_concurrent_index`, and `remove_concurrent_index_by_name` already +perform existence checks internally. + ## Adding foreign-key constraints When adding a foreign-key constraint to either an existing or a new column also diff --git a/doc/user/project/import/github.md b/doc/user/project/import/github.md index a380edf5cf6..4cd0c9e02c7 100644 --- a/doc/user/project/import/github.md +++ b/doc/user/project/import/github.md @@ -12,18 +12,6 @@ your self-managed GitLab instance. ## Overview -NOTE: **Note:** -These instructions work for users on GitLab.com, but if you are an -administrator of a self-managed GitLab instance or if you are importing from GitHub Enterprise, -you must enable [GitHub integration](../../../integration/github.md). GitHub integration is the only method for -importing from GitHub Enterprise. If you are using GitLab.com, you can alternatively import -GitHub repositories using a [personal access token](#using-a-github-token), -but this method is not recommended because it cannot associate all user activity -(such as issues and pull requests) with matching GitLab users. -If you are an administrator of a self-managed GitLab instance, you can also use the -[GitHub Rake task](../../../administration/raketasks/github_import.md) to import projects from -GitHub without the constraints of a Sidekiq worker. - The following aspects of a project are imported: - Repository description (GitLab.com & 7.7+) @@ -43,6 +31,30 @@ each imported repository maintains visibility level unless that [visibility level is restricted](../../../public_access/public_access.md#restricting-the-use-of-public-or-internal-projects), in which case it defaults to the default project visibility. +The namespace is a user or group in GitLab, such as `gitlab.com/janedoe` or `gitlab.com/customer-success`. You can do some bulk actions to move projects to different namespaces in the rails console. + +This process does not migrate or import any types of groups or organizations from GitHub to GitLab. + +### If you're using GitLab.com + +If you're using GitLab.com, you can alternatively import +GitHub repositories using a [personal access token](#using-a-github-token), +but we don't recommend this method because it can't associate all user activity +(such as issues and pull requests) with matching GitLab users. + +### If you're importing from GitLab Enterprise + +If you're importing from GitHub Enterprise, you must enable [GitHub integration][gh-import]. + +### If you're using a self-managed GitLab instance + +If you're an administrator of a self-managed GitLab instance, you must enable +[GitHub integration][gh-import]. + +If you're an administrator of a self-managed GitLab instance, you can also use the +[GitHub Rake task](../../../administration/raketasks/github_import.md) to import projects from +GitHub without the constraints of a Sidekiq worker. + ## How it works When issues and pull requests are being imported, the importer attempts to find their GitHub authors and diff --git a/doc/user/project/repository/reducing_the_repo_size_using_git.md b/doc/user/project/repository/reducing_the_repo_size_using_git.md index 5f698454c59..28fdda07b05 100644 --- a/doc/user/project/repository/reducing_the_repo_size_using_git.md +++ b/doc/user/project/repository/reducing_the_repo_size_using_git.md @@ -35,7 +35,7 @@ other internal references (refs) that are automatically created by GitLab. These - `refs/merge-requests/*` for merge requests. - `refs/pipelines/*` for - [pipelines](../../../ci/pipelines/index.md#troubleshooting-fatal-reference-is-not-a-tree). + [pipelines](../../../ci/troubleshooting.md#fatal-reference-is-not-a-tree-error). - `refs/environments/*` for environments. Git doesn't usually download these refs to make cloning and fetch faster, but we can use the `--mirror` option to |