microsoft / AL-Go

The plug-and-play DevOps solution for Business Central app development on GitHub
MIT License
255 stars 115 forks source link

How do you enabled breaking change check in AL-GO #956

Open gntpet opened 4 months ago

gntpet commented 4 months ago

Hey @freddydk,

Do you have some docs about 'braking change' detection. I see that our pipeline downloads previous release app. But, I don't see any error or warning regarding breaking changes. Is it mandatory to use container for breaking change detection?

Our configuration is like this:

{
  "type": "PTE",
  "templateUrl": "https://github.com/microsoft/AL-Go-PTE@main",
  "treatTestFailuresAsWarnings": true,
  "doNotRunBcptTests": true,
  "enableCodeCop": true,
  "rulesetFile": "../al.ruleset.json",
  "companyName": "TNM Automated Test",
  "runs-on": "srs-eid",
  "githubRunner": "srs-eid",
  "environments": [
    "QA"
  ],
  "CICDPushBranches": [
    "main",
    "release/*"
  ],
  "CICDPullRequestBranches": [
    "main",
    "release/*",
    "features/*",
    "bug/*"
  ],
  "DeployToQA": {
    "EnvironmentType": "SaaS",
    "EnvironmentName": "QA",
    "Projects": "SRS.nl,SRS.base",
    "Branches": [
      "main"
    ],
    "ContinuousDeployment": true,
    "runs-on": "srs-eid"
  },
  "DeployToUAT": {
    "EnvironmentType": "SaaS",
    "EnvironmentName": "UAT",
    "Projects": "SRS.nl,SRS.base",
    "Branches": [
      "release/*"
    ],
    "ContinuousDeployment": false,
    "runs-on": "srs-eid"
  },
  "DeployToPROD": {
    "EnvironmentType": "SaaS",
    "EnvironmentName": "PROD",
    "Projects": "SRS.nl,SRS.base",
    "Branches": [
      "release/*"
    ],
    "ContinuousDeployment": false,
    "runs-on": "srs-eid"
  },
  "EnableTaskScheduler": true,
  "doNotRunTests": true,
  "useCompilerFolder": true,
  "doNotPublishApps": true,
  "alwaysBuildAllProjects": true,
  "PullRequestTrigger": "pull_request",
  "templateSha": "1e6ebb58fc629cc134759f996f9be9ab6ada7fb4"
}

Best Regards, Gintautas

mazhelez commented 4 months ago

Hi @gntpet and thank you for your question.

Currently, AL-Go and BCContainerHelper do not support running breaking changes validation. It could be an enhancement we can consider for future versions.

You can check how we did it in BCApps, using a PreCompileApp.ps1 override. Key function is Enable-BreakingChangesCheck that creates the AppSourceCop.json, that is needed to trigger the breaking changes checks when compiling the app. See more info about it here.

Let me know if you have more questions.

freddydk commented 4 months ago

Note that the AppSourceCop.json is automatically created if the repo is an AppSource app, with breaking change validation.

bcapps-co commented 2 months ago

I have an app that is still in the pre-release stages and as a result I want breaking changes to be allowed. Al-go is failing to build due to breaking changes. How can I ignore this to get the build to run?

bcapps-co commented 2 months ago

I have an app that is still in the pre-release stages and as a result I want breaking changes to be allowed. Al-go is failing to build due to breaking changes. How can I ignore this to get the build to run?

OK, I've figured this out. I added "skipUpgrade" : true to .AL-Go/settings.json and it worked. Yay!