You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When applying the same pipeline definition (or with unrelated change), the order of the "triggers" within the pipeline swaps "at random", implying some kind of unstable sort. For example, we have two triggers "nonprod" and "infradev" and the tf-plan shows these being swapped:
resource"codefresh_pipeline""config" {
name="${codefresh_project.cloudsnooze.name}/config"tags=["config"]
is_public=truespec {
concurrency=1runtime_environment {
name=local.runtime_nonprodmemory="4000Mi"
}
contexts=[local.secrets_context]
# The spec_template block refers to the pipeline workflow YAML usedspec_template {
repo="${local.ghe_org}/${local.ghe_repo_config}"path="./codefresh.yml"revision="develop"# branchcontext=local.ghe_codefresh_integration_context
}
# Trigger the pipeline when commits to /$envname are made.# The pipeline itseld will only notify+deploy when branch=develop# We create one trigger per environment and set variables based on this.trigger {
type="git"provider="github"context=local.ghe_codefresh_integration_contextrepo="${local.ghe_org}/${local.ghe_repo_config}"# branch_regex = "/^((develop)$).*/gi"# branch_regex_input = "multiselect"events=[
"push.heads"
]
modified_files_glob="infradev/accounts/**"name="infradev_config_change"disabled=falsevariables={
ENV_NAME ="infradev"
}
runtime_environment {
name=local.runtime_infradevmemory="2000Mi"
}
}
trigger {
type="git"provider="github"context=local.ghe_codefresh_integration_contextrepo="${local.ghe_org}/${local.ghe_repo_config}"# branch_regex = "/^((develop)$).*/gi"# branch_regex_input = "multiselect"events=[
"push.heads"
]
modified_files_glob="nonprod/accounts/**"name="nonprod_config_change"disabled=falsevariables={
ENV_NAME ="nonprod"
}
runtime_environment {
name=local.runtime_nonprodmemory="2000Mi"
}
}
# Pipeline variables to include that can be referenced in the pipeline workflow YAMLvariables={
NOTIFICATION_EMAIL ="[email protected]"
}
}
}
The text was updated successfully, but these errors were encountered:
The schema for Pipeline uses schema.TypeList for the triggers (which should be order-preserving), and all triggers in the tfstate file appear to all match the order in the tf file.... digging
From what I can tell, everything is preserving the order of items. But if I store the plan in a file, it's definitely in the wrong/new order (although .spec[0].trigger is a list).
terraform plan -refresh -out=tfplan
terraform show -json tfplan
OK, I give up - will defer to someone who actually knows this stuff.
@lyricnz thanks for opening the issue.
The only way I was able to reproduce the issue is by changing the order or triggers. When I change the order of triggers after the have been applied already, diff shows. Applying again finishes successfully - but doesn't really change anything on API side, then the next plan will also show diff until I changed the order back. So for now to avoid it you can just change the trigger order in your tf file. I will investigate why changing the order works in TF but doesn't do anything on API.
What happened?
When applying the same pipeline definition (or with unrelated change), the order of the "triggers" within the pipeline swaps "at random", implying some kind of unstable sort. For example, we have two triggers "nonprod" and "infradev" and the tf-plan shows these being swapped:
Version
codefresh-io/codefresh v0.11.0
Relevant Terraform Configuration
The text was updated successfully, but these errors were encountered: