Skip to content

Latest commit

 

History

History
67 lines (42 loc) · 3.03 KB

code-snippets.md

File metadata and controls

67 lines (42 loc) · 3.03 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:

    • for azureml-examples repo:

      python GitHub/pr-report.py <PR number> 
    • for azureai-samples repo:

      python GitHub/pr-report.py <PR number> ai
  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-xx.txt and refs-found-xx.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-ml appear, copy the content and commit to azureml-examples CODEOWNERS file.

  5. If temp-fix is not listed as 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-ai-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.