-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Unsupported config key OCO_AZURE_ENDPOINT - even when provider is set to openai #352
Comments
This is reproducible for new users. |
any volunteers to make a PR? i could not find any existing one |
@di-sukharev I'll give a try and open a PR today. |
I'm running Node
|
It seems the best fix is to roll back to 3.0.11
then open your config and ensure you delete the OCO_GITPUSH parameter, otherwise you will get a parse error. └ Unknown 'OCO_GITPUSH' config option. Works fine with |
FWIW the issue seems to be caused by the entire config file being written, even empty/unset parameters, whenever any config value is set. So if you want to avoid rolling back you can edit ~/.opencommit and remove all of the empty/unset config values and it should work again. |
I got the same output after installing opencommit on my new device |
I confirm @NodeJSmith answer. You should edit the config file in ~/.opencommit and remove the line with OCO_AZURE_ENDPOINT= |
very nice |
…string to undefined resolving di-sukharev#352 - creates invalid config file
* 📝 (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 <[email protected]> Co-authored-by: Drew Payment <[email protected]> Co-authored-by: Takanori Matsumoto <[email protected]> Co-authored-by: Kellan Stevens <[email protected]> Co-authored-by: di-sukharev <[email protected]>
the PR was merged, gonna be released in the next version today |
done, please @funkyfisch follow up |
Opencommit Version
3.0.16
Node Version
v21.6.2
NPM Version
10.2.4
What OS are you seeing the problem on?
Other Linux Distro
What happened?
installing oco fresh, setting openai api key and running oco set hook.
Any further invocations of oco (including the hook itself) just fail with
Unsupported config key OCO_AZURE_ENDPOINT: Must be in format "https://<resource name>.openai.azure.com/"
I managed to bypass this by modifying the .opencommit file in the home directory and add "undefined" as a value to the
OCO_AZURE_ENDPOINT key (which was empty)
Expected Behavior
Unnecessary variables should not break the programs functionality. I couldn't even set/unset the value using the cli because of this error.
Current Behavior
oco refuses to do anything until this is fixed manually. this is similar to this earlier issue
Possible Solution
Parse the variables first, and then have a dependency graph among them. based on that dependency graph, sanitize accordingly based on what is needed. Also make sure to allow higher level commands (like oco config) to still work even if variables are set incorrectly in the autogenerated file.
Finally to fix the specific bug, make sure to populate it with undefined, similarly to how the rest of the variables are.
Steps to Reproduce
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: