f2calv / yamlizr

Azure DevOps Designer-to-YAML Pipeline CLI CodeGen Tool w/GitHub Actions Generation
MIT License
69 stars 16 forks source link

Export error: Ambiguous match found for 'CasCap.Models.TriggerAzDO Boolean batch' #216

Open rfennell opened 3 months ago

rfennell commented 3 months ago

Key

yamlizr generate -pat <PAT> -org https://dev.azure.com/myorg -proj myproj -out c:\tmp\export

Describe the bug When I do an export of an AzDo project with a pair of CIassic builds and a pair of Classic releases I get the error

Connecting to DevOps REST API, https://dev.azure.com/myorg ... connected :)
Retrieving Azure DevOps Project 'myproject' ...  retrieved :)
Pre-loading relevant Azure DevOps objects, this may take some time...
100.00% 2 build definition reference(s) retrieved.
info: CasCap.Services.ApiService[0]
Retrieving all extensions for organisation 'https://dev.azure.com/myproject'
100.00% Retrieved 2 of 2 full build definition(s). 
100.00% YamlPipelineGenerator processed 2 of 2 build definition(s).
100.00% YamlPipelineGenerator processed 2 of 2 release definition(s).

Unhandled exception. System.Reflection.AmbiguousMatchException: Ambiguous match found for 'CasCap.Models.TriggerAzDO Boolean batch'.  at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
   at System.Type.GetProperty(String name, BindingFlags bindingAttr)
   at YamlDotNet.ReflectionExtensions.GetPublicProperty(Type type, String name)
   at YamlDotNet.ReflectionExtensions.GetAllCustomAttributes[TAttribute](PropertyInfo member)
   at YamlDotNet.Serialization.TypeInspectors.ReadablePropertiesTypeInspector.ReflectionPropertyDescriptor.GetCustomAttribute[T]()
   at YamlDotNet.Serialization.YamlAttributeOverridesInspector.OverridePropertyDescriptor.GetCustomAttribute[T]()
   at YamlDotNet.Serialization.YamlAttributesTypeInspector.<>c.<GetProperties>b__2_0(IPropertyDescriptor p)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.ToArray()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.ToList()
   at YamlDotNet.Serialization.TypeInspectors.CachedTypeInspector.<>c__DisplayClass3_0.<GetProperties>b__0(Type t)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at YamlDotNet.Serialization.TypeInspectors.CachedTypeInspector.GetProperties(Type type, Object container)
   at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.TraverseProperties[TContext]

To Reproduce

  1. Run the export command
  2. Error is seen
  3. Folders are created, but no files are export

Expected behavior YAML export should occur

Screenshots NA

Desktop (please complete the following information):

Additional context PR on the way