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

chore: Add job for sorald-buildbreaker #3912

Merged
merged 7 commits into from
May 11, 2021

Conversation

slarse
Copy link
Collaborator

@slarse slarse commented May 6, 2021

Fix #3788

This PR adds a workflow job that runs https://github.com/spoonlabs/sorald-buildbreaker on Spoon, and fails the build if the changed lines (relative to master) contains any repairable violations. Here's an example of where it finds a violation in the diff: https://github.com/INRIA/spoon/pull/3912/checks?check_run_id=2543019363#step:3:123. Note that the final commit in this PR, which just removes the artificial rule violation, causes the build to go green!

Currently, it's a separate job, but once we deem buildbreaker to be stable enough we can simply incorporate it into the extras job by adding this step:

      - name: Run Sorald Buildbreaker
        uses: SpoonLabs/sorald-buildbreaker@35c1a784848bd3182cfcc8a584cff90560fa6371 # dev version
        with:
          source: 'src/main/java'
          ratchet-from: 'origin/master'

Next steps are to improve the stability of buildbreaker, and also identify what else we want buildbreaker to do. How should it present rule violations (current presentation is cryptic to the uninitiated, to say the least)? Should it propose a patch to fix the violation? Etc, etc.

Important: sorald-buildbreaker is very much experimental at this point. I would not exclude the possibility of spurious failures that have nothing to do with the PR. Please ping me if it fails on any PR such that I can investigate.

@slarse
Copy link
Collaborator Author

slarse commented May 6, 2021

Current failure is a bug in sorald-buildbreaker, see SpoonLabs/sorald-buildbreaker#46

@slarse
Copy link
Collaborator Author

slarse commented May 7, 2021

The new violation is found by Sonar, but there's obviously some problem with the ratchet as buildbreaker does not try to repair it.

Back to the drawing board!

Edit: It was a problem with relative source paths, see SpoonLabs/sorald-buildbreaker#49

@slarse
Copy link
Collaborator Author

slarse commented May 10, 2021

Ah, it finally works, the newly introduced rule violation is detected: https://github.com/INRIA/spoon/pull/3912/checks?check_run_id=2543019363#step:3:123

@slarse slarse changed the title wip: chore: Add job for sorald-buildbreaker review: chore: Add job for sorald-buildbreaker May 10, 2021
@slarse slarse requested a review from monperrus May 10, 2021 08:00
@monperrus monperrus changed the title review: chore: Add job for sorald-buildbreaker chore: Add job for sorald-buildbreaker May 11, 2021
@monperrus monperrus merged commit 245e076 into INRIA:master May 11, 2021
@monperrus
Copy link
Collaborator

Excellent, thanks a lot @slarse

@monperrus monperrus mentioned this pull request Aug 19, 2021
woutersmeenk pushed a commit to woutersmeenk/spoon that referenced this pull request Aug 29, 2021
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.

break the build if there is a Sonar violation that Sorald can fix
2 participants