Changelog History
Page 3
-
v23.0.2 Changes
July 01, 2020 -
v23.0.1 Changes
July 01, 2020 -
v23.0.0 Changes
June 28, 2020What's New in v23 of Actionhero?
๐ Swagger API Documentation #1474
๐ For years, Actionhero has shipped with a
showDocumentation
action that provided a way to describe the actions running on your server. The action was used to self-document the abilities of your server. However, the format of that action was arbitrary... and not helpful in a larger ecosystem. Switching the format of this action to swagger/OpenAPI will make the Action much more useful!- ๐ Switch the
showDocumentation
action withswagger
action. Remove all old references toshowDocumentation
- Include a new
swagger.html
andswagger
action in generated projects which can consume and demo the API - โ Remove
initializer/documentation
, as we don't need this documentation internally without the old showDocumentation action.
๐ The breaking change is only around the
showDocumentation
anddocumentation
initializer, which appears to not be used very much.
๐ New Actionhero projects going forward will be generated with the Swagger Action and HTML page, which can be seen here https://demo.actionherojs.com/swagger.html๐ฒ Action and Task errors log on only one line #1505
๐ฒ Actions and tasks now log to one line in the file and other transports. The stack trace contains
\n
so it still is legible pretty in the console.Action
# Console2020-06-25T00:48:24.045Z - error: [action @ web] to=127.0.0.1 action=broken params={"action":"broken","apiVersion":1} duration=1 error=TypeError: Cannot read property 'missing' of undefined stacktrace=TypeError: Cannot read property 'missing' of undefined at ValidationTest.run (/Users/evan/workspace/actionhero/actionhero/src/actions/broken.ts:14:27) at ActionProcessor.runAction (/Users/evan/workspace/actionhero/actionhero/src/classes/actionProcessor.ts:378:35) at processTicksAndRejections (internal/process/task\_queues.js:97:5)# File{"to":"127.0.0.1","action":"broken","params":"{\"action\":\"broken\",\"apiVersion\":1}","duration":1,"error":"TypeError: Cannot read property 'missing' of undefined","stacktrace":"TypeError: Cannot read property 'missing' of undefined\n at ValidationTest.run (/Users/evan/workspace/actionhero/actionhero/src/actions/broken.ts:14:27)\n at ActionProcessor.runAction (/Users/evan/workspace/actionhero/actionhero/src/classes/actionProcessor.ts:378:35)\n at processTicksAndRejections (internal/process/task\_queues.js:97:5)\n at WebServer.processAction (/Users/evan/workspace/actionhero/actionhero/src/classes/server.ts:229:18)","level":"error","message":"[action @ web]","timestamp":"2020-06-25T00:48:24.045Z"}
Task
# Console2020-06-25T00:38:03.840Z - error: error from task: task:busted on queue default (worker #1) arguments=[object Object] stacktrace=Error: NOPE at MyTask.run (/Users/evan/workspace/actionhero/actionhero/src/tasks/busted.ts:14:11) at Worker.perform (/Users/evan/workspace/actionhero/actionhero/src/initializers/tasks.ts:123:39) at Worker.perform (/Users/evan/workspace/actionhero/actionhero/node\_modules/node-resque/dist/core/worker.js:165:41) at processTicksAndRejections (internal/process/task\_queues.js:97:5)# File{"name":"task:busted","queue":"default","worker":1,"arguments":"{}","stacktrace":"Error: NOPE\n at MyTask.run (/Users/evan/workspace/actionhero/actionhero/src/tasks/busted.ts:14:11)\n at Worker.perform (/Users/evan/workspace/actionhero/actionhero/src/initializers/tasks.ts:123:39)\n at Worker.perform (/Users/evan/workspace/actionhero/actionhero/node\_modules/node-resque/dist/core/worker.js:165:41)\n at processTicksAndRejections (internal/process/task\_queues.js:97:5)","level":"error","message":"error from task","timestamp":"2020-06-25T00:48:28.478Z"}
๐ฒ This PR also adds support for logging custom Error properties, ie:
import { api, Action } from "./../index";class AuthenticationError extends Error {code: string;constructor(message, code = "AUTHENTICATION\_ERROR") {super(message);this.code = code;}}export class ValidationTest extends Action {constructor() {super();this.name = "broken";this.description = "I am broken";this.inputs = {};this.outputExample = {};}async run({ params, response }) {throw new AuthenticationError(`broken`);}}
๐ฒ ... which will contain "code" in the log message along with the error.
๐ฒ Optionally log Action responses #1494
๐ฒ 2 new options now enable you to log the responses your actions send to consumers of your API
- 0๏ธโฃ
config.general.enableResponseLogging
(bool) toggles this option on (off by default) - ๐
config.general. filteredResponse
(string[]) allow you to filter out certain parts of the response payload from the logs, hiding sensitive data.
When using simpleRouting, the shown Swagger route is be GET #1506
๐ Trim protocol from allowedRequestHosts when building swagger routes #1495
And of course...
- โก๏ธ Update all dependencies to the latest versions.
โฌ๏ธ Upgrading to v23 of Actionhero
๐ This release is breaking for 2 reasons:
- The logger format for Action and Task errors has changed Pull Request.
๐ 2. The
Documentation
initializer and relatedshowDocumentation
action has been removed in favor of the new swagger action & middleware Pull Request.
โก๏ธ If you use automated log ingestion (i.e.: Splunk or a Winston logger) this PR should be helpful, as the error and stack trace will now all be on the same line... but you will need to update your log tools.
๐ If you had been using the
Documentation
middleware, you can re-build it yourself fromapi.actions.actions
. If you want upgrade your Actionhero project to use the new Swagger documentation tooling, you need to copy in 2 files:- The Swagger public page - swagger.html
- The Swagger Action - swagger.ts
๐ฒ There are also new logging options to add to
src/config/api.ts
:- 0๏ธโฃ
config.general.enableResponseLogging
(bool) toggles this option on (off by default) - ๐
config.general. filteredResponse
(string[]) allow you to filter out certain parts of the response payload from the logs, hiding sensitive data.
- ๐ Switch the
-
v22.1.1 Changes
June 01, 2020๐ Release Notes
- Adds a Code of Conduct for the Actionhero Community (#1483)
- Type the
api
object. Adds Typescript definitions to the exported methods/objects in theapi
object (#1476) - Replace ActionheroWebsocketClient with fetch in example index.html. This way, the demo still works without the websocket server enabled (#1473)
- Always rely on headers["x-forwarded-proto"] if present to detect request protocol (#1482)
- ๐ Replace circleCI with Github actions. While both are free, Github Actions seem to have more stable servers, and error-out less. (#1441 and #1481)
- โก๏ธ Update dependencies. We new rely on @dependabot to automatically handle testing and alerting us about updates to our dependencies. So long @greenkeeperio-bot, thanks for all the PRs!
Code of Conduct
โ If you are in the USA, this week has been a difficult one. This has been a week of turmoil and protests catalyzed by (yet another) unjust killing of a citizen at the hands of of the people who should be protecting all of us. I try hard to not entangle this community with larger societal issues - to keep us focused only on code and APIs... but sometimes the real world intervenes.
When thinking about what small things I can do to help ensure that the communities I'm a part of are open to all people, I realized that I've been negligent in drafting a Code of Conduct for our community. This PR adds a Code of Conduct that will govern those of us who work on Actionhero going forward, and to codify my goal of making our community as available as possible to the most people.
I feel that it is also important to say that I've personally always had pleasant interactions with everyone in the Actionhero community. On the whole, I think we are a polite, smart, and diverse group of people. This document's aim is to keep our community that way! However, my experiences might not be the same as yours. As this Code of Conduct states - if you experience a problem with someone in the Actionhero community, please email [email protected] so we can address the the problem. There are tools available to us via the platforms we have chosen to use (Github, Slack, etc) to help with moderation, privacy, etc.
I've chosen to base our Code of Conduct on the Contributor Covenant Code of Conduct, which has been adopted by almost 400,000 other open source projects.
The Code of Conduct can be viewed here and will be included along with the source code for all future Actionhero releases.
-
v22.1.0 Changes
May 13, 2020- Global api object via
global
(#1459) - โก๏ธ Update Dependencies
- โ Test node.js v14 in CI
- ๐ Fix bug with
task.ts.template
(generated task tests)
- Global api object via
-
v22.0.9 Changes
May 05, 2020- ๐ Implement ignorable route prefixes for static and regexp routes (#1451)
- โก๏ธ Update Dependencies
-
v22.0.8 Changes
April 29, 2020 -
v22.0.7 Changes
April 06, 2020- โ Add debugging examples and dev scripts (#1428)
- โก๏ธ Update dependencies to latest versions
-
v22.0.6 Changes
March 18, 2020 -
v22.0.5 Changes
March 12, 2020๐ Better Server Shutdown (#1424)
- ๐ฆ provide a callback to
app.registerProcessSignals
which will be called when the app is fully shut down. This provides an explicit place to callprocess.exit()
, which will in turn ensure that all sub-processes are exited too. - on a
uncaughtRejection
oruncaughtRejection
, try to gracefully shut down the server withprocess.stop()
.- Wait
process.env.ACTIONHERO_SHUTDOWN_TIMEOUT
(or 30 seconds) and thenprocess.exit()
- Wait
- only catch one
uncaughtRejection
oruncaughtRejection
The recommended
server.ts
is now:import { Process } from "./index";// load any custom code, configure the env, as neededasync function main() { // create a new actionhero processconst app = new Process(); // handle unix signals and uncaught exceptions & rejectionsapp.registerProcessSignals(exitCode =\> { process.exit(exitCode); }); // start the app!// you can pass custom configuration to the process as neededawait app.start(); }main();
- ๐ฆ provide a callback to