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

chore(performance): use subresources & uriTemplate property #4968

Merged
merged 15 commits into from May 15, 2024

Conversation

usu
Copy link
Member

@usu usu commented Apr 14, 2024

Reopening #4940
in order to test the fix on api-platform api-platform/core#6313

@usu usu added the deploy! Creates a feature branch deployment for this PR label Apr 14, 2024
Copy link

github-actions bot commented Apr 14, 2024

Feature branch deployment currently inactive.

If the PR is still open, you can add the deploy! label to this PR to trigger a feature branch deployment.

@usu usu marked this pull request as ready for review April 29, 2024 16:37
@BacLuc BacLuc added the api-performance-test! Run API Performance test label Apr 29, 2024
@usu usu requested a review from pmattmann April 30, 2024 20:37
@usu usu temporarily deployed to feature-branch May 4, 2024 19:29 — with GitHub Actions Inactive
@usu usu temporarily deployed to feature-branch May 5, 2024 05:20 — with GitHub Actions Inactive
@usu
Copy link
Member Author

usu commented May 5, 2024

@BacLuc: Now that we merged api-platform 3.3, I also enabled link security. Users without access to the parent object now receive a 404 instead of an empty list (similar as already implemented in #3610).

Just in case, you want to have another look at it.

This means, we now don't rely on FilterByCurrentUserExtension anymore for this subresource routes. We could look into the option of disabling the extension for these routes, if it gives some performance boost. I suggest this would be a separate PR.

@usu usu temporarily deployed to feature-branch May 5, 2024 06:24 — with GitHub Actions Inactive
Comment on lines +74 to +75
$this->assertEquals("/periods/{$period2->getId()}/days", $responseArray['_embedded']['periods'][0]['_links']['days']['href']);
$this->assertEquals("/periods/{$period1->getId()}/days", $responseArray['_embedded']['periods'][1]['_links']['days']['href']);
Copy link
Member

Choose a reason for hiding this comment

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

Is the order of these two periods in the response guaranteed? Or should you use $this->assertEqualsCanonicalizing here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines 32 to 34
new GetCollection(
security: 'is_authenticated()'
),
Copy link
Member

Choose a reason for hiding this comment

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

As far as I see, you added the new GetCollections, but also kept the old, unfiltered ones everywhere. Shouldn't we switch to the new endpoints completely where possible? I think performance-wise we also found out that it doesn't make sense to fetch e.g. all schedule entries across all accessible camps, so this would enable us to disallow fetching the unfiltered collection, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd agree, that eventually, we should remove the unfiltered GetCollection (if everyone else agrees as well).

However, some additional works is necessary.

DayResponsibles is also linked from

  • CampCollaboration
  • Period

ScheduleEntry is also linked from

  • Activity
  • Day

Day is not linked from any other entity in the backend, but in the frontend we use the /days endpoint to load all days of a camp.

Overall, I'd vote for keeping this PR limited to introducing subresources as a concept. And further down the road, as we introduce more subresources we can (carefully) start to remove the main GetCollection endpoints.

@BacLuc BacLuc added the test-flaky-e2e! Add this label to a PR to run e2e tests multiple times label May 10, 2024
@usu usu mentioned this pull request May 13, 2024
9 tasks
@usu usu added the Meeting Discuss Am nächsten Core-Meeting besprechen label May 15, 2024
@usu usu temporarily deployed to feature-branch May 15, 2024 17:42 — with GitHub Actions Inactive
@manuelmeister
Copy link
Member

Core Meeting Decision

We want to replace our filters with sub resources where ever we can.

@usu usu removed the Meeting Discuss Am nächsten Core-Meeting besprechen label May 15, 2024
@usu usu enabled auto-merge May 15, 2024 19:03
@usu usu added this pull request to the merge queue May 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 15, 2024
@usu usu removed test-flaky-e2e! Add this label to a PR to run e2e tests multiple times api-performance-test! Run API Performance test labels May 15, 2024
@usu usu enabled auto-merge May 15, 2024 19:39
@usu usu added this pull request to the merge queue May 15, 2024
Merged via the queue into ecamp:devel with commit 439746e May 15, 2024
144 of 148 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy! Creates a feature branch deployment for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants