Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Simplify module type dependencies #12

@gordonbrander

Description

@gordonbrander

During the firmware flash process, we parse the module.json files from downloaded modules, but don't really use those definitions. This is because we must already have the module type described via fixture/db for the module type folder to have been downloaded in the first place. This is an unfortunate duplication.

Here's what I would like to do to simplify it:

  • Define modules as we do today, but within module, have a "firmware_repository" field that contains a git or pio dependency descriptor. This replaces the "type" field.
  • During install, fetch that dependency
  • Read the module type from the dependency's module.json

This way we don't have to manually write module types in our fixture files. All we have to do is describe a type dependency for each module config. Specifying a type is unnecessary in this scheme. The type is described in the firmware's module.json. Only the repository needs to be described.

Module configs would look like this:

{
  "_id": "am2315_1",
  "environment": "environment_1",
  "firmware_repository": {
    "type": "git",
    "url": "https://github.com/OpenAgInitiative/openag_am2315.git",
    "branch": "0.0.1"
  }
}

(Branch is optional). Other module config details remain the same. cc @LeonChambers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions