diff --git a/app/models/pages_deployment.rb b/app/models/pages_deployment.rb index 294a4e85d1f..e8a6da35fb4 100644 --- a/app/models/pages_deployment.rb +++ b/app/models/pages_deployment.rb @@ -27,10 +27,6 @@ class PagesDeployment < ApplicationRecord mount_file_store_uploader ::Pages::DeploymentUploader - def log_geo_deleted_event - # this is to be adressed in https://gitlab.com/groups/gitlab-org/-/epics/589 - end - def migrated? file.filename == MIGRATED_FILE_NAME end @@ -41,3 +37,5 @@ class PagesDeployment < ApplicationRecord self.size = file.size end end + +PagesDeployment.prepend_mod diff --git a/config/initializers_before_autoloader/000_inflections.rb b/config/initializers_before_autoloader/000_inflections.rb index 39905adf390..b7e4e143765 100644 --- a/config/initializers_before_autoloader/000_inflections.rb +++ b/config/initializers_before_autoloader/000_inflections.rb @@ -25,6 +25,7 @@ ActiveSupport::Inflector.inflections do |inflect| lfs_object_registry merge_request_diff_registry package_file_registry + pages_deployment_registry pipeline_artifact_registry project_auto_devops project_registry diff --git a/data/deprecations/templates/_deprecation_template.md.erb b/data/deprecations/templates/_deprecation_template.md.erb new file mode 100644 index 00000000000..20bccb88ce0 --- /dev/null +++ b/data/deprecations/templates/_deprecation_template.md.erb @@ -0,0 +1,30 @@ +--- +stage: none +group: none +info: "See the Technical Writers assigned to Development Guidelines: https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments-to-development-guidelines" +description: "View features that are currently deprecated" +--- + +# Deprecated features by planned removal milestone + + + +<% if milestones.any? -%> + <% milestones.each do |milestone| %> +### <%= milestone %> + <% deprecations.select{|d| d["removal_milestone"] == milestone}.each do |deprecation| %> +#### <%= deprecation["name"] %> +<%= deprecation["body"]%> + <% end %> + <% end %> +<% else -%> +## There are no deprecated features for this version of GitLab +<% end -%> diff --git a/data/deprecations/templates/example.yml b/data/deprecations/templates/example.yml new file mode 100644 index 00000000000..2ae52cad568 --- /dev/null +++ b/data/deprecations/templates/example.yml @@ -0,0 +1,35 @@ +# This is a template for a feature deprecation +# A deprecation typically occurs when a feature or capability is planned to be removed in a future release. +# Deprecations should be announced at least two releases prior to removal. Any breaking changes should only be done in major releases. +# +# Below is an example of what a single entry should look like, it's required attributes, +# and what types we expect those attribute values to be. +# +# For more information please refer to the handbook documentation here: +# {{LINK TBD}} +# +# Please delete this line and above before submitting your merge request. + +- name: # The name of the feature to be deprecated + removal_milestone: # XX.YY format - the milestone when this feature is planned to be removed + body: | # Do not modify this line, instead modify the lines below. + + stage: # (optional - may be required in the future) String value of the stage that the feature was created in. e.g., Growth + tiers: # (optional - may be required in the future) An array of tiers that the feature is available in currently. e.g., [Free, Silver, Gold, Core, Premium, Ultimate] + issue_url: # (optional) This is a link to the deprecation issue in GitLab + documentation_url: # (optional) This is a link to the current documentation page + image_url: # (optional) This is a link to a thumbnail image depicting the feature + video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg + announcement_milestone: # (optional - may be required in the future) XX.YY format - the milestone when this feature was first announced as deprecated + announcement_date: # (optional - may be required in the future) YYYY-MM-DD format - the date of the milestone release when this feature was first announced as deprecated + removal_date: # (optional - may be required in the future) YYYY-MM-DD format - the date of the milestone release when this feature is planned to be removed diff --git a/doc/.vale/gitlab/ReadingLevel.yml b/doc/.vale/gitlab/ReadingLevel.yml index 0099e70ec8f..2e78c3ef36c 100644 --- a/doc/.vale/gitlab/ReadingLevel.yml +++ b/doc/.vale/gitlab/ReadingLevel.yml @@ -6,6 +6,7 @@ # For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles extends: readability message: "Grade level (%s) is high. To lower the score, use shorter sentences and words." +link: https://docs.gitlab.com/ee/development/documentation/testing.html#vale-readability-score level: suggestion grade: 8 metrics: diff --git a/doc/administration/monitoring/prometheus/gitlab_metrics.md b/doc/administration/monitoring/prometheus/gitlab_metrics.md index 9833f41e926..d27d5b4a574 100644 --- a/doc/administration/monitoring/prometheus/gitlab_metrics.md +++ b/doc/administration/monitoring/prometheus/gitlab_metrics.md @@ -252,6 +252,16 @@ configuration option in `gitlab.yml`. These metrics are served from the | `geo_group_wiki_repositories_synced` | Gauge | 13.10 | Number of syncable group wikis synced on secondary | `url` | | `geo_group_wiki_repositories_failed` | Gauge | 13.10 | Number of syncable group wikis failed on secondary | `url` | | `geo_group_wiki_repositories_registry` | Gauge | 13.10 | Number of syncable group wikis in the registry | `url` | +| `geo_pages_deployments` | Gauge | 14.3 | Number of pages deployments on primary | `url` | +| `geo_pages_deployments_checksum_total` | Gauge | 14.3 | Number of pages deployments tried to checksum on primary | `url` | +| `geo_pages_deployments_checksummed` | Gauge | 14.3 | Number of pages deployments successfully checksummed on primary | `url` | +| `geo_pages_deployments_checksum_failed` | Gauge | 14.3 | Number of pages deployments failed to calculate the checksum on primary | `url` | +| `geo_pages_deployments_synced` | Gauge | 14.3 | Number of syncable pages deployments synced on secondary | `url` | +| `geo_pages_deployments_failed` | Gauge | 14.3 | Number of syncable pages deployments failed to sync on secondary | `url` | +| `geo_pages_deployments_registry` | Gauge | 14.3 | Number of pages deployments in the registry | `url` | +| `geo_pages_deployments_verification_total` | Gauge | 14.3 | Number of pages deployments verifications tried on secondary | `url` | +| `geo_pages_deployments_verified` | Gauge | 14.3 | Number of pages deployments verified on secondary | `url` | +| `geo_pages_deployments_verification_failed` | Gauge | 14.3 | Number of pages deployments verifications failed on secondary | `url` | | `limited_capacity_worker_running_jobs` | Gauge | 13.5 | Number of running jobs | `worker` | | `limited_capacity_worker_max_running_jobs` | Gauge | 13.5 | Maximum number of running jobs | `worker` | | `limited_capacity_worker_remaining_work_count` | Gauge | 13.5 | Number of jobs waiting to be enqueued | `worker` | diff --git a/doc/api/geo_nodes.md b/doc/api/geo_nodes.md index 42cf40d62b8..94c4bdeabcd 100644 --- a/doc/api/geo_nodes.md +++ b/doc/api/geo_nodes.md @@ -393,6 +393,18 @@ Example response: "package_files_verification_failed_count": null, "package_files_synced_in_percentage": "0.00%", "package_files_verified_in_percentage": "0.00%", + "pages_deployments_count": 5, + "pages_deployments_checksum_total_count": 5, + "pages_deployments_checksummed_count": 5, + "pages_deployments_checksum_failed_count": 0, + "pages_deployments_synced_count": null, + "pages_deployments_failed_count": null, + "pages_deployments_registry_count": null, + "pages_deployments_verification_total_count": null, + "pages_deployments_verified_count": null, + "pages_deployments_verification_failed_count": null, + "pages_deployments_synced_in_percentage": "0.00%", + "pages_deployments_verified_in_percentage": "0.00%", "terraform_state_versions_count": 5, "terraform_state_versions_checksum_total_count": 5, "terraform_state_versions_checksummed_count": 5, diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 318e3767f55..e477c2fecf9 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -6450,6 +6450,29 @@ The edge type for [`PackageTag`](#packagetag). | `cursor` | [`String!`](#string) | A cursor for use in pagination. | | `node` | [`PackageTag`](#packagetag) | The item at the end of the edge. | +#### `PagesDeploymentRegistryConnection` + +The connection type for [`PagesDeploymentRegistry`](#pagesdeploymentregistry). + +##### Fields + +| Name | Type | Description | +| ---- | ---- | ----------- | +| `edges` | [`[PagesDeploymentRegistryEdge]`](#pagesdeploymentregistryedge) | A list of edges. | +| `nodes` | [`[PagesDeploymentRegistry]`](#pagesdeploymentregistry) | A list of nodes. | +| `pageInfo` | [`PageInfo!`](#pageinfo) | Information to aid in pagination. | + +#### `PagesDeploymentRegistryEdge` + +The edge type for [`PagesDeploymentRegistry`](#pagesdeploymentregistry). + +##### Fields + +| Name | Type | Description | +| ---- | ---- | ----------- | +| `cursor` | [`String!`](#string) | A cursor for use in pagination. | +| `node` | [`PagesDeploymentRegistry`](#pagesdeploymentregistry) | The item at the end of the edge. | + #### `PathLockConnection` The connection type for [`PathLock`](#pathlock). @@ -9606,6 +9629,22 @@ four standard [pagination arguments](#connection-pagination-arguments): | ---- | ---- | ----------- | | `ids` | [`[ID!]`](#id) | Filters registries by their ID. | +##### `GeoNode.pagesDeploymentRegistries` + +Find Pages Deployment registries on this Geo node Available only when feature flag `geo_pages_deployment_replication` is enabled. This flag is disabled by default, because the feature is experimental and is subject to change without notice. + +Returns [`PagesDeploymentRegistryConnection`](#pagesdeploymentregistryconnection). + +This field returns a [connection](#connections). It accepts the +four standard [pagination arguments](#connection-pagination-arguments): +`before: String`, `after: String`, `first: Int`, `last: Int`. + +###### Arguments + +| Name | Type | Description | +| ---- | ---- | ----------- | +| `ids` | [`[ID!]`](#id) | Filters registries by their ID. | + ##### `GeoNode.pipelineArtifactRegistries` Find pipeline artifact registries on this Geo node. @@ -11791,6 +11830,23 @@ Information about pagination in a connection. | `hasPreviousPage` | [`Boolean!`](#boolean) | When paginating backwards, are there more items?. | | `startCursor` | [`String`](#string) | When paginating backwards, the cursor to continue. | +### `PagesDeploymentRegistry` + +Represents the Geo replication and verification state of a pages_deployment. + +#### Fields + +| Name | Type | Description | +| ---- | ---- | ----------- | +| `createdAt` | [`Time`](#time) | Timestamp when the PagesDeploymentRegistry was created. | +| `id` | [`ID!`](#id) | ID of the PagesDeploymentRegistry. | +| `lastSyncFailure` | [`String`](#string) | Error message during sync of the PagesDeploymentRegistry. | +| `lastSyncedAt` | [`Time`](#time) | Timestamp of the most recent successful sync of the PagesDeploymentRegistry. | +| `pagesDeploymentId` | [`ID!`](#id) | ID of the Pages Deployment. | +| `retryAt` | [`Time`](#time) | Timestamp after which the PagesDeploymentRegistry should be resynced. | +| `retryCount` | [`Int`](#int) | Number of consecutive failed sync attempts of the PagesDeploymentRegistry. | +| `state` | [`RegistryState`](#registrystate) | Sync state of the PagesDeploymentRegistry. | + ### `PathLock` Represents a file or directory in the project repository that has been locked. diff --git a/doc/api/lint.md b/doc/api/lint.md index 57e214e7034..9f95b9a94ae 100644 --- a/doc/api/lint.md +++ b/doc/api/lint.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- diff --git a/doc/ci/caching/index.md b/doc/ci/caching/index.md index 21ee332f2fa..009fb13c895 100644 --- a/doc/ci/caching/index.md +++ b/doc/ci/caching/index.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments type: index, concepts, howto --- diff --git a/doc/ci/jobs/job_control.md b/doc/ci/jobs/job_control.md index c415df01f06..71d4f689b68 100644 --- a/doc/ci/jobs/job_control.md +++ b/doc/ci/jobs/job_control.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- diff --git a/doc/ci/migration/circleci.md b/doc/ci/migration/circleci.md index d85c1137f6a..efaae873588 100644 --- a/doc/ci/migration/circleci.md +++ b/doc/ci/migration/circleci.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments comments: false type: index, howto diff --git a/doc/ci/migration/jenkins.md b/doc/ci/migration/jenkins.md index a83ce81a35c..aed1edf09e6 100644 --- a/doc/ci/migration/jenkins.md +++ b/doc/ci/migration/jenkins.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments comments: false type: index, howto diff --git a/doc/ci/pipelines/index.md b/doc/ci/pipelines/index.md index 68dd10618e4..f52e82e6840 100644 --- a/doc/ci/pipelines/index.md +++ b/doc/ci/pipelines/index.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments disqus_identifier: 'https://docs.gitlab.com/ee/ci/pipelines.html' type: reference diff --git a/doc/ci/runners/runners_scope.md b/doc/ci/runners/runners_scope.md index 2af373384d2..161b29ee05a 100644 --- a/doc/ci/runners/runners_scope.md +++ b/doc/ci/runners/runners_scope.md @@ -168,7 +168,7 @@ You must have the [Owner role](../../user/permissions.md#group-members-permissio | Attribute | Description | | ------------ | ----------- | - | Type | Displays the runner type: `group` or `specific`, together with the optional states `locked` and `paused` | + | Type | Displays the runner type: `group` or `specific`, and the optional state `paused` | | Runner token | Token used to identify the runner, and that the runner uses to communicate with the GitLab instance | | Description | Description given to the runner when it was created | | Version | GitLab Runner version | @@ -242,10 +242,10 @@ You can configure a specific runner so it is "locked" and cannot be enabled for This setting can be enabled when you first [register a runner](https://docs.gitlab.com/runner/register/), but can also be changed later. -To lock or unlock a runner: +To lock or unlock a specific runner: 1. Go to the project's **Settings > CI/CD** and expand the **Runners** section. -1. Find the runner you want to lock or unlock. Make sure it's enabled. +1. Find the specific runner you want to lock or unlock. Make sure it's enabled. You cannot lock shared or group runners. 1. Click the pencil button. 1. Check the **Lock to current projects** option. 1. Click **Save changes**. diff --git a/doc/ci/services/index.md b/doc/ci/services/index.md index be0d5b67dce..d656b8fe651 100644 --- a/doc/ci/services/index.md +++ b/doc/ci/services/index.md @@ -186,18 +186,11 @@ following these rules: To override the default behavior, you can [specify a service alias](#available-settings-for-services). -### Connecting Services - -> - [Deployed behind a feature flag](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/11751). +### Connecting services You can use inter-dependent services with complex jobs, like end-to-end tests where an external API needs to communicate with its own database. -This behavior is currently behind a -[feature flag](https://docs.gitlab.com/runner/configuration/feature-flags.html), -which you can enable by defining the `FF_NETWORK_PER_BUILD` CI/CD variable -either in the job or globally. - For example, for an end-to-end test for a front-end application that uses an API, and where the API needs a database: ```yaml @@ -218,6 +211,9 @@ end-to-end-tests: - npm test ``` +For this solution to work, you must use +[the networking mode that creates a new network for each job](https://docs.gitlab.com/runner/executors/docker.html#create-a-network-for-each-job). + ## Passing CI/CD variables to services You can also pass custom CI/CD [variables](../variables/index.md) @@ -345,11 +341,10 @@ The syntax of `command` is similar to [Dockerfile's `CMD`](https://docs.docker.c ## Using `services` with `docker run` (Docker-in-Docker) side-by-side -In addition to letting services talk to each other via `FF_NETWORK_PER_BUILD`, -containers started via `docker run` can also connect to services provided by GitLab. +Containers started with `docker run` can also connect to services provided by GitLab. -This can be useful in case booting the service is expensive or time consuming. -This technique will allow running tests from multiple different client environments, +When booting the service is expensive or time consuming, you can use +this technique to run tests from different client environments, while only booting up the tested service once. ```yaml @@ -369,6 +364,9 @@ access-service: curlimages/curl:7.74.0 curl "http://tutum-wordpress" ``` +For this solution to work, you must use +[the networking mode that creates a new network for each job](https://docs.gitlab.com/runner/executors/docker.html#create-a-network-for-each-job). + ## How Docker integration works Below is a high level overview of the steps performed by Docker during job diff --git a/doc/ci/yaml/gitlab_ci_yaml.md b/doc/ci/yaml/gitlab_ci_yaml.md index 6cd900123e0..ea05aa45b0b 100644 --- a/doc/ci/yaml/gitlab_ci_yaml.md +++ b/doc/ci/yaml/gitlab_ci_yaml.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/ci/yaml/includes.md b/doc/ci/yaml/includes.md index 673a4e75c35..d98f3264bec 100644 --- a/doc/ci/yaml/includes.md +++ b/doc/ci/yaml/includes.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments type: reference --- diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md index 374553a4e76..f04f50468f7 100644 --- a/doc/ci/yaml/index.md +++ b/doc/ci/yaml/index.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments type: reference --- diff --git a/doc/ci/yaml/script.md b/doc/ci/yaml/script.md index 93c1a6afe69..626ede21fa5 100644 --- a/doc/ci/yaml/script.md +++ b/doc/ci/yaml/script.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments type: reference --- diff --git a/doc/deprecations/index.md b/doc/deprecations/index.md new file mode 100644 index 00000000000..e35d92a8feb --- /dev/null +++ b/doc/deprecations/index.md @@ -0,0 +1,20 @@ +--- +stage: none +group: none +info: "See the Technical Writers assigned to Development Guidelines: https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments-to-development-guidelines" +description: "View features that are currently deprecated" +--- + +# Deprecated features by planned removal milestone + + + +## There are no deprecated features for this version of GitLab diff --git a/doc/development/cicd/cicd_reference_documentation_guide.md b/doc/development/cicd/cicd_reference_documentation_guide.md index 33bc416d8bc..aa3888cd866 100644 --- a/doc/development/cicd/cicd_reference_documentation_guide.md +++ b/doc/development/cicd/cicd_reference_documentation_guide.md @@ -1,6 +1,6 @@ --- stage: Verify -group: Pipeline Execution +group: Pipeline Authoring info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- diff --git a/doc/development/service_ping/index.md b/doc/development/service_ping/index.md index 9debb87db04..0a94fa2ff6c 100644 --- a/doc/development/service_ping/index.md +++ b/doc/development/service_ping/index.md @@ -66,7 +66,7 @@ We use the following terminology to describe the Service Ping components: > Introduced in GitLab 14.1. -Starting with GitLab version 14.1, free self-managed users running [GitLab EE](../ee_features.md) can receive paid features by registering with GitLab and sending us activity data via [Service Ping](#what-is-service-ping). +Starting with GitLab version 14.1, free self-managed users running [GitLab EE](../ee_features.md) can receive paid features by registering with GitLab and sending us activity data via [Service Ping](#what-is-service-ping). Features introduced here do not remove the feature from its paid tier. Users can continue to access the features in a paid tier without sharing usage data. The paid feature available in this offering is [Email from GitLab](../../tools/email.md). Administrators can use this [Premium](https://about.gitlab.com/pricing/premium/) feature to streamline diff --git a/doc/user/project/repository/branches/default.md b/doc/user/project/repository/branches/default.md index 0948394d19f..cb920184d65 100644 --- a/doc/user/project/repository/branches/default.md +++ b/doc/user/project/repository/branches/default.md @@ -37,7 +37,7 @@ the [Git commands you need](#update-the-default-branch-name-in-your-repository) To update the default branch name for an individual [project](../../index.md): -1. Sign in to GitLab as a user with the [Administrator](../../../permissions.md) role. +1. Sign in to GitLab with at least the [Maintainer](../../../permissions.md) role. 1. In the left navigation menu, go to **Settings > Repository**. 1. Expand **Default branch**, and select a new default branch. 1. (Optional) Select the **Auto-close referenced issues on default branch** checkbox to close @@ -77,7 +77,7 @@ overrides it. > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/221014) in GitLab 13.6. -Administrators of groups and subgroups can configure the default branch name for a group: +Users with at least the Owner role of groups and subgroups can configure the default branch name for a group: 1. Go to the group **Settings > Repository**. 1. Expand **Default initial branch name**. @@ -128,8 +128,8 @@ renames a Git repository's (`example`) default branch. git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main ``` -1. Sign in to GitLab as an [administrator](../../../permissions.md) and follow - the instructions to +1. Sign in to GitLab with at least the [Maintainer](../../../permissions.md) + role and follow the instructions to [change the default branch for this project](#change-the-default-branch-name-for-a-project). Select `main` as your new default branch. 1. Protect your new `main` branch as described in the [protected branches documentation](../../protected_branches.md). diff --git a/lib/tasks/gitlab/docs/compile_deprecations.rake b/lib/tasks/gitlab/docs/compile_deprecations.rake new file mode 100644 index 00000000000..6d6602c9074 --- /dev/null +++ b/lib/tasks/gitlab/docs/compile_deprecations.rake @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +namespace :gitlab do + namespace :docs do + desc "Generate deprecation list from individual files" + task :compile_deprecations do + require_relative '../../../../tooling/deprecations/docs/renderer' + + source_files = Rake::FileList.new("data/deprecations/**/*.yml") do |fl| + fl.exclude(/example\.yml/) + end + + deprecations = source_files.map do |file| + YAML.load_file(file) + end + + deprecations.sort_by! { |d| -d["removal_milestone"].to_f } + + milestones = deprecations.map { |d| d["removal_milestone"].to_f }.uniq + + contents = Deprecations::Docs::Renderer + .render(deprecations: deprecations, milestones: milestones) + + File.write( + File.expand_path("doc/deprecations/index.md", "#{__dir__}/../../../.."), + contents) + + puts "Deprecations compiled to doc/deprecations/index.md" + end + end +end diff --git a/scripts/review_apps/automated_cleanup.rb b/scripts/review_apps/automated_cleanup.rb index aaa35cfc886..90dc0fd418e 100755 --- a/scripts/review_apps/automated_cleanup.rb +++ b/scripts/review_apps/automated_cleanup.rb @@ -115,14 +115,16 @@ class AutomatedCleanup last_deploy = deployment.created_at deployed_at = Time.parse(last_deploy) + if deployed_at < stop_threshold + environment_state = fetch_environment(environment)&.state + stop_environment(environment, deployment) if environment_state && environment_state != 'stopped' + end + if deployed_at < delete_threshold delete_environment(environment, deployment) delete_count += 1 break if delete_count > max_delete_count - elsif deployed_at < stop_threshold - environment_state = fetch_environment(environment)&.state - stop_environment(environment, deployment) if environment_state && environment_state != 'stopped' end checked_environments << environment.slug diff --git a/spec/tasks/gitlab/db_rake_spec.rb b/spec/tasks/gitlab/db_rake_spec.rb index 8e98a42510e..91cd09fc6e6 100644 --- a/spec/tasks/gitlab/db_rake_spec.rb +++ b/spec/tasks/gitlab/db_rake_spec.rb @@ -129,13 +129,14 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do let(:output) { StringIO.new } before do - structure_files = %w[db/structure.sql db/ci_structure.sql] + structure_files = %w[structure.sql ci_structure.sql] allow(File).to receive(:open).and_call_original - structure_files.each do |structure_file| + structure_files.each do |structure_file_name| + structure_file = File.join(ActiveRecord::Tasks::DatabaseTasks.db_dir, structure_file_name) stub_file_read(structure_file, content: input) - allow(File).to receive(:open).with(Rails.root.join(structure_file).to_s, any_args).and_yield(output) + allow(File).to receive(:open).with(structure_file.to_s, any_args).and_yield(output) end end diff --git a/tooling/deprecations/docs/renderer.rb b/tooling/deprecations/docs/renderer.rb new file mode 100644 index 00000000000..832c4ce99d1 --- /dev/null +++ b/tooling/deprecations/docs/renderer.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true +require 'erb' + +module Deprecations + module Docs + module Renderer + module_function + + def render(**variables) + template = File.expand_path("data/deprecations/templates/_deprecation_template.md.erb", "#{__dir__}/../../..") + + load_template(template).result_with_hash(variables) + end + + def load_template(filename) + ERB.new(File.read(filename), trim_mode: '-') + end + end + end +end