Skip to content

Commit

Permalink
Redirect builds/ releases for migrated repository (#65)
Browse files Browse the repository at this point in the history
* Add migration notice to migrated builds, releases and
redirect to migrated page
  • Loading branch information
yogeshlonkar authored Mar 28, 2023
1 parent c8b1a8a commit d0b6775
Show file tree
Hide file tree
Showing 87 changed files with 10,792 additions and 844 deletions.
10 changes: 6 additions & 4 deletions .estafette.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ labels:
version:
semver:
major: 1
minor: 0
minor: 4
patch: 0

stages:
audit-and-restore:
Expand Down Expand Up @@ -87,11 +88,12 @@ stages:
- estafette

tag-revision:
image: golang:1.17-alpine
image: bitnami/git
commands:
- apk add git
- git tag ${ESTAFETTE_BUILD_VERSION}
- git push origin ${ESTAFETTE_BUILD_VERSION}
when: status == 'succeeded' &&
branch == 'main'

slack-notify:
image: extensions/slack-build-status:dev
Expand All @@ -100,4 +102,4 @@ stages:
- '#build-status'
when:
status == 'succeeded' ||
status == 'failed'
status == 'failed'
19 changes: 19 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CVE-2022-3970
CVE-2022-3570
CVE-2022-3597
CVE-2022-3598
CVE-2022-3599
CVE-2022-3626
CVE-2022-3627
CVE-2022-4645
CVE-2022-48281
CVE-2023-0795
CVE-2023-0796
CVE-2023-0797
CVE-2023-0798
CVE-2023-0799
CVE-2023-0800
CVE-2023-0801
CVE-2023-0802
CVE-2023-0803
CVE-2023-0804
4 changes: 4 additions & 0 deletions mocks/api/migrations/GET.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { delay, type, file } = require('connect-api-mocker/helpers')
const path = require('path')

module.exports = [delay(500), type('application/json'), file(path.join(__dirname, './index.json'))]
4 changes: 4 additions & 0 deletions mocks/api/migrations/builds/123/GET.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { delay, type, file } = require('connect-api-mocker/helpers')
const path = require('path')

module.exports = [delay(500), type('application/json'), file(path.join(__dirname, './index.json'))]
231 changes: 231 additions & 0 deletions mocks/api/migrations/builds/123/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
{
"id": "9123",
"repoSource": "github.com",
"repoOwner": "estafette-2",
"repoName": "migration",
"repoBranch": "main",
"repoRevision": "52ff4a70d56a97fc89522e17e1b4f459586e9449",
"buildVersion": "1.0.0-main-1719",
"buildStatus": "succeeded",
"labels": [
{
"key": "app-group",
"value": "estafette-ci"
},
{
"key": "language",
"value": "golang"
},
{
"key": "team",
"value": "estafette"
},
{
"key": "type",
"value": "service"
}
],
"releaseTargets": [
{
"name": "tooling-estafette",
"actions": [
{
"name": "deploy-canary"
},
{
"name": "deploy-stable"
},
{
"name": "rollback-canary",
"hideBadge": true
},
{
"name": "restart-stable",
"hideBadge": true
}
],
"activeReleases": [
{
"name": "tooling-estafette",
"action": "deploy-stable",
"id": "664373458571591697",
"repoSource": "github.com",
"repoOwner": "estafette",
"repoName": "migration",
"releaseVersion": "1.0.0-main-1728",
"releaseStatus": "succeeded",
"triggerEvents": [
{
"fired": true,
"manual": {
"userID": "[email protected]"
}
}
],
"insertedAt": "2021-06-04T15:38:09.260982Z",
"startedAt": "2021-06-04T15:38:11.572968Z",
"updatedAt": "2021-06-04T15:39:25.13434Z",
"duration": 73000000000,
"pendingDuration": 2000000000,
"extraInfo": {
"medianPendingDuration": 2000000000,
"medianDuration": 77000000000
}
},
{
"name": "tooling-estafette",
"action": "deploy-canary",
"id": "664372945397841937",
"repoSource": "github.com",
"repoOwner": "estafette",
"repoName": "migration",
"releaseVersion": "1.0.0-main-1728",
"releaseStatus": "succeeded",
"triggerEvents": [
{
"fired": true,
"manual": {
"userID": "[email protected]"
}
}
],
"insertedAt": "2021-06-04T15:35:32.652756Z",
"startedAt": "2021-06-04T15:35:34.746145Z",
"updatedAt": "2021-06-04T15:36:09.231216Z",
"duration": 34000000000,
"pendingDuration": 2000000000,
"extraInfo": {
"medianPendingDuration": 2000000000,
"medianDuration": 20000000000
}
},
{
"name": "tooling-estafette",
"action": "restart-stable",
"id": "664308454879461393",
"repoSource": "github.com",
"repoOwner": "estafette",
"repoName": "migration",
"releaseVersion": "1.0.0-main-1722",
"releaseStatus": "succeeded",
"triggerEvents": [
{
"fired": true,
"manual": {
"userID": "[email protected]"
}
}
],
"insertedAt": "2021-06-04T10:07:31.708355Z",
"startedAt": "2021-06-04T10:07:33.422702Z",
"updatedAt": "2021-06-04T10:08:33.80782Z",
"duration": 60000000000,
"pendingDuration": 1000000000,
"extraInfo": {
"medianPendingDuration": 3000000000,
"medianDuration": 90000000000
}
},
{
"name": "tooling-estafette",
"action": "rollback-canary",
"id": "663722926313242642",
"repoSource": "github.com",
"repoOwner": "estafette",
"repoName": "migration",
"releaseVersion": "1.0.0-main-1710",
"releaseStatus": "succeeded",
"triggerEvents": [
{
"fired": true,
"manual": {
"userID": "[email protected]"
}
}
],
"insertedAt": "2021-06-02T08:29:22.570649Z",
"startedAt": "2021-06-02T08:29:24.685091Z",
"updatedAt": "2021-06-02T08:29:42.049986Z",
"duration": 17000000000,
"pendingDuration": 2000000000,
"extraInfo": {
"medianPendingDuration": 3000000000,
"medianDuration": 17000000000
}
}
]
},
{
"name": "release-helm-chart"
},
{
"name": "helm-diff",
"activeReleases": [
{
"name": "helm-diff",
"id": "503219038331437061",
"repoSource": "github.com",
"repoOwner": "estafette",
"repoName": "migration",
"releaseVersion": "1.0.0-add-official-helm-chart-892",
"releaseStatus": "succeeded",
"triggerEvents": [
{
"manual": {
"userID": "[email protected]"
}
}
],
"insertedAt": "2019-11-13T10:24:23.162207Z",
"updatedAt": "2019-11-13T10:24:46.091556Z",
"duration": 22000000000,
"pendingDuration": 0
}
]
}
],
"commits": [
{
"message": "inject bot stages",
"author": {
"email": "[email protected]",
"name": "Just Me",
"username": "JustMe"
}
}
],
"triggers": [
{
"name": "migrator",
"pipeline": {
"event": "finished",
"status": "succeeded",
"name": "github.com/estafette/estafette-ci-db-migrator",
"branch": "main"
},
"builds": {
"branch": "main"
}
}
],
"triggerEvents": [
{
"fired": true,
"git": {
"event": "push",
"repository": "github.com/estafette/migration",
"branch": "main"
}
}
],
"insertedAt": "2021-06-03T06:56:05.088499Z",
"startedAt": "2021-06-03T06:56:09.145449Z",
"updatedAt": "2021-06-03T07:02:41.789903Z",
"duration": 392000000000,
"pendingDuration": 4000000000,
"organizations": [
{
"name": "Estafette"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const { delay, type, file } = require('connect-api-mocker/helpers')
const path = require('path')

module.exports = [delay(500), type('application/json'), file(path.join(__dirname, './index.json'))]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "9f2b24bc-17d7-4e43-898a-d0fa3361cf4b",
"status": "completed",
"lastStep": "completion_done",
"builds": 42522,
"releases": 35945,
"totalDuration": 5754269760949,
"fromSource": "github.com",
"fromOwner": "estafette",
"fromName": "migration",
"toSource": "github.com",
"toOwner": "estafette-2",
"toName": "migration",
"callbackUrl": null,
"queuedAt": "2023-03-16 22:14:25.147690 +00:00",
"updatedAt": "2023-03-17 10:12:18.877321 +00:00",
"errorDetails": null
}
Loading

0 comments on commit d0b6775

Please sign in to comment.