-
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
build: include a source map in the packaged dist #32
Conversation
How can we test that this works? 🤔 |
@filmaj I was hoping including the file in build outputs would be enough, but I'm not certain what gets included in tagged releases with the build and tag action... 😳 |
OK I was able to sort of half-ass test this out and indeed it does work! I would suggest a couple minor changes as part of this PR while we're here: Catch and report errors for health score
|
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.
Overall great improvement but there needs to be a bit better error handling at least at the compile
level as mentioned in my last comment. Likely need to examine what the appropriate way to raise errors using the actions/core
package looks like as part of that error reporting change I requested.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32 +/- ##
=======================================
Coverage 95.48% 95.48%
=======================================
Files 6 6
Lines 332 332
=======================================
Hits 317 317
Misses 15 15 ☔ View full report in Codecov by Sentry. |
@filmaj Thanks for taking a look at this and the callouts and suggestions! 🙏 🙏 These are all great and I've made a few changes to the JSdoc and added the I found that breaking the actual action is another way to test this in CI and that's showing as a run like this. I'll revert the change that caused this failure, but the error message shown from that error is looking solid! |
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.
📝 Notes on changes for the kind reviewers
.catch((err) => { | ||
core.setFailed('Failed to check up on the health score!'); | ||
console.error(err); | ||
}); |
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.
Added the catch
here at the end since I think hs.report
was still attempted if the catch
was before it. Open to adjustments though!
With the earlier catch
$ node
> healthscore=require('./dist/index')
...
::error::Failed to check up on the health score!
TypeError: core.getInpu is not a function
at Object.compileScore [as compile] (/Users/ethan.zimbelman/programming/tools/slack-health-score/src/health-score.js:15:1)
at /Users/ethan.zimbelman/programming/tools/slack-health-score/src/index.js:6:1
at /Users/ethan.zimbelman/programming/tools/slack-health-score/dist/index.js:71959:3
at Object.<anonymous> (/Users/ethan.zimbelman/programming/tools/slack-health-score/dist/index.js:71962:12)
at Module._compile (node:internal/modules/cjs/loader:1546:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
at Module.load (node:internal/modules/cjs/loader:1317:32)
at Function.Module._load (node:internal/modules/cjs/loader:1127:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
::warning::No GitHub token found; will not report score on commit status.
0
With the later catch
$ node
> healthscore=require('./dist/index')
...
::error::Failed to check up on the health score!
TypeError: core.getInpu is not a function
at Object.compileScore [as compile] (/Users/ethan.zimbelman/programming/tools/slack-health-score/src/health-score.js:15:1)
at /Users/ethan.zimbelman/programming/tools/slack-health-score/src/index.js:6:1
at /Users/ethan.zimbelman/programming/tools/slack-health-score/dist/index.js:71959:3
at Object.<anonymous> (/Users/ethan.zimbelman/programming/tools/slack-health-score/dist/index.js:71962:12)
at Module._compile (node:internal/modules/cjs/loader:1546:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
at Module.load (node:internal/modules/cjs/loader:1317:32)
at Function.Module._load (node:internal/modules/cjs/loader:1127:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
@filmaj big thank yous to you 🙏 |
Summary
This PR adds an
index.js.map
to the build output to improve outputs when error debugging a failed action. Example:With this file added, that error should point to the actual line number 🙏
Reviewers
Ensure the build keeps this file:
Requirements