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
* Document APPROVER_GITHUB_APP_ID and APPROVER_GITHUB_APP_PRIVATE_KEY_PATH env vars (#189)
* Add a Target Description configuration keys to provide control over promotion PR titles (#191)
* Add tests for the new **optional** configuration key
* Provide example for PR title in doc
* Allow skipping upstream TLS server certificate validation for the webhook proxy functionality (#190)
---------
Co-authored-by: Hannes Gustafsson <hnnsgstfssn@gmail.com>
Copy file name to clipboardExpand all lines: docs/installation.md
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,10 @@ Environment variables for the webhook process:
75
75
76
76
`APPROVER_GITHUB_OAUTH_TOKEN`GitHub OAuth token for automatically approving promotion PRs
77
77
78
+
`APPROVER_GITHUB_APP_ID`is an alternative to `APPROVER_GITHUB_OAUTH_TOKEN`. You can also use GitHub App style of authentication for the automated PR approval process. This variable supplies the Application ID.
79
+
80
+
`APPROVER_GITHUB_APP_PRIVATE_KEY_PATH`is an alternative to `APPROVER_GITHUB_OAUTH_TOKEN`. You can also use GitHub App style of authentication for the automated PR approval process. This variable supplies the path to the Github Application private key file (in `.pem` format).
81
+
78
82
`GITHUB_OAUTH_TOKEN`GitHub main OAuth token for all other GH operations
79
83
80
84
`GITHUB_HOST`Host name for github API, needed for Github Enterprise Server, should not include http scheme and path, e.g. :`my-gh-host.com`
@@ -114,9 +118,11 @@ Configuration keys:
114
118
|`promotionPaths[0].conditions.autoMerge`| Boolean value. If set to true, PR will be automatically merged after it is created.|
115
119
|`promotionPaths[0].promotionPrs`| Array of structures, each element represent a PR that will be opened when files are changed under `sourcePath`. Multiple elements means multiple PR will be opened|
116
120
|`promotionPaths[0].promotionPrs[0].targetPaths`| Array of strings, each element represent a directory to by synced from the changed component under `sourcePath`. Multiple elements means multiple directories will be synced in a PR|
121
+
|`promotionPaths[0].promotionPrs[0].targetDescription`| An optional string that describes the target paths, will be used in the promotion PR titles, for example "All Staging Clusters" or "Production Tier 2 Clusters". If this value is not provided Telefonistka will concatenate all `targetPaths` in the PR title which can make it very long and unreadable. Regardless of this configuration key, the PR titles will always start with the component name, e.g. `🚀 Promotion: nginx ➡️ Production Tier 2 Clusters` |
117
122
|`dryRunMode`| if true, the bot will just comment the planned promotion on the merged PR|
118
123
|`autoApprovePromotionPrs`| if true the bot will auto-approve all promotion PRs, with the assumption the original PR was peer reviewed and is promoted verbatim. Required additional GH token via APPROVER_GITHUB_OAUTH_TOKEN env variable|
119
124
|`toggleCommitStatus`| Map of strings, allow (non-repo-admin) users to change the [Github commit status](https://docs.github.com/en/rest/commits/statuses) state(from failure to success and back). This can be used to continue promotion of a change that doesn't pass repo checks. the keys are strings commented in the PRs, values are [Github commit status context](https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status) to be overridden|
125
+
|`whProxtSkipTLSVerifyUpstream`| This disables upstream TLS server certificate validation for the webhook proxy functionality. Default is `false`. |
120
126
|`commentArgocdDiffonPR`| Uses ArgoCD API to calculate expected changes to k8s state and comment the resulting "diff" as comment in the PR. Requires ARGOCD_* environment variables, see below. |
121
127
|`autoMergeNoDiffPRs`| if true, Telefonistka will **merge** promotion PRs that are not expected to change the target clusters. Requires `commentArgocdDiffonPR` and possibly `autoApprovePromotionPrs`(depending on repo branch protection rules)|
122
128
|`useSHALabelForArgoDicovery`| The default method for discovering relevant ArgoCD applications (for a PR) relies on fetching all applications in the repo and checking the `argocd.argoproj.io/manifest-generate-paths` **annotation**, this might cause a performance issue on a repo with a large number of ArgoCD applications. The alternative is to add SHA1 of the application path as a **label** and rely on ArgoCD server-side filtering, label name is `telefonistka.io/component-path-sha1`.|
@@ -130,7 +136,8 @@ promotionPaths:
130
136
conditions:
131
137
autoMerge: true
132
138
promotionPrs:
133
-
- targetPaths:
139
+
- targetDescription: "All non-production clusters"
140
+
targetPaths:
134
141
- "clusters/dev/us-east4/c2"
135
142
- "clusters/lab/europe-west4/c1"
136
143
- "clusters/staging/us-central1/c1"
@@ -141,9 +148,11 @@ promotionPaths:
141
148
prHasLabels:
142
149
- "quick_promotion" # This flow will run only if PR has "quick_promotion" label, see targetPaths below
143
150
promotionPrs:
144
-
- targetPaths:
151
+
- targetDescription: "Production clusters tier 1"
152
+
targetPaths:
145
153
- "clusters/prod/us-west1/c2" # First PR for only a single cluster
146
-
- targetPaths:
154
+
- targetDescription: "Production clusters tier 2"
155
+
targetPaths:
147
156
- "clusters/prod/europe-west3/c2" # 2nd PR will sync all 4 remaining clusters
ghPrClientDetails.PrLogger.Errorf("could not get file list from GH API: err=%s\nstatus code=%v", err, resp.Response.Status)
126
+
124
127
returnnil, err
125
128
}
126
129
prFiles=append(prFiles, perPagePrFiles...)
@@ -208,9 +211,13 @@ func generatePlanBasedOnChangeddComponent(ghPrClientDetails GhPrClientDetails, c
208
211
mapKey:=configPromotionPath.SourcePath+">"+strings.Join(ppr.TargetPaths, "|") // This key is used to aggregate the PR based on source and target combination
0 commit comments