jwgmeligmeyling / spotbugs-github-action

Push SpotBugs results as check run annotations
MIT License
10 stars 13 forks source link

Possibility to mark the job as failure? #9

Open arolfes opened 3 years ago

arolfes commented 3 years ago

Hi @jwgmeligmeyling ,

At first thank you for the Action

I started using your GHA in the micronaut-camunda-bpm project. so far it works as I understood from your readme https://github.com/arolfes/micronaut-camunda-bpm/pull/2/commits/5753bec3437d15c2da1910f84fe6168a2f6a2ec1

image

I personally miss a possibility to mark the job as failure run when there was at least one violation found.

Did I configure something wrong? Or will it always be green when upload succeed? What other chance do I have to mark the build as failure?

Best Regards

jwgmeligmeyling commented 3 years ago

It doesnt have this feature yet, but it was definitely intended to have it

jwgmeligmeyling commented 3 years ago

This would be the extension point: https://github.com/jwgmeligmeyling/spotbugs-github-action/blob/master/src/main.ts#L81

arolfes commented 3 years ago

Ok, let me try to provide an PR. Thanks for the hint

arolfes commented 3 years ago

I implented a threshold where you can configure the number of annations which leads the upload to fail

But I can't create the PR because I'm not able to build the current master which relates to my local setup Can you help me?

arolfes commented 3 years ago

ok, upgrading every dependency to latest except nodejs works fine

arolfes commented 3 years ago
arl@dev-vm-20:/workspace/sources/arolfes/spotbugs-github-action (master)$ rm -rf node_modules/
arl@dev-vm-20:/workspace/sources/arolfes/spotbugs-github-action (master)$ npm install
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^2.1.2 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 725 packages from 477 contributors and audited 730 packages in 90.388s

68 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

arl@dev-vm-20:/workspace/sources/arolfes/spotbugs-github-action (master)$ npm run build

> typescript-action@0.0.0 build /workspace/sources/arolfes/spotbugs-github-action
> tsc

arl@dev-vm-20:/workspace/sources/arolfes/spotbugs-github-action (master)$ npm run pack

> typescript-action@0.0.0 pack /workspace/sources/arolfes/spotbugs-github-action
> ncc build

ncc: Version 0.20.5
ncc: Compiling file index.js
1022kB  dist/index.js
1022kB  [57369ms] - ncc 0.20.5
arl@dev-vm-20:/workspace/sources/arolfes/spotbugs-github-action (master)$ npm test

> typescript-action@0.0.0 test /workspace/sources/arolfes/spotbugs-github-action
> jest

 PASS  __tests__/main.test.ts (58.646 s)
  ✓ parses file (298 ms)

Creating annotations for /workspace/sources/arolfes/spotbugs-github-action/reports/spotbugsXml.xml
/workspace/sources/arolfes/spotbugs-github-action/reports/spotbugsXml.xml has 12 violations
::debug::/home/runner/work/athena-hibernate-test/athena-hibernate-test/external/capsule-crm/src/main/java/com/pallasathenagroup/capsule/client/impl/CapsuleTargetTest.java does exists
Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        58.831 s
Ran all test suites.
arl@dev-vm-20:/workspace/sources/arolfes/spotbugs-github-action (master)$ 
elektrovert commented 2 years ago

Hi there,

Will this functionality have the possibility to do a complete build then mark it as failed if there are any errors? Or will it just fail when the threshold is reached? In my mind the best behaviour for this type of feature is to build a complete report, annotate the code with the errors, then fail the build.

ataylormays-duetto commented 7 months ago

Hello, any update on this change? It'd be a helpful feature!