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

Migrate remote context resolution and distage modules to Cats Effect #4361

Merged
merged 3 commits into from
Oct 12, 2023

Conversation

imsdu
Copy link
Contributor

@imsdu imsdu commented Oct 12, 2023

Fixes #4359

Vocabulary.contexts.metadata -> ContextValue.fromFile("contexts/metadata.json").accepted,
Vocabulary.contexts.error -> ContextValue.fromFile("contexts/error.json").accepted,
Vocabulary.contexts.tags -> ContextValue.fromFile("contexts/tags.json").accepted
implicit val rcr: RemoteContextResolution = RemoteContextResolution.fixedIO(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

How we load them in the tests is something we will have to improve at some point

config.sse,
xas
)(jo)
toCatsIO(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A lot of the things that we inject from the modules are resolver resolution or contexts from files in the classpath.
With my change, they are now loaded with a Cats IO and instead of changing them, I prefered to migrate the modules themselves as it is a more useful change.
So the modules that have not migrated yet, get these kind of temporary changes but we won't have to go back to those that have been migrated

@@ -28,7 +27,7 @@ object IdentitiesModule extends ModuleDef {
make[CacheConfig].from((cfg: AppConfig) => cfg.identities)

make[Identities].fromEffect { (realms: Realms, hc: HttpClient @Id("realm"), config: CacheConfig) =>
IdentitiesImpl(realms, hc, config).toUIO
Copy link
Contributor Author

@imsdu imsdu Oct 12, 2023

Choose a reason for hiding this comment

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

These go away in the migrated modules for example

shinyhappydan
shinyhappydan previously approved these changes Oct 12, 2023
)
)(implicit rcr: RemoteContextResolution): IO[Map[Iri, RemoteContext]] =
jsons.toList
.parTraverse(rcr(_))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know it's it's necessary, but an unordered traverse is available

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the toList

@imsdu imsdu merged commit bd60ed2 into BlueBrain:master Oct 12, 2023
@imsdu imsdu deleted the 4359-migrate-resolution-context-ce branch October 12, 2023 16:12
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.

Migrate RemoteContextResolution to Cats Effect
3 participants