wgnf / liz

liz (ˈlɪz) is a tool to extract license-information from your project/solution aimed on a fast and correct process. Whether it's via a dotnet-CLI-Tool, Cake-Addin or Nuke-Addon
MIT License
10 stars 0 forks source link

[BUG]: Scanning solution seems to not work in pipeline #146

Closed starteNCS closed 1 year ago

starteNCS commented 1 year ago

Description of the bug

When scanning my solution I could not get it to work on my azure devops pipeline (ubuntu), where as it works just fine on my local dev machine.

Steps to reproduce

These are my pipeline steps. Running the exact same on my local machine, does work.

steps:
  - checkout: self
  - bash: |
      dotnet tool install --global liz.tool
    displayName: Install liz license tool
    workingDirectory: $(Build.SourcesDirectory)
  - task: DotNetCoreCLI@2
    displayName: Restore packages from artifact repository
    inputs:
      command: "restore"
      feedsToUse: "select"
      vstsFeed: "***"
  - bash: |
      liz "./***.sln" --whitelist ./pipelines/licenses.json --suppress-progressbar
    displayName: Check licenses
    workingDirectory: $(Build.SourcesDirectory)

Additional Information

This is the output using the solution: image

This is the output I would expect and the output I get when using a csproj: image

wgnf commented 1 year ago

Hi @starteNCS,

thanks for providing a detailed bug-report!
Is there any chance you could provide me with the following information?

  1. A diagnostic log (using -l Trace) make sure to censor any confidential information
  2. A solution containing the projects and package-references that you're currently using - again, making sure to censor any confidential information (i.e. I don't need any source-code, as liz only uses the project- and package-reference information)

Both of these things might be helpful to track down the issue that might occur in your Azure-Pipeline.

starteNCS commented 1 year ago

Sure! I was able to reproduce this exact bug when creating a new project so here we go:

Screenshot to your first question: image

But the same can be seen here: https://dev.azure.com/PhilippHonsel/liz.bugreport/_build/results?buildId=2&view=logs&j=12f1170f-54f2-53f3-20dd-22fc7dff55f9&t=35f53584-79fc-539f-463c-6471d0663a3a

This is a "broken" pipeline run. You can feely navigate this project to find the root cause if you want. With this code it works on my windows 10 machine, but not on the pipeline. If I remember corretly, the public azure devops pipelines are running on ubuntu as well.

wgnf commented 1 year ago

Ahh very nice, this will help a lot, thank you! :)

I'll have a look at that as soon as I can. This will be some time next week though (real-life y'know), I hope that does not hinder you too much.

Looking at the output of the Trace-Log seems like liz doesn't find anything to process. As if there aren't any package- nor project-references. Seems odd.

wgnf commented 1 year ago

Unfortunately I won't be able to work on this today.

But: Can you try to run the analysis targetting a csproj instead of a sln? This might help to narrow down the cause of the issue.

starteNCS commented 1 year ago

Yes, using a csproj works. (See the screenshot in the bug report)

wgnf commented 1 year ago

I unfortunately have no solution yet, but I managed to track down that the issue probably comes from my SlnParser library which I use to parse the solution when one is given.

wgnf commented 1 year ago

I just released a new version 2.0.3 which should fix the issue that you described. Can you verify that? Worked in my Azure DevOps pipeline.

starteNCS commented 1 year ago

This did fix it indeed. Thanks! See new run: https://dev.azure.com/PhilippHonsel/liz.bugreport/_build/results?buildId=3&view=logs&j=12f1170f-54f2-53f3-20dd-22fc7dff55f9&t=35f53584-79fc-539f-463c-6471d0663a3a

wgnf commented 1 year ago

great news, thanks!