perf(read): retrieval-ribbon point-read locator (O(1) point reads, beat RocksDB structurally) #276
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
| name: Issue Auto-Labeler | |
| on: | |
| issues: | |
| types: [opened, edited] | |
| permissions: | |
| issues: write | |
| jobs: | |
| label: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Label issue by title prefix | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| const title = context.payload.issue.title.toLowerCase(); | |
| const existing = context.payload.issue.labels.map(l => l.name); | |
| const add = []; | |
| // Conventional prefix → labels | |
| const prefixMap = { | |
| 'feat': ['enhancement'], | |
| 'fix': ['bug'], | |
| 'perf': ['enhancement', 'performance'], | |
| 'refactor': ['refactor'], | |
| 'docs': ['documentation'], | |
| 'test': ['test'], | |
| 'bench': ['test', 'performance'], | |
| 'ci': ['ci'], | |
| 'research': ['enhancement'], | |
| }; | |
| // Scope → labels (optional, from parenthesized scope) | |
| const scopeMap = { | |
| 'compaction': ['compaction'], | |
| 'compact': ['compaction'], | |
| 'encrypt': ['encryption'], | |
| 'fs': ['fs-trait'], | |
| 'comparator': ['comparator'], | |
| 'crash': ['crash-safety'], | |
| 'recover': ['crash-safety'], | |
| }; | |
| // Match "type(scope): description" or "type: description" | |
| const match = title.match(/^(\w+?)(?:\(([^)]+)\))?:/); | |
| if (match) { | |
| const prefix = match[1]; | |
| const scope = match[2]; | |
| const prefixLabels = prefixMap[prefix] || []; | |
| for (const l of prefixLabels) { | |
| if (!existing.includes(l)) add.push(l); | |
| } | |
| if (scope) { | |
| for (const [key, labels] of Object.entries(scopeMap)) { | |
| if (scope.includes(key)) { | |
| for (const l of labels) { | |
| if (!existing.includes(l)) add.push(l); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| if (add.length > 0) { | |
| const unique = [...new Set(add)]; | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| labels: unique, | |
| }); | |
| console.log(`Added labels: ${unique.join(', ')}`); | |
| } else { | |
| console.log('No labels to add'); | |
| } |