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

COMMERCE-12776 test fix pr - DO NOT MERGE #6

Open
wants to merge 10,000 commits into
base: master
Choose a base branch
from

Conversation

baharturk
Copy link
Owner

I collected some of the changes that apply to some macros and tests required for COMMERCE-12776.

michaelhashimoto and others added 30 commits November 28, 2023 10:43
# breaking

## What modules/apps/object/object-admin-rest-impl/rest-openapi.yaml

The objectField property was added to the ObjectRelationship schema.

## Why

this change is required to allow exporting the object field along with the one-to-one or one-to-many object relationship that it is associated to.

----
# breaking

## What modules/apps/object/object-service/src/main/java/com/liferay/object/service/impl/ObjectRelationshipLocalServiceImpl.java

The objectField parameter was added to the addObjectRelationship and updateObjectRelationship methods in ObjectRelationshipLocalService

## Why

this change is required to allow these methods to set the provided properties on the object field that is created when an object relationship of type one-to-many or one-to-one is created.

----

# breaking

## What modules/apps/object/object-service/src/main/java/com/liferay/object/service/impl/ObjectRelationshipServiceImpl.java

The objectField parameter was added to the addObjectRelationship and updateObjectRelationship methods in ObjectRelationshipService

## Why

this change is required to allow these methods to set the provided properties on the object field that is created when an object relationship of type one-to-many or one-to-one is created.

----
# breaking

## What modules/apps/object/object-service/src/main/java/com/liferay/object/model/impl/ObjectRelationshipImpl.java

The compareType method was added to ObjectRelationship

## Why

This change was added to allow for code reuse

----
…ield

# breaking

## What modules/apps/object/object-service/src/main/java/com/liferay/object/service/impl/ObjectFieldLocalServiceImpl.java

The validateExternalReferenceCode, validateRequired and validateReadOnlyAndReadOnlyConditionExpression were made public and added to the ObjectFieldLocalService

## Why

this change is needed in order to use the the object field validation logic when creating the relationship field for one-to-many or one-to-one relationships.

----
improve the performance of the update queries that this upgrade process
will run.

Please note: I put the "segmentsExperienceId" and "plid" columns in an
inconsistent order on purpose.

For the FragmentEntryLink table, I concluded that (segmentsExperienceId,
plid) is the optimal order for the index, because there is only one
query on that table, and its WHERE clause looks like
"segmentsExperienceId = ? and (plid = ? or plid = ?)". So, having
segmentsExperienceId come first means that it only has to do 3 binary
searches instead of the 4 it would have to do if plid came first.

However, for the SegmentsExperience table, I concluded that (plid,
segmentsExperienceId) was the optimal order for the index, because there
are two queries on this table (one is actually a subquery of a larger
query on a different table). One of those queries is similar to the
FragmentEntryLink query. However, the other one only queries by plid (it
does not take segmentsExperienceId) into account at all. So, it's better
to put plid first here so that we don't have to do n binary searches,
where n is the number of distinct segmentsExperienceIds.

If you must put them in a consistent order, then please put them both in
the order (plid, segmentsExperienceId), since I think the difference
between the two is pretty negligible for the FragmentEntryLink table,
but could be substantial for the SegmentsExperienceTable if there are a
lot of distinct segmentsExperienceIds.
4lejandrito and others added 29 commits November 29, 2023 15:57
@liferay-continuous-integration
Copy link
Collaborator

To conserve resources, the PR Tester does not automatically run for every pull.

If your code changes were already tested in another pull, reference that pull in this pull so the test results can be analyzed.

If your pull was never tested, comment "ci:test" to run the PR Tester for this pull.

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.