Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

Claim bot: let me /unclaim my own issues (#1595)

bherbruckfdb059cfed94
diff --git a/scripts/claim/claim.js b/scripts/claim/claim.js
index f3cf632ad7..8cfd195551 100644
--- a/scripts/claim/claim.js
+++ b/scripts/claim/claim.js
@@ -223,8 +223,8 @@ async function unclaim(github, context) {
await react(github, context, '+1'); // nothing to release
return;
}
- if (assignees.includes(context.repo.owner)) {
- await react(github, context, 'eyes'); // never touched by the bot
+ if (assignees.includes(context.repo.owner) && user !== context.repo.owner) {
+ await react(github, context, 'eyes'); // only the owner releases their own issues
return;
}
const allowed = assignees.includes(user) || (await isMaintainer(github, context, user));
diff --git a/scripts/claim/claim.test.js b/scripts/claim/claim.test.js
index c61da8a1f9..f2fe47df79 100644
--- a/scripts/claim/claim.test.js
+++ b/scripts/claim/claim.test.js
@@ -170,10 +170,13 @@ test('unclaim by a maintainer releases, by a stranger does not', async () => {
assert.equal(find(w.calls, 'react')[1].content, 'eyes');
});
-test('unclaim never touches an issue assigned to the owner', async () => {
- const { github, calls } = fake();
- await claim.handleComment({ github, context: ctx('/unclaim', { user: 'bherbruck', assignees: ['bherbruck'], labels: ['in progress'] }), now: NOW });
- assert.equal(find(calls, 'removeLabel'), undefined);
+test('unclaim on an owner-assigned issue works only for the owner', async () => {
+ let w = fake();
+ await claim.handleComment({ github: w.github, context: ctx('/unclaim', { user: 'carol', assignees: ['bherbruck'], labels: ['in progress'] }), now: NOW });
+ assert.equal(find(w.calls, 'removeLabel'), undefined);
+ w = fake();
+ await claim.handleComment({ github: w.github, context: ctx('/unclaim', { user: 'bherbruck', assignees: ['bherbruck'], labels: ['in progress'] }), now: NOW });
+ assert.ok(find(w.calls, 'removeLabel'));
});
const issue = (number, assignees = ['bob']) => ({