-
Notifications
You must be signed in to change notification settings - Fork 76
fix(cli): correct Redis datasource name in test-helper, nycrc, and datasource files #2286
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
base: master
Are you sure you want to change the base?
Conversation
…tasource files correct Redis datasource name in test-helper, nycrc, and datasource files 2285
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the incorrect Redis datasource naming in various templates and configuration files. It updates the test-helper to correctly bind the Redis or Auth cache datasource, refines the .nycrc configuration, and adjusts datasource template injection to rely on the new naming conventions.
- Updated test-helper.ts to build the correct import mappings and binding configurations.
- Refined the datasource templates (redis.datasource.ts.tpl and name.datasource.ts.tpl) to choose the correct datasource name based on project properties.
- Adjusted the .nycrc configuration file to use a stricter coverage check.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/cli/src/generators/microservice/templates/src/tests/acceptance/test-helper.ts.ejs | Adjusted dynamic import mapping and binding for Redis/Auth datasource based on project configuration. |
packages/cli/src/generators/microservice/templates/.nycrc | Revised configuration settings to improve coverage reporting. |
packages/cli/src/generators/microservice/index.ts | Corrected assignment of baseServiceCacheName using a fallback to 'redis' when necessary. |
packages/cli/src/generators/datasource/templates/redis.datasource.ts.tpl | Updated template to use the correct datasource name from project properties. |
packages/cli/src/generators/datasource/templates/name.datasource.ts.tpl | Modified template to select between a configured store name and a default value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
|
||
|
||
<% if (project.facade || project.baseServiceCacheName) { -%> | ||
<% if (project.serviceDependency && project.baseServiceCacheName ) { -%> | ||
app.bind(`datasources.config.${<%= project.baseServiceCacheName %>}`).to({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we are binding redis anyways on line 84? do we still need it?
<% | ||
const importMap = {}; | ||
|
||
if (project.baseServiceDSList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this logic in template? this should be in the generator
|
changes made are as follows:
#2285
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: