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

[Fix missing] module_option mising option #321

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

Conversation

Tearran
Copy link
Member

@Tearran Tearran commented Dec 12, 2024

Description

The idea from the start was to have one data entry point, the "Header". The active data array can be viewed with git repo or apt installed using the command: armbian-config --api generate_json_object

This PR is the first step towards producing a JSON object pipeline that will eventually replace the JSON file. By leveraging the already used module_option array and jq for querying, we aim to ensure consistency and eliminate the need to manually edit or source a separate file.

Many JSON keys are missing in the module_option array and cannot be parsed or queried. Leveraging jq can:

Changes Made

  • Added missing keys to the module_option array for better parsing and querying.
  • Updated the generate_json_data.sh script to properly handle the new keys and generate a valid JSON object.
  • Modified the config.runtime.sh module_options to remove unhandled escape sequences and quotes.

Goals and Impact

  • Eliminate the JSON editing and automate the UX.
  • Speed up the nesting that bash is unequipped for.
  • Handle real-time changes better than bash alone.
  • Ultimately ease automated and redundant tasks.
  • Improved loading times and nesting issue handling.
  • Better automation and less manual intervention required in JSON handling.
  • Enhanced user experience through jq optimization.

Testing

  • Verified that the updated ./bin/armbian-config --api set_json_options produces the correct JSON output.

Notes

  • armbian-config --api generate_json_options is out of date and needs updating.
  • The module_options array was lacking needed keys, and this PR addresses multiple issues such as loading times and nesting issues that bash is not meant to handle.

@github-actions github-actions bot added the size/small PR with less then 50 lines label Dec 12, 2024
@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines and removed size/small PR with less then 50 lines labels Dec 12, 2024
@Tearran
Copy link
Member Author

Tearran commented Dec 12, 2024

Converts the module_option array into a raw flat json. for jq parsing.
list all modules and helper functions that have headers. Included a "short id" .

./bin/armbian-config --api set_json_data

JQ ("JSON Query") generates json list of modules

./bin/armbian-config --api generate_json_data

@Tearran
Copy link
Member Author

Tearran commented Dec 12, 2024

{F9F6B5EF-1F1C-4314-91E7-6771F5FBCDCC}

@Tearran
Copy link
Member Author

Tearran commented Dec 12, 2024

Using existing database, we can output a useable software sections

{D1F66659-7B61-4DEB-BF4B-E97C3CDDFA4E} {EE3C0E10-55E6-4BA9-84CE-9204E029C344}

@github-actions github-actions bot added size/large PR with 250 lines or more and removed size/medium PR with more then 50 and less then 250 lines labels Dec 13, 2024
@Tearran
Copy link
Member Author

Tearran commented Dec 14, 2024

{494DD53E-9F44-40DF-9964-D1AF48A17E3C}

used top menu setting for size

{6957FEAE-F31C-488C-9375-F6C83D999E99}

@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines and removed size/large PR with 250 lines or more labels Dec 14, 2024
@Tearran Tearran marked this pull request as draft December 14, 2024 06:06
@github-actions github-actions bot added size/large PR with 250 lines or more and removed size/medium PR with more then 50 and less then 250 lines labels Dec 14, 2024
@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines Documentation Documentation changes or additions and removed size/large PR with 250 lines or more labels Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation changes or additions size/medium PR with more then 50 and less then 250 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants