-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add DeleteCategory archive handler and endpoint #134
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
5 commits
Select commit
Hold shift + click to select a range
c9afcfb
squad: scribe session 2026-04-12T17:30Z — PR resolution cycle complete
06c656d
chore: sync squad workflows from dotfiles
6dc3655
chore: bump Squad version stamp to v0.5.4
9882035
feat: add DeleteCategory archive handler and endpoint (#120)
8f4165a
Merge branch 'main' into squad/120-delete-category-handler
mpaulosky 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 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,94 @@ | ||
| --- | ||
| name: Squad PR Auto-Label | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened, synchronize] | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
| contents: read | ||
|
|
||
| jobs: | ||
|
Comment on lines
+1
to
+12
|
||
| auto-label: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Auto-label PR for squad system | ||
| uses: actions/github-script@v9 | ||
| with: | ||
| script: | | ||
| const pr = context.payload.pull_request; | ||
| const author = pr.user.login; | ||
|
|
||
| // Fetch current labels on the PR | ||
| const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: pr.number | ||
| }); | ||
|
|
||
| const labelNames = currentLabels.map(l => l.name); | ||
|
|
||
| // Check if already has squad labels | ||
| const hasSquadLabel = labelNames.some(name => | ||
| name === 'squad' || name.startsWith('squad:') | ||
| ); | ||
|
|
||
| if (hasSquadLabel) { | ||
| core.info(`PR #${pr.number} already has squad label(s) — skipping`); | ||
| return; | ||
| } | ||
|
|
||
| let labelsToAdd = []; | ||
| let commentBody = ''; | ||
|
|
||
| // Handle known automation bots | ||
| const knownBots = ['dependabot[bot]', 'renovate[bot]', 'github-actions[bot]']; | ||
| if (knownBots.includes(author)) { | ||
| labelsToAdd = ['squad:boromir', 'squad']; | ||
| commentBody = [ | ||
| `### 🤖 Dependency Update PR`, | ||
| '', | ||
| `This PR was opened by **${author}** and has been automatically labeled for **Boromir** (DevOps) to review.`, | ||
| '', | ||
| `**Labels applied:**`, | ||
| `- \`squad:boromir\` — Assigned to DevOps for dependency updates`, | ||
| `- \`squad\` — In triage queue`, | ||
| '', | ||
| `> Dependency and infrastructure updates are owned by the DevOps team.` | ||
| ].join('\n'); | ||
| } else { | ||
| // Handle general PRs without squad labels | ||
| labelsToAdd = ['squad']; | ||
| commentBody = [ | ||
| `### 🏗️ PR Added to Squad Triage Queue`, | ||
| '', | ||
| `This PR has been labeled with \`squad\` and added to the triage queue.`, | ||
| '', | ||
| `**Next steps:**`, | ||
| `- The squad Lead will review and assign to an appropriate team member`, | ||
| `- A \`squad:member\` label will be added after triage`, | ||
| '', | ||
| `> If you know which squad member should handle this, you can add the appropriate \`squad:member\` label yourself.` | ||
| ].join('\n'); | ||
| } | ||
|
|
||
| // Add labels | ||
| await github.rest.issues.addLabels({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: pr.number, | ||
| labels: labelsToAdd | ||
| }); | ||
|
|
||
| core.info(`Added labels to PR #${pr.number}: ${labelsToAdd.join(', ')}`); | ||
|
|
||
| // Post comment | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: pr.number, | ||
| body: commentBody | ||
| }); | ||
|
|
||
| core.info(`Posted auto-label comment on PR #${pr.number}`); | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is described as adding a DELETE categories endpoint/handler, but it also changes Squad automation (heartbeat frequency) which is operationally significant and unrelated to the feature. Please split workflow/squad changes into a separate PR (or update the PR description/scope) so the API feature can be reviewed and deployed independently.