Open vasindran opened 1 month ago
@eamonnfaherty - This seems to occur if there are products in the hub portfolio which don't exist in the spoke portfolio and either have no versions or all versions are marked to be ignored.
If I'm following the logic correctly, then this line https://github.com/awslabs/aws-service-catalog-puppet/blob/994c221d1fee8efae5fb553f74c80e6ddcd8941a/servicecatalog_puppet/workflow/portfolio/portfolio_management/copy_into_spoke_local_portfolio_task.py#L65 marks the product to be copied and the 'True' value should later on be overwritten with the ProductId at https://github.com/awslabs/aws-service-catalog-puppet/blob/994c221d1fee8efae5fb553f74c80e6ddcd8941a/servicecatalog_puppet/workflow/portfolio/portfolio_management/copy_into_spoke_local_portfolio_task.py#L120-L122
However, if no versions are returned at this line https://github.com/awslabs/aws-service-catalog-puppet/blob/994c221d1fee8efae5fb553f74c80e6ddcd8941a/servicecatalog_puppet/workflow/portfolio/portfolio_management/copy_into_spoke_local_portfolio_task.py#L57 or EVERY version is marked to be ignored at this line https://github.com/awslabs/aws-service-catalog-puppet/blob/994c221d1fee8efae5fb553f74c80e6ddcd8941a/servicecatalog_puppet/workflow/portfolio/portfolio_management/copy_into_spoke_local_portfolio_task.py#L76
then the lines below
will never be true and the "ProductId" of 'True' stored in products_requiring_adding_to_portfolio
will remain when the below line finally gets called:
Phew! Apologies for all the snippets, explaining logic flows over gh issues is never fun :) The snippets are from the current version but the same or similar logic existed in v246 (the version in use showing this issue) just on different lines. I'm not sure on the best approach to resolve within puppet but trying to ensure products have at least one relevant version to copy should help resolve when using puppet.
Are @vasindran and @peteawood from the same company? From @vasindran report it appears the portfolio has products and they are not marked as ignored but maybe @peteawood has more details?
@vasindran could you email me your log files please.
@peteawood thanks for diving deep into this. Are you affected by this issue also? It was a design decision made back when the project started as portfolios had to have a provisioning artifact.
Sorry, should have added more context - yes same company.
And yes, the portfolio has products but most of them, in regions other than our primary, have only Version 1 with a name of "-" which I think is what's causing the issue as
indicates such products, whilst present in the Portfolio, essentially have no valid versions that execute the required logic to replace the 'True' value.
Just to clarify - you are unable to share a portfolio that has no valid/active products and you would like to?
Not quite. Within our primary region, the portfolio's products are all active with valid versions. The portfolio has been copied to our secondary region but (currently) only a subset of the products have valid versions. The products which only have the placeholder version are causing the failure and preventing the active products from being copied to the spoke in the secondary region.
We would like for the portfolio to be shared with the active products even though inactive/invalid products are in the same portfolio. We would expect the invalid/inactive products would not be shared.
However, if that's not possible, or you see that as an undesirable implementation then we could also accept that we simply need to ensure that products should not exist in the portfolio until valid.
The only use case for this I could think of is when products are first created by Factory, I think they appear in a portfolio with just a placeholder version until they are developed further. With a scheduled run of puppet this could prevent sharing working until the first valid version is added.
its just creating empty portfolio, but no products shared
Originally posted by @vasindran in https://github.com/awslabs/aws-service-catalog-puppet/issues/722#issuecomment-2379196931