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.
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.
-
Check for PRs that need approval
-
(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
-
-
Approve if no issues reported.
-
If issues are present, see Fix the Problem
-
Run this script (takes 2-3 minutes):
python GitHub/find-snippets.py
-
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.)
-
You can ignore any other txt or csv files that are changed.
-
If changes to CODEOWNERS-ml appear, copy the content and commit to azureml-examples CODEOWNERS file.
-
If temp-fix is not listed as one of the active branches, update the temp-fix branch to keep it current.
-
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.)
-
If longer than 7 days since last run, add a days parameter to the command.:
python GitHub/merge-report.py <days>
-
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.
-
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.