Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Development] Updated Centralized Metadata Storage (Database) #437

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

Tearran
Copy link
Member

@Tearran Tearran commented Feb 15, 2025

module_options: Centralized Metadata Storage (Database)

The module_options array is used as a centralized Metadata Storage (Database) in the Armbian config system. This tool and pull request aim to unify the relative key pairs used between unit-testing, UX-menu, and CLI-api, ensuring consistency and preventing divergence across different paths.

Purpose

The primary purpose of module_options is to store all relevant metadata for each module in a centralized manner. By centralizing this metadata, the system can dynamically generate various configurations and scripts, such as JSON objects, unit tests, and documentation, while reducing redundancy and ensuring consistency.

Commands

The module_api_files script provides several commands to work with the module_options array:

./bin/armbian-config --api module_api_files help

Usage

Usage: module_api_files <command>
Commands:  help array json test all
Available commands:
        array   - Generate module_options files from production module_options array.
        json    - Generate JSON object from module_options.
        test    - Generate unit-test CONF from module_options.
        all     - Generate all of the above.

Command Descriptions

  1. array

    • Description: Generate module_options files from the production module_options array.
    • Usage:
      ./bin/armbian-config --api module_api_files array
    • Details: Disassembles the array and adds missing keys. If the Menu subgroup keys exist, it places a *_array.sh file in the corresponding parent folder. For arrays without the required subgroup keys, the added *_array.sh file is placed in ./tools/dev/array/ to indicate an update is needed.
  2. json

    • Description: Generate a JSON object from module_options.
    • Usage:
      ./bin/armbian-config --api module_api_files json
    • Details: Converts the module_options array into a JSON object, providing a structured format for the metadata.
  3. test

    • Description: Generate unit-test CONF from module_options.
    • Usage:
      ./bin/armbian-config --api module_api_files test
    • Details: Creates unit-test configuration files based on the module_options array.
  4. all

    • Description: Generate all of the above (array, json, test).
    • Usage:
      ./bin/armbian-config --api module_api_files all
    • Details: Executes all the above commands sequentially, generating the respective outputs.

Example

To generate the module_options files and add missing keys, use:

./bin/armbian-config --api module_api_files array

This will disassemble the array and handle the keys as described, ensuring that the metadata is up-to-date and accurately reflects the current state of the modules.

By using module_options as a centralized metadata storage (database), the Armbian config system can dynamically handle commands, generate required configurations, and reduce redundancy, leading to a more streamlined and unified process.

@Tearran Tearran added the Work in progress Unfinished / work in progress label Feb 15, 2025
@github-actions github-actions bot added the size/large PR with 250 lines or more label Feb 15, 2025
@github-actions github-actions bot added the Documentation Documentation changes or additions label Feb 16, 2025
@Tearran Tearran added Framework Framework components Help needed We need your involvement Unit Tests labels Feb 16, 2025
@Tearran Tearran added Bugfix Pull request is fixing a bug Discussion Being discussed - Voice your opinions :) GitHub Actions GitHub Actions code and removed Help needed We need your involvement labels Feb 17, 2025
@Tearran Tearran changed the title [Development] Updated module_options DataBase [Development] Updated Centralized Metadata Storage (Database) Feb 17, 2025
@Tearran
Copy link
Member Author

Tearran commented Feb 17, 2025

./bin/armbian-config --api see_menu module_api_files

{0275877D-6FD0-43C9-9DA7-D2841E5A3357}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix Pull request is fixing a bug Discussion Being discussed - Voice your opinions :) Documentation Documentation changes or additions Framework Framework components GitHub Actions GitHub Actions code size/large PR with 250 lines or more Unit Tests Work in progress Unfinished / work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant