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

Publish To Environment breaks CI/CD pipelines #798

Open
gntpet opened this issue Oct 31, 2023 · 4 comments
Open

Publish To Environment breaks CI/CD pipelines #798

gntpet opened this issue Oct 31, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@gntpet
Copy link

gntpet commented Oct 31, 2023

Hey @freddydk,

I have just tried to use "Publish To Environment" to push changes to our 'PROD' environment.

image

Since that environment is not defined in the environment list & I have no environment secret defined, it takes me through "device login" path. Very smooth and handy
image

Then, it deploys artifacts to the environment. All good here.

But, when my CICD process runs, it suddenly picks this PROD environment and tries to deploy to it. I never asked for it, and I have no setup for it in my AL go settings.

image

My Al-go-settings file looks like this:

{
  "type": "PTE",
  "templateUrl": "https://github.com/microsoft/AL-Go-PTE@preview",
  "treatTestFailuresAsWarnings": true,
  "doNotRunBcptTests": true,
  "enableCodeCop": true,
  "rulesetFile": "../al.ruleset.json",
  "companyName": "TNM Automated Test",
  "runs-on": "srs-eid",   
  "githubRunner": "srs-eid",
  "environments": [
    "SRSQA"
  ],
  "DeployToSRSQA": {
    "EnvironmentType": "SaaS",
    "EnvironmentName": "SRSQA",
    "Projects": "SRS.nl",
    "Branches": [
      "main"
    ],
    "SyncMode": "ForceSync",
    "ContinuousDeployment": true,
    "runs-on": "srs-eid"
  },
  "EnableTaskScheduler": true
}

Best Regards,
Gintautas

@mazhelez
Copy link
Collaborator

mazhelez commented Nov 2, 2023

Hey @gntpet

Using excludeEnvironments setting (see doc in AL-Go settings) will hopefully solve your issue.

@freddydk
Copy link
Contributor

freddydk commented Nov 2, 2023

The reason for this is that GitHub creates the environment under environments when you run Publish to environment to that.
excludeEnvironments as Maria says or using the DeployToSRSPROD, setting "ContinuousDeployment": false should solve this.

@freddydk
Copy link
Contributor

freddydk commented Nov 2, 2023

It is counterintutive though that an environment used to publish once gets picked up for continuous deployment automatically - will investigate what we can do about that.

@freddydk freddydk added the bug Something isn't working label Nov 2, 2023
@freddydk
Copy link
Contributor

freddydk commented Dec 8, 2023

I think this should be fixed by only allowing continuous deployment to environments, where a authcontext secret exists in either GitHub or the KeyVault. If no authcontext secret exists, the deployment will fail anyway and we shouldn't try in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants