Skip to content
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

fix(config.ts): invalid default config #371

Merged
merged 9 commits into from
Aug 13, 2024

Conversation

izzybps
Copy link
Contributor

@izzybps izzybps commented Jul 31, 2024

Resolving #352 setting initial value of OCO_AZURE_ENDPOINT to undefined instead of '', where it causes errors while trying to set any other config upon initial installation.

tumf and others added 8 commits July 4, 2024 11:03
…ion to reflect new environment variable OCO_ AI_PROVIDER (di-sukharev#351)
* 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
…string to undefined resolving di-sukharev#352 - creates invalid config file
@izzybps
Copy link
Contributor Author

izzybps commented Jul 31, 2024

I made the pull request based on the guidelines of the CONTRIBUTING.md file and it generated this large amount of changes, the bug fix consists of one line change. If you need anything else feel free to ping me.
@di-sukharev

@edmilsonrobson
Copy link

Yeah, I recently installed oco and this was a very weird first experience

@di-sukharev
Copy link
Owner

di-sukharev commented Aug 5, 2024 via email

@di-sukharev di-sukharev changed the base branch from dev to master August 7, 2024 07:47
@di-sukharev di-sukharev merged commit d63b825 into di-sukharev:master Aug 13, 2024
3 checks passed
@minarc
Copy link

minarc commented Sep 3, 2024

@di-sukharev I encountered the same issue after updating from version 3.0.1 to 3.1.2. Upon updating, the following environment variables are undefined:

OCO_OPENAI_API_KEY=api_key
OCO_ANTHROPIC_API_KEY=undefined
OCO_AZURE_API_KEY=undefined
OCO_GEMINI_API_KEY=undefined
OCO_TOKENS_MAX_INPUT=undefined
OCO_TOKENS_MAX_OUTPUT=undefined
OCO_OPENAI_BASE_PATH=undefined
OCO_GEMINI_BASE_PATH=undefined
OCO_DESCRIPTION=false
OCO_EMOJI=true
OCO_MODEL=gpt-4o-mini
OCO_LANGUAGE=en
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=$msg
OCO_PROMPT_MODULE=conventional-commit
OCO_AI_PROVIDER=openai
OCO_GITPUSH=true
OCO_ONE_LINE_COMMIT=false
OCO_AZURE_ENDPOINT=undefined
OCO_TEST_MOCK_TYPE=commit-message
OCO_FLOWISE_ENDPOINT=:
OCO_FLOWISE_API_KEY=undefined
OCO_OLLAMA_API_URL=undefined
OCO_WHY=true

As a result, oco throws a type error related to max_token.

@di-sukharev
Copy link
Owner

di-sukharev commented Sep 3, 2024 via email

@di-sukharev
Copy link
Owner

gonna be fixed here #408

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants