Add support for indirect template + customizations
Changes included in this PR:
- Support indirect template repository = Point to an existing AL-Go repository as a template, like:
In this case, org/myptetemplate is a standard AL-Go repository, which gets updated as any other AL-Go repository using Update AL-Go System Files. This is a way of standardizing your repository based on type specific AL-Go templates (which can be private or public).
Normally, Update AL-Go System Files follows this mechanism:
| File Type | Repository file(s) | AL-Go Template |
|---|---|---|
| Workflows | .github/workflows/*.yaml | <- |
| Repo Scripts | .github/*.ps1 | <- |
| Project Scripts | .AL-Go/*.ps1 | <- |
Workflows and scripts are read from the template repository and modified based on settings and saved to the repository.
Using an indirect template repository, the picture looks like this:
| File Type | Repository file(s) | Indirect Template | AL-Go Template |
|---|---|---|---|
| Workflows | .github/workflows/*.yaml | <- Customizations | <- |
| Workflows | .github/workflows/*.yaml | <- New files | |
| Repo Scripts | .github/*.ps1 | <- | |
| Repo Scripts | .github/*.ps1 | <- New files | |
| Repo Settings | .github/templateRepoSettings.doNotEdit.json | <- .github/AL-Go-Settings.json | |
| Project Scripts | .AL-Go/*.ps1 | <- | |
| Project Scripts | .AL-Go/*.ps1 | <- New files | |
| Project Settings | .github/templateProjectSettings.doNotEdit.json | <- .AL-Go/settings.json |
Workflows and scripts are read from the "real" template repository and modified based on settings. Customizations for workflows in the indirect template repository are applied.
New workflows and scripts from the indirect template repository are copied over.
Repo and Project settings from the indirect template repository are copied over to new settings files, which are applied before the final repos repo and project settings in order to allow the indirect template to add new defaults to settings to be applied to all repositories.
The final repository can also contain customizations to workflows and the winner here is the indirect template repository (if a custom job exists in both places).
This PR: https://github.com/freddydk/customized/pull/17 - is an example of a repository with customizations of CI/CD and _BuildALGoProject, which runs Update AL-Go System Files and gets customizations from the indirect template repository (both settings, scripts and workflow customizations)
Documentation on customization capabilities is here: https://github.com/freddydk/AL-Go/blob/customize/Scenarios/CustomizingALGoForGitHub.md
@freddydk, do you have an estimated time of completion for this PR? We've been testing it for a while and are considering deploying it live. However, we're a bit cautious about when the PR will be finalized and whether it will disrupt any modifications we've implemented.
Check https://github.com/microsoft/AL-Go/pull/1097 - to ensure the scenario is supported
@jonaswre, @mortenseifert and @lippertmarkus - feel free to add your code review as well
Hi @freddydk, i'm currently on vacation until September 2, but I'll test it in my demo org once im back. Im excited for this change.
But trusted nuget feeds would be my first priority. We've recently got more requests to use our apps as dependencies so will need to distribute runtimes to customers. We've implemented the GenerateBCNuget Repo which works great but distributing them is the next step for us. If I can help with that let me know.
Hi @freddydk, i'm currently on vacation until September 2, but I'll test it in my demo org once im back. Im excited for this change.
But trusted nuget feeds would be my first priority. We've recently got more requests to use our apps as dependencies so will need to distribute runtimes to customers. We've implemented the GenerateBCNuget Repo which works great but distributing them is the next step for us. If I can help with that let me know.
I will resume the work on NuGet while this PR is in review.