Skip to content

make scadm more resilient #326

@kellervater

Description

@kellervater

As seen recently in this fix #325
we currently need to manually remove section markers from lib files so the scadm flatten command works properly.

Following problems need to be solved:

  • In general scadm flatten is too opinionated on how libraries and part files must look like (variables only before modules, no sections in libs, etc).
  • the flatten command always includes ALL file contents that are included as dependencies instead of just the effective dependency chain. so a lot of unused modules and variables (e.g. from homeracker constants) land in a flattened file, effectively bloating it unnecessarily.

Solution:

  • Make it more resilient against variable and module locations
    • variables can be defined ANYWHERE in ANY file that's being included via flatten. BUT sections are only considered on the root file that's to be flattened. Every variable not under a section will land in the hidden section (with a comment above them from where there origin is)
  • Only build a flattened file from the EFFECTIVEly used moduels and variables
  • create a proper test suite testing main and edge cases
    • variables scattered over the root file to be flattened (where section variables land in the respective sections and all other variables in other locations land in hidden if not specified there already) as well as in lib files (where they need to land in the hidden section)
    • sections are only considered from the root file
    • Only actually required variables and modules down the dependency chain are actually used. other content is omitted
    • and everything else that makes sense to test

Metadata

Metadata

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