microsoft / AL-Go

The plug-and-play DevOps solution for Business Central app development on GitHub
MIT License
293 stars 124 forks source link

Error: AL0185 Codeunit 'Permissions Mock' is missing #976

Closed gntpet closed 8 months ago

gntpet commented 8 months ago

Hey @freddydk,

When building our test app via AL-GO, we get compiler error regarding Permission Mock codeunit. Locally, it builds successfully. Seems that it cannot find it as dependency.

We do have 23.4 specifiied in our al-go settings.json: image

and in app.json itslelf. image

For some reason, here it tells that depdency app file not find for Permissions Mock image

But, in the logs above it shows up in the list of "Enumerating Apps in CompilerFolder..."

image

Here are our settings, if you need full logs, I can send it via private msg only:

SETTINGS:
{
    "keyVaultCertificateUrlSecretName":  "",
    "microsoftTelemetryConnectionString":  "InstrumentationKey=84bd9223-67d4-4378-8590-9e4a46023be2;IngestionEndpoint=https://westeurope-1.in.applicationinsights.azure.com/",
    "type":  "PTE",
    "sendExtendedTelemetryToMicrosoft":  false,
    "appBuild":  2147483647,
    "installTestApps":  [

                        ],
    "versioningStrategy":  15,
    "installApps":  [
                        "secret-link-to-doc-capture"
                    ],
    "installTestLibraries":  false,
    "runNumberOffset":  0,
    "codeSignCertificatePasswordSecretName":  "codeSignCertificatePassword",
    "country":  "base",
    "DeployToUAT":  {
                        "EnvironmentType":  "SaaS",
                        "EnvironmentName":  "UAT",
                        "Projects":  "SRS.nl",
                        "Branches":  [
                                         "release/*"
                                     ],
                        "ContinuousDeployment":  false,
                        "runs-on":  "srs-eid"
                    },
    "templateSha":  "1e6ebb58fc629cc1[34](https://github.com/sede-res/srs-bc/actions/runs/8235686639/job/22520416492#step:3:36)759f996f9be9ab6ada7fb4",
    "partnerTelemetryConnectionString":  "",
    "doNotRunTests":  true,
    "enableCodeAnalyzersOnTestApps":  false,
    "runs-on":  "srs-eid",
    "configPackages":  [

                       ],
    "generateDependencyArtifact":  false,
    "excludeEnvironments":  [

                            ],
    "keyVaultCertificatePasswordSecretName":  "",
    "rulesetFile":  "../al.ruleset.json",
    "licenseFileUrlSecretName":  "licenseFileUrl",
    "enableExternalRulesets":  false,
    "memoryLimit":  "",
    "keyVaultClientIdSecretName":  "",
    "testFolders":  [
                        "Test"
                    ],
    "githubRunner":  "srs-eid",
    "doNotBuildTests":  false,
    "environments":  [
                         "QA"
                     ],
    "companyName":  "TNM Automated Test",
    "assignPremiumPlan":  false,
    "artifact":  "bcartifacts/sandbox/23.4/base/latest",
    "ghTokenWorkflowSecretName":  "ghTokenWorkflow",
    "enableTaskScheduler":  true,
    "enableCodeCop":  true,
    "DeployToPROD":  {
                         "EnvironmentType":  "SaaS",
                         "EnvironmentName":  "PROD",
                         "Projects":  "SRS.nl",
                         "Branches":  [
                                          "release/*"
                                      ],
                         "ContinuousDeployment":  false,
                         "runs-on":  "srs-eid"
                     },
    "repoVersion":  "1.0",
    "doNotPublishApps":  true,
    "githubRunnerShell":  "powershell",
    "appFolders":  [
                       "App"
                   ],
    "cacheKeepDays":  3,
    "bcptTestFolders":  [

                        ],
    "updateDependencies":  false,
    "cacheImageName":  "my",
    "treatTestFailuresAsWarnings":  true,
    "additionalCountries":  [

                            ],
    "DeployToQA":  {
                       "EnvironmentType":  "SaaS",
                       "EnvironmentName":  "QA",
                       "Projects":  "SRS.nl",
                       "Branches":  [
                                        "main"
                                    ],
                       "ContinuousDeployment":  true,
                       "runs-on":  "srs-eid"
                   },
    "alDoc":  {
                  "continuousDeployment":  false,
                  "deployToGitHubPages":  true,
                  "maxReleases":  3,
                  "groupByProject":  true,
                  "includeProjects":  [

                                      ],
                  "excludeProjects":  [

                                      ],
                  "header":  "Documentation for {REPOSITORY} {VERSION}",
                  "footer":  "Documentation for \u003ca href=\"https://github.com/{REPOSITORY}\"\u003e{REPOSITORY}\u003c/a\u003e made with \u003ca href=\"https://aka.ms/AL-Go\"\u003eAL-Go for GitHub\u003c/a\u003e, \u003ca href=\"https://go.microsoft.com/fwlink/?linkid=22[47](https://github.com/sede-res/srs-bc/actions/runs/8235686639/job/22520416492#step:3:49)[72](https://github.com/sede-res/srs-bc/actions/runs/8235686639/job/22520416492#step:3:74)8\"\u003eALDoc\u003c/a\u003e and \u003ca href=\"[https://dotnet.github.io/docfx\](https://dotnet.github.io/docfx/)"\u003eDocFx\u003c/a\u003e",
                  "defaultIndexMD":  "## Reference documentation\\n\\nThis is the generated reference documentation for [{REPOSITORY}]([https://github.com/{REPOSITORY}](https://github.com/%7BREPOSITORY%7D)).\\n\\nYou can use the navigation bar at the top and the table of contents to the left to navigate your documentation.\\n\\nYou can change this content by creating/editing the **{INDEXTEMPLATERELATIVEPATH}** file in your repository or use the alDoc:defaultIndexMD setting in your repository settings file (.github/AL-Go-Settings.json)\\n\\n{RELEASENOTES}",
                  "defaultReleaseMD":  "## Release reference documentation\\n\\nThis is the generated reference documentation for [{REPOSITORY}]([https://github.com/{REPOSITORY}](https://github.com/%7BREPOSITORY%7D)).\\n\\nYou can use the navigation bar at the top and the table of contents to the left to navigate your documentation.\\n\\nYou can change this content by creating/editing the **{INDEXTEMPLATERELATIVEPATH}** file in your repository or use the alDoc:defaultReleaseMD setting in your repository settings file (.github/AL-Go-Settings.json)\\n\\n{RELEASENOTES}"
              },
    "customCodeCops":  [

                       ],
    "appDependencies":  [

                        ],
    "doNotRunBcptTests":  true,
    "appDependencyProbingPaths":  [

                                  ],
    "useCompilerFolder":  true,
    "installTestFramework":  false,
    "keyVaultCodesignCertificateName":  "",
    "keyVaultName":  "",
    "installOnlyReferencedApps":  true,
    "CICDPushBranches":  [
                             "main",
                             "release/*"
                         ],
    "obsoleteTagMinAllowedMajorMinor":  "",
    "applicationDependency":  "18.0.0.0",
    "applicationInsightsConnectionStringSecretName":  "applicationInsightsConnectionString",
    "shell":  "powershell",
    "failOn":  "error",
    "templateUrl":  "https://github.com/microsoft/AL-Go-PTE@main",
    "projects":  [

                 ],
    "appSourceCopMandatoryAffixes":  [

                                     ],
    "projectName":  "SRS.base",
    "testDependencies":  [

                         ],
    "appRevision":  0,
    "codeSignCertificateUrlSecretName":  "codeSignCertificateUrl",
    "vsixFile":  "",
    "useProjectDependencies":  false,
    "unusedALGoSystemFiles":  [

                              ],
    "buildModes":  [

                   ],
    "enableUICop":  false,
    "templateBranch":  "",
    "DeliverToStorage":  {
                             "Branches":  [
                                              "main",
                                              "release/*"
                                          ]
                         },
    "installPerformanceToolkit":  false,
    "pullRequestTrigger":  "pull_request",
    "CICDPullRequestBranches":  [
                                    "main",
                                    "release/*",
                                    "features/*",
                                    "bug/*"
                                ],
    "doNotSignApps":  true,
    "repoName":  "srs-bc",
    "fullBuildPatterns":  [

                          ],
    "alwaysBuildAllProjects":  true,
    "skipUpgrade":  true,
    "installTestRunner":  false,
    "adminCenterApiCredentialsSecretName":  "adminCenterApiCredentials"
}
freddydk commented 8 months ago

A few things to test (in this order)

gntpet commented 8 months ago

Plus, i don't see those dependecies being installed

image

freddydk commented 8 months ago

Looked at the original error again - it actually doesn't complain about a missing app - it complains about a missing codeunit. This is missing apps: image

This is a missing codeunit: image

So, it does find the app, but cannot find the codeunit. Not sure why this is?, but I think you need to investigate that.

gntpet commented 8 months ago

Hey @freddydk ,

sorry for wasting your time on this :(

I found an issue on our end. We do have hierarchical apps, (similarly as BC apps do). I added my Library Mock in one app.json, but forgot to add on the higher level app.json file. Once i added it there, CICD builds went green.