Table of Contents generated with DocToc
Changelog
v2.6.1
Enhancements
- #23 - Use Confex for {:system} tuple runtime config. - @jeffutter
v2.6.0
Enhancements
- #21 - Alias
compile
ascompile --warnings-as-errors
to prevent another regression in@impl
usage. - @KronicDeth
Bug Fixes
-
- Fix incorrect
@impl modules
where@impl Retort.Resources
was being used forCalcinator.Resources
callbacks. - Add missing
@impl
to test support modules
- Fix incorrect
v2.5.0
Enhancements
-
Update dependencies
calcinator
4.0.0
credo
0.8.6
ex_doc
0.16.3
excoveralls
0.7.2
timex
3.1.24
amqp
0.2.3
Use Elixir 1.5.1 for CircleCI build
- Use
@impl
for callbacsk
- Use
Bug Fixes
-
- Query for
TestTag
s used variable named for credentials, which was confusing. - Test of many-to-many update should only use resource identifiers as in JSONAPI, resource identifiers will have type and id with string keys and nothing else, so the update test should not include extra information, such as the name of the TestTag, as the many-to-many support uses
put_assoc
, notcast_assoc
, so the IDs is all that matters and is supported. We don’t want people copying the tests as example code and wondering why it doesn’t work likecast_assoc
. - Previously,
TestPost.changeset_to_id
was handlingEcto.Changeset.t
data
orchanges
having string and atom keys and string or integer values, butEcto.Changeset.t
’s type definition says thatchanges
is%{optional(atom) => term}
with the added restriction fromEcto.Changeset.cast/3
that changes have undergone type casting, which means that field should be:id
and the type should be the type of theid
field in the schema. By casting the values for themany_to_many
association,changeset_to_id
becomesget_field(changeset, :id)
and the type definitions in Ecto are honored. - Use
:erlang.trace/3
to check for multi-backoff instead ofcapture_log
- Query for
v2.4.0
Enhancements
- #17 -
Retort.Client.Generic.create
andRetort.Client.Generic.update
can convertmany_to_many
associations into collection of resource identifiers for relationship in JSONAPI resource. - @jeffutter
Bug Fixes
- #17 - Use
dockerize
to wait for Postgres before runningmix test
to prevent connection errors due to postgres container not being started completely - @KronicDeth
v2.3.0
Enhancements
- #16 - Regression test for VPP-2665 - @KronicDeth
Bug Fixes
-
Rescue exceptions in
Retort.Server.Generic.handle_info({:basic_deliver, _, _}, state)
caused by processing the message, such as in thecallback_module
’shandle_method/1
. When the exception occurs- The exception will be logged as an error with its stacktrace.
- The message will be rejected instead of ack’d, so that the exception won’t keep repeating.
v2.2.0
Enhancements
-
- Allow a different
Retort.Client.Generic
pid for each transition that aRetort.Client.StateMachine
can make. If transition is not inpid_by_transition
, the older,pid
key is used as a fallback.pid_by_transition
is not required. If it is not given,pid
is always used, which mimics the older behavior. Retort.Client.StateMachine
has full test coverage.
- Allow a different
Bug Fixes
- 13 - Add
config :retort, :ecto_repos: []
toconfig/dev.exs
to suppress warning in dev. - @KronicDeth
v2.1.0
Enhancements
-
Extract
Retort.Resources.timeout/2
toRetort.Resources.Timeout.get_or_default(module, function)
.Retort.Resources.Timeout
also has functions for deleting and putting module-wide and function name specific timeouts, to make testing easier and less boiler plate needed in override examples.Retort.Resources.Timeout.delete(module)
will deletetimeout
s set byRetort.Resources.Timeout.put(module, timeout)
ORRetort.Resources.Timeout.put(module, function_name, timeout)
.Retort.Resources.Timeout.delete(module, timeout)
will deletetimeout
set byRetort.Resources.Timeout.put(module, function_name, timeout)
OR remove thetimeout
forfunction_name
and leave it for the other function names whenRetort.Resources.Timeout.put(module, timeout)
is called.Retort.Resources.Timeout.put(module, timeout)
will set thetimeout
for allRetort.Client.Generic
calls bymodule
that calleduse Retort.Resources
.Retort.Resources.Timeout.put(module, function_name, timeout)
will set thetimeout
for allRetort.Client.Generic
function_name
calls bymodule
that calleduse Retort.Resources
.Retort.Resources.Timeout.put(module, function_name, timeout, func)
will only temporarilyRetort.Resources.Timeout.put/3
, but for the duration passed function only. This can be used to test timeout handling.
- Update to
credo
0.7.4
.
Bug Fixes
- #12 - Fix formatting of timeout override example code. - @KronicDeth
Deprecations
- #12 -
Retort.Resources.timeout(module, function_name)
is deprecated; useRetort.Resources.Timeout.get_or_default(module, function_name)
instead. - @KronicDeth
v2.0.0
Enhancements
- #9 - Document
Retort.Resources
. - @KronicDeth -
Update to
alembic
3.3.0
- Drop the need for
changeset_render
by usingJaSerializer.Formatter.Utils.format_key
directly to make it the same ascalcinator
.
- Drop the need for
Update to
calcinator
3.0.0
Retort.Response.Error.to_calcinator_error(Retort.Response.t, Ecto.Changeset.t)
will convertRetort.Response.t
data
Alembic.Document.t
errors
to aCalcinator
error. If theAlembic.Error.t
format is unrecognized, it is assumed to be convertable toEcto.Changeset.t
errors usingRetort.Response.Error.Ecto.Changeset.add_alembic_errors(changeset, errors)
- Error message instead of missing clause for unknown Poison version during tests.
Update dependencies
amqp
0.2.2
faker
0.8.0
timex
3.1.15
-
Update CircleCI
- Erlang
19.3
- Elixir
1.4.2
- Erlang
Bug Fixes
-
- A missed rename left the application name used for
Application.get_env
as the original:interpreter_server_rpc
instead of:retort
inRetort.Resources.timeout/2
. - Fix (
Map
->map
) typo inRetort.Client.Generic.start_link
options. Retort.Resources.client_start_link
should not have been 0-arity, but 1-arity, so it can take in theclient_start_link_options
as an argument instead of depending on lookup bymodule
to retrieve some hidden state.
- A missed rename left the application name used for
-
Retort.Meta.valid!/2
checked if the Ecto.Repo was sandboxed withApplication.get_env(:retort, Retort.Repo)
, which is a faithful translation of the original in:interpreter_server_rpc
, but has the problem that it only works inretort
itself. To allow the repo to be check to be configured,Retort.Meta.valid!/2
now takes an:ecto_repo_module
option, which is check if its sandboxed if any of the:ecto_schema_modules
are database-backed (have a non-blank__schema__(:source)
).Retort.Server.Generic.Resources.handle_method/2
converts{:error, :sandbox_token_missing}
into RPC response errors instead of aCaseClauseError
exception.- Use
alias Retort.Request
inRetort.RequestTest
. - Increased allowed Cyclomatic Complexity for
credo
as it must be at least 10 (instead of default 9) forRetort.Server.Generic.Resources.put_calcinator_error
.
Incompatible Changes
- #9 -
Retort.Resources.client_start_link
callback changes arity from0
to1
and now should take inoptions
instead of callingRetort.Resources.client_start_link_options/0
. - @KronicDeth -
Retort.Client.Generic.start_link
calls where theecto_schema_module_by_type
ecto_schema_module
s are database-backed will now require:ecto_repo_module
to check if theEcto.Repo.t
is sandboxed.Require
alembic
~> 3.3
changeset_render
is no longer needed forRetort.Server.Generic.Resources
, soRetort.Server.Generic.Resources.t
has been removed and aCalcinator.t
should be used as the state instead.
Require to
calcinator
~> 3.0
Retort.Response.Error.Ecto.Changeset.add_alembic_errors(changeset, [Alembic.Error.t])
will convert theAlembic.Error.t
s to validation errors added to thechangeset
. It’s a way to reverse the conversion done byAlembic.Document.from_ecto_changeset
inalembic
3.3.0
.Retort.Response.Error.to_calcinator_error(Retort.Response.t, Ecto.Changeset.t)
will convertRetort.Response.t
data
Alembic.Document.t
errors
to aCalcinator
error. If theAlembic.Error.t
format is unrecognized, it is assumed to be convertable toEcto.Changeset.t
errors usingRetort.Response.Error.Ecto.Changeset.add_alembic_errors(changeset, errors)
Retort.Server.Generic.Resoruces.handle_method/2
is simplified usingput_rendered_or_error/2
, so that the large, duplicatecase
s are eliminated and error handling remains consistent across actions. For error,put_calcinator_error
is called.use Retort.Resources
generatesdelete(changeset, query_options)
to match the updatedCalcinator.Resources.delete/2
.Retort.Resources.client_start_link_options
now takes(module, query_options)
, so that if:meta
exists inquery_options
and “beam” is set, then the pre-existing “beam” will be reused.- All action callbacks in
Retort.Resources
catch{:exit, {:timeout, _}}
from theRetort.Client.Generic
calls, log them, and then return{:error, :timeout}
, so thatCalcinator.Controller
can turn it into a 504 Gateway Timeout instead of crashing the calling process. - All action callbacks in
Retort.Resources
can transform{:error, %Retort.Response.Error{}}
toCalcinator
errors usingRetort.Client.Generic.error_to_calcinator_error
. meta
in query_options is put back into the mergable params passed toRetort.Client.Generic
calls inRetort.Resources
- Coverage of all error returns from both
Calcinator.Resources.Ecto.Repo
andRetort.Client.Generic
in tests.
v1.3.2
Bug Fixes
- #7 - It was a bug that Calcinator allowed a list for filters instead of a map, so correct Retort to follow. - @KronicDeth
v1.3.1
Bug Fixes
- #6 - Restore poison 2.0 compatibility:
Retort.Request.from_string/1
’s return types only included the Poison 3.0 patterns, soRetort.Server.Generic.RPC.decode_request/1
was only handling Poison 3.0 patterns. HaveRetort.Request.from_string/1
return both Poison 2.0 and 3.0 patterns and haveRetort.Server.Generic.RPC.decode_request/1
handle both sets of patterns. - @KronicDeth
v1.3.0
Enhancements
-
Dependency updates
alembic
to3.2.0
calcinator
to2.2.0
amqp
to0.2.0
(Native support for Erlang 19! No more need for the git dependency for Erlang 19 support.)ex_doc
0.15.1
ex_machina
2.0.0
ja_serializer
0.12.0
junit_formatter
1.3.0
timex
3.1.13
uuid
1.1.7
poison
3.1.0
credo
0.7.3
- Add CircleCI badge
- Add HexFaktor badge
- Add InchEx
Bug Fixes
- #5 - Fix Elixir 1.4 warnings - @KronicDeth
v1.2.0
Enhancements
- #3 - Regression test for
use Retort.Resources
in dialyzer - @KronicDeth
Bug Fixes
-
- De-alias spec types in
Retort.Resources.__using__
because spec types had noalias
to setup correct alias names andalias
es should not be used inquote
block because they’ll leak into module whereuse
occurs. - Had to use
map
instead ofAlembic.Pagination.t
becauseAlembic.Pagination.t
is not a subtype ofmap
needed byCalcinator.Resources.list
callback.
- De-alias spec types in
- #4 -
|
has higher precedence than->
so the|
ends up being interpreted ast -> {:ok, data}
ORRetort.Client.Generic.error
instead of the correctt ->
EITHER{:ok, data}
ORRetort.Client.Generic.error
. - @KronicDeth
v1.1.0
Enhancements
-
- Ignore IntelliJ project files
- Update to
calcinator
2.1.0
- Update to
credo
0.6.0
- Update to
timex
3.1.8
- Update to
uuid
1.1.6
Bug Fixes
-
Fix
credo
0.6.0
errors- Add missing
@spec
s - Remove extra blank lines
- Add missing
- Fix Elixir 1.4 warnings about missing
()
on 0-arity function calls. - Use correct
rabbit_common
inmix.lock
for Erlang 19+.