blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
22 stars 26 forks source link

docs: Refactor bash module code guidelines #175

Closed fiftydinar closed 2 months ago

fiftydinar commented 3 months ago

Better standardization of how bash modules should be written.

It's a requirement before refactoring the current official modules to conform to these guidelines & to fix some known module issues.

Related issue: https://github.com/blue-build/modules/issues/157

xynydev commented 3 months ago

Thanks for starting work on this. I'll be sure to check this out and do some rewordings soon, when I got the time.

fiftydinar commented 3 months ago

I made YML config files a bit more detailed.

I introduced new active yaml key, which is exclusive to local-user config only. I think active switch is useful for troubleshooting, as local-user wouldn't need to remove all of his config & reapply again. I wanted to include all of the possible options of the module in a template, so that user can easily see what is possible with the module, without having to worry about YML formatting & syntax. We wouldn't need active switch for system config, as it can be easily disabled in recipe.yml. But it can be maybe useful somehow in some ways I do not see, not sure. Me & xyny agreed that single yaml config is better than fragmented config text files.

I would need to document this further though, along with a lot of other things that need to be done, like more visual examples of Code Rules section & other stuff.

What are your thoughts on this, am I on right track?

xynydev commented 2 months ago

Overall, this PR is looking great. I'd say there's the one unresolved thread to go before final review and merge.

fiftydinar commented 2 months ago

Overall, this PR is looking great. I'd say there's the one unresolved thread to go before final review and merge.

Guidelines need further refinement though, but we can do that in the future I guess?

Another thing which came into my mind rn is that I should emphasize better that build-time modules are preferred over post-install ones with some warning/note card or something

xynydev commented 2 months ago

@fiftydinar Do you have time to add the final touches and do a merge. We're getting module PRs so it would be great to have new contributors reading the guidelines.

fiftydinar commented 2 months ago

@fiftydinar Do you have time to add the final touches and do a merge. We're getting module PRs so it would be great to have new contributors reading the guidelines.

I will try to finish it up to tomorrow

fiftydinar commented 2 months ago

@xynydev I added the refinement I wanted.

It's still not ideal, but distinction is clearer now.