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

#1830 - Institution Student Authorization Part 2 #1915

Merged
merged 16 commits into from
May 3, 2023

Conversation

dheepak-aot
Copy link
Collaborator

@dheepak-aot dheepak-aot commented May 2, 2023

Enable Typeorm Cache with Redis

  • Enabled typeorm cache with redis. Configurations created to support redis standalone and redis cluster.
    Ref: https://github.com/typeorm/typeorm/blob/master/docs/caching.md
  • Default Cache lifetime is set using a constant across the application.
  • E2E test scenarios added to cover the authorization of only BC Public institutions and BC Public institutions who has access to the student data for all the controllers related.

@dheepak-aot dheepak-aot self-assigned this May 2, 2023
@dheepak-aot dheepak-aot marked this pull request as ready for review May 2, 2023 20:00
Copy link
Contributor

@ann-aot ann-aot left a comment

Choose a reason for hiding this comment

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

Good work @dheepak-aot . added some minor comments. I have qn, so, do we have a ticket to add cache to other queries too?

@dheepak-aot
Copy link
Collaborator Author

dheepak-aot commented May 3, 2023

Good work @dheepak-aot . added some minor comments. I have qn, so, do we have a ticket to add cache to other queries too?

We do not have a ticket for that so far. Probably we can discuss during our upcoming dev sync up and create as we have other things to discuss about the cache to other queries.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Great work enabling the ORM cache. Please take a look at the comments.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 3, 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
0.0% 0.0% Duplication

@github-actions
Copy link

github-actions bot commented May 3, 2023

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 18.17% ( 2014 / 11084 )
Methods: 8.37% ( 120 / 1433 )
Lines: 20.92% ( 1762 / 8422 )
Branches: 10.74% ( 132 / 1229 )

@github-actions
Copy link

github-actions bot commented May 3, 2023

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 32.41% ( 176 / 543 )
Methods: 21.25% ( 17 / 80 )
Lines: 39.25% ( 157 / 400 )
Branches: 3.17% ( 2 / 63 )

@github-actions
Copy link

github-actions bot commented May 3, 2023

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 68.32% ( 371 / 543 )
Methods: 57.97% ( 40 / 69 )
Lines: 70.47% ( 327 / 464 )
Branches: 40% ( 4 / 10 )

@@ -140,3 +140,9 @@ export async function authorizeUserTokenForLocation(
InstitutionUserTypes.user,
);
}

export const INSTITUTION_BC_PUBLIC_ERROR_MESSAGE =
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am ok to keep those here. I was just having second thoughts if we should move or not to a constant file.
Either way, I would be good with 😉

@github-actions
Copy link

github-actions bot commented May 3, 2023

E2E SIMS API Coverage Report

Totals Coverage
Statements: 40.02% ( 2736 / 6836 )
Methods: 32.96% ( 293 / 889 )
Lines: 45.31% ( 2310 / 5098 )
Branches: 15.67% ( 133 / 849 )

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Thanks for doing the changes, great start enabling the cache. Let's ensure that we have a ticket created to enable the cache for other areas like, as we talked about, the DB methods on the jwt.strategy.ts file. Looks good 👍

Copy link
Contributor

@ann-aot ann-aot left a comment

Choose a reason for hiding this comment

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

Thanks for doing the changes 👍 LGTM

Copy link
Collaborator

@andrepestana-aot andrepestana-aot left a comment

Choose a reason for hiding this comment

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

LGTM!

@dheepak-aot dheepak-aot merged commit db50593 into main May 3, 2023
@dheepak-aot dheepak-aot temporarily deployed to DEV May 3, 2023 17:12 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot temporarily deployed to DEV May 3, 2023 17:13 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot temporarily deployed to DEV May 3, 2023 17:22 — with GitHub Actions Inactive
@dheepak-aot dheepak-aot deleted the typeorm/caching-with-redis branch May 4, 2023 16:44
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.

4 participants