Skip to content

Commit

Permalink
Merge pull request #3348 from kbase/develop
Browse files Browse the repository at this point in the history
Merge to main for 5.2.0 release
  • Loading branch information
briehl committed Aug 31, 2023
2 parents 9f1b0c0 + aa86e40 commit bf8a3a2
Show file tree
Hide file tree
Showing 145 changed files with 15,293 additions and 25,920 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
max-line-length = 88
max-line-length = 100
# E203: whitespace before ‘,’, ‘;’, or ‘:’
# E501: line length
# W503: line break after binary operator
Expand Down
95 changes: 0 additions & 95 deletions .github/workflows/ReleaseCycleProposal.md

This file was deleted.

35 changes: 18 additions & 17 deletions .github/workflows/build_and_push_image.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Build and push narrative images

on:
Expand All @@ -17,55 +18,56 @@ jobs:
name: Check out GitHub Repo
with:
ref: "${{ github.event.pull_request.head.sha }}"
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up environment
run: |
if [ ${{ github.base_ref }} == 'main' ]; then
branch=''
else
branch=`"-""${{ github.base_ref }}" | awk '{print tolower($0)}'`
branch=`echo "-""${{ github.base_ref }}" | awk '{print tolower($0)}'`
fi
narrative_version=`grep '\"version\":' src/config.json.templ | awk '{print $2}' | sed 's/"//g'`
narrative_git_hash=`grep '\"git_commit_hash\":' src/config.json.templ | awk '{print $2}' | sed 's/"//g' | sed 's/,//'`
echo "APP_IMAGE_TAG=ghcr.io/${{ github.repository }}${branch}:pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "APP_VERSION_IMAGE_TAG=ghcr.io/${{ github.repository }}${branch}_version:pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "BRANCH=${branch}" >> $GITHUB_ENV
echo "BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
echo "NARRATIVE_GIT_HASH=${narrative_git_hash}" >> $GITHUB_ENV
echo "NARRATIVE_VERSION=${narrative_version}" >> $GITHUB_ENV
echo "PR=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "VCS_REF=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c -7)" >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
name: Get current date
id: date
run: echo "date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
-
name: Log in to the Container registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
-
name: Build narrative image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
pull: true
push: true
tags: ${{ env.APP_IMAGE_TAG }}
build-args: |
BRANCH=${{ github.head_ref }}
BUILD_DATE=${{ env.BUILD_DATE }}
BUILD_DATE=${{ steps.date.output.date }}
NARRATIVE_VERSION=${{ env.NARRATIVE_VERSION }}
VCS_REF=${{ env.VCS_REF }}
labels: |
us.kbase.vcs-pull-req=pr-${{ env.PR }}
VCS_REF=${{ github.sha }}
TAG='${{ github.ref }}'
-
name: Build version image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
if: ${{ github.base_ref }} == 'main' || ${{ github.base_ref }} == 'develop'
with:
context: .
Expand All @@ -74,9 +76,8 @@ jobs:
tags: ${{ env.APP_VERSION_IMAGE_TAG }}
build-args: |
BRANCH=${{ github.head_ref }}
BUILD_DATE=${{ env.BUILD_DATE }}
BUILD_DATE=${{ steps.date.output.date }}
NARRATIVE_VERSION=${{ env.NARRATIVE_VERSION }}
NARRATIVE_GIT_HASH=${{ env.NARRATIVE_GIT_HASH }}
VCS_REF=${{ env.VCS_REF }}
labels: |
us.kbase.vcs-pull-req=pr-${{ env.PR }}
VCS_REF=${{ github.sha }}
TAG='${{ github.ref }}'
5 changes: 5 additions & 0 deletions .github/workflows/build_test_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}

trivy-scans:
if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master' ) && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
secrets: inherit

run_unit_tests:
uses: ./.github/workflows/unit_test.yml
needs: run_build_and_push
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ jobs:
steps:
-
name: Log in to the Container registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
-
name: Repo checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up environment
run: |
if [ ${{ github.base_ref }} == 'main' ]; then
branch=''
else
branch=`"-""${{ github.base_ref }}" | awk '{print tolower($0)}'`
branch=`echo "-""${{ github.base_ref }}" | awk '{print tolower($0)}'`
fi
narrative_version=`grep '\"version\":' src/config.json.templ | awk '{print $2}' | sed 's/"//g'`
narrative_git_hash=`grep '\"git_commit_hash\":' src/config.json.templ | awk '{print $2}' | sed 's/"//g' | sed 's/,//'`
Expand All @@ -47,10 +47,10 @@ jobs:
shell: bash -l {0}
run: docker pull ${{ env.APP_IMAGE_TAG }}
-
name: Use Node JS 16.x
uses: actions/setup-node@v2
name: Use Node JS 16
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 16
-
name: Install JS dependencies
run: |
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Manual Build & Push
on:
workflow_dispatch:
jobs:
build-push:
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: br-${{ github.ref_name }}
secrets: inherit
44 changes: 44 additions & 0 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Pull Request Build, Tag, & Push
on:
workflow_dispatch:
# pull_request:
# branches:
# - develop
# - main
# - master
# types:
# - opened
# - reopened
# - synchronize
# - closed
jobs:
build-develop-open:
if: github.base_ref == 'develop' && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build.yml@main
secrets: inherit
build-develop-merge:
if: github.base_ref == 'develop' && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: pr-${{ github.event.number }},latest
secrets: inherit
build-main-open:
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }}
secrets: inherit
build-main-merge:
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }},latest-rc
secrets: inherit
trivy-scans:
if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master' ) && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
secrets: inherit
25 changes: 25 additions & 0 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Release - Build & Push Image
on:
release:
branches:
- main
- master
types: [ published ]
jobs:
check-source-branch:
uses: kbase/.github/.github/workflows/reusable_validate-branch.yml@main
with:
build_branch: '${{ github.event.release.target_commitish }}'
validate-release-tag:
needs: check-source-branch
uses: kbase/.github/.github/workflows/reusable_validate-release-tag.yml@main
with:
release_tag: '${{ github.event.release.tag_name }}'
build-push:
needs: validate-release-tag
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: '${{ github.event.release.tag_name }},latest'
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/tag_environments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out GitHub Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag_latest_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Check out GitHub Repo
with:
ref: "${{ github.event.pull_request.head.sha }}"
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Log in to the Container registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
password: ${{ secrets.GHCR_TOKEN }}
-
name: Repo checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up environment
run: |
if [ ${{ github.base_ref }} == 'main' ]; then
branch=''
else
branch=`"-""${{ github.base_ref }}" | awk '{print tolower($0)}'`
branch=`echo "-""${{ github.base_ref }}" | awk '{print tolower($0)}'`
fi
narrative_version=`grep '\"version\":' src/config.json.templ | awk '{print $2}' | sed 's/"//g'`
narrative_git_hash=`grep '\"git_commit_hash\":' src/config.json.templ | awk '{print $2}' | sed 's/"//g' | sed 's/,//'`
Expand All @@ -55,10 +55,10 @@ jobs:
docker run -v "${{ github.workspace }}/output:/tmp/output" --user nobody ${{ env.APP_IMAGE_TAG }} /bin/bash scripts/narrative_backend_tests.sh
continue-on-error: true
-
name: Use Node JS 16.x
name: Use Node JS 16
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 16
-
name: Install JS dependencies
run: |
Expand All @@ -74,10 +74,10 @@ jobs:
-
name: Send to Codecov
id: send_to_codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
continue-on-error: true
with:
files: ./output/coverage.xml, ./js-coverage/lcov/lcov.info
files: ./output/coverage.xml,./js-coverage/lcov/lcov.info
fail_ci_if_error: true
-
name: outcome
Expand Down
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
Loading

0 comments on commit bf8a3a2

Please sign in to comment.