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

Branching enhancements #312

Closed
freddydk opened this issue Dec 2, 2022 · 5 comments
Closed

Branching enhancements #312

freddydk opened this issue Dec 2, 2022 · 5 comments
Assignees
Labels
Shipped Feature is included in the latest version

Comments

@freddydk
Copy link
Collaborator

freddydk commented Dec 2, 2022

Add to branching:

  • Support delivery and deployment from multiple branches (Handle different UAT and Main Branching in AL-Go for github #293)
    • For continuous deployment, an environment should have a property for which branch it gets deployed from (today this is hardcoded to main)
    • For Continuous delivery, the deliveryContext should be able to determine branches (with wildcards) for - and include branch in parameters to custom delivery
  • Potentially also deploy to environment from PRs for testing (see App Artifacts not published to the Pull-Request #281)
  • Support a main branch with a different name than main
@freddydk freddydk self-assigned this Dec 2, 2022
@freddydk freddydk added the In Progress Issue is actively being worked on label Dec 3, 2022
@freddydk
Copy link
Collaborator Author

freddydk commented Dec 4, 2022

Implementation

Continuous Delivery
For continuous delivery, you can create a repository setting (.github\AL-Go-Settings.json) named DeliverToXXX, where XXX is the delivery method.
This setting can contain an array of branches for which continuous delivery will be run. Example:

    "DeliverToStorage": {
        "Branches": [ "UAT", "main" ]
    }

The branch specification can include wildcards (like release/*), although this probably won't be used a lot in continuous deployment.
Beside this, StorageContext can now also contain {branch} in the containerName or the blobName property, which will be replaced with the branch name delivering.

Continuous Deployment
For continuous deployment, you can create a repository setting (.github\AL-Go-Settings.json) named DeployToXXX, where XXX is the environment name.
This setting can contain 4 properties, which affects how deployment is done:

    "DeployToQA":  {
        "Branches": [ "UAT", "main" ],
        "EnvironmentName":  "QA",
        "Projects": "*",
        "Runs-on":  "Windows-2019"
    }

This mechanism is preferred over the old way of specifying environment name, projects and runs-on.
The branch specification can include wildcards (like release/*), although this probably won't be used a lot in continuous deployment.

For both, if artifacts are to be delivered or deployed, artifacts will be generated and published on the build (including the branch name)

Create Release can also be done from other branches.

With this, we should be able to use a different name for the main branch - still some testing to do for this.

@freddydk freddydk mentioned this issue Dec 4, 2022
@freddydk freddydk added In Preview Currently available in AL-Go for GitHub preview and removed In Progress Issue is actively being worked on labels Dec 6, 2022
@CPretorius1986
Copy link

  1. Busy evaluating this for our purposes, and found that the following presents when deploying from main and UAT branch..

ConvertFrom-Json : Invalid JSON primitive: System.Collections.Specialized.OrderedDictionary.
At D:\a_temp\4250a6d6-b048-44e0-b117-81757d528ad1.ps1:5 char:44

  • $deployToSetting = $deployToSettingStr | ConvertFrom-Json
  •                                        ~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    • FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

Error: Process completed with exit code 1.

The Authcontext seems to be failing in CI/CD.yaml

  1. I also received the below on initialization but could get around by pointing to V2.2 Initialization file

Run microsoft/AL-Go-Actions/WorkflowInitialize@main
Run try { D:\a_actions\microsoft\AL-Go-Actions\main\WorkflowInitialize/WorkflowInitialize.ps1 -eventId $ENV:eventId } catch { Write-Host "::Error::Unexpected error when running action ($($.Exception.Message.Replace("r",'').Replace("n",' ')))"; exit 1 }
_ _____ __ _____ _ _ _ _ _ ::Error::WorkflowInitialize action failed. Error: The property 'm' cannot be found on this object. Verify that the property exists. Stacktrace: at , D:\a_actions\microsoft\AL-Go-Actions\main\AL-Go-TestRepoHelper.ps1: line 209 at , D:\a_actions\microsoft\AL-Go-Actions\main\AL-Go-TestRepoHelper.ps1: line 208 at Write-Big, D:\a_actions\microsoft\AL-Go-Actions\main\AL-Go-TestRepoHelper.ps1: line 206 at , D:\a_actions\microsoft\AL-Go-Actions\main\WorkflowInitialize\WorkflowInitialize.ps1: line 30 at , D:\a_temp\3dfe20be-15f7-4866-830c-11c9b6808c02.ps1: line 1 at , : line 1
Error: Unexpected error when running action (The term 'TrackException' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.)
Error: Process completed with exit code 1.

@freddydk
Copy link
Collaborator Author

On 1 - could you share your Settings file containing the DeployTo Setting?
On 2 - how did you get into a situation, where your yaml files pointed to workflowinitialize@main?

@freddydk
Copy link
Collaborator Author

Thinking about this - it looks like you are editing the .yaml files.
If that is true, you should never do that.

Run Update AL-Go System Files workflow with https://github.com/microsoft/AL-Go-PTE@preview (or AL-Go-AppSource@preview) - then you should not see the issues above

@CPretorius1986
Copy link

Thinking about this - it looks like you are editing the .yaml files. If that is true, you should never do that.

Run Update AL-Go System Files workflow with https://github.com/microsoft/AL-Go-PTE@preview (or AL-Go-AppSource@preview) - then you should not see the issues above

Thanks Freddydk, appreciate the feedback...I read the information/manuals once more today and figured this is/was me being an idiot.

Thanks for the pointer, I will try and revert.

@freddydk freddydk added Shipped Feature is included in the latest version and removed In Preview Currently available in AL-Go for GitHub preview labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Shipped Feature is included in the latest version
Projects
Status: v2.3
Development

No branches or pull requests

2 participants