Skip to content

Commit

Permalink
Merge pull request #1127 from FarmBot/rel-9.0.3
Browse files Browse the repository at this point in the history
v9.0.3
  • Loading branch information
RickCarlino authored Jan 27, 2020
2 parents 5a95d6c + f6c37e4 commit 0b8d211
Show file tree
Hide file tree
Showing 142 changed files with 3,161 additions and 1,961 deletions.
38 changes: 19 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:
paths:
- farmbot_celery_script/_build/test
- farmbot_celery_script/deps
- save_cache:
- save_cache:
key: v14-fbcs-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_celery_script/cover
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
paths:
- farmbot_firmware/_build/test
- farmbot_firmware/deps
- save_cache:
- save_cache:
key: v14-fbfw-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_firmware/cover
Expand Down Expand Up @@ -283,7 +283,7 @@ jobs:
- farmbot_core/_build/test
- farmbot_core/deps
- farmbot_core/arduino
- save_cache:
- save_cache:
key: v14-fbcore-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_core/cover
Expand Down Expand Up @@ -330,7 +330,7 @@ jobs:
paths:
- farmbot_ext/_build/test
- farmbot_ext/deps
- save_cache:
- save_cache:
key: v14-fbext-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_ext/cover
Expand All @@ -348,7 +348,7 @@ jobs:
- checkout
- run: git submodule update --init --recursive
- restore_cache:
keys:
keys:
- v14-fbos-host-test-dependency-cache-{{ checksum "farmbot_os/mix.lock" }}
- <<: *install_elixir
- <<: *install_hex_archives
Expand All @@ -365,13 +365,13 @@ jobs:
paths:
- farmbot_os/_build/host
- farmbot_os/deps/host
- save_cache:
- save_cache:
key: v14-fbos-coverage-cache-{{ .Branch }}-{{ .Revision }}
paths:
- farmbot_os/cover
- store_artifacts:
path: farmbot_os/cover

report_coverage:
<<: *defaults
environment:
Expand All @@ -388,23 +388,23 @@ jobs:
- restore_cache:
keys:
- v14-fbsupport-test-dependency-cache-{{ checksum "mix.lock" }}
- restore_cache:
keys:
- restore_cache:
keys:
- v14-fbcs-coverage-cache-{{ .Branch }}-{{ .Revision }}
- restore_cache:
keys:
- restore_cache:
keys:
- v14-fbcs-coverage-cache-{{ .Branch }}-{{ .Revision }}
- restore_cache:
keys:
- restore_cache:
keys:
- v14-fbfw-coverage-cache-{{ .Branch }}-{{ .Revision }}
- restore_cache:
keys:
- restore_cache:
keys:
- v14-fbcore-coverage-cache-{{ .Branch }}-{{ .Revision }}
- restore_cache:
keys:
- restore_cache:
keys:
- v14-fbext-coverage-cache-{{ .Branch }}-{{ .Revision }}
- restore_cache:
keys:
- restore_cache:
keys:
- v14-fbos-coverage-cache-{{ .Branch }}-{{ .Revision }}
- run:
name: Check documentation formatting
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# 9.0.3

* Dependency updates

# 9.0.2
* See notes for 9.0.1.

Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Build status
| Master Build Status | Staging Build Status |
| :---: | :---: |
| [![Master Build Status](https://circleci.com/gh/FarmBot/farmbot_os/tree/master.svg?style=svg)](https://circleci.com/gh/FarmBot/farmbot_os/tree/master) | [![Staging Build Status](https://circleci.com/gh/FarmBot/farmbot_os/tree/staging.svg?style=svg)](https://circleci.com/gh/FarmBot/farmbot_os/tree/staging) |
---

<!-- DON'T CHANGE THE TEXT BELOW. It is used in documentation links. -->
# :floppy_disk: Latest OS Image Downloads
<!-- DON'T CHANGE THE TEXT ABOVE. It is used in documentation links. -->
Expand All @@ -12,11 +6,18 @@ Download the version of FarmBot OS that corresponds to the FarmBot kit and compu

| FarmBot Kit | Computer | Download Link |
| --- | --- | --- |
| Genesis v1.2, Genesis v1.3, Genesis v1.4, Genesis XL v1.4 | Raspberry Pi 3 | [Download FBOS](https://github.com/FarmBot/farmbot_os/releases/download/v9.0.2/farmbot-rpi3-9.0.2.img) |
| Genesis v1.2, Genesis v1.3, Genesis v1.4, Genesis XL v1.4 | Raspberry Pi 3 | [Download FBOS](https://github.com/FarmBot/farmbot_os/releases/download/v9.0.3/farmbot-rpi3-9.0.3.img) |
| Express v1.0, Express XL v1.0 | Raspberry Pi Zero W | Coming soon |

---

## Build status
| Master Build Status | Staging Build Status |
| :---: | :---: |
| [![Master Build Status](https://circleci.com/gh/FarmBot/farmbot_os/tree/master.svg?style=svg)](https://circleci.com/gh/FarmBot/farmbot_os/tree/master) | [![Staging Build Status](https://circleci.com/gh/FarmBot/farmbot_os/tree/staging.svg?style=svg)](https://circleci.com/gh/FarmBot/farmbot_os/tree/staging) |

---

## Installation
Installation should be fairly straight forward, you will need a computer for this step.
(everything after this can be set up on a mobile device.)
Expand All @@ -35,6 +36,8 @@ Installation should be fairly straight forward, you will need a computer for thi
1. download the [latest release file, available for download here](#floppy_disk-latest-os-image-downloads).
0. ```dd if=</path/to/file> of=/dev/<sddevice> bs=4``` or use [Etcher](https://etcher.io/).

---

## Running
_Refer to the [software documentation Configurator page](https://software.farm.bot/docs/configurator) for more detailed instructions._

Expand Down
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ This release uses an improved Farmware API:
* If you are a Farmware developer using Farmware Tools (`import farmware_tools`), the reinstalled Farmware should continue working as before. If you have authored a Farmware that does not use the package, you will need to replace any FarmBot device communication in your Farmware to use the `farmware_tools` package.

* See the [Farmware developer documentation](https://developer.farm.bot/docs/farmware) for more information.

# v9

FarmBot OS v8+ uses an improved Farmware API. See the [Farmware developer documentation](https://developer.farm.bot/docs/farmware) for more information.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.2
9.0.3
1 change: 1 addition & 0 deletions farmbot_celery_script/.formatter.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[
line_length: 80,
inputs: ["*.{ex,exs}", "{config,priv,lib,test}/**/*.{ex,exs}"]
]
9 changes: 2 additions & 7 deletions farmbot_celery_script/config/config.exs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
use Mix.Config

if Mix.env() == :test do
config :farmbot_celery_script, FarmbotCeleryScript.SysCalls,
sys_calls: Farmbot.TestSupport.CeleryScript.TestSysCalls
else
config :farmbot_celery_script, FarmbotCeleryScript.SysCalls,
sys_calls: FarmbotCeleryScript.SysCalls.Stubs
end
config :farmbot_celery_script, FarmbotCeleryScript.SysCalls,
sys_calls: FarmbotCeleryScript.SysCalls.Stubs
3 changes: 2 additions & 1 deletion farmbot_celery_script/lib/farmbot_celery_script/ast.ex
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ defmodule FarmbotCeleryScript.AST do
end

@spec new(atom, map, [map]) :: t()
def new(kind, args, body, comment \\ nil, meta \\ nil) when is_map(args) and is_list(body) do
def new(kind, args, body, comment \\ nil, meta \\ nil)
when is_map(args) and is_list(body) do
%AST{
kind: String.to_atom(to_string(kind)),
args: args,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ defmodule FarmbotCeleryScript.AST.Factory do

def read_pin(%AST{} = ast, pin_number, pin_mode) do
ast
|> add_body_node(new(:read_pin, %{pin_number: pin_number, pin_mode: pin_mode}))
|> add_body_node(
new(:read_pin, %{pin_number: pin_number, pin_mode: pin_mode})
)
end

def set_pin_io_mode(%AST{} = ast, pin_number, pin_io_mode) do
ast
|> add_body_node(new(:set_pin_io_mode, %{pin_number: pin_number, pin_io_mode: pin_io_mode}))
|> add_body_node(
new(:set_pin_io_mode, %{pin_number: pin_number, pin_io_mode: pin_io_mode})
)
end

def dump_info(%AST{} = ast) do
Expand Down
18 changes: 14 additions & 4 deletions farmbot_celery_script/lib/farmbot_celery_script/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,20 @@ defmodule FarmbotCeleryScript.Compiler do
end
end

def send_message(%{args: %{message: msg, message_type: type}, body: channels}, env) do
def send_message(
%{args: %{message: msg, message_type: type}, body: channels},
env
) do
# body gets turned into a list of atoms.
# Example:
# [{kind: "channel", args: {channel_name: "email"}}]
# is turned into:
# [:email]
channels =
Enum.map(channels, fn %{kind: :channel, args: %{channel_name: channel_name}} ->
Enum.map(channels, fn %{
kind: :channel,
args: %{channel_name: channel_name}
} ->
String.to_atom(channel_name)
end)

Expand Down Expand Up @@ -218,7 +224,9 @@ defmodule FarmbotCeleryScript.Compiler do

def flash_firmware(%{args: %{package: package_name}}, env) do
quote location: :keep do
FarmbotCeleryScript.SysCalls.flash_firmware(unquote(compile_ast(package_name, env)))
FarmbotCeleryScript.SysCalls.flash_firmware(
unquote(compile_ast(package_name, env))
)
end
end

Expand All @@ -242,7 +250,9 @@ defmodule FarmbotCeleryScript.Compiler do

def factory_reset(%{args: %{package: package}}, env) do
quote location: :keep do
FarmbotCeleryScript.SysCalls.factory_reset(unquote(compile_ast(package, env)))
FarmbotCeleryScript.SysCalls.factory_reset(
unquote(compile_ast(package, env))
)
end
end

Expand Down
33 changes: 25 additions & 8 deletions farmbot_celery_script/lib/farmbot_celery_script/compiler/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ defmodule FarmbotCeleryScript.Compiler.Utils do

var =
quote location: :keep do
{unquote(next_scope_var_name), unquote(Compiler.compile_ast(data_value, env))}
{unquote(next_scope_var_name),
unquote(Compiler.compile_ast(data_value, env))}
end

compile_params_to_function_args(rest, env, [var | acc])
Expand Down Expand Up @@ -117,12 +118,19 @@ defmodule FarmbotCeleryScript.Compiler.Utils do
parent = Keyword.get(params, :parent, %{x: 100, y: 200, z: 300})
"""
def compile_param_declaration(%{args: %{label: var_name, default_value: default}}, env) do
def compile_param_declaration(
%{args: %{label: var_name, default_value: default}},
env
) do
var_name = IdentifierSanitizer.to_variable(var_name)

quote location: :keep do
unquote({var_name, env, __MODULE__}) =
Keyword.get(params, unquote(var_name), unquote(Compiler.compile_ast(default, env)))
Keyword.get(
params,
unquote(var_name),
unquote(Compiler.compile_ast(default, env))
)
end
end

Expand Down Expand Up @@ -152,11 +160,15 @@ defmodule FarmbotCeleryScript.Compiler.Utils do
]
}
"""
def compile_param_application(%{args: %{label: var_name, data_value: value}}, env) do
def compile_param_application(
%{args: %{label: var_name, data_value: value}},
env
) do
var_name = IdentifierSanitizer.to_variable(var_name)

quote location: :keep do
unquote({var_name, [], __MODULE__}) = unquote(Compiler.compile_ast(value, env))
unquote({var_name, [], __MODULE__}) =
unquote(Compiler.compile_ast(value, env))
end
end

Expand All @@ -168,13 +180,16 @@ defmodule FarmbotCeleryScript.Compiler.Utils do
end)
end

def add_sequence_init_and_complete_logs(steps, sequence_name) when is_binary(sequence_name) do
def add_sequence_init_and_complete_logs(steps, sequence_name)
when is_binary(sequence_name) do
# This looks really weird because of the logs before and
# after the compiled steps
List.flatten([
quote do
fn ->
FarmbotCeleryScript.SysCalls.sequence_init_log("Starting #{unquote(sequence_name)}")
FarmbotCeleryScript.SysCalls.sequence_init_log(
"Starting #{unquote(sequence_name)}"
)
end
end,
steps,
Expand All @@ -201,7 +216,9 @@ defmodule FarmbotCeleryScript.Compiler.Utils do
fn _ ->
[
fn ->
FarmbotCeleryScript.SysCalls.sequence_init_log("Starting #{unquote(sequence_name)}")
FarmbotCeleryScript.SysCalls.sequence_init_log(
"Starting #{unquote(sequence_name)}"
)
end
]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ defmodule FarmbotCeleryScript.Compiler.Assertion do
@doc "`Assert` is a internal node useful for self testing."
def assertion(
%{
args: %{lua: expression, assertion_type: assertion_type, _then: then_ast},
args: %{
lua: expression,
assertion_type: assertion_type,
_then: then_ast
},
comment: comment
},
env
Expand Down Expand Up @@ -80,7 +84,10 @@ defmodule FarmbotCeleryScript.Compiler.Assertion do

then_block ++
[
FarmbotCeleryScript.Compiler.compile(%AST{kind: :abort, args: %{}}, [])
FarmbotCeleryScript.Compiler.compile(
%AST{kind: :abort, args: %{}},
[]
)
]
end
end
Expand Down
Loading

0 comments on commit 0b8d211

Please sign in to comment.