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:

  1. Copy folder
  2. Rename index.md to _index.md
  3. Remove h1 headline
  4. Add former headline as title front matter attribute
  5. Add toc_hide: true to 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:

  1. Add {{< design-document-header >}} shortcode after frontmatter to render the design docs header
  2. Move tod_hide: true to the bottom of front matter
  3. Replace all handbook.gitlab.com links with local links. The script gives you a nice list of links to work-off
  4. 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.

Removes rejected and implemented design docs an... (gitlab-org/gitlab!158615 - merged) removes these design docs from the gitlab repository and adds redirects.

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 by section 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
  • 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

Commits

  • Migrates rejected and implemented design documents to handbook

Edited by Marc Saleiko

Merge request reports

Loading