Skip to content

Add full_product_spec and use that in provider API#501

Open
beojan wants to merge 1 commit intoFramework-R-D:mainfrom
beojan:provider-no-query
Open

Add full_product_spec and use that in provider API#501
beojan wants to merge 1 commit intoFramework-R-D:mainfrom
beojan:provider-no-query

Conversation

@beojan
Copy link
Copy Markdown
Contributor

@beojan beojan commented Apr 9, 2026

For now product_query has a conversion operator so the tests don't have to be rewritten. This conversion operator has a commented out deprecated annotation (because we use -Werror).

For now product_query has a conversion operator so the tests don't have
to be rewritten. This conversion operator has a commented out
`deprecated` annotation (because we use `-Werror`).
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
phlex/model/full_product_spec.hpp 47.05% 9 Missing ⚠️
phlex/core/product_query.cpp 75.00% 1 Missing and 1 partial ⚠️
phlex/core/declared_provider.cpp 0.00% 1 Missing ⚠️
@@           Coverage Diff           @@
##             main     #501   +/-   ##
=======================================
  Coverage   85.57%   85.57%           
=======================================
  Files         142      143    +1     
  Lines        3604     3640   +36     
  Branches      616      619    +3     
=======================================
+ Hits         3084     3115   +31     
- Misses        310      317    +7     
+ Partials      210      208    -2     
Flag Coverage Δ
unittests 85.57% <77.77%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
phlex/core/declared_provider.hpp 100.00% <100.00%> (ø)
phlex/core/product_query.hpp 90.90% <100.00%> (+4.24%) ⬆️
phlex/core/registration_api.hpp 100.00% <100.00%> (ø)
plugins/python/src/modulewrap.cpp 78.86% <100.00%> (+0.19%) ⬆️
phlex/core/declared_provider.cpp 80.00% <0.00%> (ø)
phlex/core/product_query.cpp 66.00% <75.00%> (+1.71%) ⬆️
phlex/model/full_product_spec.hpp 47.05% <47.05%> (ø)

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51fc599...37e6b50. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@knoepfel knoepfel left a comment

Choose a reason for hiding this comment

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

Thanks, @beojan, for starting this. See below for some comments.

Comment on lines +92 to +95
// Transitional automatic conversion operator so I don't have to rewrite all the tests
// The deprecated annotation is commented out because we have -Werror on
// [[deprecated(
// "Generation of a full_product_spec from a product_query is only transitionally supported")]]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The deprecation attribute is fine for our users. They decide how to build their own Phlex-dependent code, with or without -Werror and -Wno-error=deprecated-declarations.

For our own purposes, we'll continue building with -Werror and not exclude deprecated declarations. We should convert all tests to use the encouraged API. If we want to test the deprecation, we can add a dedicated compile-only test that verifies the deprecation message. I'm not sure that's necessary, though.

namespace phlex::experimental {
class PHLEX_MODEL_EXPORT full_product_spec {
public:
full_product_spec(product_specification spec, identifier layer, identifier stage) :
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am leery of creating a full product specification when what is constructed is not, in fact, a full specification (the type is not set until later). We did this for product_query/product_specification, and I'd like to fix this...specifically, I'd like to avoid the need for setters wherever possible.

I think this means that the provider's output_product registration interface requires all of the data-product fields encapsulated by product_specification, layer, and stage, but maybe they can be received from the user in a more ergonomic way (e.g., require the arguments algorithm_name, suffix, layer, stage, where stage can default to an identifier that denotes the current process):

m.provide(...)
 .output_product(
   /* algorithm_name*/ creator,  
   /* identifier */ suffix, 
   /* identifier */ layer, 
   /* identifier, possibly defaulted */ stage
  )

How these fields are packaged is then an implementation detail.

@beojan
Copy link
Copy Markdown
Contributor Author

beojan commented Apr 20, 2026

@copilot resolve the merge conflicts in this pull request

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.

2 participants