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

fix(agama): fix agama auth dependency which blocks build process #3149

Closed
moabu opened this issue Dec 1, 2022 · 11 comments · Fixed by #3244 or #3261
Closed

fix(agama): fix agama auth dependency which blocks build process #3149

moabu opened this issue Dec 1, 2022 · 11 comments · Fixed by #3244 or #3261
Assignees
Labels
comp-agama Touching folder /agama kind-bug Issue or PR is a bug in existing functionality

Comments

@moabu
Copy link
Member

moabu commented Dec 1, 2022

Currently the process start has the auth server built before the agama which is correct . However, the dependency inside the auth blocks it to be built

[ERROR] Failed to execute goal on project jans-auth-server: Could not resolve dependencies for project io.jans:jans-auth-server:war:1.0.5: Failure to find io.jans:agama-engine:jar:1.0.5 in file:///home/jetty/.jenkins/workspace/jans-auth-server/jans-auth-server/server/integrations/otp/repository was cached in the local repository, resolution will not be reattempted until the update interval of otp_auth-local has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :jans-auth-server

This means the user after the build fails needs to head to agama and build that then return back and rebuild again.

@mo-auto mo-auto added comp-agama Touching folder /agama kind-bug Issue or PR is a bug in existing functionality labels Dec 1, 2022
@yuriyz
Copy link
Contributor

yuriyz commented Dec 1, 2022

@jgomer2001 what classes do you need in agama ? If it's not match I will move it to jans-core.

@jgomer2001
Copy link
Contributor

I am trying to understand the issue description. I guess we are having loops in deps?

I'm noticing agama-engine depends on auth-model, and agama-inbound depends on auth-common. Also auth-server depending on agama-engine, is that the problem?

agama-engine:

[INFO] io.jans:agama-engine:jar:1.0.5-SNAPSHOT
[INFO] +- io.jans:agama-model:jar:1.0.5-SNAPSHOT:compile
[INFO] |  \- io.jans:jans-orm-model:jar:1.0.5-SNAPSHOT:compile
[INFO] +- io.jans:agama-transpiler:jar:1.0.5-SNAPSHOT:compile
       ...
[INFO] +- io.jans:jans-core-util:jar:1.0.5-SNAPSHOT:compile
       ...
[INFO] +- io.jans:jans-core-cdi:jar:1.0.5-SNAPSHOT:compile
       ...
[INFO] +- io.jans:jans-core-service:jar:1.0.5-SNAPSHOT:compile
       ...
[INFO] +- io.jans:jans-orm-core:jar:1.0.5-SNAPSHOT:compile
       ...
[INFO] +- io.jans:jans-auth-model:jar:1.0.5-SNAPSHOT:compile
       ...
[INFO] +- io.jans:jans-core-jsf-util:jar:1.0.5-SNAPSHOT:compile
       ...
[INFO] +- io.jans:agama-inbound:jar:1.0.5-SNAPSHOT:test
       ...

agama-model

[INFO] io.jans:agama-model:jar:1.0.5-SNAPSHOT
[INFO] +- io.jans:jans-orm-model:jar:1.0.5-SNAPSHOT:compile
       ...
[INFO] +- io.jans:jans-core-util:jar:1.0.5-SNAPSHOT:compile
       ...

agama-inbound

[INFO] io.jans:agama-inbound:jar:1.0.5-SNAPSHOT
[INFO] +- io.jans:jans-core-util:jar:1.0.5-SNAPSHOT:provided
       ...
[INFO] +- io.jans:jans-core-service:jar:1.0.5-SNAPSHOT:provided
       ...
[INFO] +- io.jans:jans-orm-core:jar:1.0.5-SNAPSHOT:provided
       ...
[INFO] +- io.jans:jans-orm-model:jar:1.0.5-SNAPSHOT:provided
       ...
[INFO] +- io.jans:jans-auth-common:jar:1.0.5-SNAPSHOT:provided
       ...

Why do we need a fix now (not before)?

@yuriyz
Copy link
Contributor

yuriyz commented Dec 1, 2022

Yes, problem is to release it. Each time we flip version we run into problem build it all together. cc @moabu

@jgomer2001
Copy link
Contributor

jgomer2001 commented Dec 1, 2022

I wonder if we can extract parts from jans-auth-server with potential for reuse into a new separate project, say, jans-auth-commons, and put there current client, common, model, etc... Thus, other libs (like agama) or new apps may benefit from that

@moabu
Copy link
Member Author

moabu commented Dec 1, 2022

Yea exactly @jgomer2001 . That's the issue .

I think pulling things out is right . We need to have a cleaner process where we can simply follow sequence to build the packages and possibly be able to build each package separately when needed . If we have a common module then any asset can theoretically be built without triggering a full rebuild.Though at the current situation we really need to clean all these cross dependencies and allow for the sequence to be defined clearly. bom, core , common modules ...etc

@yuriyz
Copy link
Contributor

yuriyz commented Dec 2, 2022

@moabu @jgomer2001
Right, it should be strictly directional graph without crossing.

`jans-orm` <- `jans-orm` <- `jans-core` <- `jans-elevel`
                                        <- `jans-notify`                                        
                                        <- `jans-auth-server` <- `jans-config-api`
                                                              <- `jans-fido2`
                                                              <- `jans-scim`

Where do we put agama here?

At first glance it looks as we have to put it behind jans-auth-server because agama rely on jans-auth but the fact is that it's part of the jans-auth-server.

From pom I see this:

  • jans-auth-model depends on agama-model
  • jans-auth-server depends on agama-engine

We should let it be where it naturally fits:

jans-auth-model <- agama-model <- jans-auth-common <- agama-engine <- jans-auth-server

Thus we have to move agama-model and agama-engine inside jans-auth-server because each of these has to be compiled "in between" which is sign of strong coupling with jans-auth-server.

Thoughts?

@jgomer2001
Copy link
Contributor

More exactly it should be

agama-model <- jans-auth-model <- jans-auth-common <- agama-inbound <- agama-engine <- jans-auth-server

and agama's transpiler and misc folders would be kept as is.

I wonder if there will be issues with agama tests - they run currently in its own set of jenkins jobs

I'm Ok with the idea of moving agama to jans-auth

@yuriyz
Copy link
Contributor

yuriyz commented Dec 6, 2022

@jgomer2001 I can move agama into jans-auth. Currently jenkins reports tests failures for all persistences. Should I move it now and you will check tests after movement or you want to fix tests before moving agama ?

@jgomer2001
Copy link
Contributor

@yuriyz Proceed please. All tests are passing on fresh installations (e.g. easycloud). I can't explain why tests stopped working some time ago on jenkins.

@yuriyz
Copy link
Contributor

yuriyz commented Dec 7, 2022

I can assemble jans-auth-server with agama inside successfully.

image

@yuriyz
Copy link
Contributor

yuriyz commented Dec 8, 2022

Re-opening. Compilation without test works well. But jenkins also running tests and tests run is failing for agama-model which blocks other jans-auth-server modules run.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-agama Touching folder /agama kind-bug Issue or PR is a bug in existing functionality
Projects
None yet
4 participants