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

[24.4] Delete TenantMediaSet in Batch and safeguard loading detached media #1997

Closed
wants to merge 212 commits into from

Conversation

haoranpb
Copy link
Contributor

@haoranpb haoranpb commented Sep 10, 2024

Summary

port from #1990

Work Item(s)

Fixes AB#548335

aholstrup1 and others added 30 commits February 24, 2024 14:35
<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->
Update app versions and repoversion to 24.1 

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Relates to
[AB#501607](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/501607)
#### Summary
These capabilities are only available in some geos, avoid inserting them
in unsupported geos to avoid confusion.

#### Work Item(s) 
Fixes
[AB#502197](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/502197)
<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->
Add a setting for Legacy Action Bar on the User Settings and My Settings
pages for the user to customize.
Add platform subscriber to provide value of whether the setting has been
enabled or not.

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#499142](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/499142)
<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->

1. Add missing reference to powerbi.js in PowerBIManagement
2. Also reintroduce OAuthControlAddin as both should exist.
OAuthIntegration is used to create an authorization link and needs a min
height and width to do that. The OAuthControlAddin has no height and
width.

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#502394](https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_workitems/edit/502394)
…ld to avoid client error (#656)

<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->
Backport of #635

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#502380](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/502380)
#### Summary 
Data Search libraries added to system application, which will be used
for our Copilot feature

Related to
[AB#485919](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/485919)

Co-authored-by: Qasim Ikram <[email protected]>
#### Summary 
While generating marketing text, if you choose format "Tag Line +
Paragraph", there is an empty response shown. This PR fixes the issue by
making 2 LLM calls, one for each "Tag Line" and Paragraph. This is a
short term mitigation to avoid changing prompts.

#### Work Item(s) 

Fixes
[AB#504345](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/504345)

Co-authored-by: Qasim Ikram <[email protected]>
<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
AB#420000

Co-authored-by: mazhelez <[email protected]>
<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary <!-- Provide a general summary of your changes -->
Backport of #670 

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#504264](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/504264)

Co-authored-by: Carsten Scholling (MODUS Consult) <[email protected]>
Co-authored-by: Gert Robyns <[email protected]>
<!-- Thank you for submitting a Pull Request. If you're new to
contributing to BCApps please read our pull request guideline below
* https://github.com/microsoft/BCApps/Contributing.md
-->
#### Summary 
Cherry-picks of the following AppSource Gallery-related PR's.
#610 
#657 
#675 

#### Work Item(s) <!-- Add the issue number here after the #. The issue
needs to be open and approved. Submitting PRs with no linked issues or
unapproved issues is highly discouraged. -->
Fixes
[AB#504559](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/504559)

---------

Co-authored-by: Steffen Balslev <[email protected]>
Co-authored-by: Alexander Holstrup <[email protected]>
bcbuild-github-agent and others added 16 commits August 7, 2024 13:55
…eview - 4fd6c113536be76423b0eafc1b60e0ea8d077042 (#1755)

Fixes
[AB#420000](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/420000)

## preview

Note that when using the preview version of AL-Go for GitHub, we
recommend you Update your AL-Go system files, as soon as possible when
informed that an update is available.

### Issues

- Issue 1105 Increment Version Number - repoVersion in
.github/AL-Go-Settings.json is not updated
- Issue 1073 Publish to AppSource - Automated validation: failure
- Issue 980 Allow Scope to be PTE in continuousDeployment for PTE
extensions in Sandbox (enhancement request)
- Issue 1079 AppSource App deployment failes with PerTenantExtensionCop
Error PTE0001 and PTE0002
- Issue 866 Accessing GitHub Environment Variables in DeployToCustom
Scenarios for PowerShell Scripts
- Issue 1083 SyncMode for custom deployments?
- Issue 1109 Why filter deployment settings?
- Fix issue with github ref when running reusable workflows
- Issue 1098 Support for specifying the name of the AZURE_CREDENTIALS
secret by adding a AZURE_CREDENTIALSSecretName setting
- Fix placeholder syntax for git ref in PullRequestHandler.yaml

### Dependencies to PowerShell modules

AL-Go for GitHub relies on specific PowerShell modules, and the minimum
versions required for these modules are tracked in
[Packages.json](https://raw.githubusercontent.com/microsoft/AL-Go/main/Actions/Packages.json)
file. Should the installed modules on the GitHub runner not meet these
minimum requirements, the necessary modules will be installed as needed.

### Support managed identities and federated credentials

All authentication context secrets now supports managed identities and
federated credentials. See more [here](Scenarios/secrets.md).
Furthermore, you can now use https://aka.ms/algosecrets#authcontext to
learn more about the formatting of that secret.

### Business Central Performance Toolkit Test Result Viewer

In the summary after a Test Run, you now also have the result of
performance tests.

### Support Ubuntu runners for all AL-Go workflows

Previously, the workflows "Update AL-Go System Files" and
"TroubleShooting" were hardcoded to always run on `windows-latest` to
prevent deadlocks and security issues.
From now on, `ubuntu-lates` will also be allowed for these mission
critical workflows, when changing the `runs-on` setting. Additionally,
only the value `pwsh` for `shell` setting is allowed when using
`ubuntu-latest` runners.

### Updated AL-Go telemetry

AL-Go for GitHub now includes a new telemetry module. For detailed
information on how to enable or disable telemetry and to see what data
AL-Go logs, check out [this
article](https://github.com/microsoft/AL-Go/blob/main/Scenarios/EnablingTelemetry.md).

### New Settings

- `deployTo<environmentName>`: is not really new, but has a new
property:

- **Scope** = specifies the scope of the deployment: Dev, PTE. If not
specified, AL-Go for GitHub will always use the Dev Scope for AppSource
Apps, but also for PTEs when deploying to sandbox environments when
impersonation (refreshtoken) is used for authentication.
- **BuildMode** = specifies which buildMode to use for the deployment.
Default is to use the Default buildMode.
- **\<custom>** = custom properties are now supported and will be
transferred to a custom deployment script in the hashtable.

- `bcptThresholds` is a JSON object with properties for the default
thresholds for the Business Central Performance Toolkit

- **DurationWarning** - a warning is issued if the duration of a bcpt
test degrades more than this percentage (default 10)
- **DurationError** - an error is issued if the duration of a bcpt test
degrades more than this percentage (default 25)
- **NumberOfSqlStmtsWarning** - a warning is issued if the number of SQL
statements from a bcpt test increases more than this percentage (default
5)
- **NumberOfSqlStmtsError** - an error is issued if the number of SQL
statements from a bcpt test increases more than this percentage (default
10)

> \[!NOTE\]
> Duration thresholds are subject to varying results depending on the
performance of the agent running the tests. Number of SQL statements
executed by a test is often the most reliable indicator of performance
degredation.

Co-authored-by: bcbuild-github-agent <[email protected]>
#### Summary
Now that Latest is the same as Preview, we can point Entity Text back to
Latest

#### Work Item(s)
Fixes
[AB#534753](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/534753)
This PR contains the following changes:
- Update BCArtifact version. New value: 24.4.22295.22724


[AB#539394](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/539394)

Co-authored-by: mazhelez <[email protected]>
This PR contains the following changes:
- Update BCArtifact version. New value: 24.4.22295.22744


[AB#539394](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/539394)

Co-authored-by: mazhelez <[email protected]>
…870 (#1803)

This PR contains the following changes:
- Update app baselines package version. New value: 24.3.21374.22870


[AB#539394](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/539394)

Co-authored-by: aholstrup1 <[email protected]>
…eview - 0fa5d001900cac6ce60dcb2170b620dd3694dafd (#1815)

No release notes available!

[AB#539394](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/539394)

Co-authored-by: bcbuild-github-agent <[email protected]>
…to Azure Function multiple times with the same authentication parameters (#1832)

**Actions:**
Run the code below:
```
    local procedure SendRequestToAzureFunction()
    var
        AzureFunctionsAuthentication: Codeunit "Azure Functions Authentication";
        AzureFunctions: Codeunit "Azure Functions";
        AzureFunctionsAuth: Interface "Azure Functions Authentication";
        ClientID, Scope, AuthURL, EndpointText : Text;
        RequestBody: Text;
        Cert: SecretText;
        i: Integer;
    begin
        GetAuthParameters(ClientID, Cert, AuthURL, EndpointText);
        Scope := 'api://abcdefff-1111-2222-3333-123456789fff/.default';
        AzureFunctionsAuth := AzureFunctionsAuthentication.CreateOAuth2WithCert(EndpointText, '', ClientID, Cert, AuthURL, '', Scope);
        RequestBody := GetRequestBody();
        for i := 1 to 200 do
            AzureFunctions.SendPostRequest(AzureFunctionsAuth, RequestBody, 'application/json');
    end;
```

It sets Authentication parameters once and then sends POST request to
Azure Function 200 times.

**Expected result:**
Request is sent 200 times without errors.

**Actual result:**
After about 128 executions of AzureFunctions.SendPostRequest() the
function fails with the error "Authentication Failed".
The telemetry logs right befoge the authentication failure show the
error:

_Microsoft.Dynamics.Nav.LicensingService.Model.Exceptions.LicenseServiceTransientException
in AcquireApplicationTokenWithCertificate:
LicenseServiceTransientException: Exception details :
**RequestUriTooLong** - error returned._

The reason for this error is that every time the SendPostRequest is
invoked, the scope is added to the global list of scopes that is used to
authenticate in Azure Function. Therefore the list of scopes grows, and
it seems that the list is used to build URI for authentication, so after
multiple iterations the authentication function fails with
RequestUriTooLong.

Fixes
[AB#544608](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/544608)

Co-authored-by: Alexander Gladkov <[email protected]>
…073 (#1836)

This PR contains the following changes:
- Update app baselines package version. New value: 24.3.21374.23073


[AB#539394](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/539394)

Co-authored-by: aholstrup1 <[email protected]>
…eview - 73f489ec1d9a34fa2ed69fbafd5e0ec9bd67f48b (#1848)

Fixes
[AB#420000](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/420000)

## v5.3

### Issues

- Issue 1105 Increment Version Number - repoVersion in
.github/AL-Go-Settings.json is not updated
- Issue 1073 Publish to AppSource - Automated validation: failure
- Issue 980 Allow Scope to be PTE in continuousDeployment for PTE
extensions in Sandbox (enhancement request)
- Issue 1079 AppSource App deployment failes with PerTenantExtensionCop
Error PTE0001 and PTE0002
- Issue 866 Accessing GitHub Environment Variables in DeployToCustom
Scenarios for PowerShell Scripts
- Issue 1083 SyncMode for custom deployments?
- Issue 1109 Why filter deployment settings?
- Fix issue with github ref when running reusable workflows
- Issue 1098 Support for specifying the name of the AZURE_CREDENTIALS
secret by adding a AZURE_CREDENTIALSSecretName setting
- Fix placeholder syntax for git ref in PullRequestHandler.yaml
- Issue 1164 Getting secrets from Azure key vault fails in Preview

### Dependencies to PowerShell modules

AL-Go for GitHub relies on specific PowerShell modules, and the minimum
versions required for these modules are tracked in
[Packages.json](https://raw.githubusercontent.com/microsoft/AL-Go/main/Actions/Packages.json)
file. Should the installed modules on the GitHub runner not meet these
minimum requirements, the necessary modules will be installed as needed.

### Support managed identities and federated credentials

All authentication context secrets now supports managed identities and
federated credentials. See more [here](Scenarios/secrets.md).
Furthermore, you can now use https://aka.ms/algosecrets#authcontext to
learn more about the formatting of that secret.

### Business Central Performance Toolkit Test Result Viewer

In the summary after a Test Run, you now also have the result of
performance tests.

### Support Ubuntu runners for all AL-Go workflows

Previously, the workflows "Update AL-Go System Files" and
"TroubleShooting" were hardcoded to always run on `windows-latest` to
prevent deadlocks and security issues.
From now on, `ubuntu-lates` will also be allowed for these mission
critical workflows, when changing the `runs-on` setting. Additionally,
only the value `pwsh` for `shell` setting is allowed when using
`ubuntu-latest` runners.

### Updated AL-Go telemetry

AL-Go for GitHub now includes a new telemetry module. For detailed
information on how to enable or disable telemetry and to see what data
AL-Go logs, check out [this
article](https://github.com/microsoft/AL-Go/blob/main/Scenarios/EnablingTelemetry.md).

### New Settings

- `deployTo<environmentName>`: is not really new, but has a new
property:

- **Scope** = specifies the scope of the deployment: Dev, PTE. If not
specified, AL-Go for GitHub will always use the Dev Scope for AppSource
Apps, but also for PTEs when deploying to sandbox environments when
impersonation (refreshtoken) is used for authentication.
- **BuildMode** = specifies which buildMode to use for the deployment.
Default is to use the Default buildMode.
- **\<custom>** = custom properties are now supported and will be
transferred to a custom deployment script in the hashtable.

- `bcptThresholds` is a JSON object with properties for the default
thresholds for the Business Central Performance Toolkit

- **DurationWarning** - a warning is issued if the duration of a bcpt
test degrades more than this percentage (default 10)
- **DurationError** - an error is issued if the duration of a bcpt test
degrades more than this percentage (default 25)
- **NumberOfSqlStmtsWarning** - a warning is issued if the number of SQL
statements from a bcpt test increases more than this percentage (default
5)
- **NumberOfSqlStmtsError** - an error is issued if the number of SQL
statements from a bcpt test increases more than this percentage (default
10)

> \[!NOTE\]
> Duration thresholds are subject to varying results depending on the
performance of the agent running the tests. Number of SQL statements
executed by a test is often the most reliable indicator of performance
degredation.

Co-authored-by: bcbuild-github-agent <[email protected]>
…291 (#1876)

This PR contains the following changes:
- Update app baselines package version. New value: 24.3.21374.23291


[AB#539394](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/539394)

Co-authored-by: aholstrup1 <[email protected]>
…388 (#1909)

This PR contains the following changes:
- Update app baselines package version. New value: 24.3.21374.23388


[AB#539394](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/539394)

Co-authored-by: aholstrup1 <[email protected]>
…624 (#1942)

This PR contains the following changes:
- Update app baselines package version. New value: 24.3.21374.23624


[AB#539394](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/539394)

Co-authored-by: aholstrup1 <[email protected]>
…eview - 9308ffb724a39179ea32dd55c838f176903a2a5c (#1964)

## preview

Note that when using the preview version of AL-Go for GitHub, we
recommend you Update your AL-Go system files, as soon as possible when
informed that an update is available.

### Issues

- Issue 1184 Publish to Environment fails on 'Permission Denied'

Fixes
[AB#420000](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/420000)

Co-authored-by: bcbuild-github-agent <[email protected]>
…931 (#1981)

This PR contains the following changes:
- Update app baselines package version. New value: 24.3.21374.23931


[AB#539394](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/539394)

Co-authored-by: aholstrup1 <[email protected]>
@haoranpb haoranpb requested review from a team as code owners September 10, 2024 10:03
@haoranpb haoranpb closed this Sep 10, 2024
@haoranpb haoranpb deleted the bugs/548323-24.4 branch September 10, 2024 10:03
@github-actions github-actions bot added Build: Automation Workflows and other setup in .github folder AL: System Application Build: scripts & configs Build scripts and configuration files AL: Tools AL: Business Foundation labels Sep 10, 2024
@github-actions github-actions bot added this to the Version 26.0 milestone Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AL: Business Foundation AL: System Application AL: Tools Build: Automation Workflows and other setup in .github folder Build: scripts & configs Build scripts and configuration files
Projects
None yet
Development

Successfully merging this pull request may close these issues.