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 errors in CI/CD pipeline #194

Open
zambrovski opened this issue Oct 12, 2021 · 4 comments
Open

Fix errors in CI/CD pipeline #194

zambrovski opened this issue Oct 12, 2021 · 4 comments

Comments

@zambrovski
Copy link
Contributor

zambrovski commented Oct 12, 2021

Expected behaviour

CI/CD Pipeline deployes snaphosts / releases

Actual behaviour

The pipeline seems to have multiple errors:

There are some issues with calling Sonar (no authorization).
Error: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project axon-kafka-parent: You're not authorized to run analysis. No sonar.login or SONAR_TOKEN env variable was set -> [Help 1]
See: https://github.com/AxonFramework/extension-kafka/runs/3869078032?check_suite_focus=true

Due to incompatibility in a module naming scheme, JavaDoc maven plugin fails to detect the name of the Kafka module. This leads to a build error and prevents pipeline from completing.
See: https://github.com/AxonFramework/extension-kafka/runs/3836134591?check_suite_focus=true

@zambrovski zambrovski changed the title Fix CI/CD pipeline Fix errors in CI/CD pipeline Oct 12, 2021
@smcvb
Copy link
Member

smcvb commented Oct 15, 2021

The Sonar issue has to do with the fact we can't easily share the token with contributors outside of the AxonIQ organization.
I have looked into this shortly, and there's a means to adjust the workflow entirely to (1) keep the tokens secure and (2) usable by others.
As you might've guessed, this is an issue on all our open source repositories.

@zambrovski
Copy link
Contributor Author

zambrovski commented Oct 15, 2021

I'm aware of this problem. Usually the way to go will to split the build into two pipelines. One pipeline without sonar and one for sonar issues... This will give you a chance to see if the build runs correctly. You could tweak it in a way, that the PR needs to get approved first to trigger the Sonar build...

The workflow would look like this:

  1. PR created
  2. CI build runs on the branch triggered by push
  3. You run a PR review and mark is "approved" eventually
  4. CI build further runs on push
  5. Sonar build runs if the PR is approved

Another idea is to let it run as it is it now but add a condition to run sonar only on "authorized" branches, since you are not able to run it on public PRs by any other means...
This can be achieved by adding a task condition if checking the branch name...

@smcvb
Copy link
Member

smcvb commented Oct 15, 2021

I was hoping for an approach that still included Sonar for contributors too since that code needs to be validated just as well.
The two-step workflow is indeed what we were looking into, although I wasn't planning to use the "approved" trigger.
Rather a process that runs directly after the JDK 8 and 11 builds.

I'd see ignoring sonar as a temporary solution.

@lfgcampos
Copy link
Contributor

This is closed by #201, right? Can we close it?
ping @zambrovski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants