Skip to content

Commit eb466d9

Browse files
authored
fix(ci): use commit SHA instead of PR number preview-env images (#1501)
## Summary Updates preview environment manifests to use the exact commit sha when referencing artifacts to deploy (docker images). Also adds links in the GUI back to the PR and commit. ## Background This is to ensure that any subsequent updates to a PR will always result in the preview env looking for the rebuilt image (tagged with full commit hash) rather than assuming a cached one might be valid (e.g. tagged with PR number).This change is in addition to setting the imagePullPolicy to Always to make the configuration explicit. ## Changes - Update github action to tag docker images with the full commit hash ## Testing - Manually tested by applying the preview environment manifests on dev cluster and creating a new PR to verify images were tagged correctly and that ArgoCD pulled the correct image.
1 parent f7ef132 commit eb466d9

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

.github/workflows/reusable-docker-build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
type=ref,event=pr
6969
type=match,pattern=refs/tags/${{ inputs.binary-name }}-v(.*),group=1,enable=${{ startsWith(env.FULL_REF, 'refs/tags/') }},value=${{ env.FULL_REF }}
7070
type=sha
71+
# set the actual commit SHA from the PR head instead of from the PR merge commit (alternatively, we could checkout the PR head in actions/checkout)
72+
type=raw,value=sha-${{ github.event.pull_request.head.sha || github.sha }},enable=${{ startsWith(env.FULL_REF, 'refs/pull/') }}
7173
# set latest tag for `main` branch
7274
type=raw,value=latest,enable=${{ env.FULL_REF == format('refs/heads/{0}', 'main') }}
7375
- name: Build and push

dev/argocd/pr-preview-envs/evm-appset.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ spec:
4242
namespace: pr-{{.number}}
4343
server: https://kubernetes.default.svc
4444
project: default
45+
info:
46+
- name: 'Github Project:'
47+
value: >-
48+
https://github.com/astriaorg/astria
49+
- name: 'Github Pull Request:'
50+
value: >-
51+
https://github.com/astriaorg/astria/pull/{{.number}}
52+
- name: 'Github Commit:'
53+
value: >-
54+
https://github.com/astriaorg/astria/pull/{{.number}}/commits/{{.head_sha}}
4555
sources:
4656
- repoURL: https://github.com/astriaorg/astria.git
4757
targetRevision: pull/{{.number}}/head
@@ -108,10 +118,10 @@ spec:
108118
token: http://celestia-service.pr-{{.number}}.svc.cluster.local:5353
109119
images:
110120
composer:
111-
devTag: pr-{{.number}}
121+
devTag: sha-{{.head_sha}}
112122
pullPolicy: Always
113123
conductor:
114-
devTag: pr-{{.number}}
124+
devTag: sha-{{.head_sha}}
115125
pullPolicy: Always
116126
ingress:
117127
enabled: true

dev/argocd/pr-preview-envs/sequencer-appset.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ spec:
5151
namespace: pr-{{.number}}
5252
server: https://kubernetes.default.svc
5353
project: default
54+
info:
55+
- name: 'Github Project:'
56+
value: >-
57+
https://github.com/astriaorg/astria
58+
- name: 'Github Pull Request:'
59+
value: >-
60+
https://github.com/astriaorg/astria/pull/{{.number}}
61+
- name: 'Github Commit:'
62+
value: >-
63+
https://github.com/astriaorg/astria/pull/{{.number}}/commits/{{.head_sha}}
5464
sources:
5565
- repoURL: https://github.com/astriaorg/astria.git
5666
targetRevision: pull/{{.number}}/head
@@ -84,7 +94,7 @@ spec:
8494

8595
images:
8696
sequencer:
87-
devTag: pr-{{.number}}
97+
devTag: sha-{{.head_sha}}
8898
pullPolicy: Always
8999
ingress:
90100
grpc:

0 commit comments

Comments
 (0)