-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
mod: update version of goveralls. #521
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes involve updates to multiple files, including the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
713e0a0
to
47822d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
lib/runner.js (3)
1-1
: Remove redundant 'use strict' directiveThe
'use strict'
directive is unnecessary in ES6 modules since they are in strict mode by default. Consider removing it to clean up the code.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.(lint/suspicious/noRedundantUseStrict)
70-103
: Refactor duplicated code inrun
andfinish
functionsThe
run
andfinish
functions share similar logic for setting up environment variables and arguments before executing thegoveralls
command. Refactoring this shared logic into separate helper functions would improve maintainability and reduce code duplication.You can apply the following refactor to extract common code:
+async function goverallsExecute(options, isFinish) { + const env = { + COVERALLS_TOKEN: options.token, + }; + for (const name of go_environment_values) { + const value = process.env[name] || (name.match(/^GO/) && (await go_env(name))); + if (value) { + env[name] = value; + } + } + + const args = isFinish ? ["-parallel-finish", "-service=github"] : ["-service=github"]; + if (options.profile && !isFinish) { + args.push(`-coverprofile=${options.profile}`); + } + if (options.ignore) { + args.push(`-ignore=${options.ignore}`); + } + if (options.parallel && !isFinish) { + args.push("-parallel"); + if (options.flag_name !== "") { + args.push(`-flagname=${options.flag_name}`); + } + } + if (options.shallow) { + args.push("-shallow"); + } + if (core.isDebug()) { + args.push("-debug"); + } + + await exec.exec(get_goveralls_path(), args, { + env: env, + cwd: options.working_directory, + }); +} async function run(options) { - const env = { - COVERALLS_TOKEN: options.token, - }; - // [existing code to set up env and args] - await exec.exec(get_goveralls_path(), args, { - env: env, - cwd: options.working_directory, - }); + await goverallsExecute(options, false); } async function finish(options) { - const env = { - COVERALLS_TOKEN: options.token, - }; - // [existing code to set up env and args] - await exec.exec(get_goveralls_path(), args, { - env: env, - cwd: options.working_directory, - }); + await goverallsExecute(options, true); }Also applies to: 104-128
149-178
: Extend architecture support inget_goveralls_path
functionCurrently, the
get_goveralls_path
function supports only'x64'
and'arm64'
architectures. Consider adding support for additional architectures like'ia32'
or'arm'
to enhance compatibility.You can modify the architecture switch case as follows:
switch (process.arch) { case "x64": arch = "amd64"; break; case "arm64": arch = "arm64"; break; + case "ia32": + arch = "386"; + break; + case "arm": + arch = "arm"; + break; default: throw new Error(`unsupported architecture: ${process.arch}`); }lib/main.js (1)
1-1
: Remove redundant 'use strict' directiveThe
'use strict'
directive is unnecessary in ES6 modules since they are in strict mode by default. Removing it will simplify the code.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.(lint/suspicious/noRedundantUseStrict)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (135)
bin/goveralls_windows_amd64.exe
is excluded by!**/*.exe
bin/goveralls_windows_arm64.exe
is excluded by!**/*.exe
go.sum
is excluded by!**/*.sum
node_modules/@actions/core/LICENSE.md
is excluded by!**/node_modules/**
node_modules/@actions/core/README.md
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/command.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/command.js
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/command.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/core/lib/core.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/core.js
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/core.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/core/lib/file-command.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/file-command.js
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/file-command.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/core/lib/oidc-utils.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/oidc-utils.js
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/oidc-utils.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/core/lib/path-utils.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/path-utils.js
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/path-utils.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/core/lib/summary.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/summary.js
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/summary.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/core/lib/utils.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/utils.js
is excluded by!**/node_modules/**
node_modules/@actions/core/lib/utils.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/core/package.json
is excluded by!**/node_modules/**
node_modules/@actions/exec/LICENSE.md
is excluded by!**/node_modules/**
node_modules/@actions/exec/README.md
is excluded by!**/node_modules/**
node_modules/@actions/exec/lib/exec.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/exec/lib/exec.js
is excluded by!**/node_modules/**
node_modules/@actions/exec/lib/exec.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/exec/lib/interfaces.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/exec/lib/interfaces.js
is excluded by!**/node_modules/**
node_modules/@actions/exec/lib/interfaces.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/exec/lib/toolrunner.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/exec/lib/toolrunner.js
is excluded by!**/node_modules/**
node_modules/@actions/exec/lib/toolrunner.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/exec/package.json
is excluded by!**/node_modules/**
node_modules/@actions/http-client/LICENSE
is excluded by!**/node_modules/**
node_modules/@actions/http-client/README.md
is excluded by!**/node_modules/**
node_modules/@actions/http-client/lib/auth.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/http-client/lib/auth.js
is excluded by!**/node_modules/**
node_modules/@actions/http-client/lib/auth.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/http-client/lib/index.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/http-client/lib/index.js
is excluded by!**/node_modules/**
node_modules/@actions/http-client/lib/index.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/http-client/lib/interfaces.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/http-client/lib/interfaces.js
is excluded by!**/node_modules/**
node_modules/@actions/http-client/lib/interfaces.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/http-client/lib/proxy.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/http-client/lib/proxy.js
is excluded by!**/node_modules/**
node_modules/@actions/http-client/lib/proxy.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/http-client/package.json
is excluded by!**/node_modules/**
node_modules/@actions/io/README.md
is excluded by!**/node_modules/**
node_modules/@actions/io/lib/io-util.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/io/lib/io-util.js
is excluded by!**/node_modules/**
node_modules/@actions/io/lib/io-util.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/io/lib/io.d.ts
is excluded by!**/node_modules/**
node_modules/@actions/io/lib/io.js
is excluded by!**/node_modules/**
node_modules/@actions/io/lib/io.js.map
is excluded by!**/node_modules/**
,!**/*.map
node_modules/@actions/io/package.json
is excluded by!**/node_modules/**
node_modules/tunnel/CHANGELOG.md
is excluded by!**/node_modules/**
node_modules/tunnel/LICENSE
is excluded by!**/node_modules/**
node_modules/tunnel/README.md
is excluded by!**/node_modules/**
node_modules/tunnel/index.js
is excluded by!**/node_modules/**
node_modules/tunnel/lib/tunnel.js
is excluded by!**/node_modules/**
node_modules/tunnel/package.json
is excluded by!**/node_modules/**
node_modules/uuid/CHANGELOG.md
is excluded by!**/node_modules/**
node_modules/uuid/CONTRIBUTING.md
is excluded by!**/node_modules/**
node_modules/uuid/LICENSE.md
is excluded by!**/node_modules/**
node_modules/uuid/README.md
is excluded by!**/node_modules/**
node_modules/uuid/dist/bin/uuid
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/index.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/md5.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/nil.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/parse.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/regex.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/rng.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/sha1.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/stringify.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/v1.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/v3.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/v35.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/v4.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/v5.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/validate.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-browser/version.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/index.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/md5.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/nil.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/parse.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/regex.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/rng.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/sha1.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/stringify.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/v1.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/v3.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/v35.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/v4.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/v5.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/validate.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/esm-node/version.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/index.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/md5-browser.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/md5.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/nil.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/parse.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/regex.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/rng-browser.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/rng.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/sha1-browser.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/sha1.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/stringify.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/umd/uuid.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/umd/uuidNIL.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/umd/uuidParse.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/umd/uuidStringify.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/umd/uuidValidate.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/umd/uuidVersion.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/umd/uuidv1.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/umd/uuidv3.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/umd/uuidv4.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/umd/uuidv5.min.js
is excluded by!**/dist/**
,!**/node_modules/**
,!**/*.min.js
node_modules/uuid/dist/uuid-bin.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/v1.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/v3.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/v35.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/v4.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/v5.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/validate.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/dist/version.js
is excluded by!**/dist/**
,!**/node_modules/**
node_modules/uuid/package.json
is excluded by!**/node_modules/**
node_modules/uuid/wrapper.mjs
is excluded by!**/node_modules/**
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (5)
.gitignore
(0 hunks)go.mod
(1 hunks)lib/main.js
(1 hunks)lib/runner.js
(1 hunks)package.json
(1 hunks)
💤 Files with no reviewable changes (1)
- .gitignore
✅ Files skipped from review due to trivial changes (1)
- package.json
🚧 Files skipped from review as they are similar to previous changes (1)
- go.mod
🧰 Additional context used
🪛 Biome (1.9.4)
lib/main.js
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
[error] 19-19: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
lib/runner.js
[error] 1-1: Redundant use strict directive.
The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.
(lint/suspicious/noRedundantUseStrict)
[error] 19-19: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
🔇 Additional comments (1)
lib/main.js (1)
26-49
: Proper error handling in the run
function
The run
function correctly handles errors by checking if the caught error is an instance of Error
and uses core.setFailed
to report it. This is a good practice for robust error handling in GitHub Actions.
47822d9
to
c440f43
Compare
The goverall tool had a bug regarding the module versioning of golang packages see also mattn/goveralls#222 for more background. Goveralls is wrapped by another library to make it available for github actions. So the relevant PR which is referenced here in LND is: shogo82148/actions-goveralls#521.
Summary by CodeRabbit
New Features
goveralls
command in a CI/CD environment with enhanced error handling.Chores
.gitignore
for better version control tracking.Version Update
0.0.0
to1.9.0
.