mrlunchbox777 / basic-setup

basic box setup
MIT License
6 stars 3 forks source link

feature: Enhance index file label support #130

Open mrlunchbox777 opened 4 months ago

mrlunchbox777 commented 4 months ago

Contact Details

mrlunchbox777@gmail.com

Feature Description

Automatic and merged labels for the index file should be supported during runtime, e.g. os/arch labels should be automatically applied if not explicitly set, but setting those shouldn't erase other labels applied. Labels should continue being a union, not an intersection.

Why?

Automatic labels reduces cognitive and configuration load on end users.

What-should happen?

Where possible, any way of setting labels should be additive. When applied labels should be a union of selected packages. This would also imply a way of explicitly removing labels, which should only be used by the end user and also be additive, where possible. The remove list takes priority.

Some labels should be renamed, e.g. os/arch should have the -only removed. Some labels should be added, but that should be a new issue created as/after this is implemented.

Labels like os/arch should be automatically added, unless they are in the user provided remove list. When it's added, whatever the ui-based-package label ends up being should also be added. Any label that can be reasonably reliably detected automatically should be automatically added, unless they are in the user provided remove list.

Covers this TODO

Potential issues:

Environment variables are the hardest labels to merge as setting an environment variable overwrites it, and there is nothing we can do about that.

Steps to Test

  1. Run the environment validation with no labels and debug verbosity. You should see your os and arch packages selected.
  2. Run the environment validation with a label passed in. You should see your os, arch, and the label you added selected.
  3. Run the environment validation with a label passed in, as well as the same label passed into the remove labels. You should only see your os and arch selected.
  4. The os/arch labels should not have -only on the end of them in the index file, documentation, source code, and anything else.
  5. Another issue should have been created that add more labels such as a label that identifies ui based packages.

Code of Conduct