Repository navigation
fix: wait for branch checks before merging preview PRs - #10
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 38 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Dry Run: Release (Promotion)Workflow validation completed successfully. Settings
Completed
Skipped (dry run)
Environment Diffdiff --git a/.gitops/deploy/helm/templates/workflows-gitops.yaml b/.gitops/deploy/helm/templates/workflows-gitops.yaml
index 033c6b9..329a8bc 100644
--- a/.gitops/deploy/helm/templates/workflows-gitops.yaml
+++ b/.gitops/deploy/helm/templates/workflows-gitops.yaml
@@ -12,7 +12,7 @@ spec:
source:
path: .gitops/deploy/helm
repoURL: https://github.com/hops-ops/workflows-gitops.git
- targetRevision: v2.1.1
+ targetRevision: refs/pull/10/merge
helm:
version: v3
values: |
@@ -20,7 +20,7 @@ spec:
test: true
type: release
method: promotion
- event: v-tag
+ event: pr
destination:
namespace: test-project
server: https://kubernetes.default.svcGenerated Output File---
# Source: promotion/templates/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: test-project-workflows-gitops
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: test-project
source:
path: .gitops/deploy/helm
repoURL: https://github.com/hops-ops/workflows-gitops.git
targetRevision: refs/pull/10/merge
helm:
version: v3
values: |
env:
test: true
type: release
method: promotion
event: pr
destination:
namespace: test-project
server: https://kubernetes.default.svc
syncPolicy:
automated:
selfHeal: true
prune: true
|
|
Your preview environment has been published! 🚀 |
Dry Run: Release (Promotion)Workflow validation completed successfully. Settings
Completed
Skipped (dry run)
Environment Diffdiff --git a/.gitops/deploy/helm/templates/workflows-gitops.yaml b/.gitops/deploy/helm/templates/workflows-gitops.yaml
index 033c6b9..329a8bc 100644
--- a/.gitops/deploy/helm/templates/workflows-gitops.yaml
+++ b/.gitops/deploy/helm/templates/workflows-gitops.yaml
@@ -12,7 +12,7 @@ spec:
source:
path: .gitops/deploy/helm
repoURL: https://github.com/hops-ops/workflows-gitops.git
- targetRevision: v2.1.1
+ targetRevision: refs/pull/10/merge
helm:
version: v3
values: |
@@ -20,7 +20,7 @@ spec:
test: true
type: release
method: promotion
- event: v-tag
+ event: pr
destination:
namespace: test-project
server: https://kubernetes.default.svcGenerated Output File---
# Source: promotion/templates/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: test-project-workflows-gitops
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: test-project
source:
path: .gitops/deploy/helm
repoURL: https://github.com/hops-ops/workflows-gitops.git
targetRevision: refs/pull/10/merge
helm:
version: v3
values: |
env:
test: true
type: release
method: promotion
event: pr
destination:
namespace: test-project
server: https://kubernetes.default.svc
syncPolicy:
automated:
selfHeal: true
prune: true
|
Dry Run: Preview (Promotion PR)Workflow validation completed successfully. Settings
Completed
Skipped (dry run)
Environment Diffdiff --git a/.gitops/deploy/helm/templates/workflows-gitops-pr-10.yaml b/.gitops/deploy/helm/templates/workflows-gitops-pr-10.yaml
index 6c7719d..7e2cf1b 100644
--- a/.gitops/deploy/helm/templates/workflows-gitops-pr-10.yaml
+++ b/.gitops/deploy/helm/templates/workflows-gitops-pr-10.yaml
@@ -19,10 +19,10 @@ spec:
env:
test: true
type: preview
- method: promotion
+ method: promotion-pr
event: pr
image:
- tag: pr-10-72a33a1ef95918d684cc3b80fcee29a312484889
+ tag: pr-10-181de78cd0ccbdd6df02a178b3a427257d5cc633
destination:
namespace: workflows-gitops-pr-10
server: https://kubernetes.default.svcGenerated Output File---
# Source: promotion/templates/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: test-project-workflows-gitops-pr-10
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: test-project
source:
path: .gitops/deploy/helm
repoURL: https://github.com/hops-ops/workflows-gitops.git
targetRevision: fix-preview-promotion-title
helm:
version: v3
values: |
env:
test: true
type: preview
method: promotion-pr
event: pr
image:
tag: pr-10-181de78cd0ccbdd6df02a178b3a427257d5cc633
destination:
namespace: workflows-gitops-pr-10
server: https://kubernetes.default.svc
syncPolicy:
automated:
selfHeal: true
prune: true
---
# Source: promotion/templates/preview-resources.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: something
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "-1"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: test-project
source:
path: .gitops/deploy/helm
repoURL: https://github.com/unbounded-tech/something.git
targetRevision: main
helm:
version: v3
destination:
namespace: workflows-gitops-pr-10
server: https://kubernetes.default.svc
syncPolicy:
automated:
selfHeal: true
prune: true
|
Dry Run: Release (Promotion PR)Workflow validation completed successfully. Settings
Completed
Skipped (dry run)
Environment Diffdiff --git a/.gitops/deploy/helm/templates/workflows-gitops.yaml b/.gitops/deploy/helm/templates/workflows-gitops.yaml
index 033c6b9..374026a 100644
--- a/.gitops/deploy/helm/templates/workflows-gitops.yaml
+++ b/.gitops/deploy/helm/templates/workflows-gitops.yaml
@@ -12,15 +12,15 @@ spec:
source:
path: .gitops/deploy/helm
repoURL: https://github.com/hops-ops/workflows-gitops.git
- targetRevision: v2.1.1
+ targetRevision: refs/pull/10/merge
helm:
version: v3
values: |
env:
test: true
type: release
- method: promotion
- event: v-tag
+ method: promotion-pr-merge
+ event: pr
destination:
namespace: test-project
server: https://kubernetes.default.svcGenerated Output File---
# Source: promotion/templates/application.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: test-project-workflows-gitops
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: test-project
source:
path: .gitops/deploy/helm
repoURL: https://github.com/hops-ops/workflows-gitops.git
targetRevision: refs/pull/10/merge
helm:
version: v3
values: |
env:
test: true
type: release
method: promotion-pr-merge
event: pr
destination:
namespace: test-project
server: https://kubernetes.default.svc
syncPolicy:
automated:
selfHeal: true
prune: true
|
Preview promotion and cleanup open GitOps PRs and try to squash-merge them immediately. When the environment repository requires CI, GitHub can refuse that first attempt while checks are still starting. A promotion rerun also skips an open PR when rendering produces the same manifest.
Both preview workflows now retry GitHub's branch-policy refusal for up to five minutes, using the exact environment commit as a merge precondition. They stop if the PR closes, its head changes, or GitHub returns another error. A promotion rerun looks for an existing open PR even when there is no new commit. The jobs use the repository's normal merge rules and existing token permissions.
Use semantic titles with the source repository and PR number for newly opened preview and cleanup PRs. The existing GitOps commit subjects and source PR URL are preserved, including the GitHub backlink from the deployment commit.
Local validation covered immediate success, both observed branch-policy errors, concurrent merge, changed head, closed PR and authorization failure with a stubbed GitHub CLI. The four existing values-merge fixtures and ShellCheck passed. Actionlint passed with the existing shell findings and its unsupported
job.workflow_shacontext excluded.