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

MODOKAPFAC-3: implementation of GET tenant interfaces endpoint #5

Merged
merged 20 commits into from
Aug 27, 2024

Conversation

mykolam-epm
Copy link
Contributor

@mykolam-epm mykolam-epm commented Aug 22, 2024

Purpose

Implementation of GET /_/proxy/<tenant name>/interfaces endpoint

Pre-Merge Checklist:

Before merging this PR, please go through the following list and take appropriate actions.

  • Does this PR meet or exceed the expected quality standards?
    • Code coverage on new code is 80% or greater
    • Duplications on new code is 3% or less
    • There are no major code smells or security issues
  • Does this introduce breaking changes?
    • Were any API paths or methods changed, added, or removed?
    • Were there any schema changes?
    • Did any of the interface versions change?
    • Were permissions changed, added, or removed?
    • Are there new interface dependencies?
    • There are no breaking changes in this PR.

If there are breaking changes, please STOP and consider the following:

  • What other modules will these changes impact?
  • Do Rally stories exist to update the impacted modules?
    • If not, please create them
    • Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
    • Do they have all the appropriate links to blocked/related issues?
  • Are the Rally stories under active development?
    • If not, contact the project's PO and make sure they're aware of the urgency.
  • Do PRs exist for these changes?
    • If so, have they been approved?

Ideally, all the PRs involved in breaking changes would be merged on the same day to avoid breaking the folio-testing
environment. Communication is paramount if that is to be achieved, especially as the number of inter-module and
inter-team dependencies increase.

While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the
responsibility of the PR assignee.

@mykolam-epm mykolam-epm requested a review from a team as a code owner August 22, 2024 08:47
@folio-org folio-org deleted a comment from sonarqubecloud bot Aug 22, 2024
Copy link

@pfilippov-epam pfilippov-epam left a comment

Choose a reason for hiding this comment

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

Looks good, except few things:

  1. Naming of clients\configurations: from my viewpoint, it should be like MgrTenantEntitlementsClient | MgrTenantEntitlementsClientConfiguration or TenantEntitlementsClientConfiguration, because ApplicationManager and TenantManager are legacy names for these components, and for old modules they could be named like that, but it's because of lack of time to make names proper.

Comment on lines +38 to +39
@Value("${application.mte.querylimit:500}") private int entitlementsQueryLimit = 500;
@Value("${application.ma.querylimit:500}") private int applicationsQueryLimit = 500;

Choose a reason for hiding this comment

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

Can be moved to configuration class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if having 2 config properties warrants a whole separate configuration class. Will degrade readability.

return interfaceDescriptors.map(!isFull ? mapper::mapSimple : mapper::map);
}

private Predicate<? super org.folio.common.domain.model.InterfaceDescriptor> getFilter(String interfaceType) {

Choose a reason for hiding this comment

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

It should be in the import section

import org.folio.common.domain.model.InterfaceDescriptor;

...
private Predicate<? super InterfaceDescriptor> ...

Copy link
Contributor Author

@mykolam-epm mykolam-epm Aug 23, 2024

Choose a reason for hiding this comment

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

No, it can't be in import section because there is already a class named InterfaceDescriptor there. We have two classes with same name - one for OKAPI compatible API, and one for Eureka-compatible API.

}

private Stream<InterfaceDescriptor> map(
Stream<org.folio.common.domain.model.InterfaceDescriptor> interfaceDescriptors, boolean isFull) {

Choose a reason for hiding this comment

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

Suggested change
Stream<org.folio.common.domain.model.InterfaceDescriptor> interfaceDescriptors, boolean isFull) {
Stream<InterfaceDescriptor> interfaceDescriptors, boolean isFull) {

Copy link
Contributor Author

@mykolam-epm mykolam-epm Aug 23, 2024

Choose a reason for hiding this comment

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

No, it can't be in import section because there is already a class named InterfaceDescriptor there. We have two classes with same name - one for OKAPI compatible API, and one for Eureka-compatible API.

… manager applications (e.g. MgrTenantsClient instead of TenantsManager).
@mykolam-epm mykolam-epm changed the title Modokapfac 3 MODOKAPFAC-3: implementation of GET tenant interfaces endpoint Aug 23, 2024
Copy link

@mykolam-epm mykolam-epm merged commit 79a0c79 into master Aug 27, 2024
4 checks passed
@dmtkachenko dmtkachenko deleted the MODOKAPFAC-3 branch August 27, 2024 09:55
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