Skip to content

Replace SKIP_MR option with DRY_RUN mode on redirects Rake task

Evan Read requested to merge eread/replace-skip_mr-mode-with-dry_run-mode into main

What does this MR do and why?

While trying to resolve: gitlab!112520 (merged), I really needed a full "dry run" mode that made no local changes to my checkouts. I just needed to see what the script analyzed and be able to run bundle exec rake docs:clean_redirects repeatedly.

This MR:

CC @jglassman1 @ashrafkhamis @marcel.amirault

How to set up and validate locally

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Check out this branch.
  3. Run DRY_RUN=true bundle exec rake docs:clean_redirects. If:
    • gitlab!112520 (merged) is already merged, the script will complete with no error but make no local changes.

    • gitlab!112520 (merged) isn't merged, the script will abort with this error message:

      INFO: (ee): In ../gitlab/doc/development/integrations/codesandbox.md, remove date: 2023-02-01 is less than today (2023-02-21).
      INFO: (ee): Not deleting ../gitlab/doc/development/integrations/codesandbox.md because running in dry run mode...
      
      ERROR: No redirect_to found in ../gitlab/doc/development/integrations/codesandbox.md!

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports