text:
WinAppDriver leaking memory after April update (1803)

Hi,
in our company we're using WinAppDriver for stress testing our UWP application. Its mean that ours tests repeatly doing few thing within 24 hours, more precisely its something about 1500-3000 iterations. When this tests runs under Windows version 1709 so its work properly, but under Windows version 1803 we noticed that tests started leaking huge amount of memory.
Our UWP application is taking properly someting about 120-250MB.
Comparation:
Windows 1709
1500 iterations
64MB start memory
228MB end memory
Windows 1803
3000 interations
70MB start memory
4,5GB end memory (228MB was reached after 60 iterrations)
We noticed that memory is holded by our application (says task manager), but all of this leaked memory is released after closing WinAppDriver, and after this is application properly running only with max 250MB of memory.
Can you help us to find problem, please?
Here're two xlsx with stats.
Win1803.xlsx
Win1709.xlsx
BTW: When we tests this by manual, than everything is working properly, but by hand we was able to do only something about 150 iterations (more iterations is too much work for me).

Hi @MioOgbeni,
Thanks for reporting this issue. I'll take a look and see if I can reproduce the issue. There might have been a change in the OS that is causing memory not to be released in the same way. I'll report back any findings but might need your help in setting up a proper scenario.
Thanks

Thanks, If you will have some questions about scenario, let's ask me.

Hi @MioOgbeni
Could you please share how you obtained the memory usage information?
Did you use some kind of a monitor to record memory usage?
Thanks

We measure this only by Windows task manager.

Hi @MioOgbeni
I do see a slight increase on build 17134.165 compared to 16299.492 running the alarm clock tests. But nowhere near the difference that you're seeing. After 100 iterations we're at 300MB and 215MB for each.
Can you check if you are closing your sessions after each run, you might be causing WinAppDriver to keep the Accessibility tree alive if it keeps running but your sessions is not closed or released.
Would you be able to share some of the details privately of your runs?

Hi @khouzam
I'm closing session after test, but in this test is 3000 iterations of login/logout in our app. It's only few press of button in each iteration.
I need to test that our app don't leaking memory, but when I will close session after each iteration that session close also our app and release memory.
I can try this if there are some nocloseapp capabilities or some session close function which don't close app.

Thanks @MioOgbeni. Let us know what you get back with.

@hassanuz I said "if there are some", but I think that there aren't. All of session closing functions (Dispose, Close, Quit, etc..) close also my app. Or not? Can you clarify it?

@MioOgbeni , I have had my blokes grapple with (seriously) similar issues using WAD for weeks on end. Were you able to figure out the root cause ? We had to chicken out from using this stuff entirely. I would advice folks to monkey around with this tool before investing effort into it.   Serious programming , Nah! The support for queries has been far from dismal.
I have my concerns regarding the suggestions. Why would you expect folks to move on to a new OS build to check the fixes? This is time consuming and worth a pound only if you would confirm this for certain. Hao shi de, as they say here in Singapore!
Secondly, Is there a (justified) rationale behind pushing the folks to enable Developer Mode on their PCs to start using it. This requirement is pretty retarted IMHO.
On a different note, MS-UIA has been, by far the most ill-documented and convoluted piece of chicanery used for Automation. Nevertheless, its lesser evil amongst its peers and something you can consider for an attempt.

@mr-aditya  Don't bother trying with different builds!  our testing saw a few functions of this framework (Find*xx) definitely show a leak.
@hassanuz  we tried rolling back and changing to newer builds, but it hasn't made a difference

Is there any update on how to get rid of the memory leak issue?

HI,
At my company we also tried winappdriver for some accelerated life time testing. We see clear memory leaks after some 50 iterations.
What we noticed when analyzing dumps is that leaks are related to automation peers, and, according scitech memory profiler, related to reference counted GCHandles.
Exact same issues we observe when using coded UI from Microsoft, both CodedUi and appium WinAppdriver appear to eb using same cross process infrastructure to cummunicate with the automation peers.
Maybe that is related to the flow in this issue ( we noticed this after a more recent, the 1903 windows update, though we are on the LTSB/LTSC branches of windows 10)
Regards,
Mark

I hope the image upload succeeded
Note that according scitech memory profiler many of these refcounted GCHandles had a refcount of zero, and despite aggressive GC2 execution these persisted.
Regards,
Mark

@hassanuz we are also experiencing the same issue with our app.
Subsequent "driver" operations keeps increasing memory usage. Was a fix was ever identified for this?

We have opened a case with Microsoft, a few weeks ago, which is not yet resolved.
We recently did a simple experiment, run our app with Narrator active. As Narrator uses same automation peers we were expecting same behavior. However, with Narrator we see a leak on the 2016 LTSB version and no leak on the 2019 LTSC.  So at this point we are slightly confused.
Note that we are running on 64 bit OS and we use 32 bit mstest to run coded UI or WimAppDriver. I assume Narrator is a 64 bit process (did not check those aspects yet.

@mvw684 Can you let me know the ticket ID for this issue at Microsoft, that I'am able to track some improvements on this very nasty behaviour? Thx a lot.

@Smurph007 our case number: REG:120031123002339
Feel free to reach out in case of further questions

authors: AllSparkler MioOgbeni Smurph007 ashkaps hassanuz khouzam mvw684 pradeepkumar-devaraj rajeeshmenoth


text:
FontSize of RichEditBox is limited to 130

Which version of the app?
WinUI 3 Gallery 2.1.0.0
Description
In the RichEditBox sample of WinUI 3 Gallery, when pasting a huge font size context copied from Microsoft Word or some other application, the font size will be limited to 130 (fs260).
Steps to reproduce the bug

Copy text from Microsoft Word with font size 150 (or larger)
Go to RichEditBox page, look at second/third sample
Paste the text into the second/third sample
Copy the text from RichEditBox and paste it into Microsoft Word

Expected behavior
The font size of the pasted text should remain as it is (FontSize = 150).
Actual behavior
The font size of the pasted text will be reduced to 130 (fs260).
Version Info

[x] App downloaded from Store

If so, which version? (Found on the Settings page of the app.)
2.1.0.0

Screenshots
Step 1: Copy text from Microsoft Word with font size 150

Step 2: Go to RichEditBox page, look at second/third sample
Step 3: Paste the text into the second/third sample

Step 4: Copy the text from RichEditBox and paste it into Microsoft Word
Results: The font size of the pasted text will be reduced to 130 (fs260).

Windows version
Windows 10 22H2 (19045)
Additional context
This happens also in UWP projects.
Windows.UI.Xaml.Controls.RichEditBox
Universal Windows Target:
Windows 10, version 2004 (19041)

I think this is a limitation with the RichEditBox control and might be better suited for the WinUI repository.

@karkarl Could we move this offer to the WinUI repository since this is more a WinUI issue rather than an issue with the gallery.

@karkarl Could we move this offer to the WinUI repository since this is more a WinUI issue rather than an issue with the gallery.

Agree!
Also, is this issue could  be fixed in UWP as well?

source: gharchive/issue

authors: KennethVScom chingucoding

repo: microsoft/WinUI-Gallery

license: MIT

license_type: permissive

license_source: github-api


text:
Signability fails test for windows driver

This is the .inf file. It is just a sample from https://github.com/microsoft/Windows-driver-samples/tree/master/print/OEM Printer Customization Plug-in Samples/C%2B%2B/bitmap
I have all the 3 files bitmap.DLL, bitmap.ini,bitmap.gdp all in the same folder at C:\windows. Why does it only complaining about bitmap.gdp and bitmap.ini (not bitmap.DLL). All 3 files reside in the C:\Windows
I am getting this error:
Errors:
 22.9.1: bitmap.gdp in [bitmapgdp] of Driver Package1\bitmap.inf is missing or cannot be decompressed from source media.  Please verify all path values specified in SourceDisksNames, SouceDisksFiles, and CopyFiles sections resolve to the actual location of the file, and are expressed in terms relative to the location of the inf.

 22.9.1: bitmap.ini in [bitmapini] of Driver Package1\bitmap.inf is missing or can
not be decompressed from source media.  Please verify all path values specified in SourceDisksNames, SouceDisksFiles, and CopyFiles sections resolve to the actual location of the file, and are expressed in terms relative to the location of the inf.
; bitmap.INF

; INF file for bitmap Driver
; - for Windows XP (SP2), NT2003 (R2), Vista, Win7, NT2008 (x86 and x64)
;
; Copyright 2007-2010 MS

[Version]
Signature="$windows NT$"
ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
Class=Printer
Provider=MS
DriverVer=04/21/2010, 5.0.10.4211505
catalogfile = bitmapnew.cat

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Manufacturer Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Manufacturer]
"Microsoft"=Microsoft, NTx86, NTamd64, NTia64, NTarm64

[Microsoft]
"Bitmap Driver"      = BITMAP

[Microsoft.NTx86]
"Bitmap Driver"      = BITMAP

[Microsoft.NTamd64]
"Bitmap Driver"      = BITMAP

[Microsoft.NTia64]
"Bitmap Driver"      = BITMAP

[Microsoft.NTarm64]
"Bitmap Driver"      = BITMAP

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Models Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[bitmapGDP]
bitmap.GDP

[bitmapINI]
bitmap.INI

[bitmapDLL]
bitmap.DLL

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Install Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[BITMAP]
CopyFiles=bitmapGDP,bitmapINI,bitmapDLL
DataSection=UNIDRV_DATA
Include=NTPRINT.INF
Needs=UNIDRV.OEM,UNIDRV_DATA

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Source Media Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[DestinationDirs]
DefaultDestDir=66000

[SourceDisksFiles]
bitmap.DLL = 1,
bitmap.GDP = 1,
bitmap.INI = 1

[SourceDisksNames]
1 = %DiskName%,
2= %CWIN%

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Control Flags Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Strings Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Strings]
DiskName="Disk Drive",
CWIN = "C:\Windows\bitmap"

; bitmap.INF
;
; INF file for bitmap Driver
; - for Windows XP (SP2), NT2003 (R2), Vista, Win7, NT2008 (x86 and x64)
;
; Copyright 2007-2010 MS

[Version]
Signature="$windows NT$"
ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
Class=Printer
Provider=MS
DriverVer=04/21/2010, 5.0.10.4211505
catalogfile = bitmapnew.cat

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Manufacturer Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Manufacturer]
"Microsoft"=Microsoft, NTx86, NTamd64, NTia64, NTarm64

[Microsoft]
"Bitmap Driver"      = BITMAP

[Microsoft.NTx86]
"Bitmap Driver"      = BITMAP

[Microsoft.NTamd64]
"Bitmap Driver"      = BITMAP

[Microsoft.NTia64]
"Bitmap Driver"      = BITMAP

[Microsoft.NTarm64]
"Bitmap Driver"      = BITMAP

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Models Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[bitmapGDP]
bitmap.GDP

[bitmapINI]
bitmap.INI

[bitmapDLL]
bitmap.DLL

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Install Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[BITMAP]
CopyFiles=bitmapGDP,bitmapINI,bitmapDLL
DataSection=UNIDRV_DATA
Include=NTPRINT.INF
Needs=UNIDRV.OEM,UNIDRV_DATA

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Source Media Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[DestinationDirs]
DefaultDestDir=66000

[SourceDisksFiles]
bitmap.DLL = 1,
bitmap.GDP = 1,
bitmap.INI = 1

[SourceDisksNames]
1 = %DiskName%,
2= %CWIN%

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Control Flags Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Strings Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Strings]
DiskName="Disk Drive",
CWIN = "C:\Windows\bitmap"

; bitmap.INF
;
; INF file for bitmap Driver
; - for Windows XP (SP2), NT2003 (R2), Vista, Win7, NT2008 (x86 and x64)
;
; Copyright 2007-2010 MS

[Version]
Signature="$windows NT$"
ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
Class=Printer
Provider=MS
DriverVer=04/21/2010, 5.0.10.4211505
catalogfile = bitmapnew.cat

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Manufacturer Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Manufacturer]
"Microsoft"=Microsoft, NTx86, NTamd64, NTia64, NTarm64

[Microsoft]
"Bitmap Driver"      = BITMAP

[Microsoft.NTx86]
"Bitmap Driver"      = BITMAP

[Microsoft.NTamd64]
"Bitmap Driver"      = BITMAP

[Microsoft.NTia64]
"Bitmap Driver"      = BITMAP

[Microsoft.NTarm64]
"Bitmap Driver"      = BITMAP

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Models Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[bitmapGDP]
bitmap.GDP

[bitmapINI]
bitmap.INI

[bitmapDLL]
bitmap.DLL

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Install Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[BITMAP]
CopyFiles=bitmapGDP,bitmapINI,bitmapDLL
DataSection=UNIDRV_DATA
Include=NTPRINT.INF
Needs=UNIDRV.OEM,UNIDRV_DATA

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Source Media Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[DestinationDirs]
DefaultDestDir=66000

[SourceDisksFiles]
bitmap.DLL = 1,
bitmap.GDP = 1,
bitmap.INI = 1

[SourceDisksNames]
1 = %DiskName%,
2= %CWIN%

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Control Flags Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Strings Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Strings]
DiskName="Disk Drive",
CWIN = "C:\Windows\bitmap"

I am just trying to sign it for test reasons. We have another driver which has this issue on development machine.

I fixed it myself

repo: microsoft/Windows-driver-samples

license: MS-PL


text:
PasteCommand was updated to call validation only one time

As I understand the main problem is that when we paste XmlTree then the validation will be called for every element of this XmlTree. The main idea of my fix is to call validation only once for PasteCommand.
Close #82
Close #170

Thanks for this but I have a different fix I want to make here that is more general.

Can you try this fix?
https://github.com/microsoft/XmlNotepad/commit/e7c86855e347459a522e75056b083c06799c8979

This fix https://github.com/microsoft/XmlNotepad/commit/e7c86855e347459a522e75056b083c06799c8979   works fine. Tested with file and case from issue #170 . Paste took 1 minute or less. Great.

I think we could close this PR)))

Cool thanks for testing the fix, I'm glad it works.  I will close the PR.  Thanks for pushing to get this fixed!

source: gharchive/pull-request

authors: lovettchris olmisa

repo: microsoft/XmlNotepad


text:
UnsupportedApiVersion returned for all calls with OData

This has been hard to troubleshoot for a long time. I have a service built on OData v4 (Microsoft.OData.Core 7.5, Microsoft.AspNet.OData.Versioning 3.0.0, and Microsoft.AspNet.WebApi.Versioning 3.0.0) and I set it up practically the same as the advanced odata sample. Everything works until I enabled API versioning.
I'm using url segment prefix for versioning and I'm calling config.MapVersionedODataRoutes and config.AddApiVersioning
And my controllers inherits from ODataController. Attributes on them are ApiVersion, ControllerName, and  ODataRoutePrefix; and I have a Get() method in the controller I wish would work which has ODataRoute, EnableQuery, and HttpGet.
I debugged through the controller selector code (part of the default behavior has been overwritten), and found that the controller was successfully found, and the Initialize() method of the OData controller has been called as well. I also noticed that the Apply method on the model configuration classes were called with ApiVersion = 1.0. But requests (https://localhost/prefix/v1.0/Controller) constantly fail with status code 405 "UnsupportedApiVersion" and message:
The requested resource with API version 'x.y' does not support HTTP method 'GET' and inner message:
No route providing a controller name with API version '1.0' was found to match HTTP method 'GET' and request URI.
This even happens on service document and metadata document as well.
One thing I don't know if is related is that my controllers and the startup class are in different assemblies. I had to move the MapVersionedODataRoutes to the controller's assembly to reach my current stage.
Any troubleshooting advice?

Ok, after more experiments I was able to see it working by moving the model configuration code to the controllers assembly as well. Is there a way to let it work without doing that?

Ok, I found out that for custom controller selector to work it should inherit the ApiVersionControllerSelector, and the ApiVersionModel property needs to be added into the custom http controller descriptors.
Still I'm wondering how it can work with model configurations and controllers being in different assemblies.

You've gone deep into the bowels of the routing system. I'm not sure why you want to customize the IHttpActionSelector. That level of detail in the design is not documented because almost no one touches it. This is where all the magic in API versioning happens. Specifically, the two services you cannot change unless you extend them are:

IHttpActionSelector
IHttpControllerSelector

These services are always replaced so if you're changing them, then you need to do it after .AddApiVersioning(). I'm a bit curious why you want to change these.
ASP.NET Web API supports dependency injection, but doesn't provide anything out-of-the-box (which is different from ASP.NET Core). I can't think of anything that would prevent IModelConfiguration definitions from being used in other assemblies. The mere act of adding them to the VersionedODataModelBuilder should make them get picked up.
There are two parts to the VersionedODataModelBuilder. The first is enumerating all possible API versions for all OData controllers. The second part taskes the unioned set of all API versions and then passes to each one to a model configuration to build an IEdmModel per API version. You can see that in VersionedODataModelBuilder.GetEdmModels(). While no services are replaced, VersionedODataModelBuilder.GetApiVersions() uses a lot of services to do its job. If you've changed any of these, it could be affecting the results. You can see for yourself in the code, but for a quick glance, these services are used:

IAssembliesResolver
IHttpControllerTypeResolver
IHttpActionSelector
IHttpControllerSelector

The only thing that immediately comes to mind that could have broken this behavior is if you are trying to use a plug-in type model with load-on-demand semantics. Since you mentioned the controllers are in different assemblies it sounds like you might be doing something like that. If you are, you'll probably need a different solution from the built-in VersionedODataModelBuilder. It is extensible. At a minimum, you'll have to override GetApiVersions() which likely uses a separate AppDomain to do discovery. You haven't provided enough information to say for sure, but sounds like you might be in this arena.
I hope that helps clear a few things up and get you on the path to a working solution.

Thanks for the explanations @commonsensesoftware . It does clear things up!
So the reason I need custom controller selection is that part of my controller classes are generated dynamically at run time, and part of them are defined classes. For dynamic ones I want override SelectController to return a desired controller descriptor, and for the others I wish to just call base.SelectController.
I looked into the AddApiVersioning code and found it was ApiVersionControllerSelector that I needed to extend and now that part is mostly working. But the challenge now is how to insert ApiVersion attributes on these dynamic classes. I noticed that on 3.0.0, it could be easily solvesd by inserting a property into the descriptor, but for 2.3.0 it can't work. (I'm now using 2.3.0 and OData 7.2.0).
And yes, for the cross assembly issue, I did find the code of relying on assembly resolver and controller type resolver for GetApiVersions in your code, so that's probably what I need to overwrite. But given it works when I move the model building and configuration to controller's assembly, I might just live with it for now.

Also, is there a way to apply some default OData route prefix when it's not specified on a controllers? Most of the time it's supposed to be the prefix of the controller name, and people tend to forget it.

The term prefix is a bit overloaded in OData, but this can be achieved using the MapVersionedODataRoute or MapVersionedODataRoutes extension methods (just like MapODataServiceRoute). If you mean relative to the controller using attributes, I believe ODataRoutePrefixAttribute is the only option. Beyond that you are relying completely on OData conventions.

Checking in before I close out this issue. Did this resolve your issue?

@commonsensesoftware Yep, I have moved on with some workarounds and it's working pretty good.
Thank you!!

repo: microsoft/aspnet-api-versioning


text:
[Feature Request]: OAI_CONFIG_LIST should accept not only .json, but also .yaml

Is your feature request related to a problem? Please describe.
I am currently working on a project where I aim to make multi-agent experiments more structured. To achieve this, I am integrating the entire workflow and configuration using Hydra by FacebookResearch.
For those familiar with PyTorch Lightning, there is a repository called lightning-hydra-template, which is designed to enhance the experience for fine-tuning and training models.
With this in mind, I believe it would be beneficial to have a function that can load configurations from YAML files. Given that YAML and JSON share similar structures, I anticipate that incorporating this functionality should not pose significant challenges.
Describe the solution you'd like
I have devised a solution that I've successfully tested in my project. In the autogen/oai/openai_utils.py file, I propose replacing json.loads with yaml.safe_load to facilitate the loading of YAML files.
I plan to implement this change and will submit a pull request to address this enhancement.
We can split this or make a new function is ok to me.
Additional context
No response
### add yaml support

Is it possible to for us to do both?

Is it possible to for us to have both JSON and YAML support?

Yes, i already made a PR
I did this on my own project as well

sorry i am busy now, i will finish this up later on this month

repo: microsoft/autogen


text:
Support matrix conditions

We have setup a build in VS Code which takes advantage of a build matrix to build for two different platforms. We also use the conditions directive to conditionally build such a phase.
https://github.com/Microsoft/vscode/blob/master/build/tfs/product-build.yml
phases:
- phase: Windows
  condition: eq(variables['VSCODE_BUILD_WIN32'], 'true')
  queue:
    name: Hosted VS2017
    parallel: 2
    matrix:
      x64:
        VSCODE_ARCH: x64
      ia32:
        VSCODE_ARCH: ia32

Is it possible to support conditions per matrix combination? The current condition checks VSCODE_BUILD_WIN32 for the true value. I'd like to get that behaviour per matrix combination and check both VSCODE_BUILD_WIN32_X64 and VSCODE_BUILD_WIN32_IA32 variables to conditionally build x64 and ia32 respectively.

For your specific scenario, since you only have two values in the matrix, a workaround would be to specify two phases instead.
We are in the process of rolling out a new feature, where sections of your process can pull in reusable template files. Here is a real world example. The docs for the feature are here.
That would enable you to easily define two phases, without duplicating the list of steps twice. You would put the steps in a separate file, and then reference the same file from each phase. We expect to be able to turn on the feature for all scale units, later this month.
We are also working on providing more context for template expresions. We want to be able to enable something like this:
phases:
- ${{ if or(eq(variables['VSCODE_BUILD_WIN32_X64'], 'true'), eq(variables['VSCODE_BUILD_WIN32_IA32'], 'true')) }}:
  - phase: Windows
    queue:
      name: Hosted VS2017
      parallel: 2
      matrix:
        ${{ if eq(variables['VSCODE_BUILD_WIN32_X64'], 'true') }}:
          x64:
            VSCODE_ARCH: x64
        ${{ if eq(variables['VSCODE_BUILD_WIN32_IA32'], 'true') }}:
          ia32:
            VSCODE_ARCH: ia32

Templates look great. Any set date for this to roll out in visualstudio.com?

FYI I was expecting to be able to do joaomoreno originally suggested.
Are the templates ready?

templates are rolling out with the current deployment. the deployment will resume next week (paused due to build conf) and will take about a week or two to roll out across all scale units

@ericsciple Can you ping me once it's out?

@joaomoreno they deployment has finished rolling out to all scale units

Oh cool, thanks. I couldn't find any official release notes in the blog.

@ericsciple Is there any update on support for conditional matrix elements using the '${{ if condition }}` notation?

authors: JakeRadMSFT drwill-ms ericsciple joaomoreno

repo: microsoft/azure-pipelines-agent


text:
Is "version" a predefined or reserved variable?

Agent Version and Platform
Version of your agent? 2.173.0
OS of the machine running the agent? Windows
Azure DevOps Type and Version
dev.azure.com
What's not working?
Maybe I just haven't found it anywhere in documentation. Having a variable "version" in the pipeline causes some pretty nasty and unexpected side-effects, and I don't see any documentation about predefined variables, or any other reserved words.
There are multiple tasks failing and it's no where obvious to the user that where/how that version is passed around and used.
i.e. setting
variables:
  Version: '1.2.3.4.5.6'

will at first instance cause a Nuget Restore task to fail

Detected NuGet version 5.7.0.6726 / 5.7.0+b804bf4ba62c0b47c77bbf3e22e196b57cd7a556.b804bf4ba62c0b47c77bbf3e22e196b57cd7a556
SYSTEMVSSCONNECTION exists true
C:\hostedtoolcache\windows\NuGet\5.7.0\x64\nuget.exe sources Add -NonInteractive -Name NuGetOrg -Source https://api.nuget.org/v3/index.json -ConfigFile D:\a\1\Nuget\tempNuGet_535.config
Package source with Name: NuGetOrg added successfully.
C:\hostedtoolcache\windows\NuGet\5.7.0\x64\nuget.exe restore D:\a\1\s\VersionTest\VersionTest.sln -Verbosity Detailed -NonInteractive -ConfigFile D:\a\1\Nuget\tempNuGet_535.config
C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\csanes0g.3hy.nugetrestore.targets(160,5): error MSB4018: The "WriteRestoreGraphTask" task failed unexpectedly. [C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\3lxfmmkx.ikw.nugetinputs.targets]
NuGet Version: 5.7.0.6726
C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\csanes0g.3hy.nugetrestore.targets(160,5): error MSB4018: System.ArgumentException: '1.2.3.4.5.6' is not a valid version string. [C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\3lxfmmkx.ikw.nugetinputs.targets]

Having a more valid version string
variables:
  Version: '1.2.3'
  VersionSuffix: 'alpha.1'

will override any version(suffix) parameters defined in the solution or passed as arguments to MSBuild Task
  - task: MSBuild@1
    displayName: Building the solution
    inputs:
      solution: '$(solution)'
      msbuildArchitecture: 'x64'
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'
      msbuildArguments: '-property:VersionSuffix=$(versionSuffix)'

"D:\a_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.166.2\ps_modules\MSBuildHelpers\vswhere.exe" -version [16.0,17.0) -latest -format json
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe" "D:\a\1\s\VersionTest\VersionTest.sln" /nologo /nr:false /dl:CentralLogger,"D:\a_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.166.2\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=|SolutionDir=D:\a\1\s\VersionTest"*ForwardingLogger,"D:\a_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.166.2\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" -property:versionsuffix=alpha.1 /p:platform="Any CPU" /p:configuration="Release" /p:_MSDeployUserAgent="VSTS_e52e8498-937d-414a-a9ea-729fef41d04b_build_10_0"
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.

As per command line, the version suffix is passed correctly, and should be merged with VersionPrefix as defined in a project (or Prefix will default to 1.0.0). However, somewhere the $(version) variable is getting used, and all assemblies' file version and product version are set to "1.2.3" instead of expected "1.0.0-alpha.1"
All works as expected if just renaming the "version" variable.
Agent and Worker's Diagnostic Logs
As per above.

Hi @perpetualKid it seems that "Version" environment variable is used by Nuget tool, but this seems to be not documented well - since it's not related to agent, I would recommend to create ticket on https://github.com/NuGet/NuGet.Client - to get right eyes on this issue.

Closing this also since it's not related to agent itself.

authors: anatolybolshakov perpetualKid