-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Querying OpenAI API to get the commit subject and the body as default values
- Loading branch information
tal-rofe
committed
Apr 21, 2023
1 parent
d2bcb71
commit a5dc8c6
Showing
18 changed files
with
308 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,5 @@ | ||
export interface CommitType { | ||
value: string; | ||
description: string; | ||
emoji?: string; | ||
} | ||
import type { z } from 'zod'; | ||
|
||
export type Config = Partial<{ | ||
headerFormat: string; | ||
commitTypes: CommitType[]; | ||
maxCommitLineWidth: number; | ||
typeQuestion: string; | ||
scopeQuestion: string; | ||
skipScope: boolean; | ||
scopes: string[]; | ||
ticketIdQuestion: string; | ||
skipTicketId: boolean; | ||
ticketIdRegex: string; | ||
allowEmptyTicketIdForBranches: string[]; | ||
subjectQuestion: string; | ||
subjectMaxLength: number; | ||
subjectMinLength: number; | ||
bodyQuestion: string; | ||
skipBody: boolean; | ||
skipBreakingChanges: boolean; | ||
issuesQuestion: string; | ||
skipIssues: boolean; | ||
}>; | ||
import type ConfigurationSchema from './models/configuration'; | ||
|
||
export type CzVinylConfig = z.infer<typeof ConfigurationSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const AI_COMMIT_IGNORED_FILES = [ | ||
'package-lock.json', | ||
'yarn.lock', | ||
'pnpm-lock.yaml', | ||
'go.sum', | ||
'go.work.sum', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { z } from 'zod'; | ||
|
||
const AiResponseSchema = z.object({ | ||
subject: z.string(), | ||
body: z.string().optional(), | ||
}); | ||
|
||
export default AiResponseSchema; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export const USER_MESSAGE = `diff --git a/src/server.ts b/src/server.ts | ||
index ad4db42..f3b18a9 100644 | ||
--- a/src/server.ts | ||
+++ b/src/server.ts | ||
@@ -10,7 +10,7 @@ | ||
import { | ||
initWinstonLogger(); | ||
const app = express(); | ||
-const port = 7799; | ||
+const PORT = 7799; | ||
app.use(express.json()); | ||
@@ -34,6 +34,6 @@ | ||
app.use((_, res, next) => { | ||
// ROUTES | ||
app.use(PROTECTED_ROUTER_URL, protectedRouter); | ||
-app.listen(port, () => { | ||
- console.log(\`Server listening on port \${port}\`); | ||
+app.listen(process.env.PORT || PORT, () => { | ||
+ console.log(\`Server listening on port \${PORT}\`); | ||
});`; |
Oops, something went wrong.