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

GitHub NuGet Handling fails for User Feeds #3573

Open
ChrisBlankDe opened this issue Jun 11, 2024 · 1 comment
Open

GitHub NuGet Handling fails for User Feeds #3573

ChrisBlankDe opened this issue Jun 11, 2024 · 1 comment
Assignees
Labels

Comments

@ChrisBlankDe
Copy link
Contributor

Describe the issue
The NuGetFeed Class currently only support orga feeds on github and fails on user feeds.

$queryUrl = "https://api.github.com/orgs/$organization/packages?package_type=nuget&per_page=100&page="

If we change the url to https://api.github.com/users/* this would work fine for users.
Unfortunately there is no nice solution to distinguish users and orgs. but there are workarounds

especially for the evaluation of the possibilities it would be nice if the github handling would also work for users and not only for orgs

Scripts used to create container and cause the issue
Triggert from GenerateBcNuGet Pipeline:
https://github.com/ChrisBlankDe/GenerateBcNuGet/actions/runs/9468253923/job/26084188320#step:4

Full output of scripts

Run . (Join-Path $env:GITHUB_WORKSPACE "GenerateNuGetPackages.ps1")
  . (Join-Path $env:GITHUB_WORKSPACE "GenerateNuGetPackages.ps1")
  shell: /usr/bin/pwsh -command ". '{0}'"
  env:
    nuGetToken: ***
    nuGetServerUrl: https://nuget.pkg.github.com/ChrisBlankDe/index.json
    apps: ***
    symbolsOnly: 
    packageIdTemplate: {publisher}.{name}.{id}
Generate Runtime NuGet Packages
Downloading BcContainerHelper developer version from https://bccontainerhelper.blob.core.windows.net/public/preview.zip
BcContainerHelper version 6.0.19-preview1[2](https://github.com/ChrisBlankDe/GenerateBcNuGet/actions/runs/9467593906/job/26081968342#step:4:2)13
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Running on Linux, PowerShell 7.4.2
Downloading /tmp/e5c4[3](https://github.com/ChrisBlankDe/GenerateBcNuGet/actions/runs/9467593906/job/26081968342#step:4:3)9ee-8938-48fa-839f-ad0ef509c2ff/apps.zip
Downloading AL Language Extension (Prerelease) to /home/runner/.bccontainerhelper/alLanguageExtension/1[4](https://github.com/ChrisBlankDe/GenerateBcNuGet/actions/runs/9467593906/job/26081968342#step:4:4).0.1037708.zip
using Expand-Archive
Setting execute permissions on altool
Search NuGetFeed https://nuget.pkg.github.com/ChrisBlankDe/index.json
Search package using https://api.github.com/orgs/ChrisBlankDe/packages?package_type=nuget&per_page=100&page=1
Error Message: Response status code does not indicate success: 404 (Not Found).
StackTrace: at Search, /tmp/344b009f-ec21-4fc3-b963-c83e7843f08d/BcContainerHelper/NuGet/NuGetFeedClass.ps1: line 103
at Find-BcNuGetPackage, /tmp/344b009f-ec21-4fc3-b963-c83e7843f08d/BcContainerHelper/NuGet/Find-BcNuGetPackage.ps1: line 63
at Get-BcNuGetPackage, /tmp/344b009f-ec21-4fc3-b963-c83e7843f08d/BcContainerHelper/NuGet/Get-BcNuGetPackage.ps1: line [5](https://github.com/ChrisBlankDe/GenerateBcNuGet/actions/runs/9467593906/job/26081968342#step:4:5)7
at <ScriptBlock>, /home/runner/work/GenerateBcNuGet/GenerateBcNuGet/GenerateNuGetPackages.ps1: line 20
at <ScriptBlock>, /home/runner/work/_temp/34eeb1b4-9b2f-4e7b-9ebd-1e8387afe5a[6](https://github.com/ChrisBlankDe/GenerateBcNuGet/actions/runs/9467593906/job/26081968342#step:4:6).ps1: line 2
at <ScriptBlock>, <No file>: line 1
Invoke-RestMethod: /tmp/344b009f-ec21-4fc3-b963-c83e[7](https://github.com/ChrisBlankDe/GenerateBcNuGet/actions/runs/9467593906/job/26081968342#step:4:7)843f08d/BcContainerHelper/NuGet/NuGetFeedClass.ps1:103
Line |
 103 |  …   $result = Invoke-RestMethod -Method GET -Headers $headers -Uri "$qu …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     |  {   "message": "Not Found",   "documentation_url":
     | "https://docs.github.com/rest/packages/packages#list-packages-for-an-organization",   "status": "404" }
Error: Process completed with exit code 1.

Additional context

  • does it happen all the time? Yes
  • did it use to work? No
@freddydk
Copy link
Contributor

Sounds like a bug
Will investigate after Tech Days.

@freddydk freddydk added the bug label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants