Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Local Package Source NU1301 when using parent directory #10672

Open
1 task done
brianfeucht opened this issue Sep 25, 2024 · 0 comments
Open
1 task done
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet L: github:actions GitHub Actions L: go:modules Golang modules T: bug 🐞 Something isn't working

Comments

@brianfeucht
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Package ecosystem

Nuget

Package manager version

No response

Language version

No response

Manifest location and content before the Dependabot update

No response

dependabot.yml content

No response

Updated dependency

No response

What you expected to see, versus what you actually saw

This is similar to #8543

We are using a directory in a parent project to keep a local build of a nuget package. It is used to verify the generated nuget package is good before deploying it.

Dependabot is converting the path ..\..\artifacts\ to \artifacts\ which when run returns a Unhandled exception: System.UnauthorizedAccessException: Access to the path '/artifacts/' is denied. error

You can repo by updating the existing test at

to

 describe "local path in NuGet.Config" do
    let(:config_file) do
      nuget_config_content = <<~XML
        <configuration>
          <packageSources>
            <clear />
            <add key="LocalSource1" value="SomePath" />
            <add key="LocalSource2" value="./RelativePath" />
            <add key="LocalSource3" value="/AbsolutePath" />			
            <add key="LocalSource4" value="../ParentPath" />
            <add key="PublicSource" value="https://nuget.example.com/index.json" />
          </packageSources>
        </configuration>
      XML
      Dependabot::DependencyFile.new(
        name: "NuGet.Config",
        content: nuget_config_content,
        directory: "some/directory"
      )
    end

    subject(:known_repositories) { finder.known_repositories }

    it "finds all local paths" do
      urls = known_repositories.map { |r| r[:url] }
      expected = [
        "/some/directory/SomePath",
        "/some/directory/RelativePath",
        "/AbsolutePath",
		"../ParentPath",
        "https://nuget.example.com/index.json"
      ]
      expect(urls).to match_array(expected)
    end
  end

Native package manager behavior

No response

Images of the diff or a link to the PR, issue, or logs

https://github.com/litmus/HeadlessChromium.Puppeteer.Lambda.Dotnet/actions/runs/11042302948/job/30674371538

Smallest manifest that reproduces the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet L: github:actions GitHub Actions L: go:modules Golang modules T: bug 🐞 Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant