Skip to content
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

#1242562 [Elasticsearch] Prevent automatic ES requests during model A… #546

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

rbayet
Copy link
Collaborator

@rbayet rbayet commented Jul 19, 2023

…PI calls

API Platform's Elasticsearch bridge data providers are enabled by default because they look for an "elasticsearch" boolean property and if it is missing, they consider to valued to "true".

This patch reverts the logic: the data providers ared used only if the property is present.

@github-actions github-actions bot added the backend PR targets backend application label Jul 19, 2023
@rbayet rbayet force-pushed the fix-1242562-ES-requests-during-API-calls branch from 3e6889c to ca808db Compare July 19, 2023 06:18
@botisSmile botisSmile force-pushed the fix-1242562-ES-requests-during-API-calls branch from ca808db to ada18d7 Compare July 20, 2023 13:58
@github-actions
Copy link

github-actions bot commented Jul 20, 2023

Coverage report for commit: a85ec72
File: api/coverage/coverage.xml

Summary - Lines: 85.12% 🔽 | Methods: 84.62% 🔽
FilesLinesMethodsBranches
/api/vendor/gally/gally-standard
   .php-cs-fixer.dist.php---
/api/vendor/gally/gally-standard/src/Analysis/Service
   Config.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Bundle/DataProvider
   ExtraBundleDataProvider.php87.50%66.67%-
/api/vendor/gally/gally-standard/src/Cache/Command
   ClearAllCommand.php---
   ClearTagsCommand.php---
   CreateCacheObjectCommand.php---
/api/vendor/gally/gally-standard/src/Cache/EventSubscriber
   AddProxyCacheTagsSubscriber.php87.50%66.67%-
   ResponseSubscriber.php83.33%50.00%-
/api/vendor/gally/gally-standard/src/Cache/Service
   CacheManager.php60.87%16.67%-
   ProxyCacheManager.php93.33%66.67%-
/api/vendor/gally/gally-standard/src/Catalog/DataPersister
   LocalizedCatalogDataPersister.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Catalog/DataProvider/Source
   LocalizedCatalogGroupOptionDataProvider.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Catalog/Exception
   NoCatalogException.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Catalog/Filter
   LocalizedCatalogLocaleFilter.php---
/api/vendor/gally/gally-standard/src/Catalog/Model
   Catalog.php55.56%77.78%-
   LocalizedCatalog.php91.30%92.86%-
/api/vendor/gally/gally-standard/src/Catalog/Repository
   CatalogRepository.php100.00%100.00%-
   LocalizedCatalogRepository.php77.27%75.00%-
/api/vendor/gally/gally-standard/src/Catalog/Service
   DefaultCatalogProvider.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/Controller
   CategoryConfigurationGet.php82.35%50.00%-
   CategoryProductPositionGet.php100.00%100.00%-
   CategoryProductPositionSave.php100.00%100.00%-
   GetCategoryTree.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/DataProvider
   CategorySortingOptionDataProvider.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/Decoration
   SyncCategoryDataAfterBulk.php100.00%100.00%-
   SyncCategoryDataAfterBulkDelete.php100.00%100.00%-
   SyncCategoryDataAfterBulkDeleteRest.php100.00%100.00%-
   SyncCategoryDataAfterBulkRest.php100.00%100.00%-
   SyncCategoryDataAfterInstall.php100.00%100.00%-
   SyncCategoryDataAfterInstallRest.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/EventSubscriber
   ReindexPosition.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/Exception
   SyncCategoryException.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/Model
   Category.php100.00%100.00%-
   CategoryTree.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/Model/Category
   Configuration.php100.00%100.00%-
   ProductMerchandising.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/OpenApi
   CategoryDecorator.php22.22%50.00%-
/api/vendor/gally/gally-standard/src/Category/Repository
   CategoryConfigurationRepository.php88.46%76.92%-
   CategoryProductMerchandisingRepository.php100.00%100.00%-
   CategoryRepository.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/Repository/CategoryProductPositionIndexer
   CategoryProductPositionIndexerRepository.php85.71%50.00%-
/api/vendor/gally/gally-standard/src/Category/Resolver
   CategoryTreeResolver.php100.00%100.00%-
   ConfigurationResolver.php94.44%50.00%-
   PositionGetResolver.php100.00%100.00%-
   PositionSaveResolver.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Category/Service
   CategoryProductPositionManager.php95.45%85.71%-
   CategoryProductsSortingOptionsProvider.php77.27%66.67%-
   CategorySynchronizer.php100.00%100.00%-
   CategoryTreeBuilder.php98.33%80.00%-
   CurrentCategoryProvider.php85.71%66.67%-
/api/vendor/gally/gally-standard/src/Category/Validator
   DefaultSortingFieldConstraintValidator.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Configuration/DataProvider
   ConfigurationDataProvider.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/DependencyInjection
   Configuration.php---
   Extension.php---
   GallyExtension.php---
   GenericFactory.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Entity/Constant
   SourceFieldAttributeMapping.php---
/api/vendor/gally/gally-standard/src/Entity/Filter
   BooleanFilter.php30.00%50.00%-
   RangeFilterWithDefault.php5.77%50.00%-
   SearchColumnsFilter.php96.00%--
   SearchFilterWithDefault.php6.25%50.00%-
   VirtualSearchFilter.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Entity/GraphQl/Type/Definition/Filter
   AbstractFilter.php94.59%90.91%-
   BoolFilterInputType.php100.00%100.00%-
   BoolTypeFilterInputType.php100.00%100.00%-
   CategoryTypeDefaultFilterInputType.php100.00%100.00%-
   DateTypeFilterInputType.php56.67%66.67%-
   EntityFilterInterface.php---
   FloatTypeFilterInputType.php100.00%100.00%-
   IntegerTypeFilterInputType.php46.88%75.00%-
   PriceTypeDefaultFilterInputType.php95.83%80.00%-
   SelectTypeDefaultFilterInputType.php100.00%100.00%-
   StockTypeDefaultFilterInputType.php100.00%100.00%-
   TextTypeFilterInputType.php71.43%66.67%-
/api/vendor/gally/gally-standard/src/Entity/Model/Attribute
   AttributeFactory.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Entity/Model/Attribute/Type
   AbstractAttribute.php100.00%100.00%-
   AbstractStructuredAttribute.php88.89%66.67%-
   BooleanAttribute.php85.71%50.00%-
   CategoryAttribute.php100.00%100.00%-
   FloatAttribute.php85.71%50.00%-
   IntAttribute.php85.71%50.00%-
   NestedAttribute.php100.00%100.00%-
   PriceAttribute.php100.00%100.00%-
   SelectAttribute.php100.00%100.00%-
   StockAttribute.php100.00%100.00%-
   TextAttribute.php88.89%50.00%-
/api/vendor/gally/gally-standard/src/Entity/Model/Doctrine
   QueryBuilder.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Entity/Service
   PriceGroupProvider.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Example/Command/Cache
   DeleteCommand.php---
   GetCommand.php---
   GetCustomCommand.php---
   GetOtherCommand.php---
   InvalidateTagsCommand.php---
   InvalidateTagsInjectedCommand.php---
/api/vendor/gally/gally-standard/src/Exception
   LogicException.php---
/api/vendor/gally/gally-standard/src/Fixture/Service
   ElasticsearchFixtures.php16.33%30.00%-
   EntityIndicesFixtures.php54.55%50.00%-
/api/vendor/gally/gally-standard/src
   GallyBundle.php---
/api/vendor/gally/gally-standard/src/GraphQl/Decoration/Resolver/Stage
   ReadStage.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/GraphQl/Decoration/Serializer
   SerializerContextBuilder.php94.74%66.67%-
/api/vendor/gally/gally-standard/src/GraphQl/Decoration/Type
   RenameGraphQlQuery.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Hydra/Decoration/Serializer
   DocumentationNormalizer.php92.98%60.00%-
/api/vendor/gally/gally-standard/src/Index/Command
   IndexClearCommand.php---
   MappingGenerateCommand.php---
   MappingStatusCommand.php---
/api/vendor/gally/gally-standard/src/Index/Controller
   RemoveIndexDocument.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Index/Converter/SourceField
   BasicSourceFieldConverter.php100.00%100.00%-
   CategorySourceFieldConverter.php100.00%100.00%-
   ImageSourceFieldConverter.php100.00%100.00%-
   ObjectSourceFieldConverter.php50.00%50.00%-
   PriceSourceFieldConverter.php100.00%100.00%-
   ReferenceSourceFieldConverter.php100.00%100.00%-
   SelectSourceFieldConverter.php100.00%100.00%-
   StockSourceFieldConverter.php100.00%100.00%-
   TextSourceFieldConverter.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Index/DataPersister
   DocumentDataPersister.php83.33%75.00%-
   IndexDataPersister.php71.43%75.00%-
/api/vendor/gally/gally-standard/src/Index/DataProvider
   IndexDataProvider.php100.00%100.00%-
   MappingStatusDataProvider.php83.33%75.00%-
/api/vendor/gally/gally-standard/src/Index/DataTransformer
   CreateIndexInputDataTransformer.php73.68%33.33%-
   InstallIndexDataTransformer.php100.00%100.00%-
   RefreshIndexDataTransformer.php100.00%100.00%-
   SelfReIndexDataTransformer.php85.71%66.67%-
/api/vendor/gally/gally-standard/src/Index/Decoration/Metadata/Document/Factory
   AttributeDocumentMetadataFactory.php9.52%50.00%-
/api/vendor/gally/gally-standard/src/Index/Dto/Bulk
   Request.php100.00%100.00%-
   Response.php81.48%57.14%-
/api/vendor/gally/gally-standard/src/Index/Model
   Index.php87.10%88.24%-
   IndexDocument.php55.56%60.00%-
/api/vendor/gally/gally-standard/src/Index/Model/Index
   Mapping.php97.37%91.67%-
   SelfReindex.php77.78%80.00%-
/api/vendor/gally/gally-standard/src/Index/Model/Index/Mapping
   Field.php93.41%86.36%-
   Status.php100.00%100.00%-
/api/vendor/gally/gally-standard/src/Index/MutationResolver
   BulkDeleteIndexMutation.php100.00%100.00%-
   BulkIndexMutation.php96.55%75.00%-
   CreateIndexMutation.php68.75%50.00%-
Table truncated to fit comment

Backend Coverage compared to target branch

@github-actions
Copy link

github-actions bot commented Jul 20, 2023

Frontend Coverage of this branch

File Coverage
All files 24%
src/components/App/App.tsx 0%
src/components/Facets/Facet.styled.ts 0%
src/components/Facets/Facet.tsx 0%
src/components/Facets/FacetBoolean.tsx 0%
src/components/Facets/FacetCategory.tsx 0%
src/components/Facets/FacetChoice.tsx 0%
src/components/Facets/FacetLoadMore.tsx 0%
src/components/Facets/FacetSlider.tsx 0%
src/components/Facets/Facets.tsx 0%
src/components/Header/Header.tsx 58%
src/components/Layout/Layout.tsx 0%
src/components/Menu/Menu.tsx 0%
src/components/Menu/MenuItem.tsx 0%
src/components/Menu/MenuList.tsx 0%
src/components/PageLayout/PageLayout.tsx 0%
src/components/PageTitle/PageTitle.tsx 0%
src/components/Products/ProductCard.tsx 0%
src/components/Products/Products.tsx 0%
src/components/Providers/AppProvider/AppProvider.tsx 0%
src/components/Providers/CatalogProvider/CatalogProvider.tsx 0%
src/components/Providers/CategoryProvider/CategoryProvider.tsx 0%
src/components/Providers/ConfigurationsProvider/ConfigurationsProvider.tsx 0%
src/components/Providers/SchemaProvider/SchemaProvider.tsx 0%
src/components/Providers/SchemaProvider/RequestedPathProvider/RequestedPathProvider.tsx 0%
src/components/Providers/SearchProvider/SearchProvider.tsx 0%
src/components/Providers/UserProvider/UserProvider.tsx 0%
src/components/SearchBar/SearchBar.tsx 0%
src/components/Title/Title.tsx 0%
src/components/TwoColsLayout/TwoColsLayout.tsx 0%
src/hooks/index.ts 0%
src/hooks/useApi.ts 84%
src/hooks/useGraphql.ts 89%
src/hooks/useProducts.ts 53%
src/hooks/useUser.ts 95%
src/pages/Category/Category.tsx 0%
src/pages/Homepage/Homepage.tsx 0%
src/pages/Login/Login.tsx 0%
src/pages/Search/Search.tsx 0%

Minimum allowed coverage is 1%

Generated by 🐒 cobertura-action against a85ec72

@rbayet rbayet force-pushed the fix-1242562-ES-requests-during-API-calls branch from ada18d7 to 8e1f7ab Compare July 21, 2023 09:04
@github-actions github-actions bot added frontend PR targets frontend application pwa PR targets the pwa application labels Jul 21, 2023
@rbayet rbayet changed the base branch from 1.0.x to master July 21, 2023 09:05
@rbayet rbayet assigned rbayet and unassigned rbayet Jul 21, 2023
@rbayet rbayet requested a review from botisSmile July 21, 2023 09:08
@rbayet rbayet force-pushed the fix-1242562-ES-requests-during-API-calls branch from 8e1f7ab to a85ec72 Compare July 24, 2023 08:05
@github-actions github-actions bot removed frontend PR targets frontend application pwa PR targets the pwa application labels Jul 24, 2023
@rbayet rbayet merged commit e14ecd8 into master Jul 24, 2023
4 checks passed
@rbayet rbayet deleted the fix-1242562-ES-requests-during-API-calls branch July 24, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend PR targets backend application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants