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

XWIKI-22681: Provide a relative ResourceReferenceEntityReferenceResolver #3673

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

surli
Copy link
Member

@surli surli commented Nov 22, 2024

Jira URL

https://jira.xwiki.org/browse/XWIKI-22681

TODO

  • Add missing tests for Page/PageAttachment resources

Changes

Description

  • Provide implementation for a RelativeResourceReferenceEntityReferenceResolver
  • Resolution of untyped document references is closely related to resolution performed by the default resolver, except when it's not possible to have info about the parent. We need to ensure we agree on this implem. Note that it also impacts resolution of attachment resources.

Clarifications

Screenshots & Video

Executed Tests

Run mvn clean install -Pquality on module xwiki-platform-rendering-xwiki. Now this component implem is used for #3654 so integration tests are executed in that one.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • 16.10.x since we need that to fix XWIKI-22571

@tmortagne
Copy link
Member

The relations between the relative and absolute versions of EntityReferenceResolver<ResourceReference> seems to be messy. One seems to extend the other, but at the same time duplicate a lot of things that don't seem to really have a different logic. Feels like you should do stuff like introduce a AbstractAbsoluteResourceReferenceEntityReferenceResolver which extends AbstractResourceReferenceEntityReferenceResolver (like AbstractRelativeResourceReferenceEntityReferenceResolver) and distribute a bit better the differences between the relative and the absolute logic.

@surli surli self-assigned this Dec 3, 2024
@surli surli merged commit 65acde0 into master Dec 10, 2024
1 check passed
@surli surli deleted the XWIKI-22681 branch December 10, 2024 08:51
Copy link

The backport to stable-16.10.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-stable-16.10.x stable-16.10.x
# Navigate to the new working tree
cd .worktrees/backport-stable-16.10.x
# Create a new branch
git switch --create backport-3673-to-stable-16.10.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 65acde038d0b0cddb9a7012e0a29e6bcae852c83
# Push it to GitHub
git push --set-upstream origin backport-3673-to-stable-16.10.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-stable-16.10.x

Then, create a pull request where the base branch is stable-16.10.x and the compare/head branch is backport-3673-to-stable-16.10.x.

surli added a commit that referenced this pull request Dec 10, 2024
surli added a commit that referenced this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants