Skip to content

Commit dba3800

Browse files
committed
resource/gitlab_repository_file: Improve documentation and reference upstream docs
1 parent 39c758a commit dba3800

File tree

2 files changed

+11
-33
lines changed

2 files changed

+11
-33
lines changed

docs/resources/repository_file.md

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,18 @@
33
page_title: "gitlab_repository_file Resource - terraform-provider-gitlab"
44
subcategory: ""
55
description: |-
6-
This resource allows you to create and manage GitLab repository files.
7-
Limitations:
8-
The GitLab Repository Files API https://docs.gitlab.com/ee/api/repository_files.html
9-
can only create, update or delete a single file at the time.
10-
The API will also
11-
fail with a 400 https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository
12-
response status code if the underlying repository is changed while the API tries to make changes.
13-
Therefore, it's recommended to make sure that you execute it with
14-
-parallelism=1 https://www.terraform.io/docs/cli/commands/apply.html#parallelism-n
15-
and that no other entity than the terraform at hand makes changes to the
16-
underlying repository while it's executing.
6+
The gitlab_repository_file resource allows to manage the lifecycle of a file within a repository.
7+
~> Limitations: The GitLab Repository Files API https://docs.gitlab.com/ee/api/repository_files.html can only create, update or delete a single file at the time. The API will also fail with a 400 https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository response status code if the underlying repository is changed while the API tries to make changes. Therefore, it's recommended to make sure that you execute it with -parallelism=1 https://www.terraform.io/docs/cli/commands/apply.html#parallelism-n and that no other entity than the terraform at hand makes changes to the underlying repository while it's executing.
8+
Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/repository_files.html
179
---
1810

1911
# gitlab_repository_file (Resource)
2012

21-
This resource allows you to create and manage GitLab repository files.
13+
The `gitlab_repository_file` resource allows to manage the lifecycle of a file within a repository.
2214

23-
**Limitations**:
15+
~> **Limitations**: The [GitLab Repository Files API](https://docs.gitlab.com/ee/api/repository_files.html) can only create, update or delete a single file at the time. The API will also [fail with a 400](https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository) response status code if the underlying repository is changed while the API tries to make changes. Therefore, it's recommended to make sure that you execute it with [-parallelism=1](https://www.terraform.io/docs/cli/commands/apply.html#parallelism-n) and that no other entity than the terraform at hand makes changes to the underlying repository while it's executing.
2416

25-
The [GitLab Repository Files API](https://docs.gitlab.com/ee/api/repository_files.html)
26-
can only create, update or delete a single file at the time.
27-
The API will also
28-
[fail with a `400`](https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository)
29-
response status code if the underlying repository is changed while the API tries to make changes.
30-
Therefore, it's recommended to make sure that you execute it with
31-
[`-parallelism=1`](https://www.terraform.io/docs/cli/commands/apply.html#parallelism-n)
32-
and that no other entity than the terraform at hand makes changes to the
33-
underlying repository while it's executing.
17+
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/repository_files.html)
3418

3519
## Example Usage
3620

internal/provider/resource_gitlab_repository_file.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,11 @@ const encoding = "base64"
1616

1717
var _ = registerResource("gitlab_repository_file", func() *schema.Resource {
1818
return &schema.Resource{
19-
Description: "This resource allows you to create and manage GitLab repository files.\n\n" +
20-
"**Limitations**:\n\n" +
21-
"The [GitLab Repository Files API](https://docs.gitlab.com/ee/api/repository_files.html)\n" +
22-
"can only create, update or delete a single file at the time.\n" +
23-
"The API will also\n" +
24-
"[fail with a `400`](https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository)\n" +
25-
"response status code if the underlying repository is changed while the API tries to make changes.\n" +
26-
"Therefore, it's recommended to make sure that you execute it with\n" +
27-
"[`-parallelism=1`](https://www.terraform.io/docs/cli/commands/apply.html#parallelism-n)\n" +
28-
"and that no other entity than the terraform at hand makes changes to the\n" +
29-
"underlying repository while it's executing.",
19+
Description: `The ` + "`gitlab_repository_file`" + ` resource allows to manage the lifecycle of a file within a repository.
20+
21+
~> **Limitations**: The [GitLab Repository Files API](https://docs.gitlab.com/ee/api/repository_files.html) can only create, update or delete a single file at the time. The API will also [fail with a 400](https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository) response status code if the underlying repository is changed while the API tries to make changes. Therefore, it's recommended to make sure that you execute it with [-parallelism=1](https://www.terraform.io/docs/cli/commands/apply.html#parallelism-n) and that no other entity than the terraform at hand makes changes to the underlying repository while it's executing.
22+
23+
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/repository_files.html)`,
3024

3125
CreateContext: resourceGitlabRepositoryFileCreate,
3226
ReadContext: resourceGitlabRepositoryFileRead,

0 commit comments

Comments
 (0)