Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Make criteria for pushing frontend images to GHCR same as that of deployment (#2275)

Dhruv Bhanushali6d62d3db9e62
diff --git a/.github/filters.yml b/.github/filters.yml
index 142ae9d3a..54b2f95d3 100644
--- a/.github/filters.yml
+++ b/.github/filters.yml
@@ -33,7 +33,7 @@ analytics:
- setup_plausible.sh
documentation:
- documentation/**
- - frontend/**.mdx
+ - frontend/**/*.mdx
- frontend/.storybook/**
- frontend/nuxt.config.ts
- frontend/tailwind.config.js
diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml
index 3b3daca69..821be88ab 100644
--- a/.github/workflows/ci_cd.yml
+++ b/.github/workflows/ci_cd.yml
@@ -730,7 +730,7 @@ jobs:
(needs.test-ing.result == 'success' || needs.test-ing.result == 'skipped') &&
(needs.test-api.result == 'success' || needs.test-api.result == 'skipped') &&
(needs.test-cat.result == 'success' || needs.test-cat.result == 'skipped') &&
- (needs.nuxt-build.result == 'success' || needs.nuxt-build.result == 'skipped') &&
+ (needs.playwright.result == 'success' || needs.playwright.result == 'skipped') &&
needs.build-docs.result == 'success'
runs-on: ubuntu-latest
needs:
@@ -738,7 +738,7 @@ jobs:
- test-cat
- test-ing
- test-api
- - nuxt-build
+ - playwright
- build-docs
steps:
@@ -820,7 +820,7 @@ jobs:
(needs.test-ing.result == 'success' || needs.test-ing.result == 'skipped') &&
(needs.test-api.result == 'success' || needs.test-api.result == 'skipped') &&
(needs.test-cat.result == 'success' || needs.test-cat.result == 'skipped') &&
- (needs.nuxt-build.result == 'success' || needs.nuxt-build.result == 'skipped')
+ (needs.playwright.result == 'success' || needs.playwright.result == 'skipped')
needs:
- determine-images
- get-image-tag
@@ -828,7 +828,7 @@ jobs:
- test-ing # test for ingestion server
- test-api # test for API
- test-cat # test for catalog
- - nuxt-build # test for frontend
+ - playwright # test for frontend
permissions:
packages: write
contents: read
diff --git a/documentation/meta/ci_cd/jobs/api.md b/documentation/meta/ci_cd/jobs/api.md
index ee114ed18..56942caf8 100644
--- a/documentation/meta/ci_cd/jobs/api.md
+++ b/documentation/meta/ci_cd/jobs/api.md
@@ -28,9 +28,11 @@ This job exports the [`api_logs` artifact](/meta/ci_cd/artifacts.md#logs).
```{note}
This job is treated as the proof of functionality for publishing Docker images
-for the API. Since the job also initialises the API, it provides a basic
-verification of the ingestion server's core functionality of populating the API
-database and Elasticsearch.
+for the API and deploying the image to staging.
+
+Since the job also initialises the API, it provides a basic verification of the
+ingestion server's core functionality of populating the API database and
+Elasticsearch.
```
## `django-checks`
diff --git a/documentation/meta/ci_cd/jobs/frontend.md b/documentation/meta/ci_cd/jobs/frontend.md
index a54c2e667..f864c741f 100644
--- a/documentation/meta/ci_cd/jobs/frontend.md
+++ b/documentation/meta/ci_cd/jobs/frontend.md
@@ -15,14 +15,6 @@ are
- [`build-docs`](/meta/ci_cd/jobs/documentation.md#build-docs) for the
documentation
-```{note}
-This job is treated as the proof of functionality for publishing Docker images
-for the frontend.
-
-This job, combined with the [`playwright` job](#playwright), is treated as the
-proof of functionality for deploying frontend to staging.
-```
-
## `nuxt-checks`
Runs a matrix for various Nuxt checks for the frontend using the following
@@ -53,8 +45,8 @@ Node.js scripts.
This job is skipped if the frontend codebase has not changed.
```{note}
-This job, combined with the [`nuxt-build` job](/meta/ci_cd/jobs/frontend.md#nuxt-build), is treated as the
-proof of functionality for deploying frontend to staging.
+This job is treated as the proof of functionality for publishing Docker images
+for the frontend and deploying the image to staging.
```
Since this is a required check for a matrix job, it has a bypass counterpart.
diff --git a/documentation/meta/ci_cd/proof_of_functionality.md b/documentation/meta/ci_cd/proof_of_functionality.md
index d2267d82b..aa8e388f5 100644
--- a/documentation/meta/ci_cd/proof_of_functionality.md
+++ b/documentation/meta/ci_cd/proof_of_functionality.md
@@ -11,13 +11,13 @@ determine if the build assets of a service are fit for
For different services, different tests are considered to establish
proof-of-functionality for different use-cases.
-| Service | Docs publish | GHCR publish | Staging deploy |
-| ---------------- | ------------------------------------------------------------ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
-| Catalog | [`test-cat`](/meta/ci_cd/jobs/catalog.md#test-cat) | [`test-cat`](/meta/ci_cd/jobs/catalog.md#test-cat) | [`test-cat`](/meta/ci_cd/jobs/catalog.md#test-cat) |
-| Ingestion server | [`test-ing`](/meta/ci_cd/jobs/ingestion_server.md#test-ing) | [`test-ing`](/meta/ci_cd/jobs/ingestion_server.md#test-ing) | [`test-ing`](/meta/ci_cd/jobs/ingestion_server.md#test-ing) |
-| API | [`test-api`](/meta/ci_cd/jobs/api.md#test-api) | [`test-api`](/meta/ci_cd/jobs/api.md#test-api) | [`test-api`](/meta/ci_cd/jobs/api.md#test-api) |
-| Frontend | [`nuxt-build`](/meta/ci_cd/jobs/frontend.md#nuxt-build) | [`nuxt-build`](/meta/ci_cd/jobs/frontend.md#nuxt-build) | [`nuxt-build`](/meta/ci_cd/jobs/frontend.md#nuxt-build) + [`playwright`](/meta/ci_cd/jobs/frontend.md#playwright) |
-| Documentation | [`build-docs`](/meta/ci_cd/jobs/documentation.md#build-docs) | | |
+| Service | Docs publish | GHCR publish | Staging deploy |
+| ---------------- | ------------------------------------------------------------ | ----------------------------------------------------------- | ----------------------------------------------------------- |
+| Catalog | [`test-cat`](/meta/ci_cd/jobs/catalog.md#test-cat) | [`test-cat`](/meta/ci_cd/jobs/catalog.md#test-cat) | [`test-cat`](/meta/ci_cd/jobs/catalog.md#test-cat) |
+| Ingestion server | [`test-ing`](/meta/ci_cd/jobs/ingestion_server.md#test-ing) | [`test-ing`](/meta/ci_cd/jobs/ingestion_server.md#test-ing) | [`test-ing`](/meta/ci_cd/jobs/ingestion_server.md#test-ing) |
+| API | [`test-api`](/meta/ci_cd/jobs/api.md#test-api) | [`test-api`](/meta/ci_cd/jobs/api.md#test-api) | [`test-api`](/meta/ci_cd/jobs/api.md#test-api) |
+| Frontend | [`playwright`](/meta/ci_cd/jobs/frontend.md#playwright) | [`playwright`](/meta/ci_cd/jobs/frontend.md#playwright) | [`playwright`](/meta/ci_cd/jobs/frontend.md#playwright) |
+| Documentation | [`build-docs`](/meta/ci_cd/jobs/documentation.md#build-docs) | | |
## Rationales
@@ -42,5 +42,7 @@ tests conclusively proves that the API works as intended.
### Frontend
-The frontends difference between criteria for GHCR publish and staging deploy is
-a controversial choice. 🚧 We will revise this.
+The Playwright tests for the frontend in `playwright` include E2E tests, visual
+regression tests for the pages, and also tests for the Storybook stories.
+Passing these tests conclusively proves that each individual component, and also
+the frontend as a whole, looks and works as intended.