Forecastle.Appup.Draft (forecastle v1.0.0)

Copy Markdown View Source

Drafts appup instructions for modules that changed between two builds.

The draft uses BEAM behaviour attributes to choose an instruction:

ModuleInstruction
Supervisor{:update, module, :supervisor}
GenServer, :gen_server, :gen_statem, :gen_event or :gen_fsm{:update, module, {:advanced, []}}
Other changed module{:load_module, module}
Added module{:add_module, module}
Removed module{:delete_module, module}

Supervisor classification takes precedence when a module declares several behaviours. The draft comments on decisions that require review, including the Extra value, missing code_change callbacks, changed behaviour roles, unsupervised processes, child upgrades, module ordering, and modules absent from the application's .app resource.

Summary

Types

An instruction and the comment lines rendered above it.

One from-version entry, ready to render.

Functions

Drafts one from-version entry from two application builds.

Types

annotated()

@type annotated() :: {tuple(), [binary()]}

An instruction and the comment lines rendered above it.

entry()

@type entry() :: %{
  from_vsn: binary(),
  preamble: [binary()],
  instructions: [annotated()]
}

One from-version entry, ready to render.

preamble holds comments about the entry as a whole.

Functions

entry(from_vsn, old, new)

Drafts one from-version entry from two application builds.

The result has instructions in a stable order, with review comments, for changed, added and removed modules.