-
Notifications
You must be signed in to change notification settings - Fork 0
Add schema-based config generator for efcpt-config.json files #60
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
Conversation
- Created EfcptConfigGenerator utility to parse schema and generate config - Generates efcpt-config.json with all non-preview properties and their defaults - Updated both default config files to match schema-generated output - Added comprehensive unit tests for config generation - Config files now include all properties with proper defaults matching efcpt CLI behavior Co-authored-by: JerrettDavis <2610199+JerrettDavis@users.noreply.github.com>
- Created comprehensive README explaining generator purpose and usage - Documented when and how to regenerate config files - Clarified that generator is only needed at pack-time for libraries Co-authored-by: JerrettDavis <2610199+JerrettDavis@users.noreply.github.com>
- Updated TryGetDefaultValue to properly handle nullable type arrays - Now includes properties like t4-template-path and output-dbcontext-path with null values - Regenerated both config files to include all properties matching efcpt CLI output - All tests still passing Co-authored-by: JerrettDavis <2610199+JerrettDavis@users.noreply.github.com>
JerrettDavis
left a comment
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.
Ensure generated files include the schema property linked to the efcpt repo schema file. We should update our schema location logic. Right now it's hard-coded to the JerrettDavis repo, but it really should target the repo https://[raw.githubusercontent.com/ErikEJ/EFCorePowerTools/refs/heads/master/samples/efcpt-config.schema.json](https://raw.githubusercontent.com/ErikEJ/EFCorePowerTools/refs/heads/master/samples/efcpt-config.schema.json) first. If unavailable there, then it can check the JerrettDavis repo. It can also check the repo /lib folder on disk if needed.
Ultimately, we need to ensure ErikEJ's repo is the source of truth with fallbacks.
We need to make sure only required fields are included in the generated schemas. We must include the schema link for intellsense/linting to work properly.
- Changed generator to only process required properties from schema - Added $schema property pointing to ErikEJ/EFCorePowerTools repo - Implemented fallback schema URL logic (ErikEJ primary, JerrettDavis fallback) - Removed type-mappings section (not required) - Removed non-required properties from code-generation, names, and file-layout - Regenerated both config files with only required properties Co-authored-by: JerrettDavis <2610199+JerrettDavis@users.noreply.github.com>
Implemented in commit 9fb849f:
|
|
@copilot Ensure the tests are updated to reflect our new default logic. https://github.com/JerrettDavis/JD.Efcpt.Build/actions/runs/20727489006/job/59506683587?pr=60 |
- Added verification that $schema property is present with correct URL - Added test to verify only required properties are included - Verified code-generation has 12 properties, names has 2, file-layout has 1 - Verified optional sections (type-mappings, etc.) are not present - All 9 tests now pass Co-authored-by: JerrettDavis <2610199+JerrettDavis@users.noreply.github.com>
Updated in commit c9f3f54. Tests now verify:
|
|
@copilot There is 1 test failure related to expected efcpt-config configuration. https://github.com/JerrettDavis/JD.Efcpt.Build/actions/runs/20728211668/job/59509583872?pr=60 |
- Template config needs dbcontext-namespace and model-namespace for project customization - These fields allow template substitution like "EfcptProject.Data" -> "MyProject.Data" - Defaults config (MSBuild) still has only required fields - Fixes Template_ConfigFileContainsCorrectProjectName test failure Co-authored-by: JerrettDavis <2610199+JerrettDavis@users.noreply.github.com>
Fixed in commit c8aed8b. The template config needed optional namespace fields (dbcontext-namespace, model-namespace) for project name customization. The MSBuild defaults config still has only required fields as intended. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Code Coverage |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #60 +/- ##
==========================================
+ Coverage 79.39% 86.83% +7.43%
==========================================
Files 51 52 +1
Lines 3373 3486 +113
Branches 459 507 +48
==========================================
+ Hits 2678 3027 +349
+ Misses 510 459 -51
+ Partials 185 0 -185
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Implementation Plan: Generate efcpt-config.json from Schema
ConfigGeneratorclass to parse JSON schemapreview-properties$schemaproperty to generated configs/src/JD.Efcpt.Build/defaults/efcpt-config.json- only required fields/src/JD.Efcpt.Build.Templates/templates/efcptbuild/efcpt-config.json- includes optional namespace fields for template customizationOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.