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:
- A generic
searchmethod (make search-content query="whatever") to find a given string in any of the docs projects. - The more targeted
make find-expired-contentscript 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:
- https://docs.gitlab.com/development/documentation/styleguide/deprecations_and_removals/
- #270 (closed)
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing/docs-gitlab-com/-/blob/main/doc/setup.md. -
Try the search command:
make search-content query="{{< tabs >}}"
-
Try running the new maintenance script: make find-expired-content. Expected results: no expired content found. -
Create some "expired content" by editing a few pages in ../gitlab/docand 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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Hiru Fernando