Skip to content
Draft
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
28 changes: 20 additions & 8 deletions apps/server/src/git/Errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,30 @@ export class GitCommandError extends Schema.TaggedErrorClass<GitCommandError>()(
}

/**
* GitHubCliError - GitHub CLI execution or authentication failed.
* GitHostingCliError - Git hosting CLI (gh, glab, etc.) execution or authentication failed.
*/
export class GitHubCliError extends Schema.TaggedErrorClass<GitHubCliError>()("GitHubCliError", {
operation: Schema.String,
detail: Schema.String,
cause: Schema.optional(Schema.Defect),
}) {
export class GitHostingCliError extends Schema.TaggedErrorClass<GitHostingCliError>()(
"GitHostingCliError",
{
operation: Schema.String,
detail: Schema.String,
cause: Schema.optional(Schema.Defect),
},
) {
override get message(): string {
return `GitHub CLI failed in ${this.operation}: ${this.detail}`;
return `Git hosting CLI failed in ${this.operation}: ${this.detail}`;
}
}

/**
* @deprecated Use GitHostingCliError instead. Kept for backwards compatibility.
*/
export type GitHubCliError = GitHostingCliError;
/**
* @deprecated Use GitHostingCliError instead. Kept for backwards compatibility.
*/
export const GitHubCliError = GitHostingCliError;

/**
* TextGenerationError - Commit or PR text generation failed.
*/
Expand Down Expand Up @@ -63,5 +75,5 @@ export class GitManagerError extends Schema.TaggedErrorClass<GitManagerError>()(
export type GitManagerServiceError =
| GitManagerError
| GitCommandError
| GitHubCliError
| GitHostingCliError
| TextGenerationError;
2 changes: 1 addition & 1 deletion apps/server/src/git/Layers/CodexTextGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ const makeCodexTextGeneration = Effect.gen(function* () {

const generatePrContent: TextGenerationShape["generatePrContent"] = (input) => {
const prompt = [
"You write GitHub pull request content.",
"You write pull request / merge request content.",
"Return a JSON object with keys: title, body.",
"Rules:",
"- title should be concise and specific",
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/git/Layers/GitCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,8 @@ const makeGitCore = Effect.gen(function* () {
statusDetails(input.cwd).pipe(
Effect.map((details) => ({
branch: details.branch,
hostingPlatform: "github" as const,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not always correct?

hostingCliAuthenticated: null,
hasWorkingTreeChanges: details.hasWorkingTreeChanges,
workingTree: details.workingTree,
hasUpstream: details.hasUpstream,
Expand Down
Loading
Loading