Skip to content

Generator enhancements #674

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

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Generator enhancements #674

merged 6 commits into from
Jun 11, 2024

Conversation

Mark90
Copy link
Contributor

@Mark90 Mark90 commented Jun 7, 2024

Generator enhancements

product_block

  • Fix imports of dependent product blocks in the same product
  • Detect invalid product block configuration: cyclic or multiple roots

product

  • Only attach the root product block to the product type

migration

  • Only relate the root product block to the product, instead of all blocks (product_product_blocks)
  • Fill depends_on_block_relations, ensuring the correct order (product_block_relations)
  • Only create resource types for non-product block fields (product_block_resource_types)

Please review the updated migrations in the diff, as well as in the example orchestrator workfloworchestrator/example-orchestrator#19

Other

  • add testing for generated migrations
  • add testcases for (invalid) product block generation
  • make revision argument to command db upgrade mandatory
  • change db history command to indicate current revision by default

Closes #651

Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 95.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 83.48%. Comparing base (f372ba9) to head (1cdc430).

Files Patch % Lines
orchestrator/cli/generator/generator/migration.py 77.27% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #674      +/-   ##
==========================================
+ Coverage   83.40%   83.48%   +0.07%     
==========================================
  Files         183      183              
  Lines        9005     9064      +59     
  Branches     1472     1487      +15     
==========================================
+ Hits         7511     7567      +56     
- Misses       1229     1232       +3     
  Partials      265      265              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Mark90 Mark90 force-pushed the 651-generator-enhancements branch 4 times, most recently from a33fea7 to a28659c Compare June 7, 2024 15:16
@Mark90 Mark90 changed the title 651 generator enhancements Generator enhancements Jun 7, 2024
@Mark90 Mark90 force-pushed the 651-generator-enhancements branch 6 times, most recently from a6316cd to c70924e Compare June 10, 2024 13:59
Mark90 added a commit to workfloworchestrator/example-orchestrator that referenced this pull request Jun 10, 2024
@Mark90 Mark90 force-pushed the 651-generator-enhancements branch from c70924e to c9928c0 Compare June 10, 2024 14:21
@Mark90 Mark90 marked this pull request as ready for review June 10, 2024 14:21
Copy link
Contributor

@mrijk mrijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit too many nested for loops (and if statements) for my taste

Mark90 added 4 commits June 11, 2024 15:28
product_block:
- Fix imports of dependent product blocks in the same product
- Detect invalid product block configuration: cyclic or multiple roots

product:
- Only attach the root product block to the product type

migration:
- Only relate the root product block to the product, instead of all blocks (product_product_blocks)
- Fill depends_on_block_relations in correct order (product_block_relations)
- Only create resource types for non-product block fields (product_block_resource_types)

Signed-off-by: Mark90 <[email protected]>
- history: show current revision by default
- upgrade: make revision a required argument

Signed-off-by: Mark90 <[email protected]>
@Mark90 Mark90 force-pushed the 651-generator-enhancements branch from c9928c0 to 1cdc430 Compare June 11, 2024 13:29
@Mark90 Mark90 merged commit 32a1a8f into main Jun 11, 2024
16 checks passed
@Mark90 Mark90 deleted the 651-generator-enhancements branch June 11, 2024 13:39
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.

[Bug]: Product generator not filling the product block relations table
4 participants