Skip to content

Conversation

@emmachughes
Copy link
Contributor

@emmachughes emmachughes commented Sep 16, 2025

Fixes the slow query in CA that leads to a timeout when migrating the H5P.NDLAThreeImage stuff.

This is based on earlier work that was done for SaaS, hence the April date on the migrations. That work removed the content_versions table (which had data imported from versionapi) and unused collaboration code in CA (apparently these two had to be removed together). Replacing these tables are parent_id and version_purpose columns on each of the content type tables, with appropriate indexes and foreign key constraints.

The end result is that looking up the migratable resources against the modified h5p_contents now takes a few seconds on my machine, compared to around a minute prior to the change. The version lookup page in CA admin has been updated to reflect these changes.

phpstan failure is a false positive, it passes locally.

@github-actions github-actions bot added documentation Improvements or additions to documentation Component: Content Author All issues that affect content author (sourcecode/apis/contentauthor) labels Sep 16, 2025
@codecov
Copy link

codecov bot commented Sep 16, 2025

Codecov Report

❌ Patch coverage is 90.42553% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.37%. Comparing base (5cefdab) to head (9e55797).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3174      +/-   ##
============================================
+ Coverage     64.19%   68.37%   +4.17%     
+ Complexity     3325     2247    -1078     
============================================
  Files           391      209     -182     
  Lines         14497    10549    -3948     
============================================
- Hits           9307     7213    -2094     
+ Misses         5190     3336    -1854     
Components Coverage Δ
Content Author 68.37% <90.42%> (-1.29%) ⬇️
Hub ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@emmachughes emmachughes force-pushed the fix-slow-version-queries branch from 47710d5 to 1efd86e Compare September 17, 2025 10:31
@emmachughes emmachughes force-pushed the fix-slow-version-queries branch from ac3287e to afbf2e5 Compare September 17, 2025 10:48
@github-actions github-actions bot added dependencies Pull requests that update a dependency file composer Pull requests that update Composer packages labels Sep 17, 2025
@emmachughes emmachughes linked an issue Sep 17, 2025 that may be closed by this pull request
@emmachughes emmachughes marked this pull request as ready for review September 17, 2025 12:21
/**
* Used for some admin pages.
*
* @return LaravelCollection<int|string, array{
Copy link
Contributor

Choose a reason for hiding this comment

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

Does not match returned structure

@edlib-oddarne edlib-oddarne self-requested a review October 15, 2025 11:12
@tmkarlsen tmkarlsen marked this pull request as draft October 29, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Content Author All issues that affect content author (sourcecode/apis/contentauthor) composer Pull requests that update Composer packages dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fetching H5P in admin tool for migration leads to timeout

4 participants