Slackbot
01/24/2024, 11:12 AMmelix
01/24/2024, 3:52 PM<http://Usage.XXX|Usage.XXX> constants.melix
01/24/2024, 3:52 PMBundling attribute where it would expect a Usage. If both were stringly typed then you could mix things up.Vampire
01/24/2024, 3:54 PMattribute(Usage.USAGE_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
or with static imports
attribute(USAGE_ATTRIBUTE, objects.named(EXTERNAL))melix
01/24/2024, 3:54 PMmelix
01/24/2024, 3:55 PMattribute(Usage.USAGE_ATTRIBUTE, objects.named(Bundling.EXTERNAL)))melix
01/24/2024, 3:55 PMVampire
01/24/2024, 3:55 PMBundling.EXTERNAL is just a Stringmelix
01/24/2024, 3:55 PMBundling as the 2d argumentmelix
01/24/2024, 3:55 PMVampire
01/24/2024, 3:55 PMattribute(Usage.USAGE_ATTRIBUTE, objects.named("external")Vampire
01/24/2024, 3:56 PMUsage and it is a Usage, the type is inferred from the first argumentmelix
01/24/2024, 3:56 PMnamed takes the Named type as the 1st arg)Vampire
01/24/2024, 3:56 PMattribute(Usage.USAGE_ATTRIBUTE, objects.named<Usage>(Bundling.EXTERNAL))melix
01/24/2024, 3:56 PMVampire
01/24/2024, 3:56 PMattribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, Bundling.EXTERNAL))melix
01/24/2024, 3:57 PMmelix
01/24/2024, 3:57 PMVampire
01/24/2024, 3:58 PMattribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.class, "external")) which then is not so obvious and sometimes is even handymelix
01/24/2024, 3:58 PMNamed, which is that the objects can have more methods to be used in disambiguation rules for exampleVampire
01/24/2024, 3:58 PMMachineArchitecture for which no constant exists like arm32melix
01/24/2024, 3:59 PMVampire
01/24/2024, 3:59 PMobjects.newInstance or whatever instead.Vampire
01/24/2024, 3:59 PMmelix
01/24/2024, 3:59 PMmelix
01/24/2024, 3:59 PMmelix
01/24/2024, 4:00 PMmelix
01/24/2024, 4:00 PMVampire
01/24/2024, 4:00 PMVampire
01/24/2024, 4:01 PMmelix
01/24/2024, 4:02 PMVampire
01/24/2024, 4:02 PMVampire
01/24/2024, 4:02 PMBoolean attribute or not?melix
01/24/2024, 4:03 PMfalse, true, false, false and the other you get Awesome.FALSE, etc...melix
01/24/2024, 4:03 PMBoolean type because it's much easier to deal withmelix
01/24/2024, 4:03 PMVampire
01/24/2024, 4:04 PMString for a custom attribute 😄Vampire
01/24/2024, 4:04 PMmelix
01/24/2024, 4:04 PMVampire
01/24/2024, 4:05 PMmelix
01/24/2024, 4:07 PMVampire
01/24/2024, 4:08 PMVampire
01/24/2024, 4:09 PMVampire
01/24/2024, 4:09 PMVampire
01/24/2024, 4:10 PMString and Boolean.
At least the String can probably anytime enhanced to a full type as it is a String in the GMM anywaymelix
01/24/2024, 4:10 PMVampire
01/24/2024, 4:11 PMVampire
01/24/2024, 4:11 PMmelix
01/24/2024, 4:11 PMVampire
01/24/2024, 4:18 PMVampire
02/12/2024, 11:57 PMOPERATING_SYSTEM_ATTRIBUTE are set by a non-cached component metadata rule or on the first run with a cached rule, they are properly typed OperatingSystemFamily.
But if the type is coming from the GMM, or from the cached state of a cached rule, it is just String typed, which makes it significantly harder to get the value from an attributes container for example when filtering on resolved artifacts to find those that do not have a value for an attribute or have a specific value but not none.
🤯melix
02/13/2024, 9:27 AMmelix
02/13/2024, 9:29 AMVampire
02/13/2024, 9:30 AMmelix
02/13/2024, 12:54 PMattributes.getAttribute(Category.CATEGORY_ATTRIBUTE) just returns null when working on ResolvedVariantResult, because what you get there is a stringly typed attribute.Vampire
02/13/2024, 12:56 PMVampire
02/13/2024, 12:56 PMmelix
02/13/2024, 12:56 PMVampire
02/13/2024, 12:57 PM