forked from wayfair-incubator/telefonistka
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use "concise" diff comment in cases "regular" diff comment is > 65536 (…
…#20)
- Loading branch information
Showing
2 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{{define "argoCdDiffConcise"}} | ||
Diff of ArgoCD applications(⚠️ concise view, full diff didn't fit GH comment): | ||
{{ range $appDiffResult := .DiffOfChangedComponents }} | ||
|
||
|
||
{{if $appDiffResult.DiffError }} | ||
⚠️ ⚠️ **Error getting diff from ArgoCD** (`{{ $appDiffResult.ComponentPath }}`) ⚠️ ⚠️ | ||
``` | ||
{{ $appDiffResult.DiffError }} | ||
|
||
``` | ||
|
||
{{- else }} | ||
<img src="https://argo-cd.readthedocs.io/en/stable/assets/favicon.png" width="20"/> **[{{ $appDiffResult.ArgoCdAppName }}]({{ $appDiffResult.ArgoCdAppURL }})** @ `{{ $appDiffResult.ComponentPath }}` | ||
{{if $appDiffResult.HasDiff }} | ||
|
||
<details><summary>ArgoCD list of changed objects(Click to expand):</summary> | ||
|
||
{{ range $objectDiff := $appDiffResult.DiffElements }} | ||
{{- if $objectDiff.Diff}} | ||
`{{ $objectDiff.ObjectNamespace }}/{{ $objectDiff.ObjectKind}}/{{ $objectDiff.ObjectName }}` | ||
{{- end}} | ||
{{- end }} | ||
|
||
</details> | ||
{{- else }} | ||
No diff 🤷 | ||
{{- end}} | ||
{{if $appDiffResult.AppWasTemporarilyCreated }} | ||
⚠️ ⚠️ ⚠️ | ||
This PR appears to create this new application, Telefonistka has **temporarly** created an ArgoCD app object for it just to render its manifests. | ||
It will not be present in ArgoCD UI for more than a few seconds and it can not be synced from the PR branch | ||
⚠️ ⚠️ ⚠️ | ||
{{- end}} | ||
|
||
{{- end }} | ||
|
||
{{- end }} | ||
|
||
{{- if .HasSyncableComponens }} | ||
|
||
- [ ] <!-- telefonistka-argocd-branch-sync --> Set ArgoCD apps Target Revision to `{{ .BranchName }}` | ||
|
||
{{ end}} | ||
|
||
|
||
{{- end }} |