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

ci: fix action failures #309

Merged
merged 16 commits into from
Oct 24, 2023
Merged

ci: fix action failures #309

merged 16 commits into from
Oct 24, 2023

Conversation

stevenh
Copy link
Collaborator

@stevenh stevenh commented Oct 21, 2023

Fix issues causing actions to report errors.

Run npm lint:fix to get a good baseline for further changes.
Fix the permission errors triggered by checkov CKV2_GHA_1 by giving the
workflows only their required permissions.
Fix the errors about spelling reported by cspell.
@stevenh stevenh marked this pull request as ready for review October 21, 2023 15:22
Fix the permission on lib/index.js causing failure of npm run test:debug
sh: 1: npm-groovy-lint: Permission denied
@nvuillam
Copy link
Owner

@stevenh I changed the settings of the repo, github action jobs should run without approval now :)

@codecov
Copy link

codecov bot commented Oct 22, 2023

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (cd70bbd) 93.06% compared to head (afa730c) 92.54%.

❗ Current head afa730c differs from pull request most recent head 049ea1b. Consider uploading reports for the commit 049ea1b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #309      +/-   ##
==========================================
- Coverage   93.06%   92.54%   -0.53%     
==========================================
  Files          82       82              
  Lines        1991     2013      +22     
==========================================
+ Hits         1853     1863      +10     
- Misses        138      150      +12     
Files Coverage Δ
lib/index.js 60.00% <ø> (ø)
lib/options.js 100.00% <ø> (ø)
lib/output.js 93.18% <100.00%> (ø)
lib/utils.js 97.34% <100.00%> (ø)
lib/codenarc-factory.js 93.60% <80.00%> (ø)
lib/groovy-lint.js 97.02% <50.00%> (ø)
lib/codenarc-caller.js 77.63% <48.14%> (-5.10%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stevenh stevenh force-pushed the chore/fix-checks branch 2 times, most recently from e3b5a35 to cb54f11 Compare October 22, 2023 22:28
Switch debian from stretch image for openjdk 8 to buster as stretch is
so old apt update fails even when pointed at archive.debian.org.

Also switch to multi line run syntax to make it easier to see what is
being run.
Switch to using actions/setup-node to simplify installation of node.
@stevenh stevenh force-pushed the chore/fix-checks branch 3 times, most recently from 265d30c to 55edcdb Compare October 23, 2023 21:12
Fix markdown lint issues flagged by megalinter ci.
@nvuillam
Copy link
Owner

Don't worry about the auto commit failure, it's just because tou don't have the rights from a fork :)
And ignore codecov :)
But Windows & mac tests would be nice ^^

@stevenh stevenh force-pushed the chore/fix-checks branch 2 times, most recently from a3525e3 to 70b375c Compare October 23, 2023 21:50
@stevenh
Copy link
Collaborator Author

stevenh commented Oct 23, 2023

Don't worry about the auto commit failure, it's just because tou don't have the rights from a fork :) And ignore codecov :) But Windows & mac tests would be nice ^^

Yep, there seemed to be a way to do it but that requires contributors to make changes there end, so too high a barrier

I'm now looking to skip it when a fork is detected.

Skip creating a commit of lint changes for forks as permissions don't
permit that without jumping through hoops.
Bump all actions to the latest versions to bring in all the related
fixes.
Fix lint failures reported by lychee by correcting / removing broken
links.
@stevenh
Copy link
Collaborator Author

stevenh commented Oct 23, 2023

Ok so node 12 is really old and the major version bumps didn't go quite to plan. Might want to consider dropping support for node 12 in the future.

Update all npm modules to address security issues flagged by grype
linter and remove now unreferenced modules.

This also includes a small fix to server kill flow to handle the
error returned by newer versions of axios, as well as fix to the
server itself to send the response before calling stopServer which
should render the special case for terminated unneeded.

No major version bumps we're applied to maintain compatibility with
node 12.
Enable npm-groovy-lint debugging for tests on windows and mac to help
identify the cause of the hangs.
@nvuillam
Copy link
Owner

@stevenh you can remove node 12 compat, good idea!

Fix the handling of the CodeNarc process when it's not accessible via
its web API.

We now maintain a handle to the process so if we can't get a response to
the initial ping requests we can still shut it down.

In addition to this correctly handle the timeout in the error case.
@stevenh
Copy link
Collaborator Author

stevenh commented Oct 24, 2023

@stevenh you can remove node 12 compat, good idea!

Got it working for now, will do that later.

Fix requests failing to talk to CodeNarc server due to Java preferring
IPv4 port binding by default and vscode-groovy-lint on Windows resolving
localhost to its IPv6 address.

We now use an IPv4 agent for all requests.
Switch codecov from bash to github action as the bash script has been
deprecated for some time.
Enable debugging on the workflows which are failing.
Copy link
Owner

@nvuillam nvuillam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job @stevenh :)
Do I wait for your other PRs to release a new version, or do you prefer to merge them before ?

@nvuillam nvuillam merged commit 6e7e859 into nvuillam:master Oct 24, 2023
@stevenh
Copy link
Collaborator Author

stevenh commented Oct 24, 2023

Oh wow, wasn't expecting that to just pass, still had lots of debug in there.

I'll make sure I use a draft for work in progress

@stevenh stevenh deleted the chore/fix-checks branch October 24, 2023 13:04
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.

2 participants