Skip to content

Test link expansion inclusion rules with truth tables (reverse links)#3915

Merged
nacnudus merged 1 commit intomainfrom
reverse-link-expansion-inclusion-tests
Mar 9, 2026
Merged

Test link expansion inclusion rules with truth tables (reverse links)#3915
nacnudus merged 1 commit intomainfrom
reverse-link-expansion-inclusion-tests

Conversation

@nacnudus
Copy link
Contributor

@nacnudus nacnudus commented Mar 2, 2026

Note: this only covers reverse links. Direct links will be done separately (see #3886).

This exhaustively tests the simplest case of link expansion, when there is a single candidate link to be included in a Content Store or GraphQL response. The simplicity makes it possible to test all possible combinations of properties of link sources and targets.

This differs from other tests because it specifically checks whether a link should be included, whereas other tests only check whether GraphQL does the same thing as classic link expanion, whether that's correct or not.

Drafts are currently only tested for classic link expansion. Once GraphQL supports drafts, a minor change to these tests will test GraphQL's link expansion too.

The more complex scenario, not addressed here, is when there are several candidate links. Precedence determines which of the candidates are expanded. But for a link to be considered for precedence, it must already pass the inclusion rules tested in this PR.

@nacnudus nacnudus force-pushed the reverse-link-expansion-inclusion-tests branch from 8244bb2 to 177160b Compare March 2, 2026 11:26
Copy link
Contributor

@mike3985 mike3985 left a comment

Choose a reason for hiding this comment

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

The same suggested change applies for this as I made for #3886.

Otherwise, I'm happy that this makes sense and offers us some value. Let's see how we get on with it 👍

Note: this only covers reverse links. Direct links will be done
separately (see #3886).

This exhaustively tests the simplest case of link expansion, when there
is a single candidate link to be included in a Content Store or GraphQL
response. The simplicity makes it possible to test all possible
combinations of properties of link sources and targets.

This differs from other tests because it specifically checks whether
a link should be included, whereas other tests only check whether
GraphQL does the same thing as classic link expanion, whether that's
correct or not.

Drafts are currently only tested for classic link expansion. Once
GraphQL supports drafts, a minor change to these tests will test
GraphQL's link expansion too.

The more complex scenario, not addressed here, is when there are several
candidate links. Precedence determines which of the candidates are
expanded. But for a link to be considered for precedence, it must
already pass the inclusion rules tested in this PR.
@nacnudus nacnudus force-pushed the reverse-link-expansion-inclusion-tests branch from 177160b to 7abfcc4 Compare March 8, 2026 19:44
@nacnudus nacnudus merged commit cdfed25 into main Mar 9, 2026
17 checks passed
@nacnudus nacnudus deleted the reverse-link-expansion-inclusion-tests branch March 9, 2026 10:02
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