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

Use GitHub Packages from different Organization #989

Open
AlexanderRichter opened this issue Mar 18, 2024 · 10 comments
Open

Use GitHub Packages from different Organization #989

AlexanderRichter opened this issue Mar 18, 2024 · 10 comments
Assignees
Labels
Fix Ready Fix Ready question Further information is requested

Comments

@AlexanderRichter
Copy link

Hello,
we are trying to find our way through different scenarios on how to use Al-Go.

Our current idea is to have one GitHub Organization for our Producut Development Team.
There we want to store all our Apps in GitHub Packages.

In a different we want to manage the individual Projects.

How could we configure Al-Go to use the Packages from the Product Org for depenendy resolution
and still have the Packages from Custom Projects within the Project Orgainzation.

My question ist, is there a way to manage mulitple GitHubPackagesContext for one organization.

@skeck
Copy link

skeck commented Mar 18, 2024

I had a similar question here: #827. Feature #261 should be in preview now (didn't check).

@AlexanderRichter
Copy link
Author

i updated the al go settings with using freddydk/AL-Go@nuget and added a trusted nuget feed in my settings

"TrustedNuGetFeeds": [
{
"Url": "https://nuget.pkg.github.com/MYProductOrg/index.json",
"AuthTokenSecret": "GhTokenWorkflow"
}
]

Then i went to my custom app in Project Org and and added a dependency as usual.
Unfortunaley the build fails because dependency could not be resolved.

Checking the Log dont even see it that the Package gehts downloaded.

The Log shows for Step "Download Project Dependencies"

Settings: {"keyVaultCertificateUrlSecretName":"","microsoftTelemetryConnectionString":"InstrumentationKey=84bd9223-67d4-4378-8590-9e4a46023be2;IngestionEndpoint=https://westeurope-1.in.applicationinsights.azure.com/","type":"PTE","sendExtendedTelemetryToMicrosoft":false,"appBuild":13,"installTestApps":[],"versioningStrategy":0,"installApps":[],"installTestLibraries":false,"runNumberOffset":0,"codeSignCertificatePasswordSecretName":"codeSignCertificatePassword","vsixFile":"","country":"de","excludeEnvironments":[],"templateSha":"32b6eb33271eeec45ea8b3b238a67762a63ccbff","partnerTelemetryConnectionString":"","doNotRunTests":false,"enableCodeAnalyzersOnTestApps":false,"runs-on":"windows-latest","generateDependencyArtifact":false,"templateUrl":"https://github.com/freddydk/AL-Go@nuget","keyVaultCertificatePasswordSecretName":"","rulesetFile":"","licenseFileUrlSecretName":"licenseFileUrl","enableExternalRulesets":false,"memoryLimit":"","keyVaultClientIdSecretName":"","testFolders":[],"githubRunner":"windows-latest","doNotBuildTests":false,"environments":[],"companyName":"","assignPremiumPlan":false,"artifact":"bcartifacts/onprem/23.0.12034.12841/de","ghTokenWorkflowSecretName":"ghTokenWorkflow","enableTaskScheduler":false,"enableCodeCop":false,"TrustedNuGetFeeds":[{"AuthTokenSecret":"MyGitHubPackages","Url":"https://nuget.pkg.github.com/XXXXXXX/index.json"}],"repoVersion":"1.0","doNotPublishApps":true,"doNotSignApps":false,"unusedALGoSystemFiles":[],"githubRunnerShell":"powershell","cacheKeepDays":3,"bcptTestFolders":[],"updateDependencies":false,"cacheImageName":"my","treatTestFailuresAsWarnings":false,"additionalCountries":[],"alDoc":{"continuousDeployment":false,"deployToGitHubPages":true,"maxReleases":3,"groupByProject":true,"includeProjects":[],"excludeProjects":[],"header":"Documentation for {REPOSITORY}

@freddydk
Copy link
Collaborator

Yes, you should be able to add multiple trusted organizations.
I haven't tried this myself - but will try next week, when I get back from vacation

@AlexanderRichter
Copy link
Author

thanks freddy, enjoy your vacation :)

@freddydk freddydk self-assigned this Mar 21, 2024
@freddydk freddydk added the Under Investigation Issue is under investigation label Apr 15, 2024
@ronnykwon
Copy link

ronnykwon commented Apr 27, 2024

I'm facing the problem here too.
I have published nuget packages in my organisation account on github.
I have generated a personal token with the package:read attribute.

In my personal github account, I've created a repo using the nuget branch template.
I created an app.
In this app I created a dependency to my organisation app.
In the .AL-Go/settings.json I have added the settings

{
  "country": "fr",
  "appFolders": [],
  "testFolders": [],
  "bcptTestFolders": [],
  "TrustedNuGetFeeds": [
    {
        "Url": "https://nuget.pkg.github.com/MyOrg/index.json",
        "AuthTokenSecret": "GhNuGetMyOrg"
    }
  ]
}

in the Action secret I have added GhNuGetMyOrg with the previously generated personal token.

The build fails.

The following command works on my server :

PS C:\actions-runner> Get-BcNuGetPackage -nuGetServerUrl "https://nuget.pkg.github.com/MyOrgPF/index.json" -nuGetToken "ghp_MyOrgPackageReadToken" -packageName "a00a0000-aa00-0000-0000-0aaa00a00000"
Search NuGetFeed https://nuget.pkg.github.com/MyOrgPF/index.json
Search package using https://api.github.com/orgs/MyOrgPF/packages?package_type=nuget&per_page=100&page=1
1 matching packages found
- AL-Go-a00a0000-aa00-0000-0000-0aaa00a00000
PackageId: AL-Go-a00a0000-aa00-0000-0000-0aaa00a00000
Get versions using https://nuget.pkg.github.com/MyOrgPF/download/al-go-a00a0000-aa00-0000-0000-0aaa00a00000/index.json
3 versions found
First version is 24.1.17
Last version is 24.1.14.1
Latest version is 24.1.17
Best match for package name a00a0000-aa00-0000-0000-0aaa00a00000 Version 0.0.0.0: AL-Go-a00a0000-aa00-0000-0000-0aaa00a00000 Version 24.1.17 from https://nuget.pkg.github.com/MyOrgPF/index.json
Download package using https://nuget.pkg.github.com/MyOrgPF/download/al-go-a00a0000-aa00-0000-0000-0aaa00a00000/24.1.17/al-go-a00a0000-aa00-0000-0000-0aaa00a00000.24.1.17.nupkg
Package successfully downloaded

I've attached the debug log of the CI/CD action

hope it helps
debug_nuget.zip

@freddydk
Copy link
Collaborator

Sorry for the delay on this - have been busy on BC24 / PS7 stuff, but will have a look at this next week.

@ronnykwon
Copy link

I would suggest to have custom script that would run on specific lifecycle event in the same spirit of BC integration

@freddydk
Copy link
Collaborator

freddydk commented May 29, 2024

You need to move the TrustedNuGetFeeds setting to the repository settings file (.github/AL-Go-Settings.json)
The project settings file (.AL-Go/settings.json) cannot contain ContainerHelper settings as it is today.

@freddydk freddydk removed the Under Investigation Issue is under investigation label May 29, 2024
@freddydk
Copy link
Collaborator

And sorry for the long wait here :-(

@freddydk
Copy link
Collaborator

This is an example of this:
https://github.com/freddydk/GHP-W1/actions/runs/9286264549

@freddydk freddydk added question Further information is requested Fix Ready Fix Ready labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Ready Fix Ready question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants