Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bcgov/pubcode
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.70
Choose a base ref
...
head repository: bcgov/pubcode
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 19 commits
  • 44 files changed
  • 3 contributors

Commits on Jan 17, 2025

  1. fix(deps): update dependency mongoose to v8.9.5 [security] (#404)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 17, 2025
    Copy the full SHA
    9ca8df6 View commit details

Commits on Jan 19, 2025

  1. chore(deps): update caddy docker tag to v2.9.1 (#406)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 19, 2025
    Copy the full SHA
    e27698f View commit details
  2. Copy the full SHA
    2c5917b View commit details
  3. chore(deps): update dependency @babel/traverse to v8.0.0-alpha.15 (#405)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 19, 2025
    Copy the full SHA
    dbd905c View commit details

Commits on Jan 21, 2025

  1. chore(deps): update node.js to v22.13.0 (#408)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 21, 2025
    Copy the full SHA
    f308b6a View commit details
  2. chore(deps): update dependency vite to v6.0.9 [security] (#409)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 21, 2025
    Copy the full SHA
    58ebf0a View commit details

Commits on Jan 23, 2025

  1. chore(deps): update dependency cypress to v14 (#410)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 23, 2025
    Copy the full SHA
    fcf574d View commit details

Commits on Jan 30, 2025

  1. chore(deps): update node.js to v22.13.1 (#411)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 30, 2025
    Copy the full SHA
    e89282d View commit details
  2. Copy the full SHA
    82fa0d3 View commit details

Commits on Feb 12, 2025

  1. feat: react 19 mui 6 bcgov react components (#414)

    * feat: initial commit for all dependency updates
    
    * fix: few missed items
    
    * fix: e2e
    
    * fix: e2e
    
    * fix: change pipeline to use new patterns
    
    * fix: pipeline
    
    * fix: pipeline
    mishraomp authored Feb 12, 2025
    Copy the full SHA
    a74349c View commit details
  2. fix: pipeline (#415)

    * feat: initial commit for all dependency updates
    
    * fix: few missed items
    
    * fix: e2e
    
    * fix: e2e
    
    * fix: change pipeline to use new patterns
    
    * fix: pipeline
    
    * fix: pipeline
    
    * fix: merge
    
    * fix: tag fallback no longer test it is latest
    mishraomp authored Feb 12, 2025
    Copy the full SHA
    0f59ef5 View commit details
  3. fix: pipeline (#416)

    * fix: wrap srting with quotes
    
    * fix: retags it is now latest and not test
    
    * fix: quote
    
    * fix: trying
    
    * chore: print directory
    
    * add debug
    
    * add dry run server with debug
    
    * still tryingg
    
    * fix: trying
    
    * chore: trying
    
    * helm history or true
    
    * still trying
    
    * try without \ at the end
    
    * still trying
    
    * try
    
    * remove dry run and debug
    mishraomp authored Feb 12, 2025
    Copy the full SHA
    581cd52 View commit details

Commits on Feb 13, 2025

  1. Copy the full SHA
    348f870 View commit details
  2. chore(deps): update bcgov/action-oc-runner action to v1 (#418)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 13, 2025
    Copy the full SHA
    1ad1e01 View commit details

Commits on Feb 14, 2025

  1. chore(deps): lock file maintenance (#419)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 14, 2025
    Copy the full SHA
    3ced5ea View commit details

Commits on Feb 17, 2025

  1. chore(deps): update helm release component to v0.3.1 (#420)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 17, 2025
    Copy the full SHA
    461f18e View commit details

Commits on Feb 26, 2025

  1. fix(deps): update dependency cron to v4 (#421)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 26, 2025
    Copy the full SHA
    9e7cd44 View commit details

Commits on Feb 27, 2025

  1. chore(deps): update dependency globals to v16 (#422)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 27, 2025
    Copy the full SHA
    0e5ae2d View commit details

Commits on Mar 1, 2025

  1. chore(deps): lock file maintenance (#423)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 1, 2025
    Copy the full SHA
    7a312ef View commit details
Showing with 6,400 additions and 2,474 deletions.
  1. +116 −0 .github/workflows/.deploy.yml
  2. +25 −49 .github/workflows/merge.yml
  3. +12 −31 .github/workflows/pr-close.yml
  4. +23 −54 .github/workflows/pr-open.yml
  5. +1 −2 api/Dockerfile
  6. +115 −68 api/package-lock.json
  7. +11 −11 api/package.json
  8. +12 −7 api/src/app.js
  9. +4 −7 api/src/db/database.js
  10. +1 −1 api/src/logger.js
  11. +17 −10 api/src/schedulers/refresh-cache.js
  12. +12 −0 charts/pubcode/Chart.lock
  13. +3 −3 charts/pubcode/Chart.yaml
  14. +2 −0 charts/pubcode/values.yaml
  15. +188 −9 crawler/package-lock.json
  16. +1 −1 docker-compose.yml
  17. +24 −0 frontend/.gitignore
  18. +29 −12 frontend/Caddyfile
  19. +2 −3 frontend/Dockerfile
  20. +5 −41 frontend/README.md
  21. +1 −1 frontend/cypress/e2e/edit-form.cy.js
  22. +1 −1 frontend/cypress/e2e/home-page.cy.js
  23. +2 −2 frontend/cypress/e2e/left-drawer.cy.js
  24. +1 −1 frontend/env.js
  25. +38 −0 frontend/eslint.config.js
  26. +2 −2 frontend/index.html
  27. +5,076 −1,650 frontend/package-lock.json
  28. +30 −35 frontend/package.json
  29. BIN frontend/public/favicon.ico
  30. +26 −52 frontend/src/App.css
  31. +33 −140 frontend/src/App.jsx
  32. +38 −10 frontend/src/components/Dashboard.jsx
  33. +15 −9 frontend/src/components/EditForm.jsx
  34. +10 −4 frontend/src/components/FormComponent.jsx
  35. +67 −64 frontend/src/components/LeftDrawer.jsx
  36. +4 −4 frontend/src/components/NotFound.jsx
  37. +28 −13 frontend/src/components/{YamlDisplay.jsx → Yaml.jsx}
  38. +0 −97 frontend/src/index.css
  39. +10 −5 frontend/src/main.jsx
  40. +11 −9 frontend/src/routes/index.jsx
  41. +9 −41 frontend/vite.config.js
  42. +13 −1 renovate.json
  43. +194 −15 schema/script/package-lock.json
  44. +188 −9 utilities/remove-deleted-pubcode/package-lock.json
116 changes: 116 additions & 0 deletions .github/workflows/.deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: .Deploys

on:
workflow_call:
inputs:
### Typical / recommended
autoscaling:
description: Autoscaling enabled or not for the deployments
required: false
type: string
default: 'true'
environment:
description: Environment name; omit for PRs
required: false
type: string
tag:
description: Container tag; usually PR number
required: false
type: string
default: ${{ github.event.number }}
triggers:
description: Paths to trigger a deploy; omit=always; e.g. ('backend/' 'frontend/')
required: false
type: string

### Usually a bad idea / not recommended
directory:
description: "Chart directory"
default: "charts/${{ github.event.repository.name }}"
required: false
type: string
timeout-minutes:
description: "Timeout minutes"
default: 10
required: false
type: number
values:
description: "Values file"
default: "values.yaml"
required: false
type: string
params:
description: "Extra parameters to pass to helm upgrade"
default: ""
required: false
type: string
release_name:
description: "Release name"
default: ${{ github.event.repository.name }}
required: false
type: string


jobs:

deploys:
name: Helm
environment: ${{ inputs.environment }}
runs-on: ubuntu-24.04
timeout-minutes: ${{ inputs.timeout-minutes }}
steps:
- uses: actions/checkout@v4
- name: Stop pre-existing deployments on PRs (status = pending-upgrade)
if: github.event_name == 'pull_request'
uses: bcgov/action-oc-runner@v1.0.0
with:
oc_namespace: ${{ vars.oc_namespace }}
oc_token: ${{ secrets.oc_token }}
oc_server: ${{ vars.oc_server }}
triggers: ${{ inputs.triggers }}
commands: |
# Interrupt any previous deployments (PR only)
PREVIOUS=$(helm status ${{ inputs.release_name }} -o json | jq .info.status || true)
if [[ ${PREVIOUS} =~ pending ]]; then
echo "Rollback triggered"
helm rollback ${{ inputs.release_name }} || \
helm uninstall ${{ inputs.release_name }}
fi
- name: Deploy
uses: bcgov/action-oc-runner@v1.0.0
with:
oc_namespace: ${{ vars.oc_namespace }}
oc_token: ${{ secrets.oc_token }}
oc_server: ${{ vars.oc_server }}
triggers: ${{ inputs.triggers }}
commands: |
# If directory provided, cd to it
[ -z "${{ inputs.directory }}" ]|| cd ${{ inputs.directory }}
# Deploy Helm Chart
helm dependency update
helm package --app-version="v${{ inputs.tag }}" --version=${{ inputs.tag }} .
cp ./${{ github.event.repository.name }}-${{ inputs.tag }}.tgz pubcode.tgz
ls -la
helm upgrade ${{ inputs.release_name }} pubcode.tgz \
--set global.autoscaling=${{ inputs.autoscaling }} \
--set-string global.repository="${{ github.repository }}" \
--set-string global.secrets.emailRecipients="${{ secrets.EMAIL_RECIPIENTS }}" \
--set-string global.secrets.chesTokenURL="${{ secrets.CHES_TOKEN_URL }}" \
--set-string global.secrets.chesClientID="${{ secrets.CHES_CLIENT_ID }}" \
--set-string global.secrets.chesClientSecret="${{ secrets.CHES_CLIENT_SECRET }}" \
--set-string global.secrets.chesAPIURL="${{ secrets.CHES_API_URL }}" \
--set-string global.secrets.databaseAdminPassword="${{ secrets.DB_PWD }}" \
${{ inputs.params }} \
--install \
--wait \
--atomic \
--timeout ${{ inputs.timeout-minutes }}m \
--values ${{ inputs.values }}
# print history
helm history ${{ inputs.release_name }} || true
# Remove old build runs, build pods and deployment pods
oc delete po --field-selector=status.phase==Succeeded
74 changes: 25 additions & 49 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ concurrency:
jobs:
semantic-version:
outputs:
semanticVersion: ${{ steps.changelog.outputs.version }}
tag: ${{ steps.changelog.outputs.tag }}
semanticVersion: ${{ steps.changelog.outputs.version }} # this is without v 1.0.0
tag: ${{ steps.changelog.outputs.tag }} # this is with v, v1.0.0
clean_changelog: ${{ steps.changelog.outputs.clean_changelog }}
runs-on: ubuntu-24.04
timeout-minutes: 1
@@ -43,36 +43,22 @@ jobs:
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: test
tags: ${{ needs.semantic-version.outputs.semanticVersion }}
target: latest
tags: |
${{ needs.semantic-version.outputs.semanticVersion }}
${{ needs.semantic-version.outputs.tag }}
deploys:
name: TEST Deployments
needs: [retag-images, semantic-version]
environment: test
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"
- name: Deploy
shell: bash
run: |
# Allow pipefail, since we could be catching oc create errors
set +o pipefail
# Login to OpenShift (NOTE: project command is a safeguard)
oc login --token=${{ secrets.oc_token }} --server=${{ vars.oc_server }}
oc project ${{ vars.oc_namespace }}
cd charts/pubcode
# Deploy Helm Chart
helm dependency update
helm upgrade --install --wait --atomic pubcode-test --values values.yaml --set-string global.repository=${{ github.repository }} --set-string api.containers[0].tag="${{ needs.semantic-version.outputs.semanticVersion }}" --set-string frontend.containers[0].tag="${{ needs.semantic-version.outputs.semanticVersion }}" --set-string global.secrets.emailRecipients="${{ secrets.EMAIL_RECIPIENTS }}" --set-string global.secrets.chesTokenURL="${{ secrets.CHES_TOKEN_URL }}" --set-string global.secrets.chesClientID="${{ secrets.CHES_CLIENT_ID }}" --set-string global.secrets.chesClientSecret="${{ secrets.CHES_CLIENT_SECRET }}" --set-string global.secrets.chesAPIURL="${{ secrets.CHES_API_URL }}" --set-string global.secrets.databaseAdminPassword="${{ secrets.DB_PWD }}" --set-string namespace="${{ vars.oc_namespace }}" --timeout 5m .
uses: ./.github/workflows/.deploy.yml
secrets: inherit
with:
autoscaling: true
environment: test
tag: ${{ needs.semantic-version.outputs.semanticVersion }} # this is without v
release_name: pubcode-test
params: --set-string api.containers[0].tag="${{ needs.semantic-version.outputs.tag }}" --set-string frontend.containers[0].tag="${{ needs.semantic-version.outputs.tag }}"
tests:
name: Tests
needs: [deploys]
@@ -83,29 +69,19 @@ jobs:
deploys-prod:
name: PROD Deployments
needs: [semantic-version, tests]
environment: prod
uses: ./.github/workflows/.deploy.yml
secrets: inherit
with:
autoscaling: true
environment: prod
tag: ${{ needs.semantic-version.outputs.semanticVersion }}
release_name: pubcode
params: --set-string api.containers[0].tag="${{ needs.semantic-version.outputs.tag }}" --set-string frontend.containers[0].tag="${{ needs.semantic-version.outputs.tag }}"
github_release:
name: Create Release
needs: [semantic-version, deploys-prod]
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"
- name: Deploy
shell: bash
run: |
# Allow pipefail, since we could be catching oc create errors
set +o pipefail
# Login to OpenShift (NOTE: project command is a safeguard)
oc login --token=${{ secrets.oc_token }} --server=${{ vars.oc_server }}
oc project ${{ vars.oc_namespace }}
# Deploy Helm Chart
cd charts/pubcode
helm dependency update
helm upgrade --install --wait --atomic pubcode --values values.yaml --set-string global.repository=${{ github.repository }} --set-string api.containers[0].tag="${{ needs.semantic-version.outputs.semanticVersion }}" --set-string frontend.containers[0].tag="${{ needs.semantic-version.outputs.semanticVersion }}" --set-string global.secrets.emailRecipients="${{ secrets.EMAIL_RECIPIENTS }}" --set-string global.secrets.chesTokenURL="${{ secrets.CHES_TOKEN_URL }}" --set-string global.secrets.chesClientID="${{ secrets.CHES_CLIENT_ID }}" --set-string global.secrets.chesClientSecret="${{ secrets.CHES_CLIENT_SECRET }}" --set-string global.secrets.chesAPIURL="${{ secrets.CHES_API_URL }}" --set-string global.secrets.databaseAdminPassword="${{ secrets.DB_PWD }}" --set-string namespace="${{ vars.oc_namespace }}" --timeout 5m .
- name: Create Release
uses: softprops/action-gh-release@v2
continue-on-error: true
43 changes: 12 additions & 31 deletions .github/workflows/pr-close.yml
Original file line number Diff line number Diff line change
@@ -10,34 +10,15 @@ concurrency:
cancel-in-progress: true

jobs:
# Clean up OpenShift when PR closed, no conditions
cleanup-openshift:
name: Cleanup OpenShift
runs-on: ubuntu-24.04
steps:
- uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"
- name: Remove OpenShift artifacts
run: |
oc login --token=${{ secrets.OC_TOKEN }} --server=${{ vars.OC_SERVER }}
oc project ${{ vars.OC_NAMESPACE }}
# Remove old build runs, build pods and deployment pods
helm uninstall pubcode-${{ github.event.number }}
# If merged into main, then handle any image promotions
image-promotions:
name: Image Promotions
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-24.04
strategy:
matrix:
package: [api, database, frontend]
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ github.event.number }}
tags: test
cleanup:
name: Cleanup and Image Promotion
uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-close.yml@v0.8.3
permissions:
packages: write
secrets:
oc_namespace: ${{ vars.OC_NAMESPACE }}
oc_token: ${{ secrets.OC_TOKEN }}
with:
cleanup: helm
packages: api database frontend

77 changes: 23 additions & 54 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ jobs:
pull-requests: write
steps:
- name: PR Greeting
uses: bcgov-nr/action-pr-description-add@v1.2.0
uses: bcgov/action-pr-description-add@v1.2.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
add_markdown: |
@@ -44,11 +44,11 @@ jobs:
package: [api, frontend, database]
steps:
- uses: actions/checkout@v4
- uses: bcgov-nr/action-builder-ghcr@v2.3.0
- uses: bcgov/action-builder-ghcr@v2.3.0
with:
package: ${{ matrix.package }}
tag: ${{ github.sha }}
tag_fallback: test
tag_fallback: latest
token: ${{ secrets.GITHUB_TOKEN }}
triggers: ('${{ matrix.package }}/')

@@ -62,57 +62,26 @@ jobs:
deploys:
name: Deploys
needs: [builds]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"
- name: Deploy to OpenShift
shell: bash
run: |
# Expand for deployment steps
set +o pipefail
oc login --token=${{ secrets.oc_token }} --server=${{ vars.oc_server }}
oc project ${{ vars.oc_namespace }} # Safeguard!

# Deploy Helm Chart
cd charts/pubcode
helm dependency update
helm upgrade --install --wait --atomic pubcode-${{ github.event.number }} \
--set-string global.repository=${{ github.repository }} \
--set-string api.containers[0].tag="${{ github.sha }}" \
--set-string api.containers[0].resources.limits.cpu="250m" \
--set-string api.containers[0].resources.limits.memory="250Mi" \
--set-string api.containers[0].resources.requests.cpu="100m" \
--set-string api.containers[0].resources.requests.memory="150Mi" \
--set api.autoscaling.minReplicas=1 \
--set api.autoscaling.maxReplicas=1 \
--set frontend.autoscaling.minReplicas=1 \
--set frontend.autoscaling.maxReplicas=1 \
--set-string frontend.containers[0].tag="${{ github.sha }}" \
--set-string frontend.containers[0].resources.limits.cpu="200m" \
--set-string frontend.containers[0].resources.limits.memory="150Mi" \
--set-string frontend.containers[0].resources.requests.cpu="100m" \
--set-string frontend.containers[0].resources.requests.memory="50Mi" \
--set-string database.containers[0].resources.limits.cpu="500m" \
--set-string database.containers[0].resources.limits.memory="450Mi" \
--set-string database.containers[0].resources.requests.cpu="100m" \
--set-string database.containers[0].resources.requests.memory="150Mi" \
--set-string database.initContainers[0].resources.limits.cpu="500m" \
--set-string database.initContainers[0].resources.limits.memory="450Mi" \
--set-string database.initContainers[0].resources.requests.cpu="100m" \
--set-string database.initContainers[0].resources.requests.memory="150Mi" \
--set-string database.pvc.size="350Mi" \
--set-string global.secrets.emailRecipients="${{ secrets.EMAIL_RECIPIENTS }}" \
--set-string global.secrets.chesTokenURL="${{ secrets.CHES_TOKEN_URL }}" \
--set-string global.secrets.chesClientID="${{ secrets.CHES_CLIENT_ID }}" \
--set-string global.secrets.chesClientSecret="${{ secrets.CHES_CLIENT_SECRET }}" \
--set-string global.secrets.chesAPIURL="${{ secrets.CHES_API_URL }}" \
--set-string global.secrets.databaseAdminPassword="${{ secrets.DB_PWD }}" \
--set-string global.env.VITE_SCHEMA_BRANCH=${{ github.event.pull_request.head.ref }} \
--set-string namespace="${{ vars.oc_namespace }}" -f values.yaml --timeout 5m .
uses: ./.github/workflows/.deploy.yml
secrets: inherit
with:
autoscaling: false
tag: ${{ github.event.number }}
release_name: pubcode-${{ github.event.number }}
params: |
--set-string global.repository=${{ github.repository }} \
--set-string api.containers[0].tag="${{ github.sha }}" \
--set-string api.containers[0].resources.requests.cpu="30m" \
--set-string api.containers[0].resources.requests.memory="50Mi" \
--set-string frontend.containers[0].tag="${{ github.sha }}" \
--set-string frontend.containers[0].resources.requests.cpu="30m" \
--set-string frontend.containers[0].resources.requests.memory="50Mi" \
--set-string database.containers[0].resources.requests.cpu="30m" \
--set-string database.containers[0].resources.requests.memory="50Mi" \
--set-string database.initContainers[0].resources.requests.cpu="30m" \
--set-string database.initContainers[0].resources.requests.memory="50Mi" \
--set-string database.pvc.size="350Mi" \
--set-string global.env.VITE_SCHEMA_BRANCH=${{ github.event.pull_request.head.ref }} \
tests:
name: Tests
3 changes: 1 addition & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Build static files
FROM node:22.12.0-slim AS build
FROM node:22 AS build
WORKDIR /app
COPY *.json ./
RUN npm ci --omit=dev --ignore-scripts
Loading