@devries-cameron20 / t3code Mirror · read-only / commits / 8b9a954193
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 03:15 UTC

fix(forgejo): read author assignees once (#30686)

Johan Vaz committed Nov 6, 2026 at 12:34 UTC 8b9a95419377838f0f5af3e0ce4fc39bb7847395
2 files changed +39 -3
packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts
+2 -3
@@ -704,12 +704,11 @@ export const make = Effect.gen(function* () {
704 // Before anything is typed the repository's own people stand in; a search reaches
705 // contributors from forks, who are never assignable.
706 if (query.length === 0) {
707 - const users = yield* page(
707 + const users = yield* readArray(
708 { ...input, path: `${repoPath(input)}/assignees` },
709 ForgejoUser,
710 - 100,
710 );
712 - return { items: actors(users.items), truncated: users.truncated };
711 + return { items: actors(users), truncated: false };
712 }
713 const found = yield* readLinked(
714 {
packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts
+37
@@ -708,6 +708,43 @@ it.effect("lists nothing for an author Forgejo has no account for", () =>
708 ),
709 );
710
711 +it.effect.each([
712 + { query: undefined, count: 3 },
713 + { query: "", count: 3 },
714 + { query: " \t ", count: 3 },
715 + { query: "", count: 101 },
716 +])("reads all $count assignees once for author query '$query'", ({ query, count }) => {
717 + const paths: string[] = [];
718 + const users = Array.from({ length: count }, (_, index) => ({ login: `dev-${index}` }));
719 + return Effect.gen(function* () {
720 + const provider = yield* ForgejoPullRequestProvider.make;
721 + const search = provider.searchRepositoryAuthors;
722 + if (search === undefined) return yield* Effect.die("author search missing");
723 + const found = yield* search({
724 + cwd: "/repo",
725 + repository: "maria/project",
726 + host: "forgejo.test",
727 + ...(query === undefined ? {} : { query }),
728 + });
729 + assert.strictEqual(paths.length, 1);
730 + assert.deepStrictEqual(found, {
731 + items: users.map(({ login }) => ({ login, name: null, avatarUrl: null })),
732 + truncated: false,
733 + });
734 + }).pipe(
735 + Effect.provide(
736 + Layer.mock(ForgejoCli.ForgejoCli)({
737 + api: (input) => {
738 + paths.push(input.path);
739 + assert.strictEqual(input.path.split("?")[0], "repos/maria/project/assignees");
740 + // Forgejo ignores paging here: every page is the full list, with no Link header.
741 + return encodeJsonEffect(users).pipe(Effect.orDie, Effect.map(processOutput));
742 + },
743 + }),
744 + ),
745 + );
746 +});
747 +
748 it.effect("says an author search was cut short by a server that pages below its limit", () =>
749 Effect.gen(function* () {
750 const provider = yield* ForgejoPullRequestProvider.make;