Repository: kbase/file_cache_server
Pull request #24: SECURITY-47: Add GHA workflows
Author: login: Xiangs18
Created: 2025-03-14T21:04:15Z | Merged: 2025-03-18T17:12:46Z



Diff:
diff --git a/.github/codeql.yml b/.github/codeql.yml
new file mode 100644
index 0000000..0f2f982
--- /dev/null
+++ b/.github/codeql.yml
@@ -0,0 +1,52 @@
+name: "Code scanning - action"
+
+on:
+  push:
+  pull_request:
+  schedule:
+    - cron: '0 19 * * 0'
+
+jobs:
+  CodeQL-Build:
+
+    # CodeQL runs on ubuntu-latest and windows-latest
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v4
+      with:
+        # We must fetch at least the immediate parents so that if this is
+        # a pull request then we can checkout the head.
+        fetch-depth: 2
+
+    # If this run was triggered by a pull request event, then checkout
+    # the head of the pull request instead of the merge commit.
+    - run: git checkout HEAD^2
+      if: ${{ github.event_name == 'pull_request' }}
+      
+    # Initializes the CodeQL tools for scanning.
+    - name: Initialize CodeQL
+      uses: github/codeql-action/init@v3
+      # Override language selection by uncommenting this and choosing your languages
+      # with:
+      #   languages: go, javascript, csharp, python, cpp, java
+
+    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
+    # If this step fails, then you should remove it and run the build manually (see below)
+    - name: Autobuild
+      uses: github/codeql-action/autobuild@v3
+
+    # ℹ️ Command-line programs to run using the OS shell.
+    # 📚 https://git.io/JvXDl
+
+    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
+    #    and modify them (or add more) to build your code if your project
+    #    uses a compiled language
+
+    #- run: |
+    #   make bootstrap
+    #   make release
+
+    - name: Perform CodeQL Analysis
+      uses: github/codeql-action/analyze@v3
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..1cadfe8
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,23 @@
+version: 2
+updates:
+
+  # Docker
+  - package-ecosystem: docker
+    directory: "/"
+    schedule:
+      interval: "monthly"
+    open-pull-requests-limit: 25
+
+  # Python
+  - package-ecosystem: "pip" # See documentation for possible values
+    directory: "/" # Location of package manifests
+    schedule:
+      interval: "monthly"
+    open-pull-requests-limit: 25
+
+  # GitHub Actions
+  - package-ecosystem: "github-actions"
+    directory: ".github/workflows"
+    schedule:
+      interval: "monthly"
+    open-pull-requests-limit: 25
diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml
new file mode 100644
index 0000000..944f903
--- /dev/null
+++ b/.github/workflows/manual-build.yml
@@ -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
diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml
new file mode 100644
index 0000000..0fa1c46
--- /dev/null
+++ b/.github/workflows/pr_build.yml
@@ -0,0 +1,43 @@
+---
+name: Pull Request Build, Tag, & Push
+on:
+  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
diff --git a/.github/workflows/release-main.yml b/.github/workflows/release-main.yml
new file mode 100644
index 0000000..a254678
--- /dev/null
+++ b/.github/workflows/release-main.yml
@@ -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
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..115a1f4
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r requirements.txt
+          pip install -r dev-requirements.txt
+
+      - name: Run tests
+        shell: bash
+        run: |
+          docker compose up -d
+          sleep 10
+          make test
+
+      - name: Upload coverage to Codecov
+        uses: codecov/codecov-action@v5
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
+          fail_ci_if_error: true
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index b271dbe..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-sudo: required
-services:
-- docker
-script:
-- docker-compose up -d
-- sleep 10
-- make test
diff --git a/Dockerfile b/Dockerfile
index 8fd5293..89cfe67 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.7-slim
+FROM python:3.9.19-slim
 
 ARG DEVELOPMENT
 ARG BUILD_DATE
diff --git a/Makefile b/Makefile
index a472162..6fc8915 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 .PHONY: test stress-test
 
 test:
-	docker-compose run web sh scripts/run_tests.sh
+	docker compose run web sh scripts/run_tests.sh
 
 stress-test:
-	docker-compose run web sh -c "python -m unittest src/test/test_server_stress.py"
+	docker compose run web sh -c "python -m unittest src/test/test_server_stress.py"
diff --git a/VERSION b/VERSION
index 6e8bf73..17e51c3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.0
+0.1.1
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 1fb65d2..5f8d280 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,6 +1,7 @@
 mypy==0.800
 bandit==1.7.0
-mccabe==0.6.1
-flake8==3.8.4
+mccabe==0.7.0
+flake8==5.0.4
 grequests==0.6.0
-coverage==5.4
+pytest==7.4.0
+pytest-cov==4.1.0
diff --git a/requirements.txt b/requirements.txt
index 23836db..86538c3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,8 +1,11 @@
 minio==7.0.2
-Flask==1.1.2
+flask==2.0.3
 gunicorn==20.0.4
 gevent==21.1.2
 simplejson==3.17.2
 python-dotenv==0.15.0
 requests==2.25.1
 docopt==0.6.2
+Jinja2==3.0
+MarkupSafe==2.0.0
+werkzeug==2.0.3
\ No newline at end of file
diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh
index dfa65fa..f1495b7 100644
--- a/scripts/run_tests.sh
+++ b/scripts/run_tests.sh
@@ -4,6 +4,6 @@ set -e
 
 flake8 --max-complexity 6 src/caching_service
 flake8 src/test
-mypy --ignore-missing-imports src
+# mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+PYTHONPATH=. pytest -s -vv --cov=src/caching_service --cov-report=term --cov-report=xml src/test/caching_service


Reviews:
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-14T22:14:42Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T22:18:09Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T22:18:14Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T22:20:40Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T22:36:16Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-14T22:37:30Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-14T22:38:52Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-14T22:39:17Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T23:25:03Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T23:26:02Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-14T23:29:44Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-14T23:31:12Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-14T23:31:24Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T23:42:03Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-14T23:43:53Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-14T23:44:38Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-14T23:54:45Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-15T00:03:31Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-15T00:36:12Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-15T01:39:54Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-17T20:35:16Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-17T20:37:15Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-17T20:49:18Z
user: login: Xiangs18
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-17T22:23:36Z
user: login: MrCreosote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-17T22:33:52Z
user: login: MrCreosote
body: LGTM. @bio-boris do you want to review?
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-17T22:37:53Z
user: login: bio-boris
body: lgtm
state: APPROVED
author_association: NONE
submitted_at: 2025-03-18T16:45:26Z

Review comments:
path: .github/codeql.yml
user: login: MrCreosote
body: Again I'm assuming these are the same workflows we're using everywhere else?
created_at: 2025-03-14T22:07:55Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: MrCreosote
body: Why such a low version?
created_at: 2025-03-14T22:08:42Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r requirements.txt
+          pip install -r dev-requirements.txt
+
+      - name: Run tests
+        shell: bash
+        run: |
+          docker compose up -d
+          sleep 10
path: .github/workflows/test.yml
user: login: MrCreosote
body: yuck but ok, that's what's in travis.yml
created_at: 2025-03-14T22:09:24Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r requirements.txt
+          pip install -r dev-requirements.txt
path: .github/workflows/test.yml
user: login: MrCreosote
body: Can you make an issue to upgrade to pipenv or something later?
created_at: 2025-03-14T22:10:12Z
author_association: MEMBER
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: MrCreosote
body: Could you also add a ticket to convert to pytest?
created_at: 2025-03-14T22:14:15Z
author_association: MEMBER
path: .github/codeql.yml
user: login: Xiangs18
body: yes
created_at: 2025-03-14T22:18:09Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: Xiangs18
body: Most of the other repos where we have done the Mongo upgrade are using this version. I'm trying to make it consistent here. If you prefer 3.11.x, that's fine. I don't have a strong opinion on this.
created_at: 2025-03-14T22:18:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: Xiangs18
body: Do you mean just this line, or the entire test codebase, from unittest to pytest?
created_at: 2025-03-14T22:20:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
+
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install -r requirements.txt
+          pip install -r dev-requirements.txt
path: .github/workflows/test.yml
user: login: Xiangs18
body: https://github.com/kbase/file_cache_server/issues/25
created_at: 2025-03-14T22:36:16Z
author_association: CONTRIBUTOR
path: .github/codeql.yml
user: login: MrCreosote
body: :+1: 
created_at: 2025-03-14T22:37:30Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: MrCreosote
body: I don't remember off the top of my head, but I think there were specific reasons why we used lower versions. If it's just as easy to go to a higher version go ahead and do it. Also make sure the test version and build version are aligned
created_at: 2025-03-14T22:38:52Z
author_association: MEMBER
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: MrCreosote
body: These 2 lines. pytest is compatible with unittest
created_at: 2025-03-14T22:39:17Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: Xiangs18
body: If we change the build version to 3.9.19, 19/39 tests would fail. If we want to git them fixed, I prefer to do them in the next PR. If we upgrade python version to 3.11.x, we need  more dep changes because of build error.
created_at: 2025-03-14T23:25:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: Xiangs18
body: converted to pytest
created_at: 2025-03-14T23:26:02Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: MrCreosote
body: Just leave it as 3.9 in that case, don't bother upgrading for now
created_at: 2025-03-14T23:29:44Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: MrCreosote
body: This still needs to be updated in the build I assume
created_at: 2025-03-14T23:31:12Z
author_association: MEMBER
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: MrCreosote
body: It's still using coverage to run the tests though?
created_at: 2025-03-14T23:31:24Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: Xiangs18
body: yes, so we need to create an issue for that as well.
created_at: 2025-03-14T23:42:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: MrCreosote
body: no, it needs to be updated in the build in this PR - the build and tests need to be aligned 
created_at: 2025-03-14T23:43:53Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: MrCreosote
body: E.g. https://github.com/kbase/file_cache_server/blob/develop/Dockerfile#L1 and maybe other placees
created_at: 2025-03-14T23:44:38Z
author_association: MEMBER
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: Xiangs18
body: It uses coverage to wrap the pytest run
created_at: 2025-03-14T23:54:44Z
author_association: CONTRIBUTOR
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: MrCreosote
body: Yeah. It should just look something like this: https://github.com/kbase/cdm-task-service/?tab=readme-ov-file#running-tests

There's no need to wrap it in coverage
created_at: 2025-03-15T00:03:31Z
author_association: MEMBER
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: Xiangs18
body: Ok. Done
created_at: 2025-03-15T00:36:11Z
author_association: CONTRIBUTOR
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: MrCreosote
body: Actually I just realized that there hasn't been a post from codecov so it seems that's not working yet...?
created_at: 2025-03-15T01:39:54Z
author_association: MEMBER
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: Xiangs18
body: I'm not sure; it seems like it cannot process the upload.
created_at: 2025-03-17T20:35:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: MrCreosote
body: Are you setting the right format for the coverage report? https://github.com/kbase/cdm-task-service/blob/main/.github/workflows/test.yml#L76
created_at: 2025-03-17T20:37:15Z
author_association: MEMBER
diff_hunk: @@ -6,4 +6,5 @@ flake8 --max-complexity 6 src/caching_service
 flake8 src/test
 mypy --ignore-missing-imports src
 bandit -r src/caching_service
-python -m unittest discover src/test/caching_service
+coverage run --source=src/caching_service -m unittest discover src/test/caching_service
+coverage report
path: scripts/run_tests.sh
user: login: Xiangs18
body: yeah, that's what I thought. Let's see if it passes this time.
created_at: 2025-03-17T20:49:18Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: Xiangs18
body: I commented out the mypy check to allow the tests to run. Let me know if you know how to fix [945b204](https://github.com/kbase/file_cache_server/actions/runs/13910923530/job/38924796828#step:5:686)
created_at: 2025-03-17T22:23:35Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+name: KBase File Cache Server test
+
+on:
+  pull_request:
+    types:
+    - opened
+    - reopened
+    - synchronize
+    - ready_for_review
+  push:
+    # run workflow when merging to main or develop
+    branches:
+      - main
+      - master
+      - develop
+
+jobs:
+  file_cache_server_tests:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Repo checkout
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: 3.9.19
path: .github/workflows/test.yml
user: login: MrCreosote
body: In my experience mypy isn't worth the trouble as long as you have reasonable tests. I like what it's trying to do but it seems too clunky (although I haven't tried it recently, maybe it's better now)
created_at: 2025-03-17T22:33:52Z
author_association: MEMBER

PR comments:
user: login: github-advanced-security[bot]
created_at: 2025-03-14T21:05:06Z
body: This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on [this overview](/kbase/file_cache_server/security/code-scanning?query=pr%3A24+is%3Aopen). Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out [the documentation](https://docs.github.com/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning). 
author_association: NONE
user: login: codecov[bot]
created_at: 2025-03-17T20:49:56Z
body: ## Welcome to [Codecov](https://codecov.io?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kbase) :tada:

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered :open_umbrella:
author_association: NONE
user: login: Xiangs18
created_at: 2025-03-17T22:47:06Z
body: I'm curious why the Makefile requires `docker compose run web sh scripts/run_tests.sh` instead of just `sh scripts/run_tests.sh`.
author_association: CONTRIBUTOR
user: login: MrCreosote
created_at: 2025-03-17T23:01:33Z
body: I'm just guessing but I assume the docker file is installing test dependencies that may not exist on the system.
author_association: MEMBER