Open rdipardo opened 3 months ago
Note for future me: after a quick look it appears that the issue is the job starting in a subdirectory (examples/minimal
in this case) and the temporary juggling of the global.json
file two directories up is causing an issue.
Some minimal examples trying to isolate the cause. Hopefully someone will fork 'em and test out any conditions I overlooked (e.g., they don't have *.sln
files or any Directory.Build.props
like the full-sized repos do).
global.json
from each project dir is ../..
https://github.com/npp-dotnet/dependabot-update-test-multi-dir/actions
https://github.com/npp-dotnet/dependabot-update-test/actions
Both have "Dependabot on Actions runners" enabled as per the default.
Both currently updating with no issue ¯\(ツ)/¯
The originally reported "Repo 2" has straightened itself out:
https://github.com/rdipardo/Fornax.Seo/actions
This leads me to suspect the problem was always with project references. No issues after adding some more ignore ignore keys to dependabot.yml
to avoid circular dependencies
"Repo 1" still has problems:
The exception is coming from the function GetProjectPathsFromProject
which makes me think there might be an issue with the following section:
...
<ProjectReference Include="$(MSBuildThisFileDirectory)../../lib/Npp.DotNet.Plugin.csproj">
...
That's perfectly valid MSBuild, but the dependency analyzer might be choking on that. I'll explore a bit.
The exception is coming from the function
GetProjectPathsFromProject
which makes me think there might be an issue with the following section:... <ProjectReference Include="$(MSBuildThisFileDirectory)../../lib/Npp.DotNet.Plugin.csproj"> ...
The exception is coming from the function
GetProjectPathsFromProject
...Bingo ...
Precisely here, by the looks of it:
// Issue10306.fsx
#r "nuget:Microsoft.Extensions.FileSystemGlobbing,8.0.0"
open Microsoft.Extensions.FileSystemGlobbing
let matcher = Matcher()
[| @"..\..\Project1.csproj"
@$"{__SOURCE_DIRECTORY__}\..\..\Project2.csproj" |]
|> Array.iter
(fun path ->
let normalizedUnixPath = path.Replace("\\", "/")
printfn $"Adding path: \"{normalizedUnixPath}\""
matcher.AddInclude(normalizedUnixPath) |> ignore
printfn "O.K.")
$ dotnet fsi /langversion:latest Issue10306.fsx
Adding path: "../../Project1.csproj"
O.K.
Adding path: "C:/Users/Rob/dev/../../Project2.csproj"
System.ArgumentException: ".." can be only added at the beginning of the pattern.
at Microsoft.Extensions.FileSystemGlobbing.Internal.Patterns.PatternBuilder.Build(String pattern)
at Microsoft.Extensions.FileSystemGlobbing.Matcher.AddInclude(String pattern)
at FSI_0002.staticInitialization@() in C:\Users\Rob\dev\Issue10306.fsx:line 15
at <StartupCode$FSI_0002>.$FSI_0002.main@()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Stopped due to error
I'm currently working on some changes to actually invoke MSBuild to do the full file detection, which should fix this issue. It's a larger work item, so I don't have an ETA but the work is underway.
Is there an existing issue for this?
Package ecosystem
nuget
Package manager version
ghcr.io/dependabot/dependabot-updater-nuget:65e4d27bfa9606e9e17db230f46e4d7c6a92d206
Language version
net8.0
Manifest location and content before the Dependabot update
/src/Hello.World/Hello.World.csproj
[source]
/test/Hello.World.Tests/Hello.World.Tests.csproj
(consumes
Hello.World.csproj
)[source]
Outdated
### Repo 1 [`/test/Memory/Memory.csproj`](https://github.com/npp-dotnet/Npp.DotNet.Plugin/blob/9c7990ee582e288121502856554d11d5eb4492f1/test/Memory/Memory.csproj) [`/examples/minimal/Npp.DotNet.Plugin.Demo.csproj`](https://github.com/npp-dotnet/Npp.DotNet.Plugin/blob/9c7990ee582e288121502856554d11d5eb4492f1/examples/minimal/Npp.DotNet.Plugin.Demo.csproj) ### Repo 2 [`/src/Fornax.Seo/Fornax.Seo.fsproj`](https://github.com/rdipardo/Fornax.Seo/blob/eee9263cb56dafcb647a7db6b502c2c947f8c296/src/Fornax.Seo/Fornax.Seo.fsproj) [`/example/Fornax.Seo.Example/Fornax.Seo.Example.fsproj`](https://github.com/rdipardo/Fornax.Seo/blob/eee9263cb56dafcb647a7db6b502c2c947f8c296/example/Fornax.Seo.Example/Fornax.Seo.Example.fsproj) [`/test/Fornax.Seo.Tests/Fornax.Seo.Tests.fsproj`](https://github.com/rdipardo/Fornax.Seo/blob/eee9263cb56dafcb647a7db6b502c2c947f8c296/test/Fornax.Seo.Tests/Fornax.Seo.Tests.fsproj)dependabot.yml content
Outdated
### Repo 1 https://github.com/npp-dotnet/Npp.DotNet.Plugin/blob/main/.github/dependabot.yml ### Repo 2 https://github.com/rdipardo/Fornax.Seo/blob/main/.github/dependabot.ymlUpdated dependency
multiple
What you expected to see, versus what you actually saw
Expected a green-lit update check to appear in the Actions log.
Instead see a red-lit failed job with the following error summary:
Outdated
I expected PRs to be opened with updated package manifests showing the build result of the CI workflows triggered by the `pull_request` event. Instead the container aborts the update and logs a failed build under the __Actions__ tab with a title like "nuget in *etc.* - Update #861824051". The failed jobs have their own workflow group ("Dependabot Updates"), but there's no link to a YAML config that I can find. It's been happening on schedule since about 07-22-2024 in two .NET repos, both public, one using the [multi-directory key](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#directories), and the other monitoring directories individually (i.e. no multi-directory key). It looks like the older per-directory config is still working, sometimes, i.e., compare the log of the successful job "Bump NUnit3TestAdapter *etc.*" with the 3 failed jobs from the same day:Native package manager behavior
No response
Images of the diff or a link to the PR, issue, or logs
3. Run Dependabot (log)
Complete logs: https://github.com/npp-dotnet/dependabot-update-test-multi-dir/actions/runs/10498841353/job/29084527439#step:3:1
Outdated
### Repo 1 https://github.com/npp-dotnet/Npp.DotNet.Plugin/actions/runs/10145989896/job/28053007647#step:3:1 The issue here seems to be the location of `global.json` in a parent directory; the [root exception message](https://github.com/npp-dotnet/Npp.DotNet.Plugin/actions/runs/10145989896/job/28053007647#step:3:50) is: `Unhandled exception: System.ArgumentException: ".." can be only added at the beginning of the pattern.` ### Repo 2 https://github.com/rdipardo/Fornax.Seo/actions/runs/10139219949/job/28032161119#step:3:1 https://github.com/rdipardo/Fornax.Seo/actions/runs/10139216173/job/28032151106#step:3:1 https://github.com/rdipardo/Fornax.Seo/actions/runs/10139096478/job/28031838994#step:3:1 No idea what the logs are indicating here, but it seems the updater is trying to update the tools packages in `/.config/dotnet-tools.json`, instead of the .NET project files (???) --- *Note: logs from 07-22 and earlier were deleted by me, thinking it was a spam PR from some kind of malicious bot*Smallest manifest that reproduces the issue