Add a script to flag expired content

What does this MR do and why?

This MR adds two new CLI commands to accomplish the "find expired content" maintenance task:

  1. A generic search method (make search-content query="whatever") to find a given string in any of the docs projects.
  2. The more targeted make find-expired-content script to specifically find expired content that needs to be removed.

Expired content is marked in docs using comments like this:

<!--- start_remove The following content will be removed on remove_date: 'YYYY-MM-DD' -->

Cleaning these up monthly is part of the monthly tasks rotation (which we can start up again after we get this last one merged, and the template updated!).

Related:

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/blob/main/doc/setup.md.
  2. Try the search command:
make search-content query="{{< tabs >}}"
  1. Try running the new maintenance script: make find-expired-content. Expected results: no expired content found.
  2. Create some "expired content" by editing a few pages in ../gitlab/doc and adding expiration tags, like:

A date in the past, that should be returned by the script:

<!--- start_remove The following content will be removed on remove_date: '2020-12-31' -->

A date in the future, which should not:

<!--- start_remove The following content will be removed on remove_date: '2025-11-15' -->

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.

Edited by Hiru Fernando

Merge request reports

Loading