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
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,11 @@ export const make = Effect.gen(function* () {
})),
),
page({ ...input, path: `${pullPath(input)}/reviews` }, ForgejoReview),
page({ ...input, path: `${pullPath(input)}/commits` }, ForgejoCommit),
// Without these, each commit lists its files and a big merge outgrows the output limit.
page(
{ ...input, path: `${pullPath(input)}/commits?files=false&verification=false` },
ForgejoCommit,
),
page({ ...input, path: `${issuePath(input)}/reactions` }, ForgejoReaction),
getViewer(input),
],
Expand Down Expand Up @@ -399,7 +403,7 @@ export const make = Effect.gen(function* () {
? yield* read(
{
...input,
path: `${repoPath(input)}/git/commits/${encodeURIComponent(input.commit)}`,
path: `${repoPath(input)}/git/commits/${encodeURIComponent(input.commit)}?files=false&verification=false`,
},
ForgejoCommit,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,59 @@ it.effect(
},
);

it.effect("reads Forgejo pull request commits without their file lists", () => {
const paths: string[] = [];
return Effect.gen(function* () {
const provider = yield* ForgejoPullRequestProvider.make;
const activity = yield* provider.getChangeRequestActivity({
cwd: "/repo",
repository: "maria/project",
host: "forgejo.test",
number: 30,
});
assert.deepStrictEqual(
activity.commits.map((commit) => commit.oid),
["abc"],
);
const commitReads = paths.filter((path) =>
path.startsWith("repos/maria/project/pulls/30/commits"),
);
assert.isNotEmpty(commitReads);
for (const path of commitReads) {
const query = new URLSearchParams(path.split("?")[1]);
assert.strictEqual(query.get("files"), "false");
assert.strictEqual(query.get("verification"), "false");
}
}).pipe(
Effect.provide(
Layer.mock(ForgejoCli.ForgejoCli)({
api: (input) => {
paths.push(input.path);
const [path, query] = input.path.split("?");
const page = Number(new URLSearchParams(query).get("page") ?? "1");
const body =
path === "user"
? { login: "maria" }
: path === "repos/maria/project/pulls/30/commits" && page === 1
? [
{
sha: "abc",
author: null,
commit: {
message: "Reorganize folders",
committer: { date: "2026-10-11T00:00:00Z" },
},
parents: [],
},
]
: [];
return encodeJsonEffect(body).pipe(Effect.orDie, Effect.map(processOutput));
},
}),
),
);
});

it.effect("discovers Forgejo accounts and retains the server port", () =>
Effect.gen(function* () {
const auth = ForgejoSourceControlProvider.discovery.parseAuth(
Expand Down
Loading