Skip to content

Commit

Permalink
add code-snippets.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sdgilley committed Jan 10, 2024
1 parent 11aa337 commit 66c71f3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 11 deletions.
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ Some handy scripts for working with markdown articles on learn.microsoft.com

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/sdgilley/learn-tools?quickstart=1)

In Codespaces, the following shortcut commands are available the Github merge and pr reports:

```bash
./merge.sh
./merge.sh <days>
./pr.sh <pr-number>
```


## ![Python](media/python-logo.png) Python scripts:

* [fix-nb.py](fix-nb.py) - Change notebook links and images to markdown syntax.
Expand All @@ -22,9 +13,9 @@ In Codespaces, the following shortcut commands are available the Github merge an

### GitHub folder

Scripts in the GitHub folder are used to help us maintain our code references. Make sure you have `pyGithub` installed (`pip install pyGithub`) to run these scripts.
See [Maintain code snippets in Azure docs](code-snippets.md) for more information on how to use these scripts.

* [create-codeowners.py](GitHub/create-codeowners.py) - create a CODEOWNERS file for the azureml-examples repo. Use this to generate content to replace the lines in https://github.com/Azure/azureml-examples/blob/main/.github/CODEOWNERS.
Scripts in the GitHub folder are used to help us maintain our code references. Make sure you have `pyGithub` installed (`pip install pyGithub`) to run these scripts.

* [find-snippets.py](GitHub/find-snippets.py)
* creates the file refs-found.csv. This file is used for both the pr-report and merge-report scripts.
Expand All @@ -41,6 +32,13 @@ The following files provide functions used in the above scripts:

You'll need to set a GH_ACCESS_TOKEN environment variable before using auth-request.py. See https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens to create a token. Then add the token to an environment variable called GH_ACCESS_TOKEN.

The following shortcut commands are available for Github merge and pr reports:

```bash
./merge.sh
./merge.sh <days>
./pr.sh <pr-number>
```

## Other repos

Expand Down
48 changes: 48 additions & 0 deletions code-snippets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Maintain code snippets in Azure docs

You can perform all maintenance tasks in Codespaces, with no additional setup needed. Click the button below to open this repo in a Codespace.

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/sdgilley/learn-tools?quickstart=1)


## Daily tasks

1. Check for [PRs that need approval](https://github.com/Azure/azureml-examples/pulls?q=is%3Apr+is%3Aopen+user-review-requested%3A%40me )

1. For each PR number that you need to investigate, in the terminal, run:

```bash
./pr.sh <pr-number>
```

1. Approve if no issues reported.
1. If issues are present, see [Fix the Problem](https://microsoft.sharepoint.com/teams/AzureDataandAIDocsLT/_layouts/OneNote.aspx?id=%2Fteams%2FAzureDataandAIDocsLT%2FShared%20Documents%2FGeneral%2FAdvanced%20Analytics%20Tech%20Docs&wd=target%28Code%20Maintenance.one%7C2EEC86EA-36BC-4D03-A0EE-4684419BF75B%2FFix%20the%20Problem%7CF06C94CC-934D-4E05-B461-5BB56ECBE65E%2F%29)

## Weekly tasks

### Update snippet references and codeowners files

1. Run this script (takes about two minutes):

```bash
python GitHub/find-snippets.py
```

1. If changes to .txt and .csv files appear, commit them to this repo (learn-tools). You can do this from a Codespace, but you'll first need to switch to a new branch.
1. If changes to CODEOWNERS appear, commit them to azureml-examples [CODEOWNERS](https://github.com/Azure/azureml-examples/blob/main/.github/CODEOWNERS) file
### Update docs
1. Run the merge report. If last run 7 days ago, simply run:
```bash
./merge.sh
```
1. If longer than 7 days since last run:
```bash
./merge.sh <days>
```
1. Modify the files in azure-docs-pr as listed in the report.

0 comments on commit 66c71f3

Please sign in to comment.