Skip to content

Commit

Permalink
chore: restore pkgManager field, fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Nov 7, 2024
1 parent b6e3882 commit 0896e78
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
17 changes: 3 additions & 14 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"name": "Start | Stop",
"description": "Assign or un-assign yourself from an issue.",
"ubiquity:listeners": [
"issue_comment.created",
"issues.assigned",
"issues.unassigned",
"pull_request.opened",
"pull_request.edited"
],
"ubiquity:listeners": ["issue_comment.created", "issues.assigned", "issues.unassigned", "pull_request.opened", "pull_request.edited"],
"commands": {
"start": {
"ubiquity:example": "/start",
Expand Down Expand Up @@ -51,12 +45,7 @@
"type": "string"
},
"rolesWithReviewAuthority": {
"default": [
"COLLABORATOR",
"OWNER",
"MEMBER",
"ADMIN"
],
"default": ["COLLABORATOR", "OWNER", "MEMBER", "ADMIN"],
"type": "array",
"items": {
"type": "string"
Expand All @@ -79,4 +68,4 @@
"requiredLabelsToStart"
]
}
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@
"extends": [
"@commitlint/config-conventional"
]
}
},
"packageManager": "[email protected]"
}
12 changes: 6 additions & 6 deletions tests/configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ describe("Configuration tests", () => {
maxConcurrentTasks: { admin: 20, member: 10, contributor: 2 },
rolesWithReviewAuthority: ["OWNER", "ADMIN", "MEMBER"],
requiredLabelsToStart: PRIORITY_LABELS,
}) as StartStopSettings;
}) as PluginSettings;
expect(settings).toEqual(cfg);
});
it("Should default the admin to infinity if missing from config when decoded", () => {
const settings = Value.Default(startStopSchema, {
const settings = Value.Default(pluginSettingsSchema, {
requiredLabelsToStart: PRIORITY_LABELS,
}) as StartStopSettings;
const decodedSettings = Value.Decode(startStopSchema, settings);
}) as PluginSettings;
const decodedSettings = Value.Decode(pluginSettingsSchema, settings);
expect(decodedSettings.maxConcurrentTasks["admin"]).toEqual(Infinity);
});

it("Should normalize maxConcurrentTasks role keys to lowercase when decoded", () => {
const settings = Value.Default(pluginSettingsSchema, {
maxConcurrentTasks: { ADMIN: 20, memBER: 10, CONTRIBUTOR: 2 },
requiredLabelsToStart: PRIORITY_LABELS,
}) as StartStopSettings;
const decodedSettings = Value.Decode(startStopSchema, settings);
}) as PluginSettings;
const decodedSettings = Value.Decode(pluginSettingsSchema, settings);
expect(decodedSettings.maxConcurrentTasks).toEqual({ admin: 20, member: 10, contributor: 2 });
});
});

0 comments on commit 0896e78

Please sign in to comment.