diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-19 00:09:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-19 00:09:17 +0300 |
commit | a407a618ae21dce15c85ae15c465a531811a69b9 (patch) | |
tree | 698b42a38f42ae333c58e48f9f954d23035c5f64 /doc | |
parent | 9f2bc6fc4c27d0703260352c79463fbc62555ac8 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/administration/operations/gitlab_sshd.md | 2 | ||||
-rw-r--r-- | doc/api/group_relations_export.md | 2 | ||||
-rw-r--r-- | doc/development/migration_style_guide.md | 2 | ||||
-rw-r--r-- | doc/topics/awesome_co.md | 66 |
4 files changed, 69 insertions, 3 deletions
diff --git a/doc/administration/operations/gitlab_sshd.md b/doc/administration/operations/gitlab_sshd.md index b15e9cade1a..249d6232616 100644 --- a/doc/administration/operations/gitlab_sshd.md +++ b/doc/administration/operations/gitlab_sshd.md @@ -12,7 +12,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w `gitlab-sshd` is [a standalone SSH server](https://gitlab.com/gitlab-org/gitlab-shell/-/tree/main/internal/sshd) written in Go. It is provided as a part of the `gitlab-shell` package. It has a lower memory use as a OpenSSH alternative, and supports -[group access restriction by IP address](../../user/group/index.md) for applications +[group access restriction by IP address](../../user/group/access_and_permissions.md#restrict-group-access-by-ip-address) for applications running behind the proxy. `gitlab-sshd` is a lightweight alternative to OpenSSH for providing diff --git a/doc/api/group_relations_export.md b/doc/api/group_relations_export.md index 065ae03259a..7a8000eafd1 100644 --- a/doc/api/group_relations_export.md +++ b/doc/api/group_relations_export.md @@ -11,7 +11,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w With the Group Relations Export API, you can partially export group structure. This API is similar to [group export](group_import_export.md), but it exports each top-level relation (for example, milestones/boards/labels) as a separate file -instead of one archive. The group relations export API is primarily used in [group migration](../user/group/index.md). +instead of one archive. The group relations export API is primarily used in [group migration](../user/group/import/index.md). ## Schedule new export diff --git a/doc/development/migration_style_guide.md b/doc/development/migration_style_guide.md index 9f2ad1f7769..ee5fc877d4c 100644 --- a/doc/development/migration_style_guide.md +++ b/doc/development/migration_style_guide.md @@ -156,7 +156,7 @@ regenerate a clean `db/structure.sql` for the migrations you're adding. This script applies all migrations found in `db/migrate` or `db/post_migrate`, so if there are any migrations you don't want to commit to the schema, rename or remove them. If your branch is not -targeting `main` you can set the `TARGET` environment variable. +targeting the default Git branch, you can set the `TARGET` environment variable. ```shell # Regenerate schema against `main` diff --git a/doc/topics/awesome_co.md b/doc/topics/awesome_co.md index e89dd677278..f6cad7eb804 100644 --- a/doc/topics/awesome_co.md +++ b/doc/topics/awesome_co.md @@ -141,6 +141,25 @@ create(:project, name: 'No longer throws error', owner: @owner, namespace: creat create(:epic, group: create(:group), author: @owner) ``` +#### `parsing id "my id" as "my_id"` + +See [specifying variables](#specify-a-variable) + +#### `id is invalid` + +Given that non-Ruby parsers parse IDs as Ruby Objects, the [naming conventions](https://docs.ruby-lang.org/en/2.0.0/syntax/methods_rdoc.html#label-Method+Names) of Ruby must be followed when specifying an ID. + +Examples of invalid IDs: + +- IDs that start with a number +- IDs that have special characters (-, !, $, @, `, =, <, >, ;, :) + +#### ActiveRecord::AssociationTypeMismatch: Model expected, got ... which is an instance of String + +This is currently a limitation for the seeder. + +See the issue for [allowing parsing of raw Ruby objects](https://gitlab.com/gitlab-org/gitlab/-/issues/403079). + ## YAML Factories ### Generator to generate _n_ amount of records @@ -210,3 +229,50 @@ epics: start_date: <%= 1.day.ago %> due_date: <%= 1.month.from_now %> ``` + +## Variables + +Each created factory can be assigned an identifier to be used in future seeding. + +You can specify an ID for any created factory that you may use later in the seed file. + +### Specify a variable + +You may pass an `_id` attribute on any factory to refer back to it later in non-Ruby parsers. + +Variables are under the factory definitions that they reside in. + +```yaml +--- +group_labels: + - _id: my_label #=> group_labels.my_label + +projects: + - _id: my_project #=> projects.my_project +``` + +Variables: + +NOTE: +It is not advised, but you may specify variables with spaces. These variables may be referred back to with underscores. + +### Referencing a variable + +Given a YAML seed file: + +```yaml +--- +group_labels: + - _id: my_group_label #=> group_labels.my_group_label + name: My Group Label + color: "#FF0000" + - _id: my_other_group_label #=> group_labels.my_other_group_label + color: <%= group_labels.my_group_label.color %> + +projects: + - _id: my_project #=> projects.my_project + name: My Project +``` + +When referring to a variable, the variable refers to the _already seeded_ models. In other words, the model's `id` attribute will +be populated. |