diff --git a/app/controllers/api/diagnostic_dumps_controller.rb b/app/controllers/api/diagnostic_dumps_controller.rb deleted file mode 100644 index ede80aaba..000000000 --- a/app/controllers/api/diagnostic_dumps_controller.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Api - class DiagnosticDumpsController < Api::AbstractController - def index - render json: diagnostic_dumps - end - - def create - mutate DiagnosticDumps::Create.run(raw_json, device: current_device) - end - - def destroy - diagnostic_dump.destroy! - render json: "" - end - - private - - def diagnostic_dumps - current_device.diagnostic_dumps - end - - def diagnostic_dump - @diagnostic_dump ||= diagnostic_dumps.find(params[:id]) - end - end -end diff --git a/app/models/device.rb b/app/models/device.rb index 683fcd808..f2ecf6521 100644 --- a/app/models/device.rb +++ b/app/models/device.rb @@ -16,7 +16,7 @@ class Device < ApplicationRecord images logs peripherals pin_bindings plant_templates points point_groups regimens saved_gardens sensor_readings sensors sequences token_issuances tools - webcam_feeds diagnostic_dumps fragments) + webcam_feeds fragments) PLURAL_RESOURCES.map { |resources| has_many resources, dependent: :destroy } diff --git a/app/models/diagnostic_dump.rb b/app/models/diagnostic_dump.rb deleted file mode 100644 index 38601231b..000000000 --- a/app/models/diagnostic_dump.rb +++ /dev/null @@ -1,3 +0,0 @@ -class DiagnosticDump < ApplicationRecord - belongs_to :device -end diff --git a/app/mutations/diagnostic_dumps/create.rb b/app/mutations/diagnostic_dumps/create.rb deleted file mode 100644 index 3aa2fb082..000000000 --- a/app/mutations/diagnostic_dumps/create.rb +++ /dev/null @@ -1,25 +0,0 @@ -module DiagnosticDumps - class Create < Mutations::Command - required do - model :device, class: Device - string :fbos_version - string :fbos_commit - string :firmware_commit - string :network_interface - string :fbos_dmesg_dump - string :firmware_state - end - - def execute - DiagnosticDump - .create!(device: device, - ticket_identifier: rand(36**5).to_s(36), - fbos_version: fbos_version, - fbos_commit: fbos_commit, - firmware_commit: firmware_commit, - network_interface: network_interface, - fbos_dmesg_dump: fbos_dmesg_dump, - firmware_state: firmware_state,) - end - end -end diff --git a/app/mutations/diagnostic_dumps/destroy.rb b/app/mutations/diagnostic_dumps/destroy.rb deleted file mode 100644 index 3bd82e306..000000000 --- a/app/mutations/diagnostic_dumps/destroy.rb +++ /dev/null @@ -1,3 +0,0 @@ -module DiagnosticDumps - Destroy = CreateDestroyer.run!(resource: DiagnosticDump) -end diff --git a/app/serializers/diagnostic_dump_serializer.rb b/app/serializers/diagnostic_dump_serializer.rb deleted file mode 100644 index ae83278cf..000000000 --- a/app/serializers/diagnostic_dump_serializer.rb +++ /dev/null @@ -1,5 +0,0 @@ -class DiagnosticDumpSerializer < ApplicationSerializer - attributes :device_id, :ticket_identifier, :fbos_commit, :fbos_version, - :firmware_commit, :firmware_state, :network_interface, - :fbos_dmesg_dump -end diff --git a/config/routes.rb b/config/routes.rb index 1c8717c8d..d520ee751 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,6 @@ FarmBot::Application.routes.draw do # Standard API Resources: { alerts: [:create, :destroy, :index], - diagnostic_dumps: [:create, :destroy, :index], farm_events: [:create, :destroy, :index, :show, :update], farmware_envs: [:create, :destroy, :index, :show, :update], first_party_farmwares: [:show, :index], diff --git a/db/migrate/20200204192005_drop_diagnostic_dumps.rb b/db/migrate/20200204192005_drop_diagnostic_dumps.rb new file mode 100644 index 000000000..5fd5c178b --- /dev/null +++ b/db/migrate/20200204192005_drop_diagnostic_dumps.rb @@ -0,0 +1,20 @@ +class DropDiagnosticDumps < ActiveRecord::Migration[6.0] + def change + drop_table :diagnostic_dumps do |t| + t.references :device, foreign_key: true, null: false + t.string :fbos_commit, null: false + t.string :fbos_version, null: false + t.string :firmware_commit, null: false + t.string :firmware_hardware, limit: 12 + t.string :firmware_state, null: false + t.string :firmware_version, limit: 12 + t.string :network_interface, null: false + t.string :soc_temp, limit: 12 + t.string :sync_status, limit: 12 + t.string :ticket_identifier, null: false, unique: true + t.string :wifi_level, limit: 12 + t.text :fbos_dmesg_dump, null: false + t.timestamps + end + end +end diff --git a/db/structure.sql b/db/structure.sql index 6592bfcd4..0a58a1615 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -301,49 +301,6 @@ CREATE SEQUENCE public.devices_id_seq ALTER SEQUENCE public.devices_id_seq OWNED BY public.devices.id; --- --- Name: diagnostic_dumps; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.diagnostic_dumps ( - id bigint NOT NULL, - device_id bigint NOT NULL, - ticket_identifier character varying NOT NULL, - fbos_commit character varying NOT NULL, - fbos_version character varying NOT NULL, - firmware_commit character varying NOT NULL, - firmware_state character varying NOT NULL, - network_interface character varying NOT NULL, - fbos_dmesg_dump text NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - sync_status character varying(12), - wifi_level character varying(12), - soc_temp character varying(12), - firmware_hardware character varying(12), - firmware_version character varying(12) -); - - --- --- Name: diagnostic_dumps_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.diagnostic_dumps_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: diagnostic_dumps_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.diagnostic_dumps_id_seq OWNED BY public.diagnostic_dumps.id; - - -- -- Name: edge_nodes; Type: TABLE; Schema: public; Owner: - -- @@ -1877,13 +1834,6 @@ ALTER TABLE ONLY public.delayed_jobs ALTER COLUMN id SET DEFAULT nextval('public ALTER TABLE ONLY public.devices ALTER COLUMN id SET DEFAULT nextval('public.devices_id_seq'::regclass); --- --- Name: diagnostic_dumps id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.diagnostic_dumps ALTER COLUMN id SET DEFAULT nextval('public.diagnostic_dumps_id_seq'::regclass); - - -- -- Name: edge_nodes id; Type: DEFAULT; Schema: public; Owner: - -- @@ -2193,14 +2143,6 @@ ALTER TABLE ONLY public.devices ADD CONSTRAINT devices_pkey PRIMARY KEY (id); --- --- Name: diagnostic_dumps diagnostic_dumps_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.diagnostic_dumps - ADD CONSTRAINT diagnostic_dumps_pkey PRIMARY KEY (id); - - -- -- Name: edge_nodes edge_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -2552,13 +2494,6 @@ CREATE INDEX index_devices_on_mounted_tool_id ON public.devices USING btree (mou CREATE INDEX index_devices_on_timezone ON public.devices USING btree (timezone); --- --- Name: index_diagnostic_dumps_on_device_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX index_diagnostic_dumps_on_device_id ON public.diagnostic_dumps USING btree (device_id); - - -- -- Name: index_edge_nodes_on_kind_and_value; Type: INDEX; Schema: public; Owner: - -- @@ -3150,14 +3085,6 @@ ALTER TABLE ONLY public.active_storage_attachments ADD CONSTRAINT fk_rails_c3b3935057 FOREIGN KEY (blob_id) REFERENCES public.active_storage_blobs(id); --- --- Name: diagnostic_dumps fk_rails_c5df7fdc83; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.diagnostic_dumps - ADD CONSTRAINT fk_rails_c5df7fdc83 FOREIGN KEY (device_id) REFERENCES public.devices(id); - - -- -- Name: farmware_installations fk_rails_c72f38683f; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -3448,6 +3375,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20191203163621'), ('20191219212755'), ('20191220010646'), -('20200116140201'); +('20200116140201'), +('20200204192005'); diff --git a/frontend/__test_support__/control_panel_state.ts b/frontend/__test_support__/control_panel_state.ts index b38c276ac..13eddf61a 100644 --- a/frontend/__test_support__/control_panel_state.ts +++ b/frontend/__test_support__/control_panel_state.ts @@ -7,7 +7,6 @@ export const panelState = (): ControlPanelState => { encoders_and_endstops: false, danger_zone: false, power_and_reset: false, - pin_guard: false, - diagnostic_dumps: false + pin_guard: false }; }; diff --git a/frontend/__test_support__/fake_state/bot.ts b/frontend/__test_support__/fake_state/bot.ts index 1b0bef683..ec6c82df5 100644 --- a/frontend/__test_support__/fake_state/bot.ts +++ b/frontend/__test_support__/fake_state/bot.ts @@ -10,7 +10,6 @@ export const bot: Everything["bot"] = { "danger_zone": false, "power_and_reset": false, "pin_guard": false, - "diagnostic_dumps": false }, "hardware": { "gpio_registry": {}, diff --git a/frontend/__test_support__/fake_state/resources.ts b/frontend/__test_support__/fake_state/resources.ts index 1c254d97f..9a545bee4 100644 --- a/frontend/__test_support__/fake_state/resources.ts +++ b/frontend/__test_support__/fake_state/resources.ts @@ -1,7 +1,6 @@ import { Everything } from "../../interfaces"; import { buildResourceIndex } from "../resource_index_builder"; import { - TaggedDiagnosticDump, TaggedFarmEvent, TaggedFbosConfig, TaggedFirmwareConfig, @@ -159,23 +158,6 @@ export function fakePlant(): TaggedPlantPointer { }); } -export function fakeDiagnosticDump(): TaggedDiagnosticDump { - const string = "----PLACEHOLDER DIAG STUFF ---"; - return fakeResource("DiagnosticDump", { - id: idCounter++, - device_id: idCounter++, - ticket_identifier: string, - fbos_commit: string, - fbos_version: string, - firmware_commit: string, - firmware_state: string, - network_interface: string, - fbos_dmesg_dump: string, - created_at: "2018-01-11T20:20:38.362Z", - updated_at: "2018-01-11T20:20:38.362Z", - }); -} - export function fakePoint(): TaggedGenericPointer { return fakeResource("Point", { id: idCounter++, diff --git a/frontend/__test_support__/resource_index_builder.ts b/frontend/__test_support__/resource_index_builder.ts index d70ab24fb..1272005d0 100644 --- a/frontend/__test_support__/resource_index_builder.ts +++ b/frontend/__test_support__/resource_index_builder.ts @@ -375,7 +375,6 @@ const KIND_PRIORITY: ResourceLookupTable = { Regimen: 3, PinBinding: 3, FarmEvent: 4, - DiagnosticDump: 4, Image: 4, Log: 4, WebcamFeed: 4, diff --git a/frontend/api/__tests__/api_test.ts b/frontend/api/__tests__/api_test.ts index ca67d50a4..5edfcce36 100644 --- a/frontend/api/__tests__/api_test.ts +++ b/frontend/api/__tests__/api_test.ts @@ -13,7 +13,6 @@ describe("API", () => { [API.current.sensorReadingPath, BASE + "/api/sensor_readings"], [API.current.farmwareEnvPath, BASE + "/api/farmware_envs/"], [API.current.plantTemplatePath, BASE + "/api/plant_templates/"], - [API.current.diagnosticDumpsPath, BASE + "/api/diagnostic_dumps/"], [API.current.farmwareInstallationPath, BASE + "/api/farmware_installations/"], [API.current.globalBulletinPath, BASE + "/api/global_bulletins/"], [API.current.accountSeedPath, BASE + "/api/device/seed"], diff --git a/frontend/api/api.ts b/frontend/api/api.ts index 8996be830..03d5a55d0 100644 --- a/frontend/api/api.ts +++ b/frontend/api/api.ts @@ -154,8 +154,6 @@ export class API { get exportDataPath() { return `${this.baseUrl}/api/export_data`; } /** /api/plant_templates/:id */ get plantTemplatePath() { return `${this.baseUrl}/api/plant_templates/`; } - /** /api/diagnostic_dumps/:id */ - get diagnosticDumpsPath() { return `${this.baseUrl}/api/diagnostic_dumps/`; } /** /api/farmware_installations/:id */ get farmwareInstallationPath() { return `${this.baseUrl}/api/farmware_installations/`; diff --git a/frontend/api/crud.ts b/frontend/api/crud.ts index a39991d7f..310c55a5a 100644 --- a/frontend/api/crud.ts +++ b/frontend/api/crud.ts @@ -260,7 +260,6 @@ export function urlFor(tag: ResourceName) { const OPTIONS: Partial> = { Alert: API.current.alertPath, Device: API.current.devicePath, - DiagnosticDump: API.current.diagnosticDumpsPath, FarmEvent: API.current.farmEventsPath, FarmwareEnv: API.current.farmwareEnvPath, FarmwareInstallation: API.current.farmwareInstallationPath, diff --git a/frontend/api/maybe_start_tracking.ts b/frontend/api/maybe_start_tracking.ts index f96748b82..dfed2ade7 100644 --- a/frontend/api/maybe_start_tracking.ts +++ b/frontend/api/maybe_start_tracking.ts @@ -3,7 +3,6 @@ import { startTracking } from "../connectivity/data_consistency"; import { unpackUUID } from "../util"; const BLACKLIST: ResourceName[] = [ - "DiagnosticDump", "FbosConfig", "FirmwareConfig", "Image", diff --git a/frontend/devices/__tests__/actions_test.ts b/frontend/devices/__tests__/actions_test.ts index da3893a92..ad82f57be 100644 --- a/frontend/devices/__tests__/actions_test.ts +++ b/frontend/devices/__tests__/actions_test.ts @@ -13,8 +13,7 @@ const mockDeviceDefault: DeepPartial = { readPin: jest.fn(() => Promise.resolve()), home: jest.fn(() => Promise.resolve()), sync: jest.fn(() => Promise.resolve()), - readStatus: jest.fn(() => Promise.resolve()), - dumpInfo: jest.fn(() => Promise.resolve()) + readStatus: jest.fn(() => Promise.resolve()) }; const mockDevice = { @@ -213,13 +212,6 @@ describe("MCUFactoryReset()", function () { }); }); -describe("requestDiagnostic", () => { - it("requests that FBOS build a diagnostic report", () => { - actions.requestDiagnostic(); - expect(mockDevice.current.dumpInfo).toHaveBeenCalled(); - }); -}); - describe("settingToggle()", () => { it("toggles mcu param via FirmwareConfig", () => { const sourceSetting = () => ({ value: 1, consistent: true }); diff --git a/frontend/devices/__tests__/reducer_test.ts b/frontend/devices/__tests__/reducer_test.ts index 160dacea9..a96115cc1 100644 --- a/frontend/devices/__tests__/reducer_test.ts +++ b/frontend/devices/__tests__/reducer_test.ts @@ -53,7 +53,7 @@ describe("botReducer", () => { }); const bulkToggable = - omit(state.controlPanelState, "power_and_reset", "diagnostic_dumps"); + omit(state.controlPanelState, "power_and_reset"); values(bulkToggable).map(value => { expect(value).toBeTruthy(); }); diff --git a/frontend/devices/actions.ts b/frontend/devices/actions.ts index ec91da775..30cbcaab6 100644 --- a/frontend/devices/actions.ts +++ b/frontend/devices/actions.ts @@ -168,11 +168,6 @@ export function execSequence( } } -export function requestDiagnostic() { - const noun = t("Diagnostic Request"); - return getDevice().dumpInfo().then(commandOK(noun), commandErr(noun)); -} - const tagNameToVersionString = (tagName: string): string => tagName.toLowerCase().replace("v", ""); diff --git a/frontend/devices/components/__tests__/diagnostic_dump_row_test.tsx b/frontend/devices/components/__tests__/diagnostic_dump_row_test.tsx deleted file mode 100644 index d59a17931..000000000 --- a/frontend/devices/components/__tests__/diagnostic_dump_row_test.tsx +++ /dev/null @@ -1,23 +0,0 @@ -jest.mock("../../../api/crud", () => { - return { destroy: jest.fn() }; -}); - -import * as React from "react"; -import { mount } from "enzyme"; -import { DiagnosticDumpRow } from "../diagnostic_dump_row"; -import { - fakeDiagnosticDump -} from "../../../__test_support__/fake_state/resources"; -import { destroy } from "../../../api/crud"; - -describe("", () => { - it("renders a single diagnostic dump", () => { - const dispatch = jest.fn(); - const diag = fakeDiagnosticDump(); - diag.body.ticket_identifier = "0000"; - const el = mount(); - expect(el.text()).toContain("0000"); - el.find("button.red").first().simulate("click"); - expect(destroy).toHaveBeenCalledWith(diag.uuid); - }); -}); diff --git a/frontend/devices/components/__tests__/farmbot_os_settings_test.tsx b/frontend/devices/components/__tests__/farmbot_os_settings_test.tsx index ece77e241..917caaead 100644 --- a/frontend/devices/components/__tests__/farmbot_os_settings_test.tsx +++ b/frontend/devices/components/__tests__/farmbot_os_settings_test.tsx @@ -35,7 +35,6 @@ describe("", () => { ota_hour: 3, tz_offset_hrs: 0 }), - diagnostics: [], dispatch: jest.fn(), bot, alerts: [], diff --git a/frontend/devices/components/__tests__/send_diagnostic_report_test.tsx b/frontend/devices/components/__tests__/send_diagnostic_report_test.tsx deleted file mode 100644 index 4536e4df8..000000000 --- a/frontend/devices/components/__tests__/send_diagnostic_report_test.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import * as React from "react"; -import { render } from "enzyme"; -import { SendDiagnosticReport, DiagReportProps } from "../send_diagnostic_report"; -import { fakeDiagnosticDump } from "../../../__test_support__/fake_state/resources"; - -describe("", () => { - const fakeProps = (): DiagReportProps => ({ - dispatch: jest.fn(), - diagnostics: [fakeDiagnosticDump()], - expanded: true, - botOnline: true, - }); - - it("renders", () => { - const p = fakeProps(); - const wrapper = render(); - expect(wrapper.text()).toContain("DIAGNOSTIC CHECK"); - }); -}); diff --git a/frontend/devices/components/diagnostic_dump_row.tsx b/frontend/devices/components/diagnostic_dump_row.tsx deleted file mode 100644 index 1948b917a..000000000 --- a/frontend/devices/components/diagnostic_dump_row.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import * as React from "react"; -import { Row, Col } from "../../ui"; -import { TaggedDiagnosticDump } from "farmbot"; -import { destroy } from "../../api/crud"; -import { ago } from "../connectivity/status_checks"; -import { t } from "../../i18next_wrapper"; - -export interface Props { - diag: TaggedDiagnosticDump; - dispatch: Function; -} - -export class DiagnosticDumpRow extends React.Component { - get ticket() { return this.props.diag.body.ticket_identifier; } - - get age() { return ago(this.props.diag.body.created_at); } - - destroy = () => this.props.dispatch(destroy(this.props.diag.uuid)); - - render() { - return - - {t("Report {{ticket}} (Saved {{age}})", { - ticket: this.ticket, age: this.age - })} - - - - - ; - } -} diff --git a/frontend/devices/components/farmbot_os_settings.tsx b/frontend/devices/components/farmbot_os_settings.tsx index 5aaa3cb35..9fceb9231 100644 --- a/frontend/devices/components/farmbot_os_settings.tsx +++ b/frontend/devices/components/farmbot_os_settings.tsx @@ -14,7 +14,6 @@ import { FarmbotOsRow } from "./fbos_settings/farmbot_os_row"; import { AutoUpdateRow } from "./fbos_settings/auto_update_row"; import { AutoSyncRow } from "./fbos_settings/auto_sync_row"; import { PowerAndReset } from "./fbos_settings/power_and_reset"; -import { SendDiagnosticReport } from "./send_diagnostic_report"; import { BootSequenceSelector } from "./fbos_settings/boot_sequence_selector"; export enum ColWidth { @@ -164,11 +163,6 @@ export class FarmbotOsSettings sourceFbosConfig={sourceFbosConfig} shouldDisplay={this.props.shouldDisplay} botOnline={botOnline} /> - diff --git a/frontend/devices/components/send_diagnostic_report.tsx b/frontend/devices/components/send_diagnostic_report.tsx deleted file mode 100644 index d098c309a..000000000 --- a/frontend/devices/components/send_diagnostic_report.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import * as React from "react"; -import { Row, Col } from "../../ui"; -import { ColWidth } from "./farmbot_os_settings"; -import { Collapse } from "@blueprintjs/core"; -import { Header } from "./hardware_settings/header"; -import { Feature } from "../interfaces"; -import { TaggedDiagnosticDump } from "farmbot"; -import { DiagnosticDumpRow } from "./diagnostic_dump_row"; -import { requestDiagnostic } from "../actions"; -import { Content } from "../../constants"; -import { t } from "../../i18next_wrapper"; - -export interface DiagReportProps { - dispatch: Function; - expanded: boolean; - diagnostics: TaggedDiagnosticDump[]; - botOnline: boolean; -} - -export class SendDiagnosticReport extends React.Component { - render() { - return
-
-
-
- - - - - - -

{t(Content.DIAGNOSTIC_CHECK)}

- - - - -
-
- {this.props.diagnostics.map(d => { - return ; - })} -
-
; - } -} diff --git a/frontend/devices/devices.tsx b/frontend/devices/devices.tsx index 1564417e2..1d45a8e46 100644 --- a/frontend/devices/devices.tsx +++ b/frontend/devices/devices.tsx @@ -6,7 +6,6 @@ import { Page, Col, Row } from "../ui/index"; import { mapStateToProps } from "./state_to_props"; import { Props } from "./interfaces"; import { PinBindings } from "./pin_bindings/pin_bindings"; -import { selectAllDiagnosticDumps } from "../resources/selectors"; import { getStatus } from "../connectivity/reducer_support"; import { isFwHardwareValue } from "./components/firmware_hardware_support"; @@ -24,7 +23,6 @@ export class RawDevices extends React.Component { ; export interface FarmbotOsProps { bot: BotState; alerts: Alert[]; - diagnostics: TaggedDiagnosticDump[]; deviceAccount: TaggedDevice; botToMqttStatus: NetworkState; botToMqttLastSeen: number; @@ -251,5 +248,4 @@ export interface ControlPanelState { danger_zone: boolean; power_and_reset: boolean; pin_guard: boolean; - diagnostic_dumps: boolean; } diff --git a/frontend/devices/pin_bindings/list_and_label_support.tsx b/frontend/devices/pin_bindings/list_and_label_support.tsx index 73ddcc2cb..3e6e503e3 100644 --- a/frontend/devices/pin_bindings/list_and_label_support.tsx +++ b/frontend/devices/pin_bindings/list_and_label_support.tsx @@ -25,7 +25,6 @@ export const specialActionLabelLookup: { [x: string]: string } = { [PinBindingSpecialAction.power_off]: t("Shutdown"), [PinBindingSpecialAction.reboot]: t("Reboot"), [PinBindingSpecialAction.sync]: t("Sync"), - [PinBindingSpecialAction.dump_info]: t("Diagnostic Report"), [PinBindingSpecialAction.read_status]: t("Read Status"), [PinBindingSpecialAction.take_photo]: t("Take Photo"), "": t("None") diff --git a/frontend/devices/reducer.ts b/frontend/devices/reducer.ts index 9791b8587..3a1a1adf8 100644 --- a/frontend/devices/reducer.ts +++ b/frontend/devices/reducer.ts @@ -30,8 +30,7 @@ export const initialState = (): BotState => ({ encoders_and_endstops: false, danger_zone: false, power_and_reset: false, - pin_guard: false, - diagnostic_dumps: false + pin_guard: false }, hardware: { gpio_registry: {}, diff --git a/frontend/resources/__tests__/reducer_test.ts b/frontend/resources/__tests__/reducer_test.ts index 7e85fa703..5ee1fff8e 100644 --- a/frontend/resources/__tests__/reducer_test.ts +++ b/frontend/resources/__tests__/reducer_test.ts @@ -65,7 +65,7 @@ describe("resource reducer", () => { }); const TEST_RESOURCE_NAMES: TaggedResource["kind"][] = ["Crop", "Device", - "DiagnosticDump", "FarmEvent", "FarmwareInstallation", "FbosConfig", + "FarmEvent", "FarmwareInstallation", "FbosConfig", "FirmwareConfig", "Log", "Peripheral", "PinBinding", "PlantTemplate", "Point", "Regimen", "SavedGarden", "Sensor"]; diff --git a/frontend/resources/reducer.ts b/frontend/resources/reducer.ts index 8053d667b..589daf595 100644 --- a/frontend/resources/reducer.ts +++ b/frontend/resources/reducer.ts @@ -44,7 +44,6 @@ export const emptyState = (): RestResources => { Alert: {}, Crop: {}, Device: {}, - DiagnosticDump: {}, FarmEvent: {}, FarmwareEnv: {}, FarmwareInstallation: {}, diff --git a/frontend/resources/selectors_by_kind.ts b/frontend/resources/selectors_by_kind.ts index eddffb753..0932ea3c1 100644 --- a/frontend/resources/selectors_by_kind.ts +++ b/frontend/resources/selectors_by_kind.ts @@ -14,7 +14,6 @@ import { TaggedSensor, TaggedPeripheral, TaggedPinBinding, - TaggedDiagnosticDump, TaggedSensorReading, TaggedSavedGarden, TaggedPlantTemplate, @@ -82,8 +81,6 @@ export const selectAllPointGroups = export const selectAllActivePoints = (input: ResourceIndex) => selectAllPoints(input).filter(x => !x.body.discarded_at); -export const selectAllDiagnosticDumps = - (i: ResourceIndex) => findAll(i, "DiagnosticDump"); export const selectAllFarmwareEnvs = (i: ResourceIndex) => findAll(i, "FarmwareEnv"); export const selectAllFarmwareInstallations = (i: ResourceIndex) => diff --git a/frontend/sequences/step_tiles/__tests__/index_test.ts b/frontend/sequences/step_tiles/__tests__/index_test.ts index 9586d07bb..2129558cf 100644 --- a/frontend/sequences/step_tiles/__tests__/index_test.ts +++ b/frontend/sequences/step_tiles/__tests__/index_test.ts @@ -203,10 +203,6 @@ describe("renderCeleryNode()", () => { node: { kind: "sync", args: {} }, expected: "" }, - { - node: { kind: "dump_info", args: {} }, - expected: "" - }, { node: { kind: "power_off", args: {} }, expected: "" diff --git a/frontend/sync/actions.ts b/frontend/sync/actions.ts index 3aa64e4df..f14ce8e76 100644 --- a/frontend/sync/actions.ts +++ b/frontend/sync/actions.ts @@ -90,7 +90,6 @@ export async function fetchSyncData(dispatch: Function) { ]), 4: () => Promise.all<{}>([ get("FarmEvent", API.current.farmEventsPath), - get("DiagnosticDump", API.current.diagnosticDumpsPath), get("Image", API.current.imagesPath), get("Log", API.current.filteredLogsPath), get("WebcamFeed", API.current.webcamFeedPath) diff --git a/package.json b/package.json index 65459279b..13ff7f67d 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "coveralls": "3.0.9", "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.2", - "farmbot": "9.0.1-rc1", + "farmbot": "9.0.2", "i18next": "19.0.3", "install": "0.13.0", "lodash": "4.17.15", @@ -69,7 +69,6 @@ "redux": "4.0.5", "redux-immutable-state-invariant": "2.1.0", "redux-thunk": "2.3.0", - "sass": "1.25.0", "sass-lint": "1.13.1", "takeme": "0.11.3", "ts-jest": "25.0.0", @@ -81,9 +80,10 @@ "devDependencies": { "jest": "25.1.0", "jest-cli": "25.1.0", - "jest-skipped-reporter": "0.0.5", "jest-junit": "10.0.0", + "jest-skipped-reporter": "0.0.5", "jshint": "2.11.0", - "madge": "3.6.0" + "madge": "3.6.0", + "sass": "1.25.0" } } diff --git a/spec/controllers/api/devices/devices_controller_sync_spec.rb b/spec/controllers/api/devices/devices_controller_sync_spec.rb index 6f06e1306..00c10b6d9 100644 --- a/spec/controllers/api/devices/devices_controller_sync_spec.rb +++ b/spec/controllers/api/devices/devices_controller_sync_spec.rb @@ -15,7 +15,6 @@ describe Api::DevicesController do it "provides timestamps of updates, plus current time" do sign_in user - FactoryBot.create(:diagnostic_dump, device: device) FactoryBot.create(:farm_event, device: device) FactoryBot.create(:farmware_env, device: device) FactoryBot.create(:farmware_installation, device: device) diff --git a/spec/controllers/api/diagnostic_dumps/diagnostic_dumps_controller_spec.rb b/spec/controllers/api/diagnostic_dumps/diagnostic_dumps_controller_spec.rb deleted file mode 100644 index 9deae28af..000000000 --- a/spec/controllers/api/diagnostic_dumps/diagnostic_dumps_controller_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -require 'spec_helper' - -describe Api::DiagnosticDumpsController do - let(:device) { FactoryBot.create(:device) } - let(:user) { FactoryBot.create(:user, device: device) } - - include Devise::Test::ControllerHelpers - - it 'lists all diagnostics' do - sign_in user - DiagnosticDump.destroy_all - farmware_env = FactoryBot.create_list(:diagnostic_dump, 3, device: device) - get :index - expect(json.length).to eq(3) - expect(json.pluck(:device_id).uniq).to eq([user.device.id]) - end - - it 'creates a dump' do # Blinky test 7-AUG-18 RC - sign_in user - DiagnosticDump.destroy_all - b4 = DiagnosticDump.count - input = { - fbos_version: "123_fbos_version", - fbos_commit: "123_fbos_commit", - firmware_commit: "123_firmware_commit", - network_interface: "123_network_interface", - fbos_dmesg_dump: "123_fbos_dmesg_dump", - firmware_state: "123_firmware_state", - } - post :create, body: input.to_json - expect(response.status).to eq(200) - expect(DiagnosticDump.count).to be > b4 - expect(DiagnosticDump.last.device).to eq(device) - expect(json[:fbos_version]).to eq("123_fbos_version") - expect(json[:fbos_commit]).to eq("123_fbos_commit") - expect(json[:firmware_commit]).to eq("123_firmware_commit") - expect(json[:network_interface]).to eq("123_network_interface") - expect(json[:fbos_dmesg_dump]).to eq("123_fbos_dmesg_dump") - expect(json[:firmware_state]).to eq("123_firmware_state") - expect(json[:ticket_identifier].length).to be >= 4 - end - - it 'deletes' do - sign_in user - # DiagnosticDump.destroy_all - farmware_env = FactoryBot.create(:diagnostic_dump, device: device) - id = farmware_env.id - delete :destroy, params: { id: farmware_env.id } - expect(response.status).to eq(200) - expect(DiagnosticDump.exists?(id)).to be false - end -end diff --git a/spec/factories/diagnostic_dumps.rb b/spec/factories/diagnostic_dumps.rb deleted file mode 100644 index 980ffa8e1..000000000 --- a/spec/factories/diagnostic_dumps.rb +++ /dev/null @@ -1,12 +0,0 @@ -FactoryBot.define do - factory :diagnostic_dump do - device - fbos_version { "123_fbos_version" } - fbos_commit { "123_fbos_commit" } - firmware_commit { "123_firmware_commit" } - network_interface { "123_network_interface" } - fbos_dmesg_dump { "123_fbos_dmesg_dump" } - firmware_state { "123_firmware_state" } - ticket_identifier { rand(36**5).to_s(36) } - end -end