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

UHF-8636: debug page item for indexed items #121

Closed
wants to merge 10 commits into from

Conversation

rpnykanen
Copy link
Contributor

@rpnykanen rpnykanen commented Jul 18, 2023

UHF-8636

Allow showing SearchApi index status on dashboard

How to install

Select one of the environments with elasticsearch set up (Kasko for example)
You should also test this with a site without searchapi enabled to make sure nothing breaks.

  • Make sure your instance is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Update the Helfi api base
    • composer require drupal/helfi_api_base:dev-UHF-8636_index_debug
  • Run make drush-updb drush-cr

How to test

  • Go to see the api result from /api/v1/debug
  • You should see helfi_search_api_index key within the result
    • The message for the index should tell you to run the indexing or rebuild the index.
  • Go to /admin/config/search/search-api
    • Select an active index and click the name (for example School in kasko)
  • Click Rebuild tracking information
    • Go to see the api result. You should see the same message
  • Now go and run only 1 batch of 50 items
    • Go to see the api result. You should see the amount of items indexed, for example (50/134000)
  • Now go and run the full indexing
    • Go to see the api result. You should see a message telling you that Index up to date.

Test this with any other site without elasticsearch (kuva?). Open the api search result and you should see it.
Also open debug page and see that it works as well.

Other PRs

@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2023

Codecov Report

Merging #121 (193700e) into main (82ee1db) will decrease coverage by 1.18%.
The diff coverage is 15.00%.

❗ Current head 193700e differs from pull request most recent head 25a5397. Consider uploading reports for the commit 25a5397 to get more accurate results

@@             Coverage Diff              @@
##               main     #121      +/-   ##
============================================
- Coverage     64.19%   63.01%   -1.18%     
- Complexity      464      477      +13     
============================================
  Files            65       66       +1     
  Lines          1631     1671      +40     
============================================
+ Hits           1047     1053       +6     
- Misses          584      618      +34     
Files Changed Coverage Δ
src/Plugin/DebugDataItem/SearchApiIndex.php 15.00% <15.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@tuutti tuutti left a comment

Choose a reason for hiding this comment

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

This needs a simple test as well, especially the conditional construction logic. See https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/blob/main/tests/src/Unit/ComposerDataItemTest.php for example

*
* @var null
*/
protected $clientManager = NULL;
Copy link
Member

Choose a reason for hiding this comment

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

Missing property type

*
* @var null
*/
protected $clusterManager = NULL;
Copy link
Member

Choose a reason for hiding this comment

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

Missing property type.

@tuutti
Copy link
Member

tuutti commented Aug 9, 2023

Nevermind. We should move this to helfi_react_search module.

See City-of-Helsinki/drupal-helfi-platform-config#564

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.

3 participants