Skip to content

Snapshot read below the oldest retained version panics in get_version_for_snapshot #368

Snapshot read below the oldest retained version panics in get_version_for_snapshot

Snapshot read below the oldest retained version panics in get_version_for_snapshot #368

Workflow file for this run

name: Issue Auto-Labeler
on:
issues:
types: [opened, edited]
permissions:
issues: write
jobs:
label:
runs-on: ubuntu-latest
steps:
# Pinning policy: first-party actions (actions/*, dependabot/*) track a
# MAJOR tag; third-party actions stay pinned to a commit digest with a
# version comment. See coordinode-release.yml for the reasoning.
- name: Label issue by title prefix
uses: actions/github-script@v9
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');
}