diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-27 03:06:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-27 03:06:23 +0300 |
commit | 41aba3c68d1ab3b450f1b33027c57258ff88f28e (patch) | |
tree | e1ee61d4a069ad4f7ded56565de5775bc8f0fc30 /doc | |
parent | 430999251558db3c64b4adfc6e2b4fb771f6cd48 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/development/testing_guide/testing_migrations_guide.md | 51 | ||||
-rw-r--r-- | doc/subscriptions/index.md | 14 | ||||
-rw-r--r-- | doc/user/project/issues/csv_export.md | 5 |
3 files changed, 61 insertions, 9 deletions
diff --git a/doc/development/testing_guide/testing_migrations_guide.md b/doc/development/testing_guide/testing_migrations_guide.md index 03dd7fc7851..b28d17a4b55 100644 --- a/doc/development/testing_guide/testing_migrations_guide.md +++ b/doc/development/testing_guide/testing_migrations_guide.md @@ -44,6 +44,10 @@ autoloaded with Rails. Example: require Rails.root.join('db', 'post_migrate', '20170526185842_migrate_pipeline_stages.rb') ``` +### Test helpers + +#### `table` + Use the `table` helper to create a temporary `ActiveRecord::Base`-derived model for a table. [FactoryBot](https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#factories) **should not** be used to create data for migration specs. For example, to @@ -53,6 +57,8 @@ create a record in the `projects` table: project = table(:projects).create!(id: 1, name: 'gitlab1', path: 'gitlab1') ``` +#### `migrate!` + Use the `migrate!` helper to run the migration that is under test. It will not only run the migration, but will also bump the schema version in the `schema_migrations` table. It is necessary because in the `after` hook we trigger the rest of @@ -68,6 +74,33 @@ it 'migrates successfully' do end ``` +#### `reversible_migration` + +Use the `reversible_migration` helper to test migrations with either a +`change` or both `up` and `down` hooks. This will test that the state of +the application and its data after the migration becomes reversed is the +same as it was before the migration ran in the first place. The helper: + +1. Runs the `before` expectations before the **up** migration. +1. Migrates **up**. +1. Runs the `after` expectations. +1. Migrates **down**. +1. Runs the `before` expectations a second time. + +Example: + +```ruby +reversible_migration do |migration| + migration.before -> { + # ... pre-migration expectations + } + + migration.after -> { + # ... post-migration expectations + } +end +``` + ### Example database migration test This spec tests the @@ -93,7 +126,7 @@ describe MigratePipelineStages, :migration do jobs.create!(id: 2, commit_id: 1, project_id: 123, stage_idx: 1, stage: 'test') end - # Test the up migration. + # Test just the up migration. it 'correctly migrates pipeline stages' do expect(stages.count).to be_zero @@ -102,6 +135,22 @@ describe MigratePipelineStages, :migration do expect(stages.count).to eq 2 expect(stages.all.pluck(:name)).to match_array %w[test build] end + + # Test a reversible migration. + it 'correctly migrates up and down pipeline stages' do + reversible_migration do |migration| + # Expectations will run before the up migration, + # and then again after the down migration + migration.before -> { + expect(stages.count).to be_zero + } + + # Expectations will run after the up migration. + migration.after -> { + expect(stages.count).to eq 2 + expect(stages.all.pluck(:name)).to match_array %w[test build] + } + end end ``` diff --git a/doc/subscriptions/index.md b/doc/subscriptions/index.md index bc6baa1b1fc..e35d1d9c51b 100644 --- a/doc/subscriptions/index.md +++ b/doc/subscriptions/index.md @@ -192,13 +192,15 @@ account: #### Change associated namespace -With a linked GitLab.com account, go to the -[**Subscriptions**](https://customers.gitlab.com/subscriptions) page to choose -or change the namespace your subscription applies to. +With a linked GitLab.com account: -NOTE: **Note:** -Please note that you need to be a group owner to associate a group to your -subscription. +1. Log in to the [GitLab Subscription Manager](https://customers.gitlab.com/customers/sign_in). +1. Navigate to the **Manage Purchases** page. +1. Click **Change linked group**. +1. Select the desired group from the **This subscription is for** dropdown. +1. Click **Proceed to checkout**. + +Subscription charges are calculated based on the total number of users in a group, including its subgroups and nested projects. If the total number of users exceeds the number of seats in your subscription, you will be charged for the additional users. ### Confirm or upgrade your subscription diff --git a/doc/user/project/issues/csv_export.md b/doc/user/project/issues/csv_export.md index 6ad96f41572..9321f6120ac 100644 --- a/doc/user/project/issues/csv_export.md +++ b/doc/user/project/issues/csv_export.md @@ -28,7 +28,7 @@ Among numerous use cases for exporting issues for CSV, we can name a few: ## Choosing which issues to include -From the issues page you can narrow down which issues to export using the search bar, along with the All/Open/Closed tabs. All issues returned will be exported, including those not shown on the first page. +After selecting a project, from the issues page you can narrow down which issues to export using the search bar, along with the All/Open/Closed tabs. All issues returned will be exported, including those not shown on the first page. ![CSV export button](img/csv_export_button.png) @@ -72,4 +72,5 @@ Data will be encoded with a comma as the column delimiter, with `"` used to quot ## Limitations -As the issues will be sent as an email attachment, there is a limit on how much data can be exported. Currently this limit is 15MB to ensure successful delivery across a range of email providers. If this limit is reached we suggest narrowing the search before export, perhaps by exporting open and closed issues separately. +- Export Issues to CSV is not available at the Group's Issues List. +- As the issues will be sent as an email attachment, there is a limit on how much data can be exported. Currently this limit is 15MB to ensure successful delivery across a range of email providers. If this limit is reached we suggest narrowing the search before export, perhaps by exporting open and closed issues separately. |