Skip to content
Permalink
Browse files

Progress on refactoring data syncing (#643)

  • Loading branch information...
ConnorRigby committed Oct 29, 2018
1 parent dd9428b commit d4cce5165b527228cfcbf1110e12d68c6049ca50
Showing with 3,771 additions and 4,083 deletions.
  1. +3 −0 .formatter.exs
  2. +4 −1 Makefile
  3. +3 −0 farmbot_celery_script/.formatter.exs
  4. +3 −0 farmbot_celery_script/lib/farmbot_celery_script/run_time/instruction_set.ex
  5. +5 −0 farmbot_core/.formatter.exs
  6. +1 −1 farmbot_core/.gitignore
  7. +11 −26 farmbot_core/c_src/build_calendar/build_calendar.c
  8. +26 −10 farmbot_core/config/config.exs
  9. +102 −0 farmbot_core/lib/asset.ex
  10. +36 −0 farmbot_core/lib/asset/device.ex
  11. +55 −0 farmbot_core/lib/asset/diagnostic_dump.ex
  12. +101 −0 farmbot_core/lib/asset/farm_event.ex
  13. +34 −0 farmbot_core/lib/asset/farmware_env.ex
  14. +32 −0 farmbot_core/lib/asset/farmware_installation.ex
  15. +70 −0 farmbot_core/lib/asset/fbos_config.ex
  16. +298 −0 farmbot_core/lib/asset/firmware_config.ex
  17. +37 −0 farmbot_core/lib/asset/peripheral.ex
  18. +20 −0 farmbot_core/lib/asset/persistent_regimen.ex
  19. +72 −0 farmbot_core/lib/asset/pin_binding.ex
  20. +61 −0 farmbot_core/lib/asset/point.ex
  21. +47 −0 farmbot_core/lib/asset/private.ex
  22. +165 −0 farmbot_core/lib/asset/private/local_meta.ex
  23. +63 −0 farmbot_core/lib/asset/regimen.ex
  24. +4 −0 farmbot_core/lib/asset/repo.ex
  25. +29 −0 farmbot_core/lib/asset/schema.ex
  26. +37 −0 farmbot_core/lib/asset/sensor.ex
  27. +44 −0 farmbot_core/lib/asset/sensor_reading.ex
  28. +39 −0 farmbot_core/lib/asset/sequence.ex
  29. +20 −0 farmbot_core/lib/asset/supervisor.ex
  30. +101 −0 farmbot_core/lib/asset/sync.ex
  31. +31 −0 farmbot_core/lib/asset/tool.ex
  32. +15 −0 farmbot_core/lib/asset/view.ex
  33. +80 −0 farmbot_core/lib/asset_monitor.ex
  34. +0 −191 farmbot_core/lib/asset_storage/asset.ex
  35. +0 −31 farmbot_core/lib/asset_storage/asset_logger.ex
  36. +0 −58 farmbot_core/lib/asset_storage/converter.ex
  37. +0 −26 farmbot_core/lib/asset_storage/device.ex
  38. +0 −125 farmbot_core/lib/asset_storage/farm_event.ex
  39. +0 −26 farmbot_core/lib/asset_storage/farmware_env.ex
  40. +0 −25 farmbot_core/lib/asset_storage/farmware_installation.ex
  41. +0 −25 farmbot_core/lib/asset_storage/on_start_task.ex
  42. +0 −26 farmbot_core/lib/asset_storage/peripheral.ex
  43. +0 −27 farmbot_core/lib/asset_storage/persistent_regimen.ex
  44. +0 −34 farmbot_core/lib/asset_storage/pin_binding.ex
  45. +0 −30 farmbot_core/lib/asset_storage/point.ex
  46. +0 −50 farmbot_core/lib/asset_storage/regimen.ex
  47. +0 −4 farmbot_core/lib/asset_storage/repo/module_type/farm_event.ex
  48. +0 −4 farmbot_core/lib/asset_storage/repo/module_type/point.ex
  49. +0 −39 farmbot_core/lib/asset_storage/repo/repo.ex
  50. +0 −102 farmbot_core/lib/asset_storage/repo/snapshot.ex
  51. +0 −26 farmbot_core/lib/asset_storage/sensor.ex
  52. +0 −42 farmbot_core/lib/asset_storage/sequence.ex
  53. +0 −22 farmbot_core/lib/asset_storage/settings.ex
  54. +0 −49 farmbot_core/lib/asset_storage/settings/fbos_config.ex
  55. +0 −115 farmbot_core/lib/asset_storage/settings/firmware_config.ex
  56. +0 −58 farmbot_core/lib/asset_storage/settings/helpers.ex
  57. +0 −22 farmbot_core/lib/asset_storage/supervisor.ex
  58. +0 −121 farmbot_core/lib/asset_storage/sync.ex
  59. +0 −29 farmbot_core/lib/asset_storage/sync_cmd.ex
  60. +0 −22 farmbot_core/lib/asset_storage/tool.ex
  61. +82 −0 farmbot_core/lib/asset_supervisor.ex
  62. +3 −0 farmbot_core/lib/asset_worker.ex
  63. +125 −0 farmbot_core/lib/asset_workers/farm_event_worker.ex
  64. +46 −0 farmbot_core/lib/asset_workers/peripheral_worker.ex
  65. +13 −0 farmbot_core/lib/asset_workers/persistent_regimen_worker.ex
  66. +11 −0 farmbot_core/lib/asset_workers/pin_binding_worker.ex
  67. +4 −3 farmbot_core/lib/celery_script/celery_script.ex
  68. +11 −1 farmbot_core/lib/config_storage/config_storage.ex
  69. +0 −472 farmbot_core/lib/farm_event/manager.ex
  70. +0 −16 farmbot_core/lib/farm_event/supervisor.ex
  71. +0 −13 farmbot_core/lib/json/jason_parser.ex
  72. +1 −1 farmbot_core/lib/log_storage/log.ex
  73. +0 −14 farmbot_core/lib/peripheral/supervisor.ex
  74. +0 −41 farmbot_core/lib/peripheral/worker.ex
  75. +0 −12 farmbot_core/lib/pin_binding/handler.ex
  76. +0 −191 farmbot_core/lib/pin_binding/manager.ex
  77. +0 −50 farmbot_core/lib/pin_binding/stub_handler.ex
  78. +0 −15 farmbot_core/lib/pin_binding/supervisor.ex
  79. +0 −26 farmbot_core/lib/pin_binding/to_string.ex
  80. +0 −198 farmbot_core/lib/regimen/manager.ex
  81. +0 −89 farmbot_core/lib/regimen/name_provider.ex
  82. +0 −185 farmbot_core/lib/regimen/supervisor.ex
  83. +18 −0 farmbot_core/lib/time_utils.ex
  84. +23 −6 farmbot_core/mix.exs
  85. +1 −1 farmbot_core/mix.lock
  86. +4 −0 farmbot_core/priv/asset/migrations/.formatter.exs
  87. +0 −18 farmbot_core/priv/asset/migrations/20170919150432_add_farm_events_table.exs
  88. +0 −14 farmbot_core/priv/asset/migrations/20170920025503_add_peripherals_table.exs
  89. +0 −15 farmbot_core/priv/asset/migrations/20170920182759_add_sequences_table.exs
  90. +0 −13 farmbot_core/priv/asset/migrations/20170920182805_add_regimens_table.exs
  91. +0 −12 farmbot_core/priv/asset/migrations/20170920182817_add_tools_table.exs
  92. +0 −12 farmbot_core/priv/asset/migrations/20170920182827_add_tool_slots_table.exs
  93. +0 −18 farmbot_core/priv/asset/migrations/20170920182853_add_points_table.exs
  94. +0 −11 farmbot_core/priv/asset/migrations/20170920183526_add_generic_pointers_table.exs
  95. +0 −13 farmbot_core/priv/asset/migrations/20171025231225_add_devices_table.exs
  96. +0 −14 farmbot_core/priv/asset/migrations/20180309203638_add_sensors_table.exs
  97. +0 −41 farmbot_core/priv/asset/migrations/20180322010355_fix_namespaces.exs
  98. +0 −12 farmbot_core/priv/asset/migrations/20180621184803_add_sync_cmd_table.exs
  99. +0 −14 farmbot_core/priv/asset/migrations/20180621184905_add_regimen_persistence_table.exs
  100. +0 −9 farmbot_core/priv/asset/migrations/20180713180958_pin_bindings_special_action.exs
  101. +0 −7 farmbot_core/priv/asset/migrations/20180717220240_pin_bindings_unique_index.exs
  102. +0 −7 farmbot_core/priv/asset/migrations/20180718180123_pin_binding_delete.exs
  103. +0 −13 farmbot_core/priv/asset/migrations/20180814173955_create_farmware_env_table.exs
  104. +0 −13 farmbot_core/priv/asset/migrations/20180814174016_create_farmware_installations_table.exs
  105. +0 −65 farmbot_core/priv/asset/migrations/20180815120750_add_local_id_and_dirty_fields.exs
  106. +13 −0 farmbot_core/priv/asset/migrations/20181017210730_create_local_metas_table.exs
  107. +13 −0 farmbot_core/priv/asset/migrations/20181017210735_create_devices_table.exs
  108. +12 −0 farmbot_core/priv/asset/migrations/20181017223659_create_tools_table.exs
  109. +14 −0 farmbot_core/priv/asset/migrations/20181017225445_create_peripherals_table.exs
  110. +14 −0 farmbot_core/priv/asset/migrations/20181017230326_create_sensors_table.exs
  111. +17 −0 farmbot_core/priv/asset/migrations/20181017230333_create_sensor_readings_table.exs
  112. +15 −0 farmbot_core/priv/asset/migrations/20181018005030_create_sequences_table.exs
  113. +13 −0 farmbot_core/priv/asset/migrations/20181018022229_create_regimens_table.exs
  114. +4 −3 ...ons/{20180710160707_create_pin_bindings_table.exs → 20181018040229_create_pin_bindings_table.exs}
  115. +20 −0 farmbot_core/priv/asset/migrations/20181019165701_create_points_table.exs
  116. +18 −0 farmbot_core/priv/asset/migrations/20181019172740_create_farm_events_table.exs
  117. +99 −0 farmbot_core/priv/asset/migrations/20181019180739_create_firmware_configs_table.exs
  118. +23 −0 farmbot_core/priv/asset/migrations/20181019180816_create_fbos_configs_table.exs
  119. +12 −0 farmbot_core/priv/asset/migrations/20181019180911_create_farmware_installations_table.exs
  120. +13 −0 farmbot_core/priv/asset/migrations/20181019180925_create_farmware_envs_table.exs
  121. +18 −0 farmbot_core/priv/asset/migrations/20181019180955_create_diagnostic_dumps_table.exs
  122. +26 −0 farmbot_core/priv/asset/migrations/20181022002449_create_syncs_table.exs
  123. +16 −0 farmbot_core/priv/asset/migrations/20181022002450_create_persistent_regimens_table.exs
  124. +21 −0 farmbot_core/priv/asset/migrations/20181022002455_create_id_unique_indexes.exs
  125. +10 −11 farmbot_core/priv/config/migrations/20170922221449_seed_groups.exs
  126. +3 −2 farmbot_core/priv/config/migrations/20180403180047_add_regimen_persistence_table.exs
  127. +24 −5 farmbot_core/priv/config/migrations/20180724200909_migrate_secret.exs
  128. +1 −1 farmbot_core/priv/config/migrations/20180814180226_add_farmware_migration.exs
  129. +1 −0 farmbot_core/priv/config/migrations/20180814202716_add_ignore_fw_config.exs
  130. +1 −1 farmbot_core/priv/logger/migrations/20180620135642_add_log_buffer.exs
  131. +57 −0 farmbot_core/test/asset_monitor_test.exs
  132. +18 −175 farmbot_core/test/asset_test.exs
  133. +94 −0 farmbot_core/test/asset_workers/farm_event_worker_test.exs
  134. +0 −1 farmbot_core/test/botstate_test.exs
  135. +21 −0 farmbot_core/test/celery_script_test.exs
  136. +5 −0 farmbot_ext/.formatter.exs
  137. +13 −7 farmbot_ext/config/config.exs
  138. +3 −1 farmbot_ext/lib/amqp/amqp_supervisor.ex
  139. +77 −28 farmbot_ext/lib/amqp/auto_sync_transport.ex
  140. +9 −6 farmbot_ext/lib/amqp/bot_state_transport.ex
  141. +28 −14 farmbot_ext/lib/amqp/celery_script_transport.ex
  142. +18 −7 farmbot_ext/lib/amqp/channel_supervisor.ex
  143. +20 −11 farmbot_ext/lib/amqp/connection_worker.ex
  144. +14 −7 farmbot_ext/lib/amqp/log_transport.ex
  145. +81 −0 farmbot_ext/lib/api.ex
  146. +109 −0 farmbot_ext/lib/api/dirty_worker.ex
  147. +48 −0 farmbot_ext/lib/api/dirty_worker/supervisor.ex
  148. +108 −0 farmbot_ext/lib/api/eager_loader.ex
  149. +48 −0 farmbot_ext/lib/api/eager_loader/supervisor.ex
  150. +164 −0 farmbot_ext/lib/api/reconciler.ex
  151. +65 −0 farmbot_ext/lib/api/sync_group.ex
  152. +15 −0 farmbot_ext/lib/api/view.ex
  153. +0 −36 farmbot_ext/lib/auto_sync_task.ex
  154. +97 −0 farmbot_ext/lib/bootstrap/api_task.ex
  155. +0 −87 farmbot_ext/lib/bootstrap/auth_task.ex
  156. +52 −27 farmbot_ext/lib/bootstrap/authorization.ex
  157. +13 −12 farmbot_ext/lib/bootstrap/supervisor.ex
  158. +0 −19 farmbot_ext/lib/http/helpers.ex
  159. +0 −110 farmbot_ext/lib/http/http.ex
  160. +0 −113 farmbot_ext/lib/http/image_uploader.ex
  161. +0 −39 farmbot_ext/lib/http/settings_worker.ex
  162. +0 −20 farmbot_ext/lib/http/supervisor.ex
  163. +2 −5 farmbot_ext/lib/jwt.ex
  164. +0 −304 farmbot_ext/lib/settings_sync.ex
  165. +1 −2 farmbot_ext/mix.exs
  166. +6 −6 farmbot_ext/mix.lock
  167. +5 −0 farmbot_os/.formatter.exs
  168. +1 −1 farmbot_os/mix.lock.host
  169. +65 −0 test/support/asset_fixtures.ex
  170. +87 −0 test/support/test_io_layer.ex
  171. +15 −0 test/support/test_support.ex
@@ -0,0 +1,3 @@
[
inputs: ["*.{ex,exs}", "{test}/**/*.{ex,exs}"]
]
@@ -26,11 +26,14 @@ help:
@echo " clean - clean all."

clean_other_branch:
rm -rf _build deps c_src config tmp
rm -rf _build deps c_src config tmp priv

clean: clean_other_branch
@for project in $(PROJECTS) ; do \
echo cleaning $$project ; \
rm -rf $$project/erl_crash.dump ; \
rm -rf $$project/.*.sqlite3* ; \
rm -rf $$project/*.sqlite3* ; \
rm -rf $$project/_build ; \
rm -rf $$project/deps ; \
rm -rf $$project/priv/*.so ; \
@@ -0,0 +1,3 @@
[
inputs: ["*.{ex,exs}", "{config,priv,lib,test}/**/*.{ex,exs}"],
]
@@ -103,6 +103,9 @@ defmodule Farmbot.CeleryScript.RunTime.InstructionSet do
@doc "Create a diagnostic dump of information."
simple_io_instruction(:dump_info)

@doc false
simple_io_instruction(:debug)

@doc "Move to a location offset by another location."
def move_absolute(%FarmProc{} = farm_proc) do
pc = get_pc_ptr(farm_proc)
@@ -0,0 +1,5 @@
[
import_deps: [:ecto],
inputs: ["*.{ex,exs}", "{config,priv,test}/**/*.{ex,exs}"],
subdirectories: ["priv/*/migrations"]
]
@@ -22,7 +22,7 @@ erl_crash.dump
# Ignore package tarball (built via "mix hex.build").
farmbot_ng-*.tar

*.sqlite3
*.sqlite3*
*.so
*.hex
!priv/eeprom_clear.ino.hex
@@ -1,9 +1,11 @@
#include <stdlib.h>
#include <string.h>
#include <limits.h>

#include <erl_nif.h>

#define MAX_GENERATED 3
// Enough space for one event every minute for 20 years.
#define MAX_GENERATED LONG_MAX

static ERL_NIF_TERM do_build_calendar(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
@@ -19,37 +21,20 @@ static ERL_NIF_TERM do_build_calendar(ErlNifEnv* env, int argc, const ERL_NIF_TE
enif_get_long(env, argv[4], &frequencySeconds);

// Data used to build the calendar.
long int gracePeriodSeconds;
gracePeriodSeconds = nowSeconds - 60;
long int gracePeriodSeconds = nowSeconds - 60;
long int step = frequencySeconds * repeat;

// iterators for loops
long int i, j;
// iterator for loops
long int i;

// build our events array, fill it with zeroes.
long int events[MAX_GENERATED];
for(i = 0; i < MAX_GENERATED; i++)
events[i] = 0;

// put up to MAX_GENERATED events into the array
for(j = 0, i = startTimeSeconds; (i < endTimeSeconds) && (j < MAX_GENERATED); i += step) {
// if this event (i) is after the grace period, add it to the array.
// count up to MAX_GENERATED items
for(i = startTimeSeconds; i < endTimeSeconds; i += step) {
// if this event (i) is after the grace period this is the next event.
if(i > gracePeriodSeconds) {
events[j] = i;
j++;
return enif_make_long(env, i);
}
}

// Count up our total generated events
for(i=0, j=0; j<MAX_GENERATED; j++) { if(events[j] > 0) { i++; } }

// Build the array to be returned.
ERL_NIF_TERM retArr [i];
for(j=0; j<i ; j++)
retArr[j] = enif_make_long(env, events[j]);

// we survived.
return enif_make_list_from_array(env, retArr, i);
return enif_make_long(env, startTimeSeconds);
}

static ErlNifFunc nif_funcs[] =
@@ -1,41 +1,57 @@
use Mix.Config

# config :logger, [
# utc_log: true,
# handle_otp_reports: true,
# handle_sasl_reports: true,
# ]
config :logger,
handle_otp_reports: true,
handle_sasl_reports: true

config :ecto, json_library: Farmbot.JSON

# Configure Farmbot Behaviours.
config :farmbot_core, :behaviour,
firmware_handler: Farmbot.Firmware.StubHandler,
leds_handler: Farmbot.Leds.StubHandler,
pin_binding_handler: Farmbot.PinBinding.StubHandler,
celery_script_io_layer: Farmbot.CeleryScript.StubIOLayer,
celery_script_io_layer: Farmbot.Core.CeleryScript.StubIOLayer,
json_parser: Farmbot.JSON.JasonParser

config :farmbot_core, Farmbot.AssetWorker.Farmbot.Asset.FarmEvent, checkup_time_ms: 10_000

config :farmbot_core, Farmbot.AssetMonitor, checkup_time_ms: 30_000

if Mix.env() == :test do
config :farmbot_core, :behaviour,
celery_script_io_layer: Farmbot.TestSupport.CeleryScript.TestIOLayer

config :farmbot_core, Farmbot.AssetWorker.Farmbot.Asset.FarmEvent, checkup_time_ms: 1000

# must be lower than other timers
# To ensure other timers have time to timeout
config :farmbot_core, Farmbot.AssetMonitor, checkup_time_ms: 500
end

config :farmbot_core,
ecto_repos: [Farmbot.Config.Repo, Farmbot.Logger.Repo, Farmbot.Asset.Repo],
expected_fw_versions: ["6.4.2.F", "6.4.2.R", "6.4.2.G"],
default_server: "https://my.farm.bot",
default_currently_on_beta: String.contains?(to_string(:os.cmd('git rev-parse --abbrev-ref HEAD')), "beta"),
default_currently_on_beta:
String.contains?(to_string(:os.cmd('git rev-parse --abbrev-ref HEAD')), "beta"),
firmware_io_logs: false,
farm_event_debug_log: false

config :farmbot_core, Farmbot.Config.Repo,
adapter: Sqlite.Ecto2,
loggers: [],
database: ".#{Mix.env}_configs.sqlite3",
database: ".#{Mix.env()}_configs.sqlite3",
priv: "priv/config"

config :farmbot_core, Farmbot.Logger.Repo,
adapter: Sqlite.Ecto2,
loggers: [],
database: ".#{Mix.env}_logs.sqlite3",
database: ".#{Mix.env()}_logs.sqlite3",
priv: "priv/logger"

config :farmbot_core, Farmbot.Asset.Repo,
adapter: Sqlite.Ecto2,
loggers: [],
database: ".#{Mix.env}_assets.sqlite3",
database: ".#{Mix.env()}_assets.sqlite3",
priv: "priv/asset"
@@ -0,0 +1,102 @@
defmodule Farmbot.Asset do
alias Farmbot.Asset.{Repo,
Device,
FarmEvent,
FbosConfig,
FirmwareConfig,
PinBinding,
Regimen,
PersistentRegimen,
Sequence
}

import Ecto.Query

## Begin Device

def device() do
Repo.one(Device) || %Device{}
end

## End Device

## Begin FarmEvent

@doc "Returns a FarmEvent by its API id."
def get_farm_event(id) do
Repo.get_by(FarmEvent, id: id)
end

def update_farm_event!(farm_event, params) do
FarmEvent.changeset(farm_event, params)
|> Repo.update!()
end

## End FarmEvent

## Begin FbosConfig

def fbos_config() do
Repo.one(FbosConfig) || %FbosConfig{}
end

def fbos_config(field) do
Map.fetch!(fbos_config(), field)
end

## End FbosConfig

## Begin FirmwareConfig

def firmware_config() do
Repo.one(FirmwareConfig) || %FirmwareConfig{}
end

def firmware_config(field) do
Map.fetch!(firmware_config(), field)
end

## End FirmwareConfig

## Begin PersistentRegimen

def upsert_persistent_regimen(%Regimen{} = regimen, %FarmEvent{} = farm_event, params \\ %{}) do
q = from pr in PersistentRegimen, where: pr.regimen_id == ^regimen.local_id and pr.farm_event_id == ^farm_event.local_id
pr = Repo.one(q) || %PersistentRegimen{}
pr
|> Repo.preload([:regimen, :farm_event])
|> PersistentRegimen.changeset(params)
|> Ecto.Changeset.put_assoc(:regimen, regimen)
|> Ecto.Changeset.put_assoc(:farm_event, farm_event)
|> Repo.insert_or_update()
end

## End PersistentRegimen

## Begin PinBinding

@doc "Lists all available pin bindings"
def list_pin_bindings do
Repo.all(PinBinding)
end

## End PinBinding

## Begin Regimen

@doc "Get a regimen by it's API id and FarmEvent API id"
def get_regimen!(params) do
Repo.get_by!(Regimen, params)
end

## End Regimen

## Begin Sequence

@doc "Get a sequence by it's API id"
def get_sequence!(params) do
Repo.get_by!(Sequence, params)
end

## End Sequence
end
@@ -0,0 +1,36 @@
defmodule Farmbot.Asset.Device do
@moduledoc """
The current device. Should only ever be _one_ of these. If not there is a huge
problem probably higher up the stack.
"""

use Farmbot.Asset.Schema, path: "/api/device"

schema "devices" do
field(:id, :id)

has_one(:local_meta, Farmbot.Asset.Private.LocalMeta,
on_delete: :delete_all,
references: :local_id,
foreign_key: :asset_local_id
)

field(:name, :string)
field(:timezone, :string)
timestamps()
end

view device do
%{
id: device.id,
name: device.name,
timezone: device.timezone
}
end

def changeset(device, params \\ %{}) do
device
|> cast(params, [:id, :name, :timezone, :created_at, :updated_at])
|> validate_required([])
end
end
@@ -0,0 +1,55 @@
defmodule Elixir.Farmbot.Asset.DiagnosticDump do
@moduledoc """
"""

use Farmbot.Asset.Schema, path: "/api/diagnostic_dumps"

schema "diagnostic_dumps" do
field(:id, :id)

has_one(:local_meta, Farmbot.Asset.Private.LocalMeta,
on_delete: :delete_all,
references: :local_id,
foreign_key: :asset_local_id
)

field(:ticket_identifier, :string)
field(:fbos_commit, :string)
field(:fbos_version, :string)
field(:firmware_commit, :string)
field(:firmware_state, :string)
field(:network_interface, :string)
field(:fbos_dmesg_dump, :string)
timestamps()
end

view diagnostic_dump do
%{
id: diagnostic_dump.id,
ticket_identifier: diagnostic_dump.ticket_identifier,
fbos_commit: diagnostic_dump.fbos_commit,
fbos_version: diagnostic_dump.fbos_version,
firmware_commit: diagnostic_dump.firmware_commit,
firmware_state: diagnostic_dump.firmware_state,
network_interface: diagnostic_dump.network_interface,
fbos_dmesg_dump: diagnostic_dump.fbos_dmesg_dump
}
end

def changeset(diagnostic_dump, params \\ %{}) do
diagnostic_dump
|> cast(params, [
:id,
:ticket_identifier,
:fbos_commit,
:fbos_version,
:firmware_commit,
:firmware_state,
:network_interface,
:fbos_dmesg_dump,
:created_at,
:updated_at
])
|> validate_required([])
end
end

0 comments on commit d4cce51

Please sign in to comment.
You can’t perform that action at this time.