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

MODFQMMGR-76: Periodically refresh materialized views #72

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Conversation

bvsharp
Copy link
Collaborator

@bvsharp bvsharp commented Nov 7, 2023

Purpose

Refresh materialized views to address MODFQMMGR-76

Testing

  • All unit tests passed
  • Tenant can be onboarded with no errors
  • Materialized views are refreshed periodically

@bvsharp bvsharp changed the base branch from master to b1.0 November 7, 2023 17:25
@bvsharp bvsharp marked this pull request as ready for review November 7, 2023 19:58
import static org.mockito.Mockito.*;

@ExtendWith(MockitoExtension.class)
class MaterializedViewRefreshRepositoryTest {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I figured that since the logic for this is so simple, we really only need to ensure that the SQL that gets executed is what we expect, and thus could just use Mockito for this (rather than the docker test-db stuff).

@@ -144,6 +155,12 @@
"description": "Run a query synchronously and get results",
"visible": true
},
{
"permissionName": "fqm.materializedViews.post",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: this permission (along with fqm.query.purge) is not part of fqm.query.all

@@ -91,6 +96,12 @@
"pathPattern": "/query/purge",
"unit": "hour",
"delay": "1"
},
{
"methods": [ "POST" ],
Copy link
Contributor

@kjain110 kjain110 Nov 7, 2023

Choose a reason for hiding this comment

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

small thing, we can remove the spaces before and after (opening and ending) of ""

@bvsharp bvsharp force-pushed the MODFQMMGR-76 branch 2 times, most recently from 0859098 to 8f5e292 Compare November 8, 2023 13:39
Copy link

sonarcloud bot commented Nov 8, 2023

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
No Duplication information No Duplication information

@bvsharp bvsharp merged commit 913719a into b1.0 Nov 8, 2023
8 checks passed
@@ -1,6 +1,6 @@
{
"id": "@artifactId@-@version@",
"name": "The module descriptor for mod-fqm-manager.",
"name": "FQM Manager Module",
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️
This drives me nuts every time I look at the list of installed modules in any environment 🙂

Comment on lines +47 to +59
/materialized-views/refresh:
post:
operationId: refreshMaterializedViews
tags:
- materializedViews
description: Refresh all materialized views for a tenant.
responses:
'204':
description: 'Views refreshed'
'400':
$ref: '#/components/responses/badRequestResponse'
'500':
$ref: '#/components/responses/internalServerErrorResponse'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for putting this here :) I meant to say something about it definitely not going in folio-query-tool-metadata (since that would put it in the edge module, too), and totally forgot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants