From c4a9ca5ffca17bd874dd77014e9f2d607c94b06c Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 22 Aug 2022 21:12:24 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../incidents/create_timeline_event.vue | 27 ++- .../incidents/timeline_events_form.vue | 219 ++++++++---------- app/models/ci/build.rb | 14 +- app/services/members/update_service.rb | 9 + app/workers/ci/build_finished_worker.rb | 2 +- .../execute_build_hooks_inline.yml | 8 - .../specification_guide/index.md | 8 +- .../glfm_canonical_examples.txt | 20 +- glfm_specification/output/spec.txt | 20 +- qa/qa/resource/group_access_token.rb | 47 +++- qa/qa/resource/impersonation_token.rb | 2 +- qa/qa/resource/project_access_token.rb | 48 +++- scripts/lib/glfm/update_example_snapshots.rb | 4 +- .../incidents/timeline_events_form_spec.js | 9 +- spec/models/ci/build_spec.rb | 37 --- spec/scripts/lib/glfm/parse_examples_spec.rb | 4 +- .../lib/glfm/update_example_snapshots_spec.rb | 86 +++---- spec/workers/ci/build_finished_worker_spec.rb | 13 -- 18 files changed, 290 insertions(+), 287 deletions(-) delete mode 100644 config/feature_flags/development/execute_build_hooks_inline.yml diff --git a/app/assets/javascripts/issues/show/components/incidents/create_timeline_event.vue b/app/assets/javascripts/issues/show/components/incidents/create_timeline_event.vue index c902895702e..a1db1be8e62 100644 --- a/app/assets/javascripts/issues/show/components/incidents/create_timeline_event.vue +++ b/app/assets/javascripts/issues/show/components/incidents/create_timeline_event.vue @@ -1,6 +1,7 @@ diff --git a/app/assets/javascripts/issues/show/components/incidents/timeline_events_form.vue b/app/assets/javascripts/issues/show/components/incidents/timeline_events_form.vue index 0d84fabb1be..eae1b856237 100644 --- a/app/assets/javascripts/issues/show/components/incidents/timeline_events_form.vue +++ b/app/assets/javascripts/issues/show/components/incidents/timeline_events_form.vue @@ -1,5 +1,5 @@ diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index bf8817e6e78..dc6423f6bf4 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -194,7 +194,7 @@ module Ci after_save :stick_build_if_status_changed after_create unless: :importing? do |build| - run_after_commit { build.feature_flagged_execute_hooks } + run_after_commit { build.execute_hooks } end class << self @@ -285,7 +285,7 @@ module Ci build.run_after_commit do BuildQueueWorker.perform_async(id) - build.feature_flagged_execute_hooks + build.execute_hooks end end @@ -313,7 +313,7 @@ module Ci build.run_after_commit do build.ensure_persistent_ref - build.feature_flagged_execute_hooks + build.execute_hooks end end @@ -780,14 +780,6 @@ module Ci pending? && !any_runners_online? end - def feature_flagged_execute_hooks - if Feature.enabled?(:execute_build_hooks_inline, project) - execute_hooks - else - BuildHooksWorker.perform_async(self) - end - end - def execute_hooks return unless project return if user&.blocked? diff --git a/app/services/members/update_service.rb b/app/services/members/update_service.rb index b4d1b80e5a3..8ef3e307519 100644 --- a/app/services/members/update_service.rb +++ b/app/services/members/update_service.rb @@ -7,6 +7,8 @@ module Members raise Gitlab::Access::AccessDeniedError unless can?(current_user, action_member_permission(permission, member), member) raise Gitlab::Access::AccessDeniedError if prevent_upgrade_to_owner?(member) || prevent_downgrade_from_owner?(member) + return success(member: member) if update_results_in_no_change?(member) + old_access_level = member.human_access old_expiry = member.expires_at @@ -26,6 +28,13 @@ module Members private + def update_results_in_no_change?(member) + return false if params[:expires_at]&.to_date != member.expires_at + return false if params[:access_level] != member.access_level + + true + end + def downgrading_to_guest? params[:access_level] == Gitlab::Access::GUEST end diff --git a/app/workers/ci/build_finished_worker.rb b/app/workers/ci/build_finished_worker.rb index 36a50735fed..05c17eea250 100644 --- a/app/workers/ci/build_finished_worker.rb +++ b/app/workers/ci/build_finished_worker.rb @@ -36,7 +36,7 @@ module Ci build.update_coverage Ci::BuildReportResultService.new.execute(build) - build.feature_flagged_execute_hooks + build.execute_hooks ChatNotificationWorker.perform_async(build.id) if build.pipeline.chat? build.track_deployment_usage build.track_verify_usage diff --git a/config/feature_flags/development/execute_build_hooks_inline.yml b/config/feature_flags/development/execute_build_hooks_inline.yml deleted file mode 100644 index 0389fca3bb1..00000000000 --- a/config/feature_flags/development/execute_build_hooks_inline.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: execute_build_hooks_inline -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93665 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/370387 -milestone: '15.3' -type: development -group: group::integrations -default_enabled: false diff --git a/doc/development/gitlab_flavored_markdown/specification_guide/index.md b/doc/development/gitlab_flavored_markdown/specification_guide/index.md index 959e5e53ce9..f2d813cb993 100644 --- a/doc/development/gitlab_flavored_markdown/specification_guide/index.md +++ b/doc/development/gitlab_flavored_markdown/specification_guide/index.md @@ -653,6 +653,10 @@ is the manually updated canonical Markdown+HTML examples for GLFM extensions. - It contains examples in the [standard backtick-delimited `spec.txt` format](#various-markdown-specifications), each of which contain a Markdown example and the corresponding canonical HTML. +- For all GitLab examples, the "extension" annotation after the backticks should consist of only + `example gitlab`. It does not currently include any additional extension annotations describing + the specific Markdown, unlike the GitHub Flavored Markdown examples, which do include + these additional annotations (such as `example strikethrough`). - The `update-specification.rb` script inserts it as new sections before the appendix of generated `spec.txt`. - It should consist of `H1` header sections, with all examples nested either 2 or 3 levels deep @@ -672,7 +676,7 @@ The actual file should not have these prefixed `|` characters. | |## Strong but with two asterisks | -|```````````````````````````````` example +|```````````````````````````````` example gitlab |**bold** |. |

bold

@@ -682,7 +686,7 @@ The actual file should not have these prefixed `|` characters. | |## Strong but with HTML | -|```````````````````````````````` example +|```````````````````````````````` example gitlab | |bold | diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_canonical_examples.txt b/glfm_specification/input/gitlab_flavored_markdown/glfm_canonical_examples.txt index 332b311dff2..3fa59a9f7b1 100644 --- a/glfm_specification/input/gitlab_flavored_markdown/glfm_canonical_examples.txt +++ b/glfm_specification/input/gitlab_flavored_markdown/glfm_canonical_examples.txt @@ -13,7 +13,7 @@ examples may be split into multiple top-level headings in the future. See [the footnotes section of the user-facing documentation for GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html#footnotes). -```````````````````````````````` example gitlab footnote +```````````````````````````````` example gitlab footnote reference tag [^fortytwo] [^fortytwo]: footnote text @@ -55,7 +55,7 @@ The following are some basic examples; more examples may be added in the future. Incomplete task: -```````````````````````````````` example gitlab tasklist +```````````````````````````````` example gitlab - [ ] incomplete .