diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-30 09:07:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-30 09:07:14 +0300 |
commit | a59d0df85f9348423e97c42b5fad4e60fe77dfb1 (patch) | |
tree | 1e04a2d818de1e54628339ed991b48c5cc5d5c7b /app | |
parent | 199a948f6c03fb7771cbf869f2c02c45e83c71ab (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/pipeline_wizard/components/wrapper.vue | 3 | ||||
-rw-r--r-- | app/assets/javascripts/pipeline_wizard/templates/pages.yml | 20 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/icons.scss | 1 | ||||
-rw-r--r-- | app/assets/stylesheets/page_bundles/ci_status.scss | 1 | ||||
-rw-r--r-- | app/graphql/types/ci/pipeline_status_enum.rb | 1 | ||||
-rw-r--r-- | app/models/ci/pipeline.rb | 8 | ||||
-rw-r--r-- | app/models/ci/stage.rb | 5 | ||||
-rw-r--r-- | app/models/commit_status.rb | 6 | ||||
-rw-r--r-- | app/models/concerns/ci/has_status.rb | 11 | ||||
-rw-r--r-- | app/views/projects/pages/_waiting.html.haml | 2 |
10 files changed, 34 insertions, 24 deletions
diff --git a/app/assets/javascripts/pipeline_wizard/components/wrapper.vue b/app/assets/javascripts/pipeline_wizard/components/wrapper.vue index ab837d04d9a..43e70046cfb 100644 --- a/app/assets/javascripts/pipeline_wizard/components/wrapper.vue +++ b/app/assets/javascripts/pipeline_wizard/components/wrapper.vue @@ -14,8 +14,7 @@ import CommitStep from './commit.vue'; export const i18n = { stepNofN: __('Step %{currentStep} of %{stepCount}'), draft: __('Draft: %{filename}'), - overlayMessage: __(`Start inputting changes and we will generate a - YAML-file for you to add to your repository`), + overlayMessage: __(`Enter values to populate the .gitlab-ci.yml configuration file.`), }; const trackingMixin = Tracking.mixin(); diff --git a/app/assets/javascripts/pipeline_wizard/templates/pages.yml b/app/assets/javascripts/pipeline_wizard/templates/pages.yml index 9d7936f2f5a..8eecd51fe27 100644 --- a/app/assets/javascripts/pipeline_wizard/templates/pages.yml +++ b/app/assets/javascripts/pipeline_wizard/templates/pages.yml @@ -1,12 +1,10 @@ id: gitlab/pages -title: Get started with Pages -description: "GitLab Pages lets you deploy static websites in minutes. All you - need is a .gitlab-ci.yml file. Follow the below steps to - create one for your app now." +title: Get started with GitLab Pages +description: "Use GitLab Pages to deploy your static website. Follow these steps to create the configuration file, .gitlab-ci.yml, and start a pipeline to deploy the site." steps: - inputs: - label: Select your build image - description: A Docker image that we can use to build your image + description: A Docker image, used to create an instance where your job runs. placeholder: node:lts widget: text target: $BUILD_IMAGE @@ -14,18 +12,15 @@ steps: pattern: "(?:[a-z]+/)?([a-z]+)(?::[0-9]+)?" invalid-feedback: Please enter a valid docker image - widget: checklist - title: "Before we begin, please check:" items: - - text: The app's built output files are in a folder named "public" - help: GitLab Pages will only publish files in that folder. - You may need to adjust your build engine's config. + - text: The application files are in the `public` folder + help: GitLab Pages publishes files in the public folder only. If needed, change your jobs to send output to this folder. template: # The Docker image that will be used to build your app image: $BUILD_IMAGE - inputs: - label: Installation Steps - description: "Enter the steps that need to run to set up a local build - environment, for example installing dependencies." + description: "Enter steps to set up a local build environment, like installing dependencies." placeholder: npm ci widget: list target: $INSTALLATION_STEPS @@ -34,8 +29,7 @@ steps: before_script: $INSTALLATION_STEPS - inputs: - label: Build Steps - description: "Enter the steps necessary to build a production version of - your application." + description: "Enter steps to build a production version of your application." widget: list target: $BUILD_STEPS template: diff --git a/app/assets/stylesheets/framework/icons.scss b/app/assets/stylesheets/framework/icons.scss index 37a2264122d..9d09c160551 100644 --- a/app/assets/stylesheets/framework/icons.scss +++ b/app/assets/stylesheets/framework/icons.scss @@ -36,6 +36,7 @@ .ci-status-icon-pending, .ci-status-icon-waiting-for-resource, +.ci-status-icon-waiting-for-callback, .ci-status-icon-failed-with-warnings, .ci-status-icon-success-with-warnings { @include icon-styles($orange-500, $orange-100); diff --git a/app/assets/stylesheets/page_bundles/ci_status.scss b/app/assets/stylesheets/page_bundles/ci_status.scss index 17886ab954a..f2129aa6841 100644 --- a/app/assets/stylesheets/page_bundles/ci_status.scss +++ b/app/assets/stylesheets/page_bundles/ci_status.scss @@ -48,6 +48,7 @@ &.ci-pending, &.ci-waiting-for-resource, + &.ci-waiting-for-callback, &.ci-failed-with-warnings, &.ci-success-with-warnings { @include status-color( diff --git a/app/graphql/types/ci/pipeline_status_enum.rb b/app/graphql/types/ci/pipeline_status_enum.rb index c8e031e18ea..17cf48bb5cf 100644 --- a/app/graphql/types/ci/pipeline_status_enum.rb +++ b/app/graphql/types/ci/pipeline_status_enum.rb @@ -7,6 +7,7 @@ module Types created: 'Pipeline has been created.', waiting_for_resource: 'A resource (for example, a runner) that the pipeline requires to run is unavailable.', preparing: 'Pipeline is preparing to run.', + waiting_for_callback: 'Pipeline is waiting for an external action.', pending: 'Pipeline has not started running yet.', running: 'Pipeline is running.', failed: 'At least one stage of the pipeline failed.', diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index a7909fcedfb..16541adf370 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -190,6 +190,7 @@ module Ci # this is needed to ensure tests to be covered transition [:running] => :running + transition [:waiting_for_callback] => :waiting_for_callback end event :request_resource do @@ -204,6 +205,10 @@ module Ci transition any - [:running] => :running end + event :wait_for_callback do + transition any - [:waiting_for_callback] => :waiting_for_callback + end + event :skip do transition any - [:skipped] => :skipped end @@ -555,7 +560,7 @@ module Ci end def self.bridgeable_statuses - ::Ci::Pipeline::AVAILABLE_STATUSES - %w[created waiting_for_resource preparing pending] + ::Ci::Pipeline::AVAILABLE_STATUSES - %w[created waiting_for_resource waiting_for_callback preparing pending] end def self.auto_devops_pipelines_completed_total @@ -851,6 +856,7 @@ module Ci when 'created' then nil when 'waiting_for_resource' then request_resource when 'preparing' then prepare + when 'waiting_for_callback' then wait_for_callback when 'pending' then enqueue when 'running' then run when 'success' then succeed diff --git a/app/models/ci/stage.rb b/app/models/ci/stage.rb index 3a498972153..3d2df9a45ef 100644 --- a/app/models/ci/stage.rb +++ b/app/models/ci/stage.rb @@ -78,6 +78,10 @@ module Ci transition any - [:running] => :running end + event :wait_for_callback do + transition any - [:waiting_for_callback] => :waiting_for_callback + end + event :skip do transition any - [:skipped] => :skipped end @@ -109,6 +113,7 @@ module Ci when 'created' then nil when 'waiting_for_resource' then request_resource when 'preparing' then prepare + when 'waiting_for_callback' then wait_for_callback when 'pending' then enqueue when 'running' then run when 'success' then succeed diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 1695b407daf..9f77bd8ebe2 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -159,15 +159,15 @@ class CommitStatus < Ci::ApplicationRecord end event :drop do - transition [:created, :waiting_for_resource, :preparing, :pending, :running, :manual, :scheduled] => :failed + transition [:created, :waiting_for_resource, :preparing, :waiting_for_callback, :pending, :running, :manual, :scheduled] => :failed end event :success do - transition [:created, :waiting_for_resource, :preparing, :pending, :running] => :success + transition [:created, :waiting_for_resource, :preparing, :waiting_for_callback, :pending, :running] => :success end event :cancel do - transition [:created, :waiting_for_resource, :preparing, :pending, :running, :manual, :scheduled] => :canceled + transition [:created, :waiting_for_resource, :preparing, :waiting_for_callback, :pending, :running, :manual, :scheduled] => :canceled end before_transition [:created, :waiting_for_resource, :preparing, :skipped, :manual, :scheduled] => :pending do |commit_status| diff --git a/app/models/concerns/ci/has_status.rb b/app/models/concerns/ci/has_status.rb index 2971ecb04b8..fb2b12e5f00 100644 --- a/app/models/concerns/ci/has_status.rb +++ b/app/models/concerns/ci/has_status.rb @@ -6,19 +6,20 @@ module Ci DEFAULT_STATUS = 'created' BLOCKED_STATUS = %w[manual scheduled].freeze - AVAILABLE_STATUSES = %w[created waiting_for_resource preparing pending running success failed canceled skipped manual scheduled].freeze + AVAILABLE_STATUSES = %w[created waiting_for_resource preparing waiting_for_callback pending running success failed canceled skipped manual scheduled].freeze STARTED_STATUSES = %w[running success failed].freeze - ACTIVE_STATUSES = %w[waiting_for_resource preparing pending running].freeze + ACTIVE_STATUSES = %w[waiting_for_resource preparing waiting_for_callback pending running].freeze COMPLETED_STATUSES = %w[success failed canceled skipped].freeze STOPPED_STATUSES = COMPLETED_STATUSES + BLOCKED_STATUS - ORDERED_STATUSES = %w[failed preparing pending running waiting_for_resource manual scheduled canceled success skipped created].freeze + ORDERED_STATUSES = %w[failed preparing pending running waiting_for_callback waiting_for_resource manual scheduled canceled success skipped created].freeze PASSED_WITH_WARNINGS_STATUSES = %w[failed canceled].to_set.freeze IGNORED_STATUSES = %w[manual].to_set.freeze ALIVE_STATUSES = (ACTIVE_STATUSES + ['created']).freeze CANCELABLE_STATUSES = (ALIVE_STATUSES + ['scheduled']).freeze STATUSES_ENUM = { created: 0, pending: 1, running: 2, success: 3, failed: 4, canceled: 5, skipped: 6, manual: 7, - scheduled: 8, preparing: 9, waiting_for_resource: 10 }.freeze + scheduled: 8, preparing: 9, waiting_for_resource: 10, + waiting_for_callback: 11 }.freeze UnknownStatusError = Class.new(StandardError) @@ -58,6 +59,7 @@ module Ci state :created, value: 'created' state :waiting_for_resource, value: 'waiting_for_resource' state :preparing, value: 'preparing' + state :waiting_for_callback, value: 'waiting_for_callback' state :pending, value: 'pending' state :running, value: 'running' state :failed, value: 'failed' @@ -72,6 +74,7 @@ module Ci scope :waiting_for_resource, -> { with_status(:waiting_for_resource) } scope :preparing, -> { with_status(:preparing) } scope :relevant, -> { without_status(:created) } + scope :waiting_for_callback, -> { with_status(:waiting_for_callback) } scope :running, -> { with_status(:running) } scope :pending, -> { with_status(:pending) } scope :success, -> { with_status(:success) } diff --git a/app/views/projects/pages/_waiting.html.haml b/app/views/projects/pages/_waiting.html.haml index 0613ffc4809..7aad6d6e0d2 100644 --- a/app/views/projects/pages/_waiting.html.haml +++ b/app/views/projects/pages/_waiting.html.haml @@ -5,7 +5,7 @@ .row.gl-align-items-center.gl-justify-content-center .text-content.gl-text-center.order-md-1 %h4= s_("GitLabPages|Waiting for the Pages Pipeline to complete...") - %p= s_("GitLabPages|Your Project has been configured for Pages. Now we have to wait for the Pipeline to succeed for the first time.") + %p= s_("GitLabPages|Your project is configured for GitLab Pages and the pipeline is running...") = render Pajamas::ButtonComponent.new(variant: :confirm, href: project_pipelines_path(@project)) do = s_("GitLabPages|Check the Pipeline Status") = render Pajamas::ButtonComponent.new(href: new_namespace_project_pages_path) do |