This PR should go in after https://github.com/microsoft/AL-Go/pull/955
This PR:
* Fixes all the issues found by the pre-commit hooks (by running
`pre-commit run --all-files`)
* Adds a check on future AL-Go PRs to ensure the pre-commit hooks have
been run.
---------
Co-authored-by: Freddy Kristiansen <freddy.kristiansen@microsoft.com>
2 bugs when deploying to preview
- use of unknown variable (reserveReleaseNotes)
- use of wrong name of end 2 end tests workflow when searching for
workflow results
Also, when testing that end 2 end tests have run - check that no jobs
were skipped (running only partial tests)
autodeploy to preview after successful end 2 end tests.
---------
Co-authored-by: freddydk <freddydk@users.noreply.github.com>
Automate:
- The generation of modifying release notes with the version number (and
revert)
- Creation of a release in AL-Go repo
Adds:
- Check that a successful end 2 end test was run on the same commit you
are releasing
---------
Co-authored-by: freddydk <freddydk@users.noreply.github.com>
Co-authored-by: Alexander Holstrup <117829001+aholstrup1@users.noreply.github.com>
After finding out that v3.3 was shipped with containerHelper preview as
the selected version, I investigated and found that:
If a defaultContainerHelperVersion wasn't specified when running deploy,
the default containerHelperVersion used was taken from AL-Go-Helper.ps1
(which normally is "preview")
This PR defaults defaultContainerHelperVersion to preview for preview
branches and latest for other branches.
Also it makes sure that the line in AL-Go-Helper.ps1 can be found and
patched - else it will throw an error.
---------
Co-authored-by: freddydk <freddydk@users.noreply.github.com>
### The only real code change is in ReadSecrets
- If you precede a secret name with an asterisk in ReadSecrets/get, it
will be encrypted (as well as base64 encoded)
- Secrets used as SecureString in code will be requested as encrypted
(codeSignCertificatePassword and KeyVaultCertificatePassword) - allows
us to use ConvertTo-SecureString (without the -plaintext clause)
- Refactor connection to Azure KeyVault to only get credentials once and
keep clientSecret as secureString
This part also contains a bug fix that was introduced in
GetKeyVaultSecret during secrets refactoring (identified by secretName
parameter was never used)
### Whitespace only changes:
- Missing BOM on .ps1 files (all now have BOM - half didn't)
- Whitespace trailing lines (fixed everywhere)
### Suppressions:
- Suppress Analyzer on parameter blocks on test runners
- Suppress ConvertTo-SecureString (with plain text) in ReadSecretsHelper
- since we get GitHub secrets in clear text in code.
- Variables initialized in BeforeAll in tests
- Assigning isWindows, isMacOS and isLinux when running PS5
### Renaming functions to not use dash in names (must then follow
cmdlets)
### Removing actor+token from ReadSettings action as this is no longer
needed
- Functionality needing these have been moved to seperate actions
---------
Co-authored-by: freddydk <freddydk@users.noreply.github.com>
Co-authored-by: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com>
This PR changes the deployment process to
* Create pull requests when deploying Al-Go rather than force pushing
* Fetch the OrgPat from a GitHub environment to ensure that the secret
can only be accessed from workflows running on the main branch of AL-Go
* (Update the OrgPat to be from a service account rather than a PAT from
a Microsoft engineer)
New deployment process:
1. Run the Deploy workflow in microsoft/Al-Go
2. Request approval from another team member
3. The deploy action will by default create PRs in Al-Go-PTE /
Al-Go-AppSource / Al-Go-Actions. Go to those repositories, validate that
the PR looks as expected and merge the new changes.
---------
Co-authored-by: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com>
When deploying to v3.2 and checked the CopyToMain checkbox, the
deployment overrode the AL-Go-Actions@preview - this should never
happen.
---------
Co-authored-by: freddydk <freddydk@users.noreply.github.com>
Ensure that all calls to GitHub API have an API Version set in the call
to ensure they don't break by an update to the API
Also, remove prior pre-release mediatypes and always use the recommended
by GitHub
Co-authored-by: freddydk <freddydk@users.noreply.github.com>
When using regex and the substitution pattern has replacements starting
with a number (branch, repo, SHA, ...) regex will fail.
This lead to wrong deployment to preview ealier.
---------
Co-authored-by: freddydk <freddydk@users.noreply.github.com>
This PR changes the way we deploy to preview.
`microsoft/AL-Go-PTE@preview` (and AppSource template) will no longer
point to `microsoft/AL-Go-Actions@preview`, it will instead point to
`microsoft/AL-Go@SHA` of the commit you are deploying from.
This means that we will no longer make in-place updates of
microsoft/AL-Go-Actions@preview with the risk of breaking people.
The PR also removes the ability to run internal/deploy.ps1 and
internal/collect.ps1 from PowerShell and deprecates collect.ps1. Deploy
and Collect will still work, but collect is subject for removal in a
near future.
Contribution documentation has also been modified.
TODO:
- [x] the default template description in the Update AL-Go System Files
Yaml file is not updated.
---------
Co-authored-by: freddydk <freddydk@users.noreply.github.com>
Co-authored-by: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com>
Fix for issue #528
Set ProgressPereference to SilentlyContinue and strict-mode v2.0 in all
PowerShell scripts.
and give better error messages when uploading to storage accounts
---------
Co-authored-by: freddydk <freddydk@users.noreply.github.com>
Fill out 4 new parameters on Run-AlPipeline (and the Compile functions),
to specify the origin of the app inside the app manifest.
- SourceRepositoryUrl specifies the repository URL
- SourceCommit specifies the SHA used for the build
- BuildBy specifies the product used to perform the build
- BuildUrl is the URL to the workflow run
Parameters dumped in the RunPipeline Action are:
![image](https://github.com/microsoft/AL-Go/assets/10775043/829a1216-0c1a-427e-94e3-392814dc1baf)
NavxManifest.xml in the app package will contain properties like this:
```
<Source RepositoryUrl="https://github.com/BusinessCentralApps/buildorder" Commit="5523f3678064a9f425e1825ef94583d6f3136ebc" />
<Build By="AL-Go for GitHub,v3.1" Url="https://github.com/BusinessCentralApps/buildorder/actions/runs/5435941342" Timestamp="2023-07-07T10:01:13.8159082Z" CompilerVersion="12.0.12.44111" />
```
---------
Co-authored-by: freddydk <freddydk@users.noreply.github.com>