Any pending `if`s in the parsing queue of a procedure should also be
cleared if the current statement in the procedure is a
break/continue/return.
In such case we should terminate the current branch, and that involves
ensuring that any `if`s branches that are still being parsed are
inserted before the branch-terminating statement.
The reason is that an `id` specified on procedure level will be applied
to all the child requests.
This means that the first response from the first completed request will
be sent to Redis and mistakenly interpreted by HTTP listeners as the
return value of the whole procedure.
`Procedure.build` should instead calculate its own ID for the procedure,
and apply different IDs to the child requests.
- Fail immediately if no branches are checked out.
- Rebase only if we're pushing on master (don't bother for feature
branches).
- Do a push force to Github.
- Update the cached representation of the procedure asynchronously on
the `publish_entities` callback. This prevents stale records from
being loaded from the db before the entities engine has persisted the
new ones.
- Don't re-publish all entities when calling `procedures.status` at the
end of `procedures.save`. This is both for performance reasons and to
avoid sending to the entities engine stale representation of the data.
- `procedures.status` should always sync with the db to ensure that the
action returns the most up-to-date version of the procedures.
- Store, return and propagate entity procedure metadata.
- `procedures.exec` now supports running procedures "on the fly" given a
definition with a list of actions.
- Fixed procedure renaming/overwrite logic.
- Access to `_all_procedures` should always be guarded by a lock.
Earlier any extra parameters passed to the `db` configuration other than
`engine` where ignored.
This enables engine-level configurations such as:
```yaml
db:
# Display all SQL queries
echo: true
```
Messages can be quite big and verbose, and they can anyway be subscribed
over Websockets.
Full dumps are anyway enabled when Platypush is started in verbose mode.
This commit replaces the dumps on INFO level with a quick summary
containing the message ID, request/event type and response time.
If some procedures are removed either from the configuration or from the
loaded scripts, then their associated entities should also be removed
from the database when the `procedures` plugin is loaded.
If some procedures are removed either from the configuration or from the
loaded scripts, then their associated entities should also be removed
from the database when the `procedures` plugin is loaded.