From e86910bd65aa8abe8f60e0b9361f9940893db8b9 Mon Sep 17 00:00:00 2001 From: Shane Maglangit Date: Fri, 29 Aug 2025 13:01:43 +0800 Subject: [PATCH 1/8] Create check-deprecated-files PoC --- .gitlab/CODEOWNERS | 4 + .gitlab/ci/rules.gitlab-ci.yml | 10 +++ .gitlab/ci/static-analysis.gitlab-ci.yml | 10 +++ app/views/admin/groups/_group.html.haml | 15 ++++ app/views/admin/projects/_projects.html.haml | 17 ++++ danger/check_deprecated_files/Dangerfile | 27 ++++++ deprecations.yml | 10 +++ lefthook.yml | 3 + scripts/check_deprecated_files.sh | 86 ++++++++++++++++++++ 9 files changed, 182 insertions(+) create mode 100644 danger/check_deprecated_files/Dangerfile create mode 100644 deprecations.yml create mode 100755 scripts/check_deprecated_files.sh diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index df65acf634c28b..52e0c225173a76 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -1735,6 +1735,10 @@ lib/api/entities/project_identity.rb lib/api/entities/project.rb ee/lib/ee/api/entities/project.rb +[Category:Groups & Projects] @gitlab-com/gl-infra/tenant-scale/organizations/groups-and-projects +app/views/admin/projects/_projects.html.haml +app/views/admin/groups/_groups_.html.haml + [Compliance] @gitlab-org/software-supply-chain-security/compliance/engineering /app/services/audit_events/build_service.rb /ee/app/services/ee/audit_events/build_service.rb diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 6b53723bc95c69..5aa3667feb52da 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -157,6 +157,9 @@ .if-merge-request-labels-skip-undercoverage: &if-merge-request-labels-skip-undercoverage if: '($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_EVENT_TYPE != "merge_train") && $CI_MERGE_REQUEST_LABELS =~ /pipeline:skip-undercoverage/' +.if-merge-request-labels-skip-check-deprecated-files: &if-merge-request-labels-skip-check-deprecated-files + if: '($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_EVENT_TYPE != "merge_train") && $CI_MERGE_REQUEST_LABELS =~ /pipeline:skip-check-deprecated-files/' + .if-merge-request-labels-jh-contribution: &if-merge-request-labels-jh-contribution if: '($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_EVENT_TYPE != "merge_train") && $CI_MERGE_REQUEST_LABELS =~ /JiHu contribution/' @@ -2712,6 +2715,13 @@ - <<: *if-default-refs changes: *docs-patterns +.static-analysis:rules:check-deprecated-files: + rules: + - <<: *if-merge-request-labels-skip-check-deprecated-files + when: never + - <<: *if-merge-request + changes: *code-patterns + .semgrep-appsec-custom-rules:rules: rules: - <<: *if-not-ee diff --git a/.gitlab/ci/static-analysis.gitlab-ci.yml b/.gitlab/ci/static-analysis.gitlab-ci.yml index 7f7ebfe67e69c8..e13b10e6a1ddd8 100644 --- a/.gitlab/ci/static-analysis.gitlab-ci.yml +++ b/.gitlab/ci/static-analysis.gitlab-ci.yml @@ -331,3 +331,13 @@ ping-appsec-for-dependency-review: script: - docker run --interactive --rm "$DEPENDENCY_REVIEW_BOT_CI_REG:latest" -t "$DEPENDENCY_REVIEW_PAT" -p "$CI_PROJECT_ID" -m "$CI_MERGE_REQUEST_IID" -s "$DISABLE_SCORING" -a "$DISABLE_MENTIONS" -c "$DISABLE_COMMENTING" allow_failure: true + +check-deprecated-files: + extends: + - .static-analysis-base + - .static-analysis:rules:check-deprecated-files + variables: + USE_BUNDLE_INSTALL: "false" + SETUP_DB: "false" + script: + - scripts/check_deprecated_files.sh diff --git a/app/views/admin/groups/_group.html.haml b/app/views/admin/groups/_group.html.haml index 0aca7d3fefbdce..0342eeae5cc28d 100644 --- a/app/views/admin/groups/_group.html.haml +++ b/app/views/admin/groups/_group.html.haml @@ -1,3 +1,18 @@ +-# STOP! DO NOT EDIT THIS FILE! +-# +-# This file is deprecated and scheduled for removal. +-# +-# Details: +-# - Feature Issue: https://gitlab.com/groups/gitlab-org/-/epics/17782 +-# - Owner: @gitlab-com/gl-infra/tenant-scale/organizations/groups-and-projects +-# +-# If you ABSOLUTELY MUST edit this file: +-# 1. Understand the implications of your changes +-# 2. Follow the deprecated features guidelines: +-# 3. Request approval from a DRI when creating a merge request +-# +-# Thank you! + - group = local_assigns.fetch(:group) - remove_form_id = "js-remove-group-#{group.id}-form" diff --git a/app/views/admin/projects/_projects.html.haml b/app/views/admin/projects/_projects.html.haml index 8120e88a93a940..34bd88a7977260 100644 --- a/app/views/admin/projects/_projects.html.haml +++ b/app/views/admin/projects/_projects.html.haml @@ -1,3 +1,20 @@ +-# STOP! DO NOT EDIT THIS FILE! +-# +-# This file is deprecated and scheduled for removal. +-# +-# Details: +-# - Feature Issue: https://gitlab.com/groups/gitlab-org/-/epics/17782 +-# - Owner: @gitlab-com/gl-infra/tenant-scale/organizations/groups-and-projects +-# +-# If you ABSOLUTELY MUST edit this file: +-# 1. Understand the implications of your changes +-# 2. Follow the deprecated features guidelines: +-# 3. Request approval from a DRI when creating a merge request +-# +-# Thank you! + +-# test modification + .js-projects-list-holder - if @projects.any? %ul.content-list diff --git a/danger/check_deprecated_files/Dangerfile b/danger/check_deprecated_files/Dangerfile new file mode 100644 index 00000000000000..0feb0179b12a86 --- /dev/null +++ b/danger/check_deprecated_files/Dangerfile @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +skip_label = "pipeline:skip-check-deprecated-files" +return if helper.mr_labels.include?(skip_label) + +script_output = `./scripts/check_deprecated_files.sh 2>&1` +script_success = $?.success? + +unless script_success + # Remove ANSI color codes for cleaner display + clean_output = script_output.gsub(/\e\[[0-9;]*m/, '') + + message_template = <<~WARNING + ``` + %{output} + ``` + + **Please assign the owners of these deprecated files as reviewers for your MR.** + + You may add the ~"%{label}" label to bypass this check afterwards. + + See `deprecations.yml` for deprecation details. + WARNING + + warning_message = format(message_template, output: clean_output, label: skip_label) + warn(warning_message) +end diff --git a/deprecations.yml b/deprecations.yml new file mode 100644 index 00000000000000..15badb6bb1cdfb --- /dev/null +++ b/deprecations.yml @@ -0,0 +1,10 @@ +- path: app/views/admin/projects/_projects.html.haml + reason: "Ongoing migration to Vue" + feature_issue: https://gitlab.com/groups/gitlab-org/-/epics/17782 + removal_issue: https://gitlab.com/gitlab-org/gitlab/-/issues/549452 + feature_category: groups_and_projects +- path: app/views/admin/groups/_groups_.html.haml + reason: "Ongoing migration to Vue" + feature_issue: https://gitlab.com/groups/gitlab-org/-/epics/17782 + removal_issue: https://gitlab.com/gitlab-org/gitlab/-/issues/549452 + feature_category: groups_and_projects diff --git a/lefthook.yml b/lefthook.yml index 4e4808cbf77562..bcd4b8c1f8d608 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -151,6 +151,9 @@ pre-push: secrets-detection: tags: secrets run: .lefthook/gitleaks.sh pre-push + check-deprecated-files: + tags: backend frontend view haml + run: scripts/check_deprecated_files.sh scripts: 'merge_conflicts': diff --git a/scripts/check_deprecated_files.sh b/scripts/check_deprecated_files.sh new file mode 100755 index 00000000000000..1d20e3a64af488 --- /dev/null +++ b/scripts/check_deprecated_files.sh @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +BRed='\033[1;31m' +BCyan='\033[1;36m' +BGreen='\033[1;32m' +Color_Off='\033[0m' + +DEPRECATION_REGISTRY="deprecations.yml" + +if [ ! -f "$DEPRECATION_REGISTRY" ]; then + exit 0 +fi + +get_changed_files_local() { + current_branch=$(git rev-parse --abbrev-ref HEAD) + upstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null) + + if [ $? -eq 0 ] && [ -n "$upstream" ]; then + base_branch="$upstream" + else + base_branch="origin/master" + fi + + merge_base=$(git merge-base "$base_branch" HEAD) + git diff --name-only --diff-filter=d "${merge_base}..HEAD" +} + +get_changed_files_ci() { + base_branch="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${GITHUB_BASE_REF:-${CI_DEFAULT_BRANCH:-master}}}" + + if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then + git diff --name-only --diff-filter=d "${CI_MERGE_REQUEST_DIFF_BASE_SHA}..HEAD" + elif [ -n "$GITHUB_BASE_REF" ]; then + git diff --name-only --diff-filter=d "origin/${GITHUB_BASE_REF}..HEAD" + else + git fetch origin "$base_branch" --depth=50 2>/dev/null || true + merge_base=$(git merge-base "origin/$base_branch" HEAD 2>/dev/null || echo "origin/$base_branch") + git diff --name-only --diff-filter=d "${merge_base}..HEAD" + fi +} + +deprecated_files=$(grep "^[[:space:]]*- path:" "$DEPRECATION_REGISTRY" | sed 's/^[[:space:]]*- path:[[:space:]]*//') + +if [ -n "$GITLAB_CI" ]; then + changed_files=$(get_changed_files_ci) +else + changed_files=$(get_changed_files_local) +fi + +deprecated_list="" +while IFS= read -r file; do + if [ -n "$file" ] && grep -qx "$file" <<< "$deprecated_files"; then + deprecated_list="${deprecated_list} ${BRed}• ${file}${Color_Off}\n" + fi +done <<< "$changed_files" + +if [ -n "$deprecated_list" ]; then + echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" + echo -e "${BRed}⚠️ WARNING: You are pushing changes to deprecated files! ⚠️${Color_Off}" + echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" + echo -e "The following deprecated files have been modified:" + echo -e "$deprecated_list" + echo -e "If you would like to proceed with this change:" + echo -e " • Assign one of the DRIs as a reviewer on your merge request" + echo -e " • Include rationale behind this modification in the MR description" + echo -e " • Consider if changes are necessary given the deprecation" + echo -e " • Be aware your changes may be removed when this file is deprecated" + + # Only show bypass method if in GitLab CI or Lefthook + if [ -n "$GITLAB_CI" ]; then + echo + echo -e "To bypass this check:" + echo -e " • Add ${BCyan}pipeline:skip-check-deprecated-files${Color_Off} label to your MR" + elif [ -n "$LEFTHOOK" ]; then + echo + echo -e "To bypass this check:" + echo -e " • Use: ${BCyan}LEFTHOOK_EXCLUDE=check-deprecated-files git push${Color_Off}" + fi + + echo + echo -e "See the deprecation details of these files in: ${BGreen}$DEPRECATION_REGISTRY${Color_Off}" + echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" + exit 1 +fi + +exit 0 -- GitLab From 10daf097d239d0b970f139e2a998b0bed9e3b083 Mon Sep 17 00:00:00 2001 From: Shane Maglangit Date: Tue, 2 Sep 2025 16:27:49 +0800 Subject: [PATCH 2/8] Update danger script --- danger/check_deprecated_files/Dangerfile | 19 ++----------------- scripts/check_deprecated_files.sh | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/danger/check_deprecated_files/Dangerfile b/danger/check_deprecated_files/Dangerfile index 0feb0179b12a86..667ed3b328c11d 100644 --- a/danger/check_deprecated_files/Dangerfile +++ b/danger/check_deprecated_files/Dangerfile @@ -7,21 +7,6 @@ script_output = `./scripts/check_deprecated_files.sh 2>&1` script_success = $?.success? unless script_success - # Remove ANSI color codes for cleaner display - clean_output = script_output.gsub(/\e\[[0-9;]*m/, '') - - message_template = <<~WARNING - ``` - %{output} - ``` - - **Please assign the owners of these deprecated files as reviewers for your MR.** - - You may add the ~"%{label}" label to bypass this check afterwards. - - See `deprecations.yml` for deprecation details. - WARNING - - warning_message = format(message_template, output: clean_output, label: skip_label) - warn(warning_message) + message = script_output.gsub(/\e\[[0-9;]*m/, '') + warn(message) end diff --git a/scripts/check_deprecated_files.sh b/scripts/check_deprecated_files.sh index 1d20e3a64af488..b876a97a39af64 100755 --- a/scripts/check_deprecated_files.sh +++ b/scripts/check_deprecated_files.sh @@ -41,7 +41,13 @@ get_changed_files_ci() { deprecated_files=$(grep "^[[:space:]]*- path:" "$DEPRECATION_REGISTRY" | sed 's/^[[:space:]]*- path:[[:space:]]*//') -if [ -n "$GITLAB_CI" ]; then +if [ -n "$GITLAB_CI" ] || [ -n "$DANGER" ]; then + IS_CI_CONTEXT=true +else + IS_CI_CONTEXT=false +fi + +if [ "$IS_CI_CONTEXT" = true ]; then changed_files=$(get_changed_files_ci) else changed_files=$(get_changed_files_local) @@ -65,15 +71,12 @@ if [ -n "$deprecated_list" ]; then echo -e " • Include rationale behind this modification in the MR description" echo -e " • Consider if changes are necessary given the deprecation" echo -e " • Be aware your changes may be removed when this file is deprecated" + echo + echo -e "To bypass this check:" - # Only show bypass method if in GitLab CI or Lefthook - if [ -n "$GITLAB_CI" ]; then - echo - echo -e "To bypass this check:" - echo -e " • Add ${BCyan}pipeline:skip-check-deprecated-files${Color_Off} label to your MR" - elif [ -n "$LEFTHOOK" ]; then - echo - echo -e "To bypass this check:" + if [ "$IS_CI_CONTEXT" = true ]; then + echo -e " • Add ${BCyan}~\"pipeline:skip-check-deprecated-files\"${Color_Off} label to your MR" + else echo -e " • Use: ${BCyan}LEFTHOOK_EXCLUDE=check-deprecated-files git push${Color_Off}" fi -- GitLab From 52b16512fa41223baaee8bcae98b59c75fa5d5b2 Mon Sep 17 00:00:00 2001 From: Shane Maglangit Date: Tue, 9 Sep 2025 11:20:46 +0800 Subject: [PATCH 3/8] Edit Dangerfile --- danger/check_deprecated_files/Dangerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/danger/check_deprecated_files/Dangerfile b/danger/check_deprecated_files/Dangerfile index 667ed3b328c11d..71b7e1f2d68a0d 100644 --- a/danger/check_deprecated_files/Dangerfile +++ b/danger/check_deprecated_files/Dangerfile @@ -3,7 +3,7 @@ skip_label = "pipeline:skip-check-deprecated-files" return if helper.mr_labels.include?(skip_label) -script_output = `./scripts/check_deprecated_files.sh 2>&1` +script_output = `DANGER=true ./scripts/check_deprecated_files.sh 2>&1` script_success = $?.success? unless script_success -- GitLab From 67c29389787a4a8c7f59edb72e0abfff2cd68a23 Mon Sep 17 00:00:00 2001 From: Shane Maglangit Date: Tue, 9 Sep 2025 11:21:02 +0800 Subject: [PATCH 4/8] Edit check_deprecated_files.sh --- scripts/check_deprecated_files.sh | 67 ++++++++++++++++++------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/scripts/check_deprecated_files.sh b/scripts/check_deprecated_files.sh index b876a97a39af64..42016abf4a05be 100755 --- a/scripts/check_deprecated_files.sh +++ b/scripts/check_deprecated_files.sh @@ -11,6 +11,15 @@ if [ ! -f "$DEPRECATION_REGISTRY" ]; then exit 0 fi +# Determine script environment +if [ "$DANGER" = "true" ]; then + SCRIPT_ENV="danger" +elif [ -n "$GITLAB_CI" ]; then + SCRIPT_ENV="ci" +else + SCRIPT_ENV="local" +fi + get_changed_files_local() { current_branch=$(git rev-parse --abbrev-ref HEAD) upstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null) @@ -41,16 +50,12 @@ get_changed_files_ci() { deprecated_files=$(grep "^[[:space:]]*- path:" "$DEPRECATION_REGISTRY" | sed 's/^[[:space:]]*- path:[[:space:]]*//') -if [ -n "$GITLAB_CI" ] || [ -n "$DANGER" ]; then - IS_CI_CONTEXT=true +# Get changed files based on environment +if [ "$SCRIPT_ENV" = "local" ]; then + changed_files=$(get_changed_files_local) else - IS_CI_CONTEXT=false -fi - -if [ "$IS_CI_CONTEXT" = true ]; then + # Both 'ci' and 'danger' use CI method changed_files=$(get_changed_files_ci) -else - changed_files=$(get_changed_files_local) fi deprecated_list="" @@ -61,28 +66,36 @@ while IFS= read -r file; do done <<< "$changed_files" if [ -n "$deprecated_list" ]; then - echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" - echo -e "${BRed}⚠️ WARNING: You are pushing changes to deprecated files! ⚠️${Color_Off}" - echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" - echo -e "The following deprecated files have been modified:" - echo -e "$deprecated_list" - echo -e "If you would like to proceed with this change:" - echo -e " • Assign one of the DRIs as a reviewer on your merge request" - echo -e " • Include rationale behind this modification in the MR description" - echo -e " • Consider if changes are necessary given the deprecation" - echo -e " • Be aware your changes may be removed when this file is deprecated" - echo - echo -e "To bypass this check:" - - if [ "$IS_CI_CONTEXT" = true ]; then + if [ "$SCRIPT_ENV" = "danger" ]; then + # Simplified output for DANGER mode + echo -e "${BRed}ERROR: Changes detected in deprecated files${Color_Off}" + echo -e "\nDeprecated files modified:" + echo -e "$deprecated_list" + echo -e "\nTo proceed:" + echo -e " • Get approval from a DRI" echo -e " • Add ${BCyan}~\"pipeline:skip-check-deprecated-files\"${Color_Off} label to your MR" + echo -e "\nSee: ${BGreen}$DEPRECATION_REGISTRY${Color_Off}" else - echo -e " • Use: ${BCyan}LEFTHOOK_EXCLUDE=check-deprecated-files git push${Color_Off}" + # Full output for CI and local modes + echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" + echo -e "${BRed}⚠️ WARNING: You are pushing changes to deprecated files! ⚠️${Color_Off}" + echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" + echo -e "The following deprecated files have been modified:" + echo -e "$deprecated_list" + echo -e "To proceed with this change:" + echo -e " • Get approval from a DRI (add as reviewer)" + echo -e " • Explain why this change is necessary in your MR" + echo + echo -e "To bypass this check:" + if [ "$SCRIPT_ENV" = "ci" ]; then + echo -e " • Add ${BCyan}~\"pipeline:skip-check-deprecated-files\"${Color_Off} label to your MR" + else + echo -e " • Push with: ${BCyan}LEFTHOOK_EXCLUDE=check-deprecated-files git push${Color_Off}" + fi + echo + echo -e "See deprecation details in: ${BGreen}$DEPRECATION_REGISTRY${Color_Off}" + echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" fi - - echo - echo -e "See the deprecation details of these files in: ${BGreen}$DEPRECATION_REGISTRY${Color_Off}" - echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" exit 1 fi -- GitLab From dee0ba4ef6759c9e616038cd1aef1c2619aac769 Mon Sep 17 00:00:00 2001 From: Shane Maglangit Date: Tue, 9 Sep 2025 12:15:25 +0800 Subject: [PATCH 5/8] Edit check_deprecated_files.sh --- scripts/check_deprecated_files.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/check_deprecated_files.sh b/scripts/check_deprecated_files.sh index 42016abf4a05be..c36d0bf718feef 100755 --- a/scripts/check_deprecated_files.sh +++ b/scripts/check_deprecated_files.sh @@ -68,13 +68,11 @@ done <<< "$changed_files" if [ -n "$deprecated_list" ]; then if [ "$SCRIPT_ENV" = "danger" ]; then # Simplified output for DANGER mode - echo -e "${BRed}ERROR: Changes detected in deprecated files${Color_Off}" echo -e "\nDeprecated files modified:" echo -e "$deprecated_list" - echo -e "\nTo proceed:" - echo -e " • Get approval from a DRI" + echo -e "\n**To proceed**:" + echo -e " • Get approval from one of the DRIs specified in deprecations.yml" echo -e " • Add ${BCyan}~\"pipeline:skip-check-deprecated-files\"${Color_Off} label to your MR" - echo -e "\nSee: ${BGreen}$DEPRECATION_REGISTRY${Color_Off}" else # Full output for CI and local modes echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" -- GitLab From c02554c1bfb9c9a6b0f1740c90c6eddb331b84c8 Mon Sep 17 00:00:00 2001 From: Shane Maglangit Date: Tue, 9 Sep 2025 13:23:52 +0800 Subject: [PATCH 6/8] Edit check_deprecated_files.sh --- scripts/check_deprecated_files.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/check_deprecated_files.sh b/scripts/check_deprecated_files.sh index c36d0bf718feef..1f810c149c3678 100755 --- a/scripts/check_deprecated_files.sh +++ b/scripts/check_deprecated_files.sh @@ -67,14 +67,12 @@ done <<< "$changed_files" if [ -n "$deprecated_list" ]; then if [ "$SCRIPT_ENV" = "danger" ]; then - # Simplified output for DANGER mode - echo -e "\nDeprecated files modified:" + echo -e "\n**Deprecated files modified:**\n" echo -e "$deprecated_list" - echo -e "\n**To proceed**:" - echo -e " • Get approval from one of the DRIs specified in deprecations.yml" - echo -e " • Add ${BCyan}~\"pipeline:skip-check-deprecated-files\"${Color_Off} label to your MR" + echo -e "\n**To proceed:**\n" + echo -e "- Get approval from one of the DRIs specified in [deprecations.yml](https://gitlab.com/gitlab-org/gitlab/-/blob/master/deprecations.yml)" + echo -e "- Add \`~\"pipeline:skip-check-deprecated-files\"\` label to your MR\n" else - # Full output for CI and local modes echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" echo -e "${BRed}⚠️ WARNING: You are pushing changes to deprecated files! ⚠️${Color_Off}" echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" -- GitLab From 66530d0189ad483ead72f83ee4c2ecf5ace2068b Mon Sep 17 00:00:00 2001 From: Shane Maglangit Date: Tue, 9 Sep 2025 13:29:56 +0800 Subject: [PATCH 7/8] Edit check_deprecated_files.sh --- scripts/check_deprecated_files.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check_deprecated_files.sh b/scripts/check_deprecated_files.sh index 1f810c149c3678..efc9da2d7ce77b 100755 --- a/scripts/check_deprecated_files.sh +++ b/scripts/check_deprecated_files.sh @@ -70,8 +70,8 @@ if [ -n "$deprecated_list" ]; then echo -e "\n**Deprecated files modified:**\n" echo -e "$deprecated_list" echo -e "\n**To proceed:**\n" - echo -e "- Get approval from one of the DRIs specified in [deprecations.yml](https://gitlab.com/gitlab-org/gitlab/-/blob/master/deprecations.yml)" - echo -e "- Add \`~\"pipeline:skip-check-deprecated-files\"\` label to your MR\n" + echo -e " • Get approval from one of the DRIs specified in [deprecations.yml](https://gitlab.com/gitlab-org/gitlab/-/blob/master/deprecations.yml)" + echo -e " • Add \`~\"pipeline:skip-check-deprecated-files\"\` label to your MR\n" else echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" echo -e "${BRed}⚠️ WARNING: You are pushing changes to deprecated files! ⚠️${Color_Off}" -- GitLab From 8ee36c7406d0227ca15ad96730b4e61fceea5f92 Mon Sep 17 00:00:00 2001 From: Shane Maglangit Date: Tue, 9 Sep 2025 13:33:44 +0800 Subject: [PATCH 8/8] Edit check_deprecated_files.sh --- scripts/check_deprecated_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check_deprecated_files.sh b/scripts/check_deprecated_files.sh index efc9da2d7ce77b..72e257e0413ed8 100755 --- a/scripts/check_deprecated_files.sh +++ b/scripts/check_deprecated_files.sh @@ -71,7 +71,7 @@ if [ -n "$deprecated_list" ]; then echo -e "$deprecated_list" echo -e "\n**To proceed:**\n" echo -e " • Get approval from one of the DRIs specified in [deprecations.yml](https://gitlab.com/gitlab-org/gitlab/-/blob/master/deprecations.yml)" - echo -e " • Add \`~\"pipeline:skip-check-deprecated-files\"\` label to your MR\n" + echo -e " • Add ~\"pipeline:skip-check-deprecated-files\" label to your MR\n" else echo -e "${BRed}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${Color_Off}" echo -e "${BRed}⚠️ WARNING: You are pushing changes to deprecated files! ⚠️${Color_Off}" -- GitLab