-
Notifications
You must be signed in to change notification settings - Fork 0
chore: normalize GitHub metadata (templates, labels) #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
38556c4
chore: org label taxonomy, template sources, and sync scripts
DerekCorniello 30e0719
fix: use updateIssue mutation to clear milestones
DerekCorniello a02ced4
fix: disable blank issues so templates always apply needs triage
DerekCorniello 370c7a1
fix: add sync-templates.sh, paginate milestone close, shared triage b…
DerekCorniello 4ed052d
fix: filter out PRs from milestone clearing loop
DerekCorniello f544ad7
fix: handle label creation race and auto-assign unassigned issues
DerekCorniello e2946b2
fix: auto-apply documentation label for docs issues
DerekCorniello d582594
fix: correct label API endpoints and widen docs detection
DerekCorniello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # mux-context overlay on labels.yml | ||
|
|
||
| - name: architecture | ||
| color: 006b75 | ||
| description: Cross-repo architecture or repo map | ||
| - name: adr | ||
| color: 5319e7 | ||
| description: Architecture decision record | ||
| - name: governance | ||
| color: fbca04 | ||
| description: Labels, templates, project board, or process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # mux-runtime overlay on labels.yml | ||
|
|
||
| - name: stdlib | ||
| color: "560143" | ||
| description: Standard library addition or change | ||
| - name: ffi | ||
| color: 4a7967 | ||
| description: C-ABI or FFI surface change |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # mux-syntax-highlighting overlay on labels.yml | ||
|
|
||
| - name: syntax-spec | ||
| color: 006b75 | ||
| description: syntax-matrix.json or canonical spec change | ||
| - name: textmate | ||
| color: 1d76db | ||
| description: TextMate grammar generation or parity | ||
| - name: editor-support | ||
| color: 5319e7 | ||
| description: editor-support configs (Sublime, JetBrains, etc.) | ||
| - name: vscode | ||
| color: 0078d4 | ||
| description: VSCode extension or grammar package | ||
| - name: sublime | ||
| color: ff9800 | ||
| description: Sublime Text highlighting or config | ||
| - name: jetbrains | ||
| color: 000000 | ||
| description: JetBrains IDE highlighting or config | ||
| - name: neovim | ||
| color: 57a143 | ||
| description: Neovim editor-support config | ||
| - name: helix | ||
| color: 675b2d | ||
| description: Helix editor-support config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # mux-website-api overlay on labels.yml | ||
|
|
||
| - name: security | ||
| color: b60205 | ||
| description: Sandbox, auth, rate limits, or untrusted code execution | ||
| - name: sandbox | ||
| color: d93f0b | ||
| description: Compile/run isolation or resource limits | ||
| - name: deployment | ||
| color: fbca04 | ||
| description: Fly.io deploy, Docker image, or MUX_VERSION pin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # mux-website overlay on labels.yml | ||
|
|
||
| - name: playground | ||
| color: 1d76db | ||
| description: In-browser playground UI or behavior | ||
| - name: docs-site | ||
| color: 0075ca | ||
| description: Docusaurus docs site content or layout | ||
| - name: mux-ai | ||
| color: 5319e7 | ||
| description: Docs AI assistant worker or indexing | ||
| - name: docusaurus | ||
| color: 0e8a16 | ||
| description: Docusaurus build, config, or tooling |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # tree-sitter-mux overlay on labels.yml | ||
|
|
||
| - name: grammar | ||
| color: 006b75 | ||
| description: grammar.js or parser behavior | ||
| - name: queries | ||
| color: 5319e7 | ||
| description: Highlight or query .scm files | ||
| - name: syntax-matrix | ||
| color: 1d76db | ||
| description: Vendored syntax-matrix.json sync or drift | ||
| - name: neovim | ||
| color: 57a143 | ||
| description: Neovim / nvim-treesitter integration | ||
| - name: helix | ||
| color: 675b2d | ||
| description: Helix grammar or query integration | ||
| - name: emacs | ||
| color: 7b1fa2 | ||
| description: Emacs tree-sitter integration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/usr/bin/env bash | ||
| # Bulk-clear milestones from all issues in a repo (issues are not deleted). | ||
| # Usage: ./scripts/clear-milestones.sh <repo> | ||
| set -euo pipefail | ||
|
|
||
| REPO="${1:?usage: clear-milestones.sh <repo>}" | ||
| FULL="muxlang/$REPO" | ||
|
|
||
| echo "Clearing milestones on $FULL ..." | ||
| gh api "repos/$FULL/issues?state=all&per_page=100" --paginate \ | ||
| --jq '.[] | select(.milestone != null and (.pull_request | not)) | .number' | while read -r num; do | ||
| id="$(gh issue view "$num" --repo "$FULL" --json id -q .id)" | ||
| gh api graphql -f query=" | ||
| mutation { | ||
| updateIssue(input: {id: \"$id\", milestoneId: null}) { | ||
| issue { number } | ||
| } | ||
| }" | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
| echo " cleared #$num" | ||
| done | ||
|
|
||
| echo "Closing milestones on $FULL ..." | ||
| gh api "repos/$FULL/milestones?state=all&per_page=100" --paginate --jq '.[].number' | while read -r n; do | ||
| gh api -X PATCH "repos/$FULL/milestones/$n" -f state=closed | ||
| echo " closed milestone #$n" | ||
| done | ||
|
|
||
| echo "Done." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/usr/bin/env bash | ||
| # Delete retired labels from all muxlang repos. | ||
| set -euo pipefail | ||
|
|
||
| REPOS=( | ||
| mux-compiler mux-runtime mux-website-api mux-syntax-highlighting | ||
| mux-website tree-sitter-mux mux-context .github | ||
| ) | ||
| RETIRED=( | ||
| "priority: urgent" "priority: high" "priority: medium" "priority: low" | ||
| "needs tested" "bug" "feature" | ||
| ) | ||
|
|
||
| for repo in "${REPOS[@]}"; do | ||
| echo "Retiring labels on muxlang/$repo ..." | ||
| for label in "${RETIRED[@]}"; do | ||
| gh label delete "$label" --repo "muxlang/$repo" --yes 2>/dev/null || true | ||
| done | ||
| done | ||
|
|
||
| echo "Done." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| #!/usr/bin/env bash | ||
| # Apply canonical labels from labels/*.yml to muxlang repos. | ||
| # Usage: ./scripts/sync-labels.sh [repo ...] | ||
| # With no args, syncs every repo in ALL_REPOS below. | ||
| set -euo pipefail | ||
|
|
||
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| ALL_REPOS=( | ||
| mux-compiler | ||
| mux-runtime | ||
| mux-website-api | ||
| mux-syntax-highlighting | ||
| mux-website | ||
| tree-sitter-mux | ||
| mux-context | ||
| .github | ||
| ) | ||
|
|
||
| apply_yaml() { | ||
| local repo="$1" | ||
| local file="$2" | ||
| local name="" color="" description="" | ||
|
|
||
| while IFS= read -r line; do | ||
| case "$line" in | ||
| "- name:"*) | ||
| name="${line#- name:}" | ||
| name="${name#\"}" | ||
| name="${name%\"}" | ||
| name="${name#"${name%%[![:space:]]*}"}" | ||
| name="${name%"${name##*[![:space:]]}"}" | ||
| ;; | ||
| " color:"*) | ||
| color="${line# color: }" | ||
| color="${color#\"}" | ||
| color="${color%\"}" | ||
| ;; | ||
| " description:"*) | ||
| description="${line# description: }" | ||
| if [[ -n "$name" && -n "$color" ]]; then | ||
| gh label create "$name" \ | ||
| --repo "muxlang/$repo" \ | ||
| --color "$color" \ | ||
| --description "$description" \ | ||
| --force | ||
| name="" | ||
| color="" | ||
| description="" | ||
| fi | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
| ;; | ||
| esac | ||
| done < "$file" | ||
| } | ||
|
|
||
| sync_repo() { | ||
| local repo="$1" | ||
| echo "Syncing muxlang/$repo ..." | ||
| apply_yaml "$repo" "$ROOT/labels/labels.yml" | ||
| if [[ -f "$ROOT/labels/$repo.yml" ]]; then | ||
| apply_yaml "$repo" "$ROOT/labels/$repo.yml" | ||
| fi | ||
| } | ||
|
|
||
| if [[ "$#" -gt 0 ]]; then | ||
| TARGETS=("$@") | ||
| else | ||
| TARGETS=("${ALL_REPOS[@]}") | ||
| fi | ||
|
|
||
| for repo in "${TARGETS[@]}"; do | ||
| sync_repo "$repo" | ||
| done | ||
|
|
||
| echo "Done." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/usr/bin/env bash | ||
| # Copy canonical issue templates (and shared bootstrap files) into a repo checkout. | ||
| # Usage: ./scripts/sync-templates.sh <repo> <path-to-repo-checkout> | ||
| # | ||
| # Example: | ||
| # ./scripts/sync-templates.sh mux-runtime ../mux-runtime | ||
| set -euo pipefail | ||
|
|
||
| REPO="${1:?usage: sync-templates.sh <repo> <dest>}" | ||
| DEST="${2:?usage: sync-templates.sh <repo> <dest>}" | ||
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | ||
| SRC="$ROOT/templates/$REPO/ISSUE_TEMPLATE" | ||
|
|
||
| if [[ ! -d "$SRC" ]]; then | ||
| echo "error: no templates for repo '$REPO' at $SRC" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| rm -rf "$DEST/.github/ISSUE_TEMPLATE" | ||
| mkdir -p "$DEST/.github/ISSUE_TEMPLATE" "$DEST/.github/workflows" | ||
| cp -r "$SRC/." "$DEST/.github/ISSUE_TEMPLATE/" | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
| cp "$ROOT/templates/shared/workflows/issue-triage.yml" "$DEST/.github/workflows/issue-triage.yml" | ||
| cp "$ROOT/templates/shared/labels.yml" "$DEST/.github/labels.yml" | ||
|
|
||
| echo "Synced templates, issue-triage workflow, and labels bootstrap to $DEST" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.