Migrates rejected and implemented design documents to handbook
Why is this change being made?
Move Architecture Blueprints to Public Handbook (#279 - closed)
This MR adds all rejected and implemented design documents from the gitlab project to the handbook project with proper metadata.
I used this script to copy content one design doc folder at a time from the gitlab project to the handbook project and do some adjustments:
- Copy folder
- Rename
index.mdto_index.md - Remove
h1headline - Add former headline as
titlefront matter attribute - Add
toc_hide: trueto front matter
Expand to see `migrate.sh` script
#!/bin/bash
# Usage:
# ./migrate.sh image_resizing
# Check if a sub path argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 <design_doc>"
exit 1
fi
# Your GDK path to blueprints folder
SRC_DIR=~/development/gitlab-development-kit/gitlab/doc/architecture/blueprints
# Your handbook path to design documents folder
DEST_DIR=~/development/handbook/content/handbook/engineering/architecture/design-documents
# Get the sub path from the argument
DESIGN_DOC=$1
echo "Copy document ${DESIGN_DOC}"
cp -R "${SRC_DIR}/${DESIGN_DOC}" "${DEST_DIR}/${DESIGN_DOC}"
echo "Move index.md to _index.md"
mv "${DEST_DIR}/${DESIGN_DOC}/index.md" "${DEST_DIR}/${DESIGN_DOC}/_index.md"
INDEX_FILE="${DEST_DIR}/${DESIGN_DOC}/_index.md"
echo "Add write permission for ${INDEX_FILE}"
chmod g+w "$INDEX_FILE"
# Extract the headline 1 and remove it from the file
HEADLINE=$(sed -n 's/^# \(.*\)/\1/p' "$INDEX_FILE")
sed -i '' '/^# /d' "$INDEX_FILE"
echo "Found and removed headline: ${HEADLINE}"
echo "Add title and toc_hide to front matter"
awk -v title="$HEADLINE" 'BEGIN {found=0}
{print}
/^---/ && !found {print "title: " title; print "toc_hide: true"; found=1}' "$INDEX_FILE" > "${INDEX_FILE}.tmp" && mv "${INDEX_FILE}.tmp" "$INDEX_FILE"
echo "---"
echo "TODOs:"
echo "1. Add {{< design-document-header >}} to document"
echo "2. Replace all handbook.gitlab.com links with local links."
echo "3. Replace all documentation links with absolute links."
echo "---"
echo "Occurrences of handbook.gitlab.com links that need transforming:"
grep -n "https://.*handbook.gitlab.com" "$INDEX_FILE" || true
echo ""
echo "Occurrences of documentation links that need transforming:"
grep -Eon '\[.*\]\([^)]*\)' "$INDEX_FILE" | grep -v -E '\]\(https?://[^)]*\)' || true
echo "---"
code "$INDEX_FILE"
Usage: ./migrate.sh email_ingestion where email_ingestion is the folder name of a design doc.
I did the following manually after the automated step:
- Add
{{< design-document-header >}}shortcode after frontmatter to render the design docs header - Move
tod_hide: trueto the bottom of front matter - Replace all handbook.gitlab.com links with local links. The script gives you a nice list of links to work-off
- Replace all documentation links with absolute links. I browsed the original document and copied the absolute links. The script give you a list of occurrences.
Author and Reviewer Checklist
Please verify the check list and ensure to tick them off before the MR is merged.
-
Provided a concise title for this Merge Request (MR) -
Added a description to this MR explaining the reasons for the proposed change, per say why, not just what - Copy/paste the Slack conversation to document it for later, or upload screenshots. Verify that no confidential data is added, and the content is SAFE
-
Assign reviewers for this MR to the correct Directly Responsible Individual/s (DRI) - If the DRI for the page/s being updated isn’t immediately clear, then assign it to one of the people listed in the
Maintained bysection on the page being edited - If your manager does not have merge rights, please ask someone to merge it AFTER it has been approved by your manager in #mr-buddies
- The when to get approval handbook section explains the workflow in more detail
- If the DRI for the page/s being updated isn’t immediately clear, then assign it to one of the people listed in the
-
For transparency, share this MR with the audience that will be impacted. -
Team: For changes that affect your direct team, share in your group Slack channel -
Department: If the update affects your department, share the MR in your department Slack channel -
Division: If the update affects your division, share the MR in your division Slack channel -
Company: If the update affects all (or the majority of) GitLab team members, post an update in #whats-happening-at-gitlab linking to this MR - For high-priority company-wide announcements work with the internal communications team to post the update in #company-fyi and align on a plan to circulate in additional channels like the "While You Were Iterating" Newsletter
-
Commits
- Migrates rejected and implemented design documents to handbook
Edited by Marc Saleiko