Skip to content

Commit

Permalink
Merge branch 'main' into bing-search-opt-out
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-andersen-msft committed Feb 12, 2025
2 parents 7c165fa + f948ab1 commit 6fa295d
Show file tree
Hide file tree
Showing 31 changed files with 323 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/AL-Go-Settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"runs-on": "windows-latest",
"cacheImageName": "",
"UsePsSession": false,
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/26.0.29684.0/base",
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/26.0.29985.0/base",
"country": "base",
"useProjectDependencies": true,
"repoVersion": "26.0",
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/PowerShell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Run PSScriptAnalyzer
Expand All @@ -33,7 +38,7 @@ jobs:

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
with:
sarif_file: results.sarif

Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/UpdateALGoOnOfficialBranches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
outputs:
updateBranches: ${{ steps.getOfficialBranches.outputs.branchesJson }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Get Official Branches
id: getOfficialBranches
uses: microsoft/BCApps/.github/actions/GetGitBranches@main
Expand All @@ -32,6 +37,11 @@ jobs:
branch: ${{ fromJson(needs.GetBranches.outputs.updateBranches) }}
fail-fast: false
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Update AL-Go System Files
env:
GH_TOKEN: ${{ secrets.GHTOKENWORKFLOW }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/UpdateBCArtifactVersion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
outputs:
updateBranches: ${{ steps.getOfficialBranches.outputs.branchesJson }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Get Official Branches
id: getOfficialBranches
uses: microsoft/BCApps/.github/actions/GetGitBranches@main
Expand All @@ -40,7 +45,7 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ matrix.branch }}

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/UpdatePackageVersions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
outputs:
updateBranches: ${{ steps.getOfficialBranches.outputs.branchesJson }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Get Official Branches
id: getOfficialBranches
uses: microsoft/BCApps/.github/actions/GetGitBranches@main
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/WorkitemValidation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
name: 'Validate link to issues'
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand All @@ -34,6 +39,11 @@ jobs:
runs-on: ubuntu-latest
needs: GitHubIssueValidation
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/scorecard-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ jobs:
id-token: write # Needed for GitHub OIDC token if publish_results is true

steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: "Checkout code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -29,6 +34,6 @@ jobs:
results_format: sarif

- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions build/Packages.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"Microsoft.Dynamics.BusinessCentral.Translations": {
"Version": "26.0.20250123.2",
"Version": "26.0.20250210.4",
"Source": "NuGet.org"
},
"AppBaselines-BCArtifacts": {
"Version": "25.4.29475.0",
"Version": "25.5.29976.0",
"Source": "BCArtifacts",
"_comment": "Used to fetch app baselines from BC artifacts"
}
Expand Down
2 changes: 1 addition & 1 deletion src/System Application/App/AI/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"platform": "26.0.0.0",
"idRanges": [
{
"from": 7758,
"from": 7757,
"to": 7778
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ codeunit 7772 "Azure OpenAI Impl"
[NonDebuggable]
local procedure SendRequest(ModelType: Enum "AOAI Model Type"; AOAIAuthorization: Codeunit "AOAI Authorization"; Payload: Text; var AOAIOperationResponse: Codeunit "AOAI Operation Response"; CallerModuleInfo: ModuleInfo)
var
CopilotNotifications: Codeunit "Copilot Notifications";
ALCopilotAuthorization: DotNet ALCopilotAuthorization;
ALCopilotCapability: DotNet ALCopilotCapability;
ALCopilotFunctions: DotNet ALCopilotFunctions;
Expand Down Expand Up @@ -548,6 +549,9 @@ codeunit 7772 "Azure OpenAI Impl"
Error := GetLastErrorText();
AOAIOperationResponse.SetOperationResponse(ALCopilotOperationResponse.IsSuccess(), ALCopilotOperationResponse.StatusCode(), ALCopilotOperationResponse.Result(), Error);

if AOAIOperationResponse.GetStatusCode() = 402 then
CopilotNotifications.CheckAIQuotaAndShowNotification();

if not ALCopilotOperationResponse.IsSuccess() then
Error(GenerateRequestFailedErr);
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ page 7775 "Copilot AI Capabilities"

trigger OnOpenPage()
var
CopilotNotifications: Codeunit "Copilot Notifications";
EnvironmentInformation: Codeunit "Environment Information";
WithinGeo: Boolean;
WithinEUDB: Boolean;
Expand All @@ -333,10 +334,10 @@ page 7775 "Copilot AI Capabilities"
CurrPage.EarlyPreviewCapabilities.Page.SetDataMovement(AllowDataMovement);

if not EnvironmentInformation.IsSaaSInfrastructure() then
CopilotCapabilityImpl.ShowCapabilitiesNotAvailableOnPremNotification();
CopilotNotifications.ShowCapabilitiesNotAvailableOnPremNotification();

if (WithinGeo and not WithinEUDB) and (not AllowDataMovement) then
CopilotCapabilityImpl.ShowPrivacyNoticeDisagreedNotification();
CopilotNotifications.ShowPrivacyNoticeDisagreedNotification();

CopilotCapabilityImpl.UpdateGuidedExperience(AllowDataMovement);

Expand All @@ -345,6 +346,11 @@ page 7775 "Copilot AI Capabilities"
WithinEUDBArea := WithinEUDB;
WithinAOAIServicesInRegionArea := WithinGeo and (not WithinEUDB);
WithinAOAIOutOfRegionArea := (not WithinGeo) and (not WithinEUDB);

if EnvironmentInformation.IsSaaSInfrastructure() then begin
CopilotNotifications.ShowBillingInTheFutureNotification();
CopilotNotifications.CheckAIQuotaAndShowNotification();
end;
end;

local procedure HasEarlyPreviewCapabilities(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@ codeunit 7774 "Copilot Capability Impl"
AzureOpenAiTxt: Label 'Azure OpenAI', Locked = true;
AlreadyRegisteredErr: Label 'Capability has already been registered.';
NotRegisteredErr: Label 'Copilot capability has not been registered by the module.';
ReviewPrivacyNoticeLbl: Label 'Review the privacy notice';
PrivacyNoticeDisagreedNotificationMessageLbl: Label 'To enable Copilot, please review and accept the privacy notice.';
CapabilitiesNotAvailableOnPremNotificationMessageLbl: Label 'Copilot capabilities published by Microsoft are not available on-premises. You can extend Copilot with custom capabilities and use them on-premises for development purposes only.';
TelemetryRegisteredNewCopilotCapabilityLbl: Label 'New copilot capability registered.', Locked = true;
TelemetryModifiedCopilotCapabilityLbl: Label 'Copilot capability modified', Locked = true;
TelemetryUnregisteredCopilotCapabilityLbl: Label 'Copilot capability unregistered.', Locked = true;
TelemetryActivatedCopilotCapabilityLbl: Label 'Copilot capability activated.', Locked = true;
TelemetryDeactivatedCopilotCapabilityLbl: Label 'Copilot capability deactivated.', Locked = true;
NotificationPrivacyNoticeDisagreedLbl: Label 'bd91b436-29ba-4823-824c-fc926c9842c2', Locked = true;
NotificationCapabilitiesNotAvailableOnPremLbl: Label 'ada1592d-9728-485c-897e-8d18e8dd7dee', Locked = true;


procedure RegisterCapability(CopilotCapability: Enum "Copilot Capability"; LearnMoreUrl: Text[2048]; CallerModuleInfo: ModuleInfo)
begin
Expand Down Expand Up @@ -181,34 +175,6 @@ codeunit 7774 "Copilot Capability Impl"
GlobalLanguage(SavedGlobalLanguageId);
end;

procedure ShowPrivacyNoticeDisagreedNotification()
var
Notification: Notification;
NotificationGuid: Guid;
begin
NotificationGuid := NotificationPrivacyNoticeDisagreedLbl;
Notification.Id(NotificationGuid);
Notification.Message(PrivacyNoticeDisagreedNotificationMessageLbl);
Notification.AddAction(ReviewPrivacyNoticeLbl, Codeunit::"Copilot Capability Impl", 'OpenPrivacyNotice');
Notification.Send();
end;

procedure ShowCapabilitiesNotAvailableOnPremNotification()
var
Notification: Notification;
NotificationGuid: Guid;
begin
NotificationGuid := NotificationCapabilitiesNotAvailableOnPremLbl;
Notification.Id(NotificationGuid);
Notification.Message(CapabilitiesNotAvailableOnPremNotificationMessageLbl);
Notification.Send();
end;

procedure OpenPrivacyNotice(Notification: Notification)
begin
Page.Run(Page::"Privacy Notices");
end;

procedure GetAzureOpenAICategory(): Code[50]
begin
exit(AzureOpenAiTxt);
Expand Down
Loading

0 comments on commit 6fa295d

Please sign in to comment.