Skip to content

Fix Apps DK (Clean) compile failure by scoping Key Vault mock tests to OnPrem#9588

Draft
djukicmilica with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-failing-github-actions-job-yet-again
Draft

Fix Apps DK (Clean) compile failure by scoping Key Vault mock tests to OnPrem#9588
djukicmilica with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-failing-github-actions-job-yet-again

Conversation

Copilot AI commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Build Apps DK (Clean) / Apps DK (Clean) failed with AL0296 in ElecVATDeclTests.Codeunit.al: Cloud-targeted test procedures invoked Key Vault mock helpers that are OnPrem-scoped.
This PR narrows those tests to OnPrem scope so the Clean Cloud compile no longer attempts illegal calls.

  • Root cause

    • ElectronicVATDeclarationDK/test (target: "Cloud") included test methods calling:
      • InitMockAzureKeyvaultSecretProvider
      • AddMockAzureKeyvaultSecretProviderMapping
      • UseAzureKeyvaultSecretProvider
    • These helpers are [Scope('OnPrem')], triggering AL0296 during Apps DK (Clean) compilation.
  • Change applied

    • Added [Scope('OnPrem')] to the four reporting-frequency tests that use Key Vault mocks.
    • Added [Scope('OnPrem')] to SetReportingFrequencyKeyVaultFlag local helper used by those tests.
  • Illustrative snippet

[Test]
[Scope('OnPrem')]
procedure ReportingFrequencyIsEnabledWhenKeyVaultFlagIsTrue()
begin
    SetReportingFrequencyKeyVaultFlag('true');
    Assert.IsTrue(ElecVATDeclAzKeyVault.IsReportingFrequencyEnabled(), ...);
end;

[Scope('OnPrem')]
local procedure SetReportingFrequencyKeyVaultFlag(FlagValue: Text)
begin
    LibraryAzureKVMockMgmt.InitMockAzureKeyvaultSecretProvider();
    LibraryAzureKVMockMgmt.AddMockAzureKeyvaultSecretProviderMapping('DKElecVAT-ReportingFrequencyEnabled', FlagValue);
    LibraryAzureKVMockMgmt.UseAzureKeyvaultSecretProvider();
end;

@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Jul 18, 2026
Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'Build Apps DK (Clean)' Fix Apps DK (Clean) compile failure by scoping Key Vault mock tests to OnPrem Jul 18, 2026
Copilot AI requested a review from djukicmilica July 18, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-approval Workflow runs require maintainer approval to start

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants