From d63b825ae50bbbcf15e2bc89751c1f332c2e592b Mon Sep 17 00:00:00 2001 From: Isaque Borges Date: Tue, 13 Aug 2024 04:25:26 -0300 Subject: [PATCH] fix(config.ts): invalid default config (#371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📝 (README.md): add support for custom AI models and update documentation to reflect new environment variable OCO_ AI_PROVIDER (#351) * Feat/add gemini (#349) * 🐛Fix: prompt-module/@commitlint (#336) * fix(commitlint/utils.ts): correct variable used in search for JSON block end tag * ♻️ (commitlint/config.ts & pwd-commitlint.ts): Refactor commitlint config loading to support both CJS and ESM modules 💡 (pwd-commitlint.ts): Add detailed comments and error handling for better clarity and robustness in commitlint module loading process * ✨ (package.json): Add setup script for e2e tests to install dependencies for commitlint configurations 🔧 (setup.sh): Add shell script to set up commitlint configurations for e2e tests * ✨ (config.ts): Add support for OCO_TEST_MOCK_TYPE configuration key to define test mock type for testing purposes 📝 (config.ts): Update documentation for OCO_TEST_MOCK_TYPE configuration key in configValidators and getConfig functions 📝 (testAi.ts): Add TEST_MOCK_TYPES constant array to define supported test mock types 📝 (testAi.ts): Update generateCommitMessage function to use OCO_TEST_MOCK_TYPE from config for different test mock types 📝 (commitlint.test.ts): Add e2e test for running "oco commitlint force" with different @commitlint versions using CJS and ESM 📝 (utils.ts): Add wait function to introduce delay in milliseconds for testing purposes * ✨ (commitlint.test.ts): refactor setupCommitlint function to accept a version parameter for better code organization and readability 📝 (commitlint.test.ts): add test case for commitlint@9 using CJS to ensure proper functionality and compatibility 📝 (commitlint.test.ts): add test case for commitlint@18 using CJS to ensure proper functionality and compatibility 📝 (commitlint.test.ts): add test case for commitlint@19 using ESM to ensure proper functionality and compatibility * 🔧 (commitlint.test.ts): remove unnecessary commands to create and add index.ts file before running tests * refactor(test/e2e/prompt-module/commitlint.test.ts): remove unused import configure style(test/e2e/prompt-module/commitlint.test.ts): add missing semicolon for consistency test(test/e2e/prompt-module/commitlint.test.ts): add e2e tests for @commitlint prompt-module integration * ✨ (e2e tests): add package.json copying to setupCommitlint for version accuracy ♻️ (commitlint config): refactor commitlint.config.js to use ES module syntax ✨ (package.json): specify "type": "module" to support ES module syntax * docs: spelling fix (#325) * 3.0.17 * ♻️ (config.ts): refactor OCO_AZURE_ENDPOINT default value from empty string to undefined resolving #352 - creates invalid config file --------- Co-authored-by: tumf Co-authored-by: Drew Payment Co-authored-by: Takanori Matsumoto Co-authored-by: Kellan Stevens Co-authored-by: di-sukharev --- out/cli.cjs | 9 +-------- out/github-action.cjs | 2 +- src/commands/config.ts | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/out/cli.cjs b/out/cli.cjs index 2ba8bd68..3788260c 100755 --- a/out/cli.cjs +++ b/out/cli.cjs @@ -30691,14 +30691,7 @@ var MODEL_LIST = { "claude-3-5-sonnet-20240620", "claude-3-opus-20240229", "claude-3-sonnet-20240229", - "claude-3-haiku-20240307" - ], - gemini: [ - "gemini-1.5-flash", - "gemini-1.5-pro", - "gemini-1.0-pro", - "gemini-pro-vision", - "text-embedding-004" + "claude-3-opus-20240229" ] }; var getDefaultModel = (provider4) => { diff --git a/out/github-action.cjs b/out/github-action.cjs index 24835c4e..87b2a099 100644 --- a/out/github-action.cjs +++ b/out/github-action.cjs @@ -49501,7 +49501,7 @@ var MODEL_LIST = { "claude-3-5-sonnet-20240620", "claude-3-opus-20240229", "claude-3-sonnet-20240229", - "claude-3-haiku-20240307" + "claude-3-opus-20240229" ], gemini: [ "gemini-1.5-flash", diff --git a/src/commands/config.ts b/src/commands/config.ts index 2d0dbe7d..8987144a 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -395,7 +395,7 @@ export const getConfig = ({ OCO_GITPUSH: process.env.OCO_GITPUSH === 'false' ? false : true, OCO_ONE_LINE_COMMIT: process.env.OCO_ONE_LINE_COMMIT === 'true' ? true : false, - OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT || '', + OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT || undefined, OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE || 'commit-message' };