Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 2.84 KB

code-snippets.md

File metadata and controls

60 lines (37 loc) · 2.84 KB

Maintain code snippets in Azure docs

This repository contains scripts to help maintain code snippets in Azure documentation. The scripts are designed to be run in a GitHub Codespace.

If you're evaluating a file for FRESHNESS, see the Freshness Dashboard.

Setup for Codespaces

Follow the steps to create/update a GitHub access token for use with the scripts in this repo.

Once your secret is stored, perform all maintenance tasks using the button below to open this repo in GitHub Codespaces. No additional setup needed. Use the Codespace terminal to run the scripts.

Open in GitHub Codespaces

Daily tasks

  1. Check for PRs that need approval

  2. (Requires the GH_ACCESS_TOKEN secret) For each PR number that you need to investigate, in the terminal, run:

    python GitHub/pr-report.py <PR number> 
  3. Approve if no issues reported.

  4. If issues are present, see Fix the Problem

Weekly tasks

Update snippet references and codeowners files

  1. Run this script (takes 2-3 minutes):

    python GitHub/find-snippets.py
  2. If changes to CODEOWNERS.txt and refs-found.csv files appear, commit them to sdgilley/learn-tools. You can do this from a Codespace, but if you're on main, you'll first need to switch to a new branch. Create a PR and let me know so I can merge it. (If you're the one maintaining the snippets for the month, no hurry on the PR - just make sure you commit changes before the end of the month so the next person has the right versions of these files.)

  3. You can ignore any other txt or csv files that are changed.

  4. If changes to CODEOWNERS appear, commit them to azureml-examples CODEOWNERS file.

  5. If temp-fix is not one of the active branches, update the temp-fix branch to keep it current.

Update docs

  1. Run the merge report. If last run 7 days ago, simply run:

    python GitHub/merge-report.py 

    The report will show PRs merged in the last 8 days. (The extra day insures that you don't miss a merge that happened after your report 7 days ago.)

  2. If longer than 7 days since last run, add a days parameter to the command.:

    python GitHub/merge-report.py <days>
  3. Modify the files in azure-docs-pr as listed in the report. If there are more than 10 files, break it into multiple PRs to be eligible for auto-merge.

  4. Copy the report output to your work item. This will let you see when it was last run, so that you can adjust days accordingly for your next report.