Skip to content

Commit

Permalink
Merge branch 'main' into chore-discord-to-slack
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc committed Jan 2, 2024
2 parents 9ed6c40 + f0208f8 commit 4377586
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 123 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
go-version-file: "go.mod"
cache: true
cache-dependency-path: go.mod
- uses: actions/download-artifact@v3
Expand All @@ -79,7 +79,7 @@ jobs:
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser-pro
version: v1.23.0
version: v1.22.1
args: release --clean --skip=announce -f .goreleaser.demo.yaml
env:
VERSION: ${{ github.ref_name}}-demo
Expand All @@ -94,29 +94,29 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

- run: |-
gcloud --quiet auth configure-docker
- run: |-
gcloud --quiet auth configure-docker
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}

- name: Deploy
run: |
TAG=${{ github.ref_name}}-demo \
NAME=tracetest-demo \
CONFIG_FILE=./k8s/tracetest.demo.yaml \
EXPOSE_HOST=demo.tracetest.io \
CERT_NAME=tracetest-demo \
BACKEND_CONFIG=tracetest-demo \
./k8s/deploy.sh
- name: Deploy
run: |
TAG=${{ github.ref_name}}-demo \
NAME=tracetest-demo \
CONFIG_FILE=./k8s/tracetest.demo.yaml \
EXPOSE_HOST=demo.tracetest.io \
CERT_NAME=tracetest-demo \
BACKEND_CONFIG=tracetest-demo \
./k8s/deploy.sh
6 changes: 5 additions & 1 deletion .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
with:
distribution: goreleaser-pro
<<<<<<< HEAD
version: v1.23.0
=======
version: v1.22.1
>>>>>>> main
args: release --clean --split --nightly
env:
GOOS: ${{ matrix.GOOS }}
Expand Down Expand Up @@ -190,7 +194,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
with:
distribution: goreleaser-pro
version: v1.23.0
version: v1.22.1
args: continue --merge
env:
VERSION: sha-${{ env.sha_short }}
Expand Down
75 changes: 20 additions & 55 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- "docs/**"
pull_request:

env:
Expand Down Expand Up @@ -146,80 +146,45 @@ jobs:
with:
fetch-depth: 0

- name: set cache keys
shell: bash
run: |
echo "WEB_CACHE_KEY=$(git log --pretty=tformat:"%H" -n1 web)" >> $GITHUB_ENV
echo "SERVER_CACHE_KEY=$(git log --pretty=tformat:"%H" -n1 server)" >> $GITHUB_ENV
echo "CLI_CACHE_KEY=$(git log --pretty=tformat:"%H" -n1 cli)" >> $GITHUB_ENV
# web
- name: Cache Web Build
id: cache-web-build
uses: actions/cache@v3
with:
path: web/build/
key: web-build-${{ env.WEB_CACHE_KEY }}

- name: Setup node
# if cache miss
if: steps.cache-web-build.outputs.cache-hit != 'true'
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: web/package-lock.json

- name: Cache dependencies
id: cache-nodemodules
# if cache miss
if: steps.cache-web-build.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: |
web/node_modules
/home/runner/.cache/Cypress
key: npm--${{ hashFiles('web/package-lock.json') }}
restore-keys: npm-

- name: Install dependencies
run: cd web/; npm ci
# if cache miss for build and deps
if: steps.cache-web-build.outputs.cache-hit != 'true' && steps.cache-nodemodules.outputs.cache-hit != 'true'

- run: cd web; CI= npm run build
if: steps.cache-web-build.outputs.cache-hit != 'true'
- name: Build UI
run: cd web; CI= npm run build

# go+docker
- name: Cache Build
id: cache-docker-build
uses: actions/cache@v3
with:
path: dist/
key: dist-${{env.SERVER_CACHE_KEY }}-${{env.CLI_CACHE_KEY }}-${{ hashFiles('.goreleaser.dev.yaml', 'Dockerfile') }}
- name: Setup go
if: steps.cache-docker-build.outputs.cache-hit != 'true'
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
cache: true
cache-dependency-path: "go.mod"
- uses: goreleaser/goreleaser-action@v4
if: steps.cache-docker-build.outputs.cache-hit != 'true'

- name: Release Go binaries
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser-pro
version: v1.23.0
version: v1.22.1
args: release --skip=announce --snapshot -f .goreleaser.dev.yaml

- name: Move binaries to known location
if: steps.cache-docker-build.outputs.cache-hit != 'true'
run: |
find ./dist -name 'tracetest' -exec cp {} ./dist \;
find ./dist -name 'tracetest-server' -exec cp {} ./dist \;
chmod +x ./dist/tracetest ./dist/tracetest-server
- name: Export docker image
if: steps.cache-docker-build.outputs.cache-hit != 'true'
run: |
docker save --output dist/image.tar "kubeshop/tracetest:$TAG"
- name: Upload assets
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -369,7 +334,7 @@ jobs:
fail-fast: false
matrix:
total_splits: [8]
index: [0,1,2,3,4,5,6,7]
index: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -438,15 +403,15 @@ jobs:
outputs:
CYPRESS_CONTAINERS: ${{ steps.configure-cypress-containers.outputs.CYPRESS_CONTAINERS }}
steps:
- name: Configure Cypress containers
id: configure-cypress-containers
run: |
# env.CYPRESS_RECORD_KEY is required for parallelization, so if it's empty run a single container
if [ "${{env.CYPRESS_RECORD_KEY}}" = "" ]; then
echo "CYPRESS_CONTAINERS=[1]" >> $GITHUB_OUTPUT
else
echo "CYPRESS_CONTAINERS=[1,2,3,4,5,6,7,8]" >> $GITHUB_OUTPUT
fi
- name: Configure Cypress containers
id: configure-cypress-containers
run: |
# env.CYPRESS_RECORD_KEY is required for parallelization, so if it's empty run a single container
if [ "${{env.CYPRESS_RECORD_KEY}}" = "" ]; then
echo "CYPRESS_CONTAINERS=[1]" >> $GITHUB_OUTPUT
else
echo "CYPRESS_CONTAINERS=[1,2,3,4,5,6,7,8]" >> $GITHUB_OUTPUT
fi
e2e:
needs: [build-docker, config-e2e]
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
with:
distribution: goreleaser-pro
version: v1.23.0
version: v1.22.1
args: release --clean -f .goreleaser.rc.yaml
env:
VERSION: ${{ github.ref_name}}
Expand All @@ -102,4 +102,3 @@ jobs:
TRACETEST_VERSION=${{ env.VERSION }}
env:
VERSION: ${{ github.ref_name }}

33 changes: 16 additions & 17 deletions .github/workflows/release-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
with:
distribution: goreleaser-pro
version: v1.23.0
version: v1.22.1
args: release --clean
env:
VERSION: ${{ github.ref_name}}
Expand All @@ -103,10 +103,10 @@ jobs:
TRACETEST_DEFAULT_CLOUD_ENDPOINT: ${{ secrets.TRACETEST_DEFAULT_CLOUD_ENDPOINT }}

helm_chart_version_bump:
name: "Trigger Helm chart appVersion update"
needs: "release"
runs-on: ubuntu-latest
steps:
name: "Trigger Helm chart appVersion update"
needs: "release"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -156,23 +156,22 @@ jobs:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_FOOTER: "Kubeshop --> Tracetest"


notify_slack_if_helm_chart_bump_fails:
runs-on: ubuntu-latest
needs: helm_chart_version_bump
if: always() && (needs.helm_chart_version_bump.result == 'failure')
steps:
- name: Slack Notification if Helm Release action failed
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: tracetest
SLACK_COLOR: ${{ needs.helm_chart_version_bump.result }}
SLACK_ICON: https://github.githubassets.com/images/modules/site/features/actions-icon-actions.svg
SLACK_TITLE: Helm Chart version bump action failed :boom:!
SLACK_USERNAME: GitHub
SLACK_LINK_NAMES: true
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_FOOTER: "Kubeshop --> Tracetest"
- name: Slack Notification if Helm Release action failed
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: tracetest
SLACK_COLOR: ${{ needs.helm_chart_version_bump.result }}
SLACK_ICON: https://github.githubassets.com/images/modules/site/features/actions-icon-actions.svg
SLACK_TITLE: Helm Chart version bump action failed :boom:!
SLACK_USERNAME: GitHub
SLACK_LINK_NAMES: true
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_FOOTER: "Kubeshop --> Tracetest"

chocolatey-release:
needs: release
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION?=dev
TAG?=$(VERSION)
GORELEASER_VERSION=1.23.0-pro
GORELEASER_VERSION=1.22.1-pro

PROJECT_ROOT=${PWD}

Expand Down
4 changes: 0 additions & 4 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ stop() {
}

cypress-ci() {

echo "Running cypress"


export CYPRESS_BASE_URL=http://localhost:11633
export POKEMON_HTTP_ENDPOINT=http://demo-api:8081

Expand All @@ -65,10 +63,8 @@ cypress-ci() {
}

cypress() {

echo "Running cypress"


export CYPRESS_BASE_URL=http://localhost:11633
export POKEMON_HTTP_ENDPOINT=http://demo-api:8081

Expand Down
8 changes: 8 additions & 0 deletions server/migrations/37_test_run_events_tenant.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BEGIN;

ALTER TABLE
test_run_events
DROP
COLUMN tenant_id;

COMMIT;
11 changes: 11 additions & 0 deletions server/migrations/37_test_run_events_tenant.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
BEGIN;

ALTER TABLE
test_run_events
ADD
COLUMN tenant_id varchar
;

CREATE INDEX idx_test_run_events_tenant_id ON test_run_events(tenant_id);

COMMIT;
2 changes: 1 addition & 1 deletion server/test/test_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const (
) as ltr ON ltr.test_id = t.id AND ltr.tenant_id = t.tenant_id
LEFT OUTER JOIN
test_runs last_test_run
ON last_test_run.test_id = ltr.test_id AND last_test_run.id = ltr.id
ON last_test_run.test_id = ltr.test_id AND last_test_run.id = ltr.id AND last_test_run.tenant_id = ltr.tenant_id
`

testMaxVersionQuery = `
Expand Down
Loading

0 comments on commit 4377586

Please sign in to comment.