Skip to content

Conversation

@github-actions
Copy link
Contributor

Backport: #1046

Note: CI is not automatically triggered on backported PRs, please comment 'ok to test' to launch Jenkins jobs

Many thanks for submitting your Pull Request ❤️!

Fixes #1038

Somehow Jandex is returning duplicated *AuthenticationMarkers annotations from the generated CompositeAuthenticationProvider classes:

package org.eurotransplant.immu.api.auth;

@jakarta.annotation.Priority(jakarta.ws.rs.Priorities.AUTHENTICATION)
@io.quarkiverse.openapi.generator.markers.BearerAuthenticationMarker(name="SecurityScheme", openApiSpecId="immu_2024_04_29_yml", scheme="bearer")
public class CompositeAuthenticationProvider implements jakarta.ws.rs.client.ClientRequestFilter {

    @jakarta.inject.Inject
    @io.quarkiverse.openapi.generator.OpenApiSpec(openApiSpecId="immu_2024_04_29_yml")
    io.quarkiverse.openapi.generator.providers.BaseCompositeAuthenticationProvider compositeProvider;

    @java.lang.Override
    public void filter(jakarta.ws.rs.client.ClientRequestContext context) throws java.io.IOException {
        compositeProvider.filter(context);
    };
}

In the reproducer provided in #1038, the class is being generated correctly, but during the build process, Jandex is returning duplicate annotations.

I ran out of time to debug more, so now the lists are being filtered to return only once, despite Jandex holding two instances of the same annotation.

@pefernan @fjtirado, this is a critical bug that should be fixed in Kogito by upgrading this library once we release a patch with this fix.

I've changed the name of our CompositeAuthenticationProvider to BaseCompositeAuthenticationProvider so as not to be confused with the generated CompositeAuthenticationProvider in the target project.

Please make sure that your PR meets the following requirements:

  • You have read the contributors guide
  • Your code is properly formatted according to our code style
  • Pull Request title contains the target branch if not targeting main: [0.9.x] Subject
  • Pull Request contains link to the issue
  • Pull Request contains link to any dependent or related Pull Request
  • Pull Request contains description of the issue
  • Pull Request does not include fixes for issues other than the main ticket
How to backport a pull request to a different branch?

In order to automatically create a backporting pull request please add one or more labels having the following format backport-<branch-name>, where <branch-name> is the name of the branch where the pull request must be backported to (e.g., backport-quarkus2 to backport the original PR to the quarkus2 branch).

NOTE: backporting is an action aiming to move a change (usually a commit) from a branch (usually the main one) to another one, which is generally referring to a still maintained release branch. Keeping it simple: it is about to move a specific change or a set of them from one branch to another.

Once the original pull request is successfully merged, the automated action will create one backporting pull request per each label (with the previous format) that has been added.

If something goes wrong, the author will be notified and at this point a manual backporting is needed.

NOTE: this automated backporting is triggered whenever a pull request on main branch is labeled or closed, but both conditions must be satisfied to get the new PR created.

Fix #1038 - Do not register duplicated AuthProviders SyntheticBeans
@github-actions github-actions bot requested a review from a team as a code owner March 19, 2025 20:19
@ricardozanini ricardozanini merged commit 3fd1393 into main-lts Mar 19, 2025
@ricardozanini ricardozanini deleted the main-lts_issue-1038 branch March 19, 2025 21:12
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.

3 participants