Skip to content

Commit

Permalink
Merge branch 'dev' into sampling-container
Browse files Browse the repository at this point in the history
  • Loading branch information
mauberti-bc authored Oct 24, 2024
2 parents c3913f1 + bb7855b commit 43cdb7f
Show file tree
Hide file tree
Showing 142 changed files with 3,271 additions and 434 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/cleanClosedPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ jobs:
with:
persist-credentials: false

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/cleanMergedPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ jobs:
with:
persist-credentials: false

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/custom-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Custom Linter

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches:
- dev

jobs:
# OpenAPI request bodies should contain the property `required` and be set to true
#
# // Valid (request body required)
#
# requestBody: {
# required: true,
# content: {}
# }
#
# // Invalid (request body not required)
#
# requestBody: {
# content: {}
# }
#
openApiRequiredRequestBody:
name: OpenAPI requestBody missing required:true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Find schemas with optional request bodies
run: |
# For OpenAPI schemas, find all request bodies that don't have `required:true`
#
# Find all non-test files in apr/src/paths
# Find all request bodies that don't contain required:true property
# Print to stdout line num + filename and return exit code
find api/src/paths -type f ! -name '*.test.ts' -exec \
awk '
BEGIN {found=0}
/requestBody:/ {found=1}
/required: true/ {found=0}
/content:/ {
if (found) print "line: " NR, FILENAME;
found=0;
}
' {} \; \
| grep . && exit 1 || exit 0
50 changes: 49 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -232,6 +238,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -293,6 +305,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -349,6 +367,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -409,6 +433,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -463,6 +493,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand All @@ -485,7 +521,7 @@ jobs:
deployDatabaseSetup:
name: Deploy Database Setup Image
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 30
if: ${{ github.event.pull_request.merged == false &&
github.event.pull_request.draft == false &&
( needs.skipDuplicateActions.outputs.ignore_skip == 'true' ||
Expand Down Expand Up @@ -518,6 +554,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -575,6 +617,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down
62 changes: 61 additions & 1 deletion .github/workflows/deployStatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ jobs:
needs:
- checkEnv
steps:
# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -119,6 +125,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -169,6 +181,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -219,6 +237,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -269,6 +293,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -320,6 +350,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -371,6 +407,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand All @@ -392,7 +434,7 @@ jobs:
deployDatabaseSetup:
name: Deploy Database Setup Image
runs-on: ubuntu-latest
timeout-minutes: 20
timeout-minutes: 30
if: ${{ github.event.pull_request.merged == true }}
env:
PR_NUMBER: ${{ github.event.number }}
Expand Down Expand Up @@ -423,6 +465,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -475,6 +523,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down Expand Up @@ -528,6 +582,12 @@ jobs:
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v4

# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
Expand Down
54 changes: 30 additions & 24 deletions .github/workflows/toDraft.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# Switch to Draft
# Scales down running PODS when switching to Draft
name: Draft Scale Down

on:
pull_request:
types: [converted_to_draft]

jobs:
scaleDownPods:
name: Scale down the pods for this PR
runs-on: ubuntu-latest
timeout-minutes: 20
env:
PR_NUMBER: ${{ github.event.number }}
steps:
# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
- name: Log in to OpenShift
run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443

- name: Scale down
run: oc get deploymentconfig --namespace af2668-dev --selector env-id=$PR_NUMBER -o name | awk '{print "oc scale --replicas=0 " $1}' | bash
# Switch to Draft
# Scales down running PODS when switching to Draft
name: Draft Scale Down

on:
pull_request:
types: [converted_to_draft]

jobs:
scaleDownPods:
name: Scale down the pods for this PR
runs-on: ubuntu-latest
timeout-minutes: 20
env:
PR_NUMBER: ${{ github.event.number }}
steps:
# Install oc, which was removed from the ubuntu-latest image in v24.04
- name: Install OpenShift CLI tools
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.14"

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
- name: Log in to OpenShift
run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443

- name: Scale down
run: oc get deploymentconfig --namespace af2668-dev --selector env-id=$PR_NUMBER -o name | awk '{print "oc scale --replicas=0 " $1}' | bash
2 changes: 1 addition & 1 deletion api/.pipeline/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const phases = {
s3KeyPrefix: 'sims',
tz: config.timezone.api,
sso: config.sso.prod,
featureFlags: 'API_FF_SUBMIT_BIOHUB',
featureFlags: 'API_FF_SUBMIT_BIOHUB,API_FF_DISABLE_MULTIPLE_ACTIVE_DEPLOYMENTS_CHECK',
logLevel: 'silent',
logLevelFile: 'debug',
logFileDir: 'data/logs',
Expand Down
Loading

0 comments on commit 43cdb7f

Please sign in to comment.