Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ checkpoint, and status-only commits are intentionally omitted.
`docs.openclaw.ai` links where appropriate.
- Clarified `incoherent` close-reason wording so rendered reports no longer
collide with `not_actionable_in_repo` (#29). Thanks @xthunder0.
- Normalized repository profile lookup against configured target repos so
mixed-case profile entries resolve correctly (#27). Thanks @xthunder0.
- Made apply runs issue-only by default, with no age floor, while still excluding
maintainer-authored items.
- Made apply runs checkpoint their progress, publish dashboard heartbeats, and
Expand Down
4 changes: 3 additions & 1 deletion src/repository-profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export const REPOSITORY_PROFILES: readonly RepositoryProfile[] = [

export function repositoryProfileFor(targetRepo: string): RepositoryProfile {
const normalized = normalizeRepo(targetRepo);
const profile = REPOSITORY_PROFILES.find((candidate) => candidate.targetRepo === normalized);
const profile = REPOSITORY_PROFILES.find(
(candidate) => normalizeRepo(candidate.targetRepo) === normalized,
);
if (!profile) {
throw new Error(
`Unsupported target repo: ${targetRepo}. Known repos: ${REPOSITORY_PROFILES.map((candidate) => candidate.targetRepo).join(", ")}`,
Expand Down
27 changes: 27 additions & 0 deletions test/repository-profiles.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import assert from "node:assert/strict";
import test from "node:test";

import { REPOSITORY_PROFILES, repositoryProfileFor } from "../dist/repository-profiles.js";

test("repositoryProfileFor matches mixed-case input against canonical profiles", () => {
const profile = repositoryProfileFor("OpenClaw/ClawHub");

assert.equal(profile.targetRepo, "openclaw/clawhub");
assert.equal(profile.slug, "openclaw-clawhub");
});

test("profile lookup normalizes candidate target repos as well as input", () => {
const mixedCaseProfile = {
...REPOSITORY_PROFILES[0],
targetRepo: "Example-Org/Mixed-Case-Repo",
slug: "example-org-mixed-case-repo",
};
REPOSITORY_PROFILES.push(mixedCaseProfile);

try {
assert.equal(repositoryProfileFor("example-org/mixed-case-repo"), mixedCaseProfile);
assert.equal(repositoryProfileFor("EXAMPLE-ORG/MIXED-CASE-REPO"), mixedCaseProfile);
} finally {
REPOSITORY_PROFILES.pop();
}
});
Loading