From ca6d677fc239afdb98739b5fb3cdd891c8898bc9 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 9 Aug 2024 17:09:35 +0930 Subject: [PATCH 001/148] feat: add initial python test file --- .github/workflows/python.yaml | 360 ++++++++++++++++++++++++++++++++++ 1 file changed, 360 insertions(+) create mode 100644 .github/workflows/python.yaml diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml new file mode 100644 index 0000000..45ee8de --- /dev/null +++ b/.github/workflows/python.yaml @@ -0,0 +1,360 @@ +--- +name: 'Python' + + +on: + workflow_call: + secrets: + WORKFLOW_TOKEN: + description: "token to clone with" + required: true + + +jobs: + + + lint: + name: Lint + if: ${{ false }} + runs-on: ubuntu-latest + steps: + + - name: Create lint job + shell: bash + run: | + echo "Job does not exists as it needs to be created." + + + unit-test: + name: Unit Test + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['3.10', '3.11', '3.12'] + outputs: + unit-test-coverage: ${{ steps.run-unit-test.outputs.coverage }} + steps: + + + - uses: actions/checkout@v4 + + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements_test.txt + + + - name: Run Tests + id: run-unit-test + shell: bash + run: | + cd app; + pytest --cov --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --junit-xml=../unit.JUnit.xml **/tests/unit; + echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT + + + - name: Upload Test Report + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: unit-test-results-${{ matrix.python-version }} + path: unit.JUnit.xml + + + - name: Upload Coverage Report + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: coverage-report-${{ matrix.python-version }} + path: coverage.xml + + + - name: Upload Coverage + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: coverage-${{ matrix.python-version }} + path: coverage/* + + + # should only run on dev/master and tag + report: + name: Create Test Reports + needs: + - unit-test + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['3.10', '3.11', '3.12'] + steps: + + + - name: Test Report + if: success() || failure() + uses: dorny/test-reporter@v1 + id: test-report + with: + artifact: unit-test-results-${{ matrix.python-version }} + name: Unit Test Report [Python ${{ matrix.python-version }}] + path: '*.xml' + reporter: java-junit + + + - name: Create Shields.io Endpoint.json + if: success() || failure() + shell: bash + run: | + echo ' + { + "schemaVersion": 1, + "label": "Unit Test", + "message": "${{ steps.test-report.outputs.passed }} passed | ${{ steps.test-report.outputs.skipped }} skipped", + "logoSvg": "python-logo", + "color": "#4584b6", + "style": "plastic" + }' > endpoint_${{ matrix.python-version }}.json + + + - name: Upload Badge Endpoint json + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: unit-test-shield-endpoint-${{ matrix.python-version }} + path: endpoint_${{ matrix.python-version }}.json + + + + coverage-report: + name: Create Coverage report + needs: + - unit-test + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['3.12'] + steps: + + - name: Run Tests + shell: bash + run: | + ls -l; + + - name: Download Coverage Artifact + uses: actions/download-artifact@v4 + with: + name: coverage-report-${{ matrix.python-version }} + github-token: ${{ github.token }} + + - name: ls + shell: bash + if: success() || failure() + run: | + ls -l; + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: coverage.xml + badge: true + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: false + indicators: true + output: both + thresholds: '60 85' + + + - name: ls + shell: bash + if: success() || failure() + run: | + ls -l; + + + - name: create status check/comment for code coverage results + id: jest_coverage_check + uses: im-open/process-code-coverage-summary@v2.3.0 + with: + github-token: ${{ github.token }} + summary-file: code-coverage-results.md + create-pr-comment: true + update-comment-if-one-exists: true + update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" + + - name: Upload Coverage Summary + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: code-coverage-results-${{ matrix.python-version }} + path: code-coverage-results.md + + + + badge-endpoint: + name: Publish Badge endpoint files + if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }} + needs: + - unit-test + - report + strategy: + max-parallel: 4 + matrix: + python-version: ['3.12'] + runs-on: ubuntu-latest + steps: + + - name: Checkout Endpoint Repo + uses: actions/checkout@v4 + with: + repository: 'nofusscomputing/.github' + ref: 'master' + token: ${{ secrets.WORKFLOW_TOKEN }} + path: 'endpoint_publish' + fetch-depth: '1' + show-progress: true + submodules: false + + + - name: Create Publish Directories + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + cd endpoint_publish; + echo "[Debug] PWD[${PWD}]"; + mkdir -p repositories/${{ github.repository }}/${{ github.ref_name }}; + ls -la; + + + - name: Create Publish Directories + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + # cd repositories/${{ github.repository }}/${{ github.ref_name }}; + echo "[Debug] PWD[${PWD}]"; + + + - name: Download Badge Endpoint json + uses: actions/download-artifact@v4 + with: + name: unit-test-shield-endpoint-${{ matrix.python-version }} + + + - name: Add endpoint file + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + + echo "[Debug] **************************** - cd endpoint_publish"; + + cd endpoint_publish; + + echo "[Debug] **************************** - ls -la"; + + ls -la + + echo "[Debug] ****************************"; + + echo "[Debug] PWD[${PWD}]"; + + echo "[Debug] **************************** - ls -la ../"; + + ls -la ../ + + echo "[Debug] **************************** - cp ../endpoint_${{ matrix.python-version }}.json repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_unit_test.json"; + + cp ../endpoint_${{ matrix.python-version }}.json repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_unit_test.json; + + echo "[Debug] **************************** - ls -la repositories/${{ github.repository }}/${{ github.ref_name }}/"; + + ls -la repositories/${{ github.repository }}/${{ github.ref_name }}/; + + + + - name: Create Shields.io Endpoint.json for coverage + if: success() || failure() + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + cd endpoint_publish; + echo "[Debug] ****************************"; + + echo "[Debug] PWD[${PWD}]"; + + echo "[Debug] **************************** - create file"; + + echo ' + { + "schemaVersion": 1, + "label": "Unit Test Coverage", + "message": "${{ needs.unit-test.outputs.unit-test-coverage }}%", + "logoSvg": "python-logo", + "color": "#4584b6", + "style": "plastic" + }' > repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_coverage.json; + + echo "[Debug] **************************** cat repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_coverage.json"; + + cat repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_coverage.json; + + + + - name: Configure git + shell: bash + run: | + git config --global user.email "helpdesk@nofusscomputing.com"; + git config --global user.name "nfc-bot"; + + + - name: Git add + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git status; + echo "[Debug] ****************************"; + git add . + + - name: Git commit + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git commit -m "chore: add badge endpount file ${{ github.repository }}/${{ github.ref_name }}" + + + - name: git push + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git push From fdf66c6a286357c5fd5c0d620e43074668deeb3a Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 9 Aug 2024 20:44:11 +0930 Subject: [PATCH 002/148] docs(readme): add usage #1 nofusscomputing/centurion_erp#216 --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4990dab..40d762d 100644 --- a/README.md +++ b/README.md @@ -1 +1,30 @@ -# No Fuss Computing - GH Action / Workflow for Python Projects \ No newline at end of file +# No Fuss Computing - GH Action / Workflow for Python Projects + +To use this workflow within your project add a file at path `.github/workflows/ci.yaml` or add the job to your existing CI file. + + +``` yaml + +--- + +name: 'CI' + + +on: + push: + branches: + - '**' + tags: + - '*' + + +jobs: + + + python: + name: 'Python' + uses: nofusscomputing/action_python/.github/workflows/python.yaml@development + secrets: + WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} + +``` From f194d56a072cbef8bb5c9317f9e416116b6dc06a Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 Aug 2024 16:40:20 +0930 Subject: [PATCH 003/148] fix(badge): Dont attempt to commit if there are no changes fixes #3 https://github.com/nofusscomputing/centurion_erp/pull/209 https://github.com/nofusscomputing/centurion_erp/pull/214 --- .github/workflows/python.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 45ee8de..35f0bc8 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -318,6 +318,7 @@ jobs: - name: Git add + id: git-add shell: bash run: | echo "[Debug] PWD[${PWD}]"; @@ -330,9 +331,28 @@ jobs: echo "[Debug] ****************************"; git status; echo "[Debug] ****************************"; + + if [ "$(git status -s)" ]; + + echo "changed=true" > $GITHUB_OUTPUT; + + echo "[Info] Changes need to be committed"; + + else + + echo "changed=false" > $GITHUB_OUTPUT; + + echo "[Info] NO changes to be committed"; + + fi + + echo "[Debug] ****************************"; + git add . + - name: Git commit + if: ${{ steps.git-add.outputs.changed }} shell: bash run: | echo "[Debug] PWD[${PWD}]"; @@ -347,6 +367,7 @@ jobs: - name: git push + if: ${{ steps.git-add.outputs.changed }} shell: bash run: | echo "[Debug] PWD[${PWD}]"; From dd3a8c29322bbfc6f7147299c01dfa131bf1897a Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 Aug 2024 16:42:36 +0930 Subject: [PATCH 004/148] feat(badge): add number of failed tests to badge https://github.com/nofusscomputing/centurion_erp/pull/209 https://github.com/nofusscomputing/centurion_erp/pull/214 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 35f0bc8..f3e08cb 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -118,7 +118,7 @@ jobs: { "schemaVersion": 1, "label": "Unit Test", - "message": "${{ steps.test-report.outputs.passed }} passed | ${{ steps.test-report.outputs.skipped }} skipped", + "message": "${{ steps.test-report.outputs.passed }} passed | ${{ steps.test-report.outputs.skipped }} skipped | ${{ steps.test-report.outputs.failed }} failed", "logoSvg": "python-logo", "color": "#4584b6", "style": "plastic" From 5dea0502bdf99837a5a1af16962b028aa6cb12dd Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 Aug 2024 16:44:57 +0930 Subject: [PATCH 005/148] ci(pr): add pull request workflow closes #4 --- .github/workflows/pull_request.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/pull_request.yaml diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..dd7861b --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,15 @@ + +--- + +name: Pull Requests + + +on: + pull_request: {} + + +jobs: + + pull-requests: + name: Pull Request + uses: nofusscomputing/action_pull_requests/.github/workflows/pull-requests.yaml@development From 0d09b7ce58ec6e8e2172fa026c71751b8fa4b203 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 Aug 2024 16:53:41 +0930 Subject: [PATCH 006/148] fix(badge): correct syntax error in git add fixes #3 https://github.com/nofusscomputing/centurion_erp/pull/209 https://github.com/nofusscomputing/centurion_erp/pull/214 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index f3e08cb..60cf1ba 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -332,7 +332,7 @@ jobs: git status; echo "[Debug] ****************************"; - if [ "$(git status -s)" ]; + if [ "$(git status -s)" ]; then echo "changed=true" > $GITHUB_OUTPUT; From dcc1dd96a27b11502436a49b57884266d127a0a9 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 Aug 2024 17:02:00 +0930 Subject: [PATCH 007/148] fix(badge): correct logic to use string check fixes #3 https://github.com/nofusscomputing/centurion_erp/pull/209 https://github.com/nofusscomputing/centurion_erp/pull/214 --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 60cf1ba..edab55b 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -352,7 +352,7 @@ jobs: - name: Git commit - if: ${{ steps.git-add.outputs.changed }} + if: ${{ steps.git-add.outputs.changed == 'true' }} shell: bash run: | echo "[Debug] PWD[${PWD}]"; @@ -367,7 +367,7 @@ jobs: - name: git push - if: ${{ steps.git-add.outputs.changed }} + if: ${{ steps.git-add.outputs.changed == 'true' }} shell: bash run: | echo "[Debug] PWD[${PWD}]"; From e98aecd331f5f2fef59a3f29ef2a85b998225c7a Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 11 Aug 2024 19:53:40 +0930 Subject: [PATCH 008/148] feat: add pip file scanning .#9 https://github.com/nofusscomputing/centurion_erp/pull/209 fixes #9 --- .github/workflows/python.yaml | 224 ++++++++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index edab55b..6a21c2a 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -379,3 +379,227 @@ jobs: echo "[Debug] PWD[${PWD}]"; echo "[Debug] ****************************"; git push + + + vulnerability-scan: + name: PIP file Scan (requirements.txt) + runs-on: ubuntu-latest + steps: + + + - uses: actions/checkout@v4 + + + - name: Run Trivy vulnerability scanner against requirements.txt + uses: aquasecurity/trivy-action@0.20.0 + with: + scan-type: 'fs' + ignore-unfixed: false + format: 'sarif' + output: 'trivy-results.sarif' + severity: 'LOW,MEDIUM,HIGH,CRITICAL' + scan-ref: requirements.txt + exit-code: 0 + + + - name: Upload requirements.txt scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: 'trivy-results.sarif' + + + - name: Run Trivy vulnerability scanner against requirements.txt (json Report) + uses: aquasecurity/trivy-action@0.20.0 + with: + scan-type: 'fs' + ignore-unfixed: false + format: 'json' + output: 'scan-results.json' + severity: 'LOW,MEDIUM,HIGH,CRITICAL' + scan-ref: requirements.txt + exit-code: 0 + + + - name: Upload scan results (json Report) + uses: actions/upload-artifact@v4 + with: + name: python-scan-results-json + path: scan-results.json + + + + vulnerability-report: + name: Create Reports + needs: + - vulnerability-scan + runs-on: ubuntu-latest + steps: + + + - name: Fetch scan results (json Report) + uses: actions/download-artifact@v4 + with: + name: python-scan-results-json + + + - name: Create Vulnerabilities (Critical/High) + run: | + echo "[Debug] jq -r '.Results'=$(jq -r '.Results' scan-results.json)"; + + if [ "$(jq -r '.Results' scan-results.json)" ]; then + + not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; + + else + + not_empty=""; + + fi + + echo "[Debug] not_empty=${not_empty}"; + + jq -r ' + [ + "# Python Scan Results (requirements.txt)", + "", + "**Scan Date:** _" + ( .CreatedAt // "" ) + "_", + "**File:** _" + ( .ArtifactName // "" ) + "_", + "" + ] | join("\n") + ' scan-results.json > vulnerability-report.md + + if [ "$not_empty" ]; then + jq -r ' + def hr(severity): + if severity == "HIGH" or severity == "CRITICAL" then true else false end; + def to_md: + "| " + (.VulnerabilityID // "") + " | " + (.PkgName // "") + " | " + (.InstalledVersion // "") + " | " + (.Severity // "") + " | " + (.Title // "") + " |"; + [ + "## High and Critical Vulnerabilities", + "", + "| Vulnerability ID | Package | Version | Severity | Description |", + "| --------- | ----- | ----- | ----- | -------|", + (.Results[] | .Vulnerabilities[] | select(hr(.Severity)) | to_md), + "" + ] | join("\n") + ' scan-results.json >> vulnerability-report.md + + else + + echo "**Nothing Found**" >> vulnerability-report.md + + fi; + + + + - name: Create Full Vulnerabilities + run: | + echo "[Debug] jq -r '.Results'=$(jq -r '.Results' scan-results.json)"; + + if [ "$(jq -r '.Results' scan-results.json)" ]; then + + not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; + + else + + not_empty=""; + + fi + + echo "[Debug] not_empty=${not_empty}"; + + + jq -r ' + [ + "# Full Scan Results", + "", + "**Scan Date:** _" + ( .CreatedAt // "" ) + "_", + "**File:** _" + ( .ArtifactName // "" ) + "_", + "" + ] | join("\n") + ' scan-results.json > full-vulnerability-report.md + + if [ "$not_empty" ]; then + jq -r ' + def hr(severity): + if severity == "HIGH" or severity == "CRITICAL" then true else true end; + def to_md: + "| " + (.VulnerabilityID // "") + " | " + (.PkgName // "") + " | " + (.InstalledVersion // "") + " | " + (.Severity // "") + " | " + (.Title // "") + " |"; + [ + "## Vulnerabilities", + "", + "| Vulnerability ID | Package | Version | Severity | Description |", + "| --------- | ----- | ----- | ----- | -------|", + (.Results[] | .Vulnerabilities[] | select(.Severity) | to_md), + "" + ] | join("\n") + ' scan-results.json >> full-vulnerability-report.md + + else + + echo "**Nothing Found**" >> full-vulnerability-report.md + + fi; + + + - name: Upload scan results + uses: actions/upload-artifact@v4 + with: + name: python-vulnerability-report + path: vulnerability-report.md + + + - name: Upload scan results + uses: actions/upload-artifact@v4 + with: + name: python-vulnerability-report-full + path: full-vulnerability-report.md + + + - uses: dtinth/markdown-report-action@v1 + with: + name: Python Vulnerability Report + title: Python Vulnerability Report + body-file: full-vulnerability-report.md + + + + pull-request-report-comment: + if: ${{ github.ref_type != 'tag' }} + needs: + - vulnerability-scan + - vulnerability-report + runs-on: ubuntu-latest + name: Comment on Pull Request (Python Scan) + steps: + + + - name: Find Current Pull Request + uses: jwalton/gh-find-current-pr@v1 + id: finder + + + - name: Fetch Vulnerability Report + if: ${{ steps.finder.outputs.pr != '' }} + uses: actions/download-artifact@v4 + with: + name: python-vulnerability-report + + + - name: Capture scan results + if: ${{ steps.finder.outputs.pr != '' }} + run: | + content=$(cat vulnerability-report.md | head -c 65000) + echo "report<> $GITHUB_ENV + echo "$content" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + + - name: Comment scan results on PR + if: ${{ steps.finder.outputs.pr != '' }} + uses: marocchino/sticky-pull-request-comment@v2 + with: + number: ${{ steps.finder.outputs.pr }} + header: Python requirements.txt Scan Results + message: | + ${{ env.report }} From d44dfbf8589b598913261ec26214749fad7827ff Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 11 Aug 2024 21:47:52 +0930 Subject: [PATCH 009/148] fix:(report): dont process on empty --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 6a21c2a..3b831f1 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -446,7 +446,7 @@ jobs: run: | echo "[Debug] jq -r '.Results'=$(jq -r '.Results' scan-results.json)"; - if [ "$(jq -r '.Results' scan-results.json)" ]; then + if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] || [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; @@ -496,7 +496,7 @@ jobs: run: | echo "[Debug] jq -r '.Results'=$(jq -r '.Results' scan-results.json)"; - if [ "$(jq -r '.Results' scan-results.json)" ]; then + if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] || [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; From 0f3febce7c164f1f3f26eb1c9891f22406a5f06e Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 11 Aug 2024 21:54:07 +0930 Subject: [PATCH 010/148] fix:(report): dont process on empty again --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 3b831f1..1260c60 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -446,7 +446,7 @@ jobs: run: | echo "[Debug] jq -r '.Results'=$(jq -r '.Results' scan-results.json)"; - if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] || [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then + if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; @@ -496,7 +496,7 @@ jobs: run: | echo "[Debug] jq -r '.Results'=$(jq -r '.Results' scan-results.json)"; - if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] || [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then + if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; From f6b93224c87c19d3a3515ab457bb7af00e0a29b5 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 11 Aug 2024 22:04:25 +0930 Subject: [PATCH 011/148] feat(pr_comment): bumpt to v 1.3.3 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 1260c60..38e8540 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -575,7 +575,7 @@ jobs: - name: Find Current Pull Request - uses: jwalton/gh-find-current-pr@v1 + uses: jwalton/gh-find-current-pr@89ee5799558265a1e0e31fab792ebb4ee91c016b #v1.3.3 id: finder From 560703b44f8aff23b77238321bbcc75b0a31a7ed Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 13 Oct 2024 14:21:00 +0930 Subject: [PATCH 012/148] fix(unit_test): add continue on error --- .github/workflows/python.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 38e8540..4b7da71 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -34,6 +34,7 @@ jobs: python-version: ['3.10', '3.11', '3.12'] outputs: unit-test-coverage: ${{ steps.run-unit-test.outputs.coverage }} + continue-on-error: true steps: @@ -55,6 +56,7 @@ jobs: - name: Run Tests id: run-unit-test + continue-on-error: true shell: bash run: | cd app; @@ -577,6 +579,8 @@ jobs: - name: Find Current Pull Request uses: jwalton/gh-find-current-pr@89ee5799558265a1e0e31fab792ebb4ee91c016b #v1.3.3 id: finder + with: + sha: ${{ github.event.pull_request.head.sha }} - name: Fetch Vulnerability Report From 906d3f49fb1e6914810c43de932dc63de9f84d34 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 15 Oct 2024 00:36:39 +0930 Subject: [PATCH 013/148] fix(pr_comment): remove specifying sha --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 4b7da71..8e850d9 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -579,8 +579,8 @@ jobs: - name: Find Current Pull Request uses: jwalton/gh-find-current-pr@89ee5799558265a1e0e31fab792ebb4ee91c016b #v1.3.3 id: finder - with: - sha: ${{ github.event.pull_request.head.sha }} + # with: + # sha: ${{ github.event.pull_request.head.sha }} - name: Fetch Vulnerability Report From 1d18ee1158aed121f9c1f164fbc5aaa1581c613b Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 22 Oct 2024 19:05:54 +0930 Subject: [PATCH 014/148] feat(trivy): update action 0.20.0 -> 0.28.0 --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 8e850d9..3f3373e 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -393,7 +393,7 @@ jobs: - name: Run Trivy vulnerability scanner against requirements.txt - uses: aquasecurity/trivy-action@0.20.0 + uses: aquasecurity/trivy-action@0.28.0 with: scan-type: 'fs' ignore-unfixed: false @@ -411,7 +411,7 @@ jobs: - name: Run Trivy vulnerability scanner against requirements.txt (json Report) - uses: aquasecurity/trivy-action@0.20.0 + uses: aquasecurity/trivy-action@0.28.0 with: scan-type: 'fs' ignore-unfixed: false From 46acf3e160f80d8406b945efd900847a7f4a12d9 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 23 Oct 2024 15:11:09 +0930 Subject: [PATCH 015/148] fix(report): ensure if report empty no attempt to create is made --- .github/workflows/python.yaml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 3f3373e..657e21e 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -450,7 +450,15 @@ jobs: if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then - not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; + if [ "$(jq -r '.Results[] | .Vulnerabilities' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results[] | .Vulnerabilities' scan-results.json)" != '0' ]; then + + not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; + + else + + not_empty=""; + + fi else @@ -500,7 +508,15 @@ jobs: if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then - not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; + if [ "$(jq -r '.Results[] | .Vulnerabilities' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results[] | .Vulnerabilities' scan-results.json)" != '0' ]; then + + not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; + + else + + not_empty=""; + + fi else @@ -508,6 +524,7 @@ jobs: fi + echo "[Debug] not_empty=${not_empty}"; From 6bd9c99381dc44e5927e3d492669b293c4e8ce49 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 23 Oct 2024 18:25:40 +0930 Subject: [PATCH 016/148] feat(python): add python 3.13 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 657e21e..8b29836 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -31,7 +31,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13'] outputs: unit-test-coverage: ${{ steps.run-unit-test.outputs.coverage }} continue-on-error: true From eb59489183fec8c53843bbb7e22ca18cafef5848 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 24 Oct 2024 13:35:31 +0930 Subject: [PATCH 017/148] feat(python): add python 3.13 report creation --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 8b29836..b989927 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -97,7 +97,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: From d74afadac2a4ca949f85bd82d14a0f40eb27683d Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 29 Oct 2024 22:13:14 +0930 Subject: [PATCH 018/148] fix(trivy): use public mirror for trivy-db image ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index b989927..60ff1c7 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -10,6 +10,10 @@ on: required: true +env: + TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 + + jobs: From 6335e187525acba425f72fc1fe6d8397450b893c Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 17:30:55 +0930 Subject: [PATCH 019/148] fix(test): Add functional tests ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 358 ++++++++++++++++++++++++++++++++++ 1 file changed, 358 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 60ff1c7..4647c79 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -92,6 +92,69 @@ jobs: path: coverage/* + functional-test: + name: Functional Test + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + outputs: + functional-test-coverage: ${{ steps.run-functional-test.outputs.coverage }} + continue-on-error: true + steps: + + + - uses: actions/checkout@v4 + + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements_test.txt + + + - name: Run Tests + id: run-functional-test + continue-on-error: true + shell: bash + run: | + cd app; + pytest --cov --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --junit-xml=../functional.JUnit.xml **/tests/functional; + echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT + + + - name: Upload Test Report + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: functional-test-results-${{ matrix.python-version }} + path: functional.JUnit.xml + + + - name: Upload Coverage Report + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: functional-coverage-report-${{ matrix.python-version }} + path: functional-coverage.xml + + + - name: Upload Coverage + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: functional-coverage-${{ matrix.python-version }} + path: coverage/functional/* + + # should only run on dev/master and tag report: name: Create Test Reports @@ -139,6 +202,53 @@ jobs: path: endpoint_${{ matrix.python-version }}.json + # should only run on dev/master and tag + functional-report: + name: Create Test Reports + needs: + - functional-test + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + steps: + + + - name: Test Report + if: success() || failure() + uses: dorny/test-reporter@v1 + id: test-report + with: + artifact: functional-test-results-${{ matrix.python-version }} + name: Functional Test Report [Python ${{ matrix.python-version }}] + path: '*.xml' + reporter: java-junit + + + - name: Create Shields.io Endpoint.json + if: success() || failure() + shell: bash + run: | + echo ' + { + "schemaVersion": 1, + "label": "Functional Test", + "message": "${{ steps.test-report.outputs.passed }} passed | ${{ steps.test-report.outputs.skipped }} skipped | ${{ steps.test-report.outputs.failed }} failed", + "logoSvg": "python-logo", + "color": "#4584b6", + "style": "plastic" + }' > endpoint_functional_${{ matrix.python-version }}.json + + + - name: Upload Badge Endpoint json + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: functional-test-shield-endpoint-${{ matrix.python-version }} + path: endpoint_functional_${{ matrix.python-version }}.json + + coverage-report: name: Create Coverage report @@ -208,6 +318,74 @@ jobs: + coverage-report-functional: + name: Create Coverage report (Functional) + needs: + - unit-test + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['3.12'] + steps: + + - name: Run Tests + shell: bash + run: | + ls -l; + + - name: Download Coverage Artifact + uses: actions/download-artifact@v4 + with: + name: functional-coverage-report-${{ matrix.python-version }} + github-token: ${{ github.token }} + + - name: ls + shell: bash + if: success() || failure() + run: | + ls -l; + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: functional-coverage.xml + badge: true + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: false + indicators: true + output: both + thresholds: '60 85' + + + - name: ls + shell: bash + if: success() || failure() + run: | + ls -l; + + + - name: create status check/comment for code coverage results + id: jest_coverage_check + uses: im-open/process-code-coverage-summary@v2.3.0 + with: + github-token: ${{ github.token }} + summary-file: code-coverage-results.md + create-pr-comment: true + update-comment-if-one-exists: true + update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" + + - name: Upload Coverage Summary + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: code-coverage-results-${{ matrix.python-version }} + path: code-coverage-results.md + + + badge-endpoint: name: Publish Badge endpoint files if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }} @@ -387,6 +565,186 @@ jobs: git push + + badge-endpoint-functional: + name: Publish Badge endpoint files + if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }} + needs: + - functional-test + - functional-report + strategy: + max-parallel: 4 + matrix: + python-version: ['3.12'] + runs-on: ubuntu-latest + steps: + + - name: Checkout Endpoint Repo + uses: actions/checkout@v4 + with: + repository: 'nofusscomputing/.github' + ref: 'master' + token: ${{ secrets.WORKFLOW_TOKEN }} + path: 'endpoint_publish' + fetch-depth: '1' + show-progress: true + submodules: false + + + - name: Create Publish Directories + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + cd endpoint_publish; + echo "[Debug] PWD[${PWD}]"; + mkdir -p repositories/${{ github.repository }}/${{ github.ref_name }}; + ls -la; + + + - name: Create Publish Directories + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + # cd repositories/${{ github.repository }}/${{ github.ref_name }}; + echo "[Debug] PWD[${PWD}]"; + + + - name: Download Badge Endpoint json + uses: actions/download-artifact@v4 + with: + name: functional-test-shield-endpoint-${{ matrix.python-version }} + + + - name: Add endpoint file + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + + echo "[Debug] **************************** - cd endpoint_publish"; + + cd endpoint_publish; + + echo "[Debug] **************************** - ls -la"; + + ls -la + + echo "[Debug] ****************************"; + + echo "[Debug] PWD[${PWD}]"; + + echo "[Debug] **************************** - ls -la ../"; + + ls -la ../ + + echo "[Debug] **************************** - cp ../endpoint_functional_${{ matrix.python-version }}.json repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_functional_test.json"; + + cp ../endpoint_functional_${{ matrix.python-version }}.json repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_functional_test.json; + + echo "[Debug] **************************** - ls -la repositories/${{ github.repository }}/${{ github.ref_name }}/"; + + ls -la repositories/${{ github.repository }}/${{ github.ref_name }}/; + + + + - name: Create Shields.io Endpoint.json for coverage + if: success() || failure() + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + cd endpoint_publish; + echo "[Debug] ****************************"; + + echo "[Debug] PWD[${PWD}]"; + + echo "[Debug] **************************** - create file"; + + echo ' + { + "schemaVersion": 1, + "label": "Functional Test Coverage", + "message": "${{ needs.functional-test.outputs.functional-test-coverage }}%", + "logoSvg": "python-logo", + "color": "#4584b6", + "style": "plastic" + }' > repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_coverage_functional.json; + + echo "[Debug] **************************** cat repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_coverage_functional.json"; + + cat repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_coverage_functional.json; + + + + - name: Configure git + shell: bash + run: | + git config --global user.email "helpdesk@nofusscomputing.com"; + git config --global user.name "nfc-bot"; + + + - name: Git add + id: git-add + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git status; + echo "[Debug] ****************************"; + + if [ "$(git status -s)" ]; then + + echo "changed=true" > $GITHUB_OUTPUT; + + echo "[Info] Changes need to be committed"; + + else + + echo "changed=false" > $GITHUB_OUTPUT; + + echo "[Info] NO changes to be committed"; + + fi + + echo "[Debug] ****************************"; + + git add . + + + - name: Git commit + if: ${{ steps.git-add.outputs.changed == 'true' }} + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git commit -m "chore: add badge endpount file ${{ github.repository }}/${{ github.ref_name }}" + + + - name: git push + if: ${{ steps.git-add.outputs.changed == 'true' }} + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git push + + vulnerability-scan: name: PIP file Scan (requirements.txt) runs-on: ubuntu-latest From e72114dcb9feb13ccaa23f06985bde3cf242e72e Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 17:32:46 +0930 Subject: [PATCH 020/148] fix(test): correct functional tests job names ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 4647c79..5751bed 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -204,7 +204,7 @@ jobs: # should only run on dev/master and tag functional-report: - name: Create Test Reports + name: Create Test Reports (Functional) needs: - functional-test runs-on: ubuntu-latest @@ -567,7 +567,7 @@ jobs: badge-endpoint-functional: - name: Publish Badge endpoint files + name: Publish Badge endpoint files (Functional) if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }} needs: - functional-test From 2effcec8043526c68c7f0c4ff872e10505eef628 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 17:34:25 +0930 Subject: [PATCH 021/148] fix(test): correct functional test dependency ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 5751bed..fd34705 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -321,7 +321,7 @@ jobs: coverage-report-functional: name: Create Coverage report (Functional) needs: - - unit-test + - functional-test runs-on: ubuntu-latest strategy: max-parallel: 4 From 034fab96a3a1f47084586a07364d423aecb69a6e Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 18:08:36 +0930 Subject: [PATCH 022/148] fix(test): continue creating report on error ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index fd34705..0ab91a2 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -212,6 +212,7 @@ jobs: max-parallel: 4 matrix: python-version: ['3.10', '3.11', '3.12', '3.13'] + continue-on-error: true steps: @@ -327,6 +328,7 @@ jobs: max-parallel: 4 matrix: python-version: ['3.12'] + continue-on-error: true steps: - name: Run Tests From 5a9be6d6b78bd6532b90f420d935d9c5d2c09ccf Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 18:12:35 +0930 Subject: [PATCH 023/148] fix(test): continue creating report on step error ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 0ab91a2..27e1dc4 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -281,6 +281,7 @@ jobs: - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 + if: success() || failure() with: filename: coverage.xml badge: true @@ -303,6 +304,7 @@ jobs: - name: create status check/comment for code coverage results id: jest_coverage_check uses: im-open/process-code-coverage-summary@v2.3.0 + if: success() || failure() with: github-token: ${{ github.token }} summary-file: code-coverage-results.md @@ -350,6 +352,7 @@ jobs: - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 + if: success() || failure() with: filename: functional-coverage.xml badge: true @@ -372,6 +375,7 @@ jobs: - name: create status check/comment for code coverage results id: jest_coverage_check uses: im-open/process-code-coverage-summary@v2.3.0 + if: success() || failure() with: github-token: ${{ github.token }} summary-file: code-coverage-results.md From ac517cdf21cafa00c1c8ad4f5475d0f483718740 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 18:31:29 +0930 Subject: [PATCH 024/148] feat(test): give status check coverage report a name ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 27e1dc4..58628ab 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -379,6 +379,7 @@ jobs: with: github-token: ${{ github.token }} summary-file: code-coverage-results.md + check-name: 'Functional Code Coverage' create-pr-comment: true update-comment-if-one-exists: true update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" From cc2ebbc042d17a7576ce014aa9645503c5935dd2 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 19:02:46 +0930 Subject: [PATCH 025/148] fix(test): removce cont on error and use failure steps ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 58628ab..17d6b35 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -212,7 +212,6 @@ jobs: max-parallel: 4 matrix: python-version: ['3.10', '3.11', '3.12', '3.13'] - continue-on-error: true steps: @@ -330,7 +329,6 @@ jobs: max-parallel: 4 matrix: python-version: ['3.12'] - continue-on-error: true steps: - name: Run Tests @@ -340,6 +338,7 @@ jobs: - name: Download Coverage Artifact uses: actions/download-artifact@v4 + if: success() || failure() with: name: functional-coverage-report-${{ matrix.python-version }} github-token: ${{ github.token }} From edf19079b6c3b198e39cba9844a6461ab17d06c9 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 19:16:40 +0930 Subject: [PATCH 026/148] fix(test): remvce failure from step for report creation ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 17d6b35..451dc47 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -169,7 +169,6 @@ jobs: - name: Test Report - if: success() || failure() uses: dorny/test-reporter@v1 id: test-report with: @@ -216,7 +215,6 @@ jobs: - name: Test Report - if: success() || failure() uses: dorny/test-reporter@v1 id: test-report with: From 41e337c8a0e14018d8fda25a71fc29de3e2da792 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 19:20:31 +0930 Subject: [PATCH 027/148] fix(test): fix coverage results rpt name for functional ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 451dc47..2bf96a6 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -375,7 +375,7 @@ jobs: if: success() || failure() with: github-token: ${{ github.token }} - summary-file: code-coverage-results.md + summary-file: functional-code-coverage-results.md check-name: 'Functional Code Coverage' create-pr-comment: true update-comment-if-one-exists: true @@ -385,8 +385,8 @@ jobs: uses: actions/upload-artifact@v4 if: success() || failure() with: - name: code-coverage-results-${{ matrix.python-version }} - path: code-coverage-results.md + name: functional-code-coverage-results-${{ matrix.python-version }} + path: functional-code-coverage-results.md From b726d326f0b18ac1e24ae19516ebd95ba6ff562d Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 19:34:25 +0930 Subject: [PATCH 028/148] fix(test): when creating reports dont fail on error ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 2bf96a6..ab5d924 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -176,6 +176,7 @@ jobs: name: Unit Test Report [Python ${{ matrix.python-version }}] path: '*.xml' reporter: java-junit + fail-on-error: false - name: Create Shields.io Endpoint.json @@ -222,6 +223,7 @@ jobs: name: Functional Test Report [Python ${{ matrix.python-version }}] path: '*.xml' reporter: java-junit + fail-on-error: false - name: Create Shields.io Endpoint.json @@ -375,7 +377,7 @@ jobs: if: success() || failure() with: github-token: ${{ github.token }} - summary-file: functional-code-coverage-results.md + summary-file: code-coverage-results.md check-name: 'Functional Code Coverage' create-pr-comment: true update-comment-if-one-exists: true @@ -386,7 +388,7 @@ jobs: if: success() || failure() with: name: functional-code-coverage-results-${{ matrix.python-version }} - path: functional-code-coverage-results.md + path: code-coverage-results.md From f37b62564ef6c71fd9ae066b4d3a597e3ea8a8fc Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 19:59:31 +0930 Subject: [PATCH 029/148] fix(test): remove success,failure from Code Coverage Report ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index ab5d924..62b746c 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -280,7 +280,6 @@ jobs: - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 - if: success() || failure() with: filename: coverage.xml badge: true @@ -351,7 +350,6 @@ jobs: - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 - if: success() || failure() with: filename: functional-coverage.xml badge: true From 0097c0f26c7b4ebb570d67d3de35839d34c9fb8b Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 20:14:29 +0930 Subject: [PATCH 030/148] fix(test): remove fail-on-error ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 62b746c..3dc5367 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -176,7 +176,7 @@ jobs: name: Unit Test Report [Python ${{ matrix.python-version }}] path: '*.xml' reporter: java-junit - fail-on-error: false + # fail-on-error: false - name: Create Shields.io Endpoint.json @@ -223,7 +223,7 @@ jobs: name: Functional Test Report [Python ${{ matrix.python-version }}] path: '*.xml' reporter: java-junit - fail-on-error: false + # fail-on-error: false - name: Create Shields.io Endpoint.json From d2df82ddf30e768e417878dc5a66d9acd12f6700 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 20:38:39 +0930 Subject: [PATCH 031/148] revert(test): revert step report to pre functional test ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 3dc5367..249837f 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -169,6 +169,7 @@ jobs: - name: Test Report + if: success() || failure() uses: dorny/test-reporter@v1 id: test-report with: @@ -176,7 +177,6 @@ jobs: name: Unit Test Report [Python ${{ matrix.python-version }}] path: '*.xml' reporter: java-junit - # fail-on-error: false - name: Create Shields.io Endpoint.json From 08e4f78cc9e66dfbc0590fcd38b86d7e360bc479 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 20:48:19 +0930 Subject: [PATCH 032/148] feat(trace): show dir contents ref: https://github.com/nofusscomputing/action_python/issues/10 --- .github/workflows/python.yaml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 249837f..eea5c86 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -167,7 +167,13 @@ jobs: python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - + + - name: Trace 'ls -la' + shell: bash + run: | + ls -la; + + - name: Test Report if: success() || failure() uses: dorny/test-reporter@v1 @@ -179,6 +185,13 @@ jobs: reporter: java-junit + - name: Trace 'ls -la' + if: success() || failure() + shell: bash + run: | + ls -la; + + - name: Create Shields.io Endpoint.json if: success() || failure() shell: bash @@ -214,7 +227,13 @@ jobs: python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - + + - name: Trace 'ls -la' + shell: bash + run: | + ls -la; + + - name: Test Report uses: dorny/test-reporter@v1 id: test-report @@ -226,6 +245,13 @@ jobs: # fail-on-error: false + - name: Trace 'ls -la' + if: success() || failure() + shell: bash + run: | + ls -la; + + - name: Create Shields.io Endpoint.json if: success() || failure() shell: bash From f250cc233f3af057283960db6b69d936de00a91b Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 21:08:03 +0930 Subject: [PATCH 033/148] fix(report): use manual download of test report --- .github/workflows/python.yaml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index eea5c86..adfb269 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -168,6 +168,19 @@ jobs: steps: + - name: Trace 'ls -la' + shell: bash + run: | + ls -la; + + + - name: Download Test Report + uses: actions/download-artifact@v4 + if: success() || failure() + with: + name: unit-test-results-${{ matrix.python-version }} + + - name: Trace 'ls -la' shell: bash run: | @@ -179,7 +192,7 @@ jobs: uses: dorny/test-reporter@v1 id: test-report with: - artifact: unit-test-results-${{ matrix.python-version }} + # artifact: unit-test-results-${{ matrix.python-version }} name: Unit Test Report [Python ${{ matrix.python-version }}] path: '*.xml' reporter: java-junit @@ -228,6 +241,19 @@ jobs: steps: + - name: Trace 'ls -la' + shell: bash + run: | + ls -la; + + + - name: Download Test Report + uses: actions/download-artifact@v4 + if: success() || failure() + with: + name: functional-test-results-${{ matrix.python-version }} + + - name: Trace 'ls -la' shell: bash run: | @@ -238,7 +264,7 @@ jobs: uses: dorny/test-reporter@v1 id: test-report with: - artifact: functional-test-results-${{ matrix.python-version }} + # artifact: functional-test-results-${{ matrix.python-version }} name: Functional Test Report [Python ${{ matrix.python-version }}] path: '*.xml' reporter: java-junit From d139e7f9c0a479fbd751ff54e39e8443542c0b6b Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 7 Nov 2024 21:15:54 +0930 Subject: [PATCH 034/148] fix(report): now requires checkout due to dorny doing git ls --- .github/workflows/python.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index adfb269..b7e310b 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -168,6 +168,9 @@ jobs: steps: + - uses: actions/checkout@v4 + + - name: Trace 'ls -la' shell: bash run: | @@ -241,6 +244,9 @@ jobs: steps: + - uses: actions/checkout@v4 + + - name: Trace 'ls -la' shell: bash run: | From 3cf43a31a53d6495961e4b7cb820e5a47060240e Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 17 Jan 2025 01:21:22 +0930 Subject: [PATCH 035/148] fix(pytest): show output --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index b7e310b..410913c 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -64,7 +64,7 @@ jobs: shell: bash run: | cd app; - pytest --cov --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --junit-xml=../unit.JUnit.xml **/tests/unit; + pytest -s --cov --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --junit-xml=../unit.JUnit.xml **/tests/unit; echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT @@ -127,7 +127,7 @@ jobs: shell: bash run: | cd app; - pytest --cov --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --junit-xml=../functional.JUnit.xml **/tests/functional; + pytest -s --cov --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --junit-xml=../functional.JUnit.xml **/tests/functional; echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT From 1a1417df6e8c244d48f7fda91f766a4d29a1b543 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 4 Feb 2025 02:30:13 +0930 Subject: [PATCH 036/148] feat(pytest): add full trace and locals out on error --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 410913c..b61982d 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -64,7 +64,7 @@ jobs: shell: bash run: | cd app; - pytest -s --cov --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --junit-xml=../unit.JUnit.xml **/tests/unit; + pytest -s -v --full-trace --showlocals --cov --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --junit-xml=../unit.JUnit.xml **/tests/unit; echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT @@ -127,7 +127,7 @@ jobs: shell: bash run: | cd app; - pytest -s --cov --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --junit-xml=../functional.JUnit.xml **/tests/functional; + pytest -s -v --full-trace --showlocals --cov --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --junit-xml=../functional.JUnit.xml **/tests/functional; echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT From f0f3bbe78d58bcac38e227e3d9b4dc3889e1609e Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 12 Apr 2025 17:17:46 +0930 Subject: [PATCH 037/148] feat(pytest): add branch coverage --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index b61982d..2b83b19 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -64,7 +64,7 @@ jobs: shell: bash run: | cd app; - pytest -s -v --full-trace --showlocals --cov --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --junit-xml=../unit.JUnit.xml **/tests/unit; + pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --junit-xml=../unit.JUnit.xml **/tests/unit; echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT @@ -127,7 +127,7 @@ jobs: shell: bash run: | cd app; - pytest -s -v --full-trace --showlocals --cov --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --junit-xml=../functional.JUnit.xml **/tests/functional; + pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --junit-xml=../functional.JUnit.xml **/tests/functional; echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT From d2a333ccfc7a82e6456049e3b3739580d92310da Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 13 Apr 2025 16:26:11 +0930 Subject: [PATCH 038/148] feat(pytest): add branch coverage to badge --- .github/workflows/python.yaml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 2b83b19..eefc457 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -38,6 +38,7 @@ jobs: python-version: ['3.10', '3.11', '3.12', '3.13'] outputs: unit-test-coverage: ${{ steps.run-unit-test.outputs.coverage }} + unit-test-branch_coverage: ${{ steps.run-unit-test.outputs.branch_coverage }} continue-on-error: true steps: @@ -64,8 +65,9 @@ jobs: shell: bash run: | cd app; - pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --junit-xml=../unit.JUnit.xml **/tests/unit; + pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --cov-report json:../coverage_unit.json --junit-xml=../unit.JUnit.xml **/tests/unit; echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT + echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' ../coverage_unit.json) $(jq -r '.totals.num_branches' ../coverage_unit.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT - name: Upload Test Report @@ -84,6 +86,14 @@ jobs: path: coverage.xml + - name: Upload Coverage Report (json) + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: coverage-report-json-${{ matrix.python-version }} + path: coverage_unit.json + + - name: Upload Coverage uses: actions/upload-artifact@v4 if: success() || failure() @@ -101,6 +111,7 @@ jobs: python-version: ['3.10', '3.11', '3.12', '3.13'] outputs: functional-test-coverage: ${{ steps.run-functional-test.outputs.coverage }} + functional-test-branch_coverage: ${{ steps.run-functional-test.outputs.branch_coverage }} continue-on-error: true steps: @@ -127,8 +138,9 @@ jobs: shell: bash run: | cd app; - pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --junit-xml=../functional.JUnit.xml **/tests/functional; + pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --cov-report json:../coverage_functional.json --junit-xml=../functional.JUnit.xml **/tests/functional; echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT + echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' ../coverage_functional.json) $(jq -r '.totals.num_branches' ../coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT - name: Upload Test Report @@ -147,6 +159,14 @@ jobs: path: functional-coverage.xml + - name: Upload Coverage Report (json) + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: functional-coverage-report-json-${{ matrix.python-version }} + path: coverage_functional.json + + - name: Upload Coverage uses: actions/upload-artifact@v4 if: success() || failure() @@ -544,7 +564,7 @@ jobs: { "schemaVersion": 1, "label": "Unit Test Coverage", - "message": "${{ needs.unit-test.outputs.unit-test-coverage }}%", + "message": "${{ needs.unit-test.outputs.unit-test-coverage }}% Line | ${{ needs.unit-test.outputs.unit-test-branch_coverage }} Branch", "logoSvg": "python-logo", "color": "#4584b6", "style": "plastic" @@ -724,7 +744,7 @@ jobs: { "schemaVersion": 1, "label": "Functional Test Coverage", - "message": "${{ needs.functional-test.outputs.functional-test-coverage }}%", + "message": "${{ needs.functional-test.outputs.functional-test-coverage }}% Line | ${{ needs.functional-test.outputs.functional-test-branch_coverage }} Branch", "logoSvg": "python-logo", "color": "#4584b6", "style": "plastic" From 6a7a8d67bf26658da475a796b3c2fd20ccc0886b Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 13 Apr 2025 16:30:31 +0930 Subject: [PATCH 039/148] feat(pytest): show badge coverage to 4 decimal places --- .github/workflows/python.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index eefc457..14b0e27 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -66,7 +66,7 @@ jobs: run: | cd app; pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --cov-report json:../coverage_unit.json --junit-xml=../unit.JUnit.xml **/tests/unit; - echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT + echo coverage=$(echo "$(jq -r '.totals.percent_covered' ../coverage_unit.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' ../coverage_unit.json) $(jq -r '.totals.num_branches' ../coverage_unit.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT @@ -139,7 +139,7 @@ jobs: run: | cd app; pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --cov-report json:../coverage_functional.json --junit-xml=../functional.JUnit.xml **/tests/functional; - echo "coverage=$(coverage report | awk '$1 == "TOTAL" {print $NF+0}')" > $GITHUB_OUTPUT + echo coverage=$(echo "$(jq -r '.totals.percent_covered' ../coverage_functional.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' ../coverage_functional.json) $(jq -r '.totals.num_branches' ../coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT @@ -564,7 +564,7 @@ jobs: { "schemaVersion": 1, "label": "Unit Test Coverage", - "message": "${{ needs.unit-test.outputs.unit-test-coverage }}% Line | ${{ needs.unit-test.outputs.unit-test-branch_coverage }} Branch", + "message": "${{ needs.unit-test.outputs.unit-test-coverage }} Line | ${{ needs.unit-test.outputs.unit-test-branch_coverage }} Branch", "logoSvg": "python-logo", "color": "#4584b6", "style": "plastic" @@ -744,7 +744,7 @@ jobs: { "schemaVersion": 1, "label": "Functional Test Coverage", - "message": "${{ needs.functional-test.outputs.functional-test-coverage }}% Line | ${{ needs.functional-test.outputs.functional-test-branch_coverage }} Branch", + "message": "${{ needs.functional-test.outputs.functional-test-coverage }} Line | ${{ needs.functional-test.outputs.functional-test-branch_coverage }} Branch", "logoSvg": "python-logo", "color": "#4584b6", "style": "plastic" From d5c5b2f4b1c2263606988259d4486fc1fecdcacf Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 21 Apr 2025 20:20:40 +0930 Subject: [PATCH 040/148] feat(pytest): dont enter app dir before running tests --- .github/workflows/python.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 14b0e27..a81248b 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -64,10 +64,9 @@ jobs: continue-on-error: true shell: bash run: | - cd app; - pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../coverage.xml --cov-report html:../coverage/ --cov-report json:../coverage_unit.json --junit-xml=../unit.JUnit.xml **/tests/unit; - echo coverage=$(echo "$(jq -r '.totals.percent_covered' ../coverage_unit.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT - echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' ../coverage_unit.json) $(jq -r '.totals.num_branches' ../coverage_unit.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT + pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:coverage.xml --cov-report html:coverage/ --cov-report json:coverage_unit.json --junit-xml=unit.JUnit.xml app/**/tests/unit; + echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_unit.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT + echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_unit.json) $(jq -r '.totals.num_branches' coverage_unit.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT - name: Upload Test Report @@ -137,10 +136,9 @@ jobs: continue-on-error: true shell: bash run: | - cd app; - pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:../functional-coverage.xml --cov-report html:../coverage/functional/ --cov-report json:../coverage_functional.json --junit-xml=../functional.JUnit.xml **/tests/functional; - echo coverage=$(echo "$(jq -r '.totals.percent_covered' ../coverage_functional.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT - echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' ../coverage_functional.json) $(jq -r '.totals.num_branches' ../coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT + pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:functional-coverage.xml --cov-report html:coverage/functional/ --cov-report json:coverage_functional.json --junit-xml=functional.JUnit.xml app/**/tests/functional; + echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_functional.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT + echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_functional.json) $(jq -r '.totals.num_branches' coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT - name: Upload Test Report From 40e3833eb5529954b97f537a1a7d4decc29c7d32 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 23 Apr 2025 00:14:26 +0930 Subject: [PATCH 041/148] feat(pytest): add more verbosity --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index a81248b..81c6b74 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -64,7 +64,7 @@ jobs: continue-on-error: true shell: bash run: | - pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:coverage.xml --cov-report html:coverage/ --cov-report json:coverage_unit.json --junit-xml=unit.JUnit.xml app/**/tests/unit; + pytest -s -vv --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:coverage.xml --cov-report html:coverage/ --cov-report json:coverage_unit.json --junit-xml=unit.JUnit.xml app/**/tests/unit; echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_unit.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_unit.json) $(jq -r '.totals.num_branches' coverage_unit.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT @@ -136,7 +136,7 @@ jobs: continue-on-error: true shell: bash run: | - pytest -s -v --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:functional-coverage.xml --cov-report html:coverage/functional/ --cov-report json:coverage_functional.json --junit-xml=functional.JUnit.xml app/**/tests/functional; + pytest -s -vv --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:functional-coverage.xml --cov-report html:coverage/functional/ --cov-report json:coverage_functional.json --junit-xml=functional.JUnit.xml app/**/tests/functional; echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_functional.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_functional.json) $(jq -r '.totals.num_branches' coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT From fb3a3f1a7b7fff2747016f1796a454e7ccd627bb Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 23 Apr 2025 00:59:41 +0930 Subject: [PATCH 042/148] feat(pytest): remove options that are in pyproject.toml --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 81c6b74..71a5e96 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -64,7 +64,7 @@ jobs: continue-on-error: true shell: bash run: | - pytest -s -vv --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:coverage.xml --cov-report html:coverage/ --cov-report json:coverage_unit.json --junit-xml=unit.JUnit.xml app/**/tests/unit; + pytest --cov-report xml:coverage.xml --cov-report html:coverage/ --cov-report json:coverage_unit.json --junit-xml=unit.JUnit.xml app/**/tests/unit; echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_unit.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_unit.json) $(jq -r '.totals.num_branches' coverage_unit.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT @@ -136,7 +136,7 @@ jobs: continue-on-error: true shell: bash run: | - pytest -s -vv --full-trace --showlocals --cov --cov-branch --cov-report term --cov-report xml:functional-coverage.xml --cov-report html:coverage/functional/ --cov-report json:coverage_functional.json --junit-xml=functional.JUnit.xml app/**/tests/functional; + pytest --cov-report xml:functional-coverage.xml --cov-report html:coverage/functional/ --cov-report json:coverage_functional.json --junit-xml=functional.JUnit.xml app/**/tests/functional; echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_functional.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_functional.json) $(jq -r '.totals.num_branches' coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT From 5f9975514af779af9cd55c8366758f914efca732 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 May 2025 18:12:59 +0930 Subject: [PATCH 043/148] feat(pytest): upload bot unit and functional coverage file (`.coverage`) --- .github/workflows/python.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 71a5e96..a7c886b 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -100,6 +100,14 @@ jobs: name: coverage-${{ matrix.python-version }} path: coverage/* + - name: Upload Unit Coverage (rc) + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: coverage-rc-unit-${{ matrix.python-version }} + path: .coverage + include-hidden-files: true + functional-test: name: Functional Test @@ -172,6 +180,14 @@ jobs: name: functional-coverage-${{ matrix.python-version }} path: coverage/functional/* + - name: Upload Functional Coverage (rc) + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: coverage-rc-functional-${{ matrix.python-version }} + path: .coverage + include-hidden-files: true + # should only run on dev/master and tag report: From e6b96e0078c1a2187f13971f4775fbb5ea98aa14 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 May 2025 19:44:15 +0930 Subject: [PATCH 044/148] feat(pytest): create combined reports --- .github/workflows/python.yaml | 93 +++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index a7c886b..04a9762 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -189,6 +189,99 @@ jobs: include-hidden-files: true + combines_report: + name: Create Combined Test Reports + needs: + - unit-test + - functional-test + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + steps: + + + - uses: actions/checkout@v4 + + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements_test.txt + + + - name: Trace 'ls -la' + shell: bash + run: | + ls -la; + + + - name: Download Unit Test Report + uses: actions/download-artifact@v4 + if: success() || failure() + with: + name: coverage-rc-unit-${{ matrix.python-version }} + + + - name: Rename Unit Test Report + shell: bash + run: | + ls -la; + mv .coverage .coverage.unit; + + + - name: Download Functional Test Report + uses: actions/download-artifact@v4 + if: success() || failure() + with: + name: coverage-rc-functional-${{ matrix.python-version }} + + + - name: Rename Functional Test Report + shell: bash + run: | + ls -la; + mv .coverage .coverage.functional; + + + - name: Trace 'ls -la' + shell: bash + run: | + ls -la; + + + - name: Combine Reports + shell: bash + run: | + coverage combine; + + + - name: Create Combined Report + shell: bash + run: | + mkdir -p artifacts; + coverage html -d artifacts; + mv .coverage artifacts/; + + + - name: Upload Combined Report + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: coverage-combined-unit-function-html-${{ matrix.python-version }} + path: artifacts/* + include-hidden-files: true + + + # should only run on dev/master and tag report: name: Create Test Reports From b04d30c0d0b1286b5ab2eddbe18d6f63f74bca6a Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 19 May 2025 23:56:05 +0930 Subject: [PATCH 045/148] feat(pylint): Add meta section and configure linting --- .github/workflows/python.yaml | 159 +++++++++++++++++++++++++++++++++- 1 file changed, 156 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 04a9762..056ab1d 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -4,6 +4,17 @@ name: 'Python' on: workflow_call: + inputs: + LINT: + default: true + description: Should pylint run + required: false + type: boolean + LINT_ERROR_ON_WARNING: + default: false + description: Should pylint return error on Warning + required: false + type: boolean secrets: WORKFLOW_TOKEN: description: "token to clone with" @@ -16,22 +27,162 @@ env: jobs: + init: + name: Meta + runs-on: ubuntu-latest + outputs: + changed-files: ${{ steps.changed-files.outputs.project_all_changed_files }} + doc-changed-files: ${{ steps.changed-files.outputs.docs_changed_files }} + py-changed-files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + py-any-changed: ${{ steps.changed-files.outputs.any_changed}} + tesy-changed-files: ${{ steps.changed-files.outputs.test_changed_files }} + steps: + + + - uses: actions/checkout@v4 + with: + fetch-depth: 100 + + + - name: Get base branch name + id: base-branch-name + shell: bash + run: | + export CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD); + + if [ "${CURRENT_BRANCH}" == "development" ]; then + + BASE_BRANCH=master + + elif [ "${CURRENT_BRANCH}" == "feature-next-release" ]; then + + BASE_BRANCH=development + + else + + BASE_BRANCH=feature-next-release + + fi; + + echo "Base branch is ${BASE_BRANCH}"; + + echo BASE_BRANCH=${BASE_BRANCH} > $GITHUB_OUTPUT + + + - uses: nrwl/nx-set-shas@dbe0650947e5f2c81f59190a38512cf49126fe6b #v4.3.0 + id: setSHAs + with: + main-branch-name: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} + + + - name: Get all files that have changed + id: changed-files + uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 + with: + files: | + **.py + !app/*/tests/ + !app/*/migrations/ + base_sha: ${{ steps.setSHAs.outputs.base }} + + + - name: List all changed files + # if: steps.changed-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + run: | + echo "changed: ${ALL_CHANGED_FILES}": + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done + + lint: name: Lint - if: ${{ false }} + needs: + - init runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['3.11', '3.12', '3.13'] steps: - - name: Create lint job + + - uses: actions/checkout@v4 + + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + + - name: Install Dependencies ${{ matrix.python-version }} + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements_test.txt + + + - name: Lint ${{ matrix.python-version }} + id: lint + if: inputs.LINT && needs.init.outputs.py-any-changed + shell: bash + env: + PY_CHANGED_FILES: ${{ needs.init.outputs.py-changed-files }} + run: | + pylint --py-version ${{ matrix.python-version }} \ + --msg-template "::{category} file={path},line={line},endLine={end_line},title={msg_id}::{msg} see https://pylint.pycqa.org/en/latest/user_guide/messages/{category}/{symbol}.html" \ + ${PY_CHANGED_FILES} || EXITCODE=$? + + if [ "${EXITCODE}" ]; then + + echo "exit_code=${EXITCODE}" >> $GITHUB_OUTPUT + + else + + echo "exit_code=0" >> $GITHUB_OUTPUT + + fi + + + - name: Fail on Error + if: steps.lint.outputs.exit_code == 1 + shell: bash + run: | + echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" + + + - name: Fail on Fatal + if: steps.lint.outputs.exit_code == 2 + shell: bash + run: | + echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" + + + - name: Fail on Warning + if: inputs.LINT_ERROR_ON_WARNING && steps.lint.outputs.exit_code == 4 + shell: bash + run: | + echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" + + + - name: Fail on Usage Error + if: steps.lint.outputs.exit_code == 32 shell: bash run: | - echo "Job does not exists as it needs to be created." + echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" + + unit-test: name: Unit Test runs-on: ubuntu-latest + needs: + - lint strategy: max-parallel: 4 matrix: @@ -112,6 +263,8 @@ jobs: functional-test: name: Functional Test runs-on: ubuntu-latest + needs: + - lint strategy: max-parallel: 4 matrix: From d74f387315009bd108478b9152cf015c15b7e2cb Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 20 May 2025 21:00:00 +0930 Subject: [PATCH 046/148] feat(pylint): add trace to display exit code --- .github/workflows/python.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 056ab1d..3380274 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -133,9 +133,9 @@ jobs: env: PY_CHANGED_FILES: ${{ needs.init.outputs.py-changed-files }} run: | - pylint --py-version ${{ matrix.python-version }} \ - --msg-template "::{category} file={path},line={line},endLine={end_line},title={msg_id}::{msg} see https://pylint.pycqa.org/en/latest/user_guide/messages/{category}/{symbol}.html" \ - ${PY_CHANGED_FILES} || EXITCODE=$? + pylint --py-version ${{ matrix.python-version }} --msg-template "::{category} file={path},line={line},endLine={end_line},title={msg_id}::{msg} see https://pylint.pycqa.org/en/latest/user_guide/messages/{category}/{symbol}.html" ${PY_CHANGED_FILES} || EXITCODE=$? + + echo "Exit code was $EXITCODE"; if [ "${EXITCODE}" ]; then @@ -147,6 +147,8 @@ jobs: fi + echo "Exit code was ${EXITCODE}"; + - name: Fail on Error if: steps.lint.outputs.exit_code == 1 From 948f653b9a0f05e49540a9dd3891867e37f894c2 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 29 May 2025 12:47:31 +0930 Subject: [PATCH 047/148] feat(pylint): update ouput to be github --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 3380274..bf97ab2 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -133,7 +133,7 @@ jobs: env: PY_CHANGED_FILES: ${{ needs.init.outputs.py-changed-files }} run: | - pylint --py-version ${{ matrix.python-version }} --msg-template "::{category} file={path},line={line},endLine={end_line},title={msg_id}::{msg} see https://pylint.pycqa.org/en/latest/user_guide/messages/{category}/{symbol}.html" ${PY_CHANGED_FILES} || EXITCODE=$? + pylint --py-version ${{ matrix.python-version }} --output-format=github ${PY_CHANGED_FILES} || EXITCODE=$? echo "Exit code was $EXITCODE"; From 2155e4839e0fd44ab4b5163f68729be32b84eb59 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 30 May 2025 09:45:31 +0930 Subject: [PATCH 048/148] feat(pylint): revert output from github to template with msg url --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index bf97ab2..26ec5d2 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -133,7 +133,7 @@ jobs: env: PY_CHANGED_FILES: ${{ needs.init.outputs.py-changed-files }} run: | - pylint --py-version ${{ matrix.python-version }} --output-format=github ${PY_CHANGED_FILES} || EXITCODE=$? + pylint --py-version ${{ matrix.python-version }} --msg-template "::notice file={path},line={line},endLine={end_line},title={msg_id}::{msg} see https://pylint.pycqa.org/en/latest/user_guide/messages/{category}/{symbol}.html" ${PY_CHANGED_FILES} || EXITCODE=$? echo "Exit code was $EXITCODE"; From 636c5c7c441101ccdf71622c86dfbb360da9a7d4 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 08:53:50 +0930 Subject: [PATCH 049/148] feat(pylint): dont run on master or dev --- .github/workflows/python.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 26ec5d2..af3cf71 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -29,6 +29,7 @@ jobs: init: name: Meta + if: github.ref_name != 'development' || github.ref_name != 'master' runs-on: ubuntu-latest outputs: changed-files: ${{ steps.changed-files.outputs.project_all_changed_files }} @@ -100,6 +101,7 @@ jobs: lint: name: Lint + if: github.ref_name != 'development' || github.ref_name != 'master' needs: - init runs-on: ubuntu-latest @@ -437,6 +439,33 @@ jobs: + + + ################################################################################################################################ + # + # Future Plan: + # + # with command: `git diff --name-only $(git rev-parse feature-next-release) HEAD` + # to get a list of files to create a coverage html report with just the changed files. + # + ################################################################################################################################ + + + + + + + + + + + + + + + + + # should only run on dev/master and tag report: name: Create Test Reports From 840c0621babbb4cdca03ea0ac45b2e14c427b9df Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 08:54:44 +0930 Subject: [PATCH 050/148] feat(pylint): dont run on master or dev --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index af3cf71..9b2d659 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -29,7 +29,7 @@ jobs: init: name: Meta - if: github.ref_name != 'development' || github.ref_name != 'master' + if: github.ref_name != 'development' && github.ref_name != 'master' runs-on: ubuntu-latest outputs: changed-files: ${{ steps.changed-files.outputs.project_all_changed_files }} @@ -101,7 +101,7 @@ jobs: lint: name: Lint - if: github.ref_name != 'development' || github.ref_name != 'master' + if: github.ref_name != 'development' && github.ref_name != 'master' needs: - init runs-on: ubuntu-latest From 5508fa924941e3c7a45c1b82a1c0cdb16bebbdce Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 08:57:15 +0930 Subject: [PATCH 051/148] feat(pylint): dont run on master or dev --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 9b2d659..ac680fc 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -29,7 +29,7 @@ jobs: init: name: Meta - if: github.ref_name != 'development' && github.ref_name != 'master' + if: github.ref_name != 'refs/heads/development' && github.ref_name != 'refs/heads/master' runs-on: ubuntu-latest outputs: changed-files: ${{ steps.changed-files.outputs.project_all_changed_files }} @@ -101,7 +101,7 @@ jobs: lint: name: Lint - if: github.ref_name != 'development' && github.ref_name != 'master' + if: github.ref_name != 'refs/heads/development' && github.ref_name != 'refs/heads/master' needs: - init runs-on: ubuntu-latest From d2789243c4d7c5e3d8262b81f165f7b099c950c5 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 08:59:54 +0930 Subject: [PATCH 052/148] feat(pylint): dont run on master or dev --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index ac680fc..d68c57b 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -29,7 +29,7 @@ jobs: init: name: Meta - if: github.ref_name != 'refs/heads/development' && github.ref_name != 'refs/heads/master' + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} runs-on: ubuntu-latest outputs: changed-files: ${{ steps.changed-files.outputs.project_all_changed_files }} @@ -101,7 +101,7 @@ jobs: lint: name: Lint - if: github.ref_name != 'refs/heads/development' && github.ref_name != 'refs/heads/master' + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} needs: - init runs-on: ubuntu-latest From ba4654c8f1c110ffeaeb233b8f3c2824ed935337 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 09:03:19 +0930 Subject: [PATCH 053/148] feat(pylint): dont run on master or dev --- .github/workflows/python.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index d68c57b..09ac572 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -29,7 +29,6 @@ jobs: init: name: Meta - if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} runs-on: ubuntu-latest outputs: changed-files: ${{ steps.changed-files.outputs.project_all_changed_files }} @@ -78,6 +77,7 @@ jobs: - name: Get all files that have changed id: changed-files + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 with: files: | @@ -101,7 +101,6 @@ jobs: lint: name: Lint - if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} needs: - init runs-on: ubuntu-latest @@ -113,15 +112,18 @@ jobs: - uses: actions/checkout@v4 + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} - name: Set up Python ${{ matrix.python-version }} + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies ${{ matrix.python-version }} + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} run: | python -m pip install --upgrade pip pip install -r requirements.txt From 0ecd2e372d0a7cb6b032b60d738fefcc140c59b3 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 09:47:55 +0930 Subject: [PATCH 054/148] feat(pylint): dont run on master or dev or tag --- .github/workflows/python.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 09ac572..0c2be70 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -77,7 +77,7 @@ jobs: - name: Get all files that have changed id: changed-files - if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 with: files: | @@ -112,18 +112,18 @@ jobs: - uses: actions/checkout@v4 - if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} - name: Set up Python ${{ matrix.python-version }} - if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies ${{ matrix.python-version }} - if: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} run: | python -m pip install --upgrade pip pip install -r requirements.txt From 32d48533000a19e7aea80c5cd29b732804487740 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 10:11:55 +0930 Subject: [PATCH 055/148] feat(pylint): try diff sha app --- .github/workflows/python.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 0c2be70..aac48a5 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -75,6 +75,13 @@ jobs: main-branch-name: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} + - uses: matheusraz/ref-sha@v1 + id: get-sha + with: + ref: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} + length: 41 + + - name: Get all files that have changed id: changed-files if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} @@ -84,7 +91,8 @@ jobs: **.py !app/*/tests/ !app/*/migrations/ - base_sha: ${{ steps.setSHAs.outputs.base }} + # base_sha: ${{ steps.setSHAs.outputs.base }} + base_sha: ${{ steps.get-sha.outputs.sha }} - name: List all changed files From db5a4580dcc75750064ed47b7e9d6ae6bffe7e7d Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 10:20:36 +0930 Subject: [PATCH 056/148] feat(pylint): try diff sha app --- .github/workflows/python.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index aac48a5..38ff474 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -75,11 +75,11 @@ jobs: main-branch-name: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} - - uses: matheusraz/ref-sha@v1 - id: get-sha - with: - ref: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} - length: 41 + # - uses: matheusraz/ref-sha@v1 + # id: get-sha + # with: + # ref: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} + # length: 41 - name: Get all files that have changed @@ -92,7 +92,8 @@ jobs: !app/*/tests/ !app/*/migrations/ # base_sha: ${{ steps.setSHAs.outputs.base }} - base_sha: ${{ steps.get-sha.outputs.sha }} + # base_sha: ${{ steps.get-sha.outputs.sha }} + base_sha: ${{ env.NX_BASE }} - name: List all changed files From 495413ec0b7c24a3543a9901053b3ee243aac94e Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 10:32:50 +0930 Subject: [PATCH 057/148] feat(pylint): try using branch name --- .github/workflows/python.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 38ff474..bbc2178 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -93,7 +93,8 @@ jobs: !app/*/migrations/ # base_sha: ${{ steps.setSHAs.outputs.base }} # base_sha: ${{ steps.get-sha.outputs.sha }} - base_sha: ${{ env.NX_BASE }} + # base_sha: ${{ env.NX_BASE }} + base_sha: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} - name: List all changed files From 0bddf3ddef4cc3cd0e7e8b84cbfee3b33fe71072 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 2 Jun 2025 10:34:44 +0930 Subject: [PATCH 058/148] feat(pylint): try update fetch depth=0 --- .github/workflows/python.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index bbc2178..c423d9c 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -41,7 +41,8 @@ jobs: - uses: actions/checkout@v4 with: - fetch-depth: 100 + # fetch-depth: 100 + fetch-depth: 0 - name: Get base branch name From eb313c4cad2c9d9b2ebf971e31e8df85eb08853e Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 3 Jun 2025 10:57:09 +0930 Subject: [PATCH 059/148] feat(tests): disable pytest annotations --- .github/workflows/python.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index c423d9c..907e43f 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -227,6 +227,10 @@ jobs: pip install -r requirements_test.txt + - run: | + echo "::remove-matcher owner=python::" + + - name: Run Tests id: run-unit-test continue-on-error: true @@ -309,6 +313,9 @@ jobs: pip install -r requirements_test.txt + - run: | + echo "::remove-matcher owner=python::" + - name: Run Tests id: run-functional-test continue-on-error: true From 03b1f9fc9a307f3b720125a1ac509c6ee2fd58a3 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 10 Aug 2025 16:26:55 +0930 Subject: [PATCH 060/148] feat(tests): Add python integration test workflow --- .github/workflows/python-integration.yaml | 100 ++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/python-integration.yaml diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml new file mode 100644 index 0000000..f7d0cd8 --- /dev/null +++ b/.github/workflows/python-integration.yaml @@ -0,0 +1,100 @@ +--- +name: 'Integration Test' + + +on: + workflow_call: + inputs: + PYTHON_VERSION: + default: '3.11' + description: Python Version to use + required: false + type: string + secrets: + WORKFLOW_TOKEN: + description: "token to clone with" + required: true + + +jobs: + + integration-test: + name: Integration Test + runs-on: ubuntu-latest + strategy: + max-parallel: 8 + matrix: + postgres-version: [ '13', '14', '15', '16', '17' ] + rabbitmq-version: [ '3.12', '3.13', '4.0', '4.1' ] + continue-on-error: true + steps: + + + - uses: actions/checkout@v4 + + + - name: Set up Docker Compose + run: | + sudo apt-get update + sudo apt-get install -y docker-compose + + - name: Set up Python ${{ inputs.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.PYTHON_VERSION }} + + + - name: Install Python Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements_test.txt + + + - run: | + echo "::remove-matcher owner=python::" + + + - name: Run Tests + id: run-integration-test + continue-on-error: true + shell: bash + env: + CENTURION_RABBITMQ_IMAGE_TAG: ${{ matrix.rabbitmq-version }} + CENTURION_POSTGRES_IMAGE_TAG: ${{ matrix.postgres-version }} + run: | + export CENTURION_IMAGE_TAG=${GITHUB_SHA}; + make test-integration + + + - name: Test Report + if: success() || failure() + uses: dorny/test-reporter@v1 + id: test-report + with: + name: Integration Test Report [python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}] + path: 'integration.JUnit.xml' + reporter: java-junit + + + - name: Upload Junit Test Report + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: integration-test-report-junit-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} + path: integration.JUnit.xml + + - name: Upload Artifacts - Logs + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: integration-logs-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} + path: test/volumes/log/* + + + - name: Upload Artifacts - Tests + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: integration-tests-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} + path: test/volumes/artifacts/* From cf4a87bc186061472796e761ae9c12668bff9bb0 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 12 Aug 2025 13:55:11 +0930 Subject: [PATCH 061/148] feat(tests): use inputs for integration testing versions --- .github/workflows/python-integration.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index f7d0cd8..0ffb5b3 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -5,11 +5,21 @@ name: 'Integration Test' on: workflow_call: inputs: + POSTGRES_VERSIONS: + default: "[ '13', '14', '15', '16', '17' ]" + description: PostgreSQL Versions to test + required: false + type: string PYTHON_VERSION: default: '3.11' description: Python Version to use required: false type: string + RABBITMQ_VERSIONS: + default: "[ '3.12', '3.13', '4.0', '4.1' ]" + description: PostgreSQL Versions to test + required: false + type: string secrets: WORKFLOW_TOKEN: description: "token to clone with" @@ -24,8 +34,8 @@ jobs: strategy: max-parallel: 8 matrix: - postgres-version: [ '13', '14', '15', '16', '17' ] - rabbitmq-version: [ '3.12', '3.13', '4.0', '4.1' ] + postgres-version: ${{ fromJSON(inputs.POSTGRES_VERSIONS) }} + rabbitmq-version: ${{ fromJSON(inputs.RABBITMQ_VERSIONS) }} continue-on-error: true steps: From 51a53601aebd84c484cafd3588b26ac54e608be1 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 12 Aug 2025 16:13:18 +0930 Subject: [PATCH 062/148] feat(tests): add badges for integration testing versions --- .github/workflows/python-integration.yaml | 60 ++++++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 0ffb5b3..cd4a99b 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -6,7 +6,7 @@ on: workflow_call: inputs: POSTGRES_VERSIONS: - default: "[ '13', '14', '15', '16', '17' ]" + default: '[ "13", "14", "15", "16", "17" ]' description: PostgreSQL Versions to test required: false type: string @@ -16,7 +16,7 @@ on: required: false type: string RABBITMQ_VERSIONS: - default: "[ '3.12', '3.13', '4.0', '4.1' ]" + default: '[ "3.12", "3.13", "4.0", "4.1" ]' description: PostgreSQL Versions to test required: false type: string @@ -40,6 +40,7 @@ jobs: steps: + - uses: actions/checkout@v4 @@ -108,3 +109,58 @@ jobs: with: name: integration-tests-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} path: test/volumes/artifacts/* + + + badge-endpoint-versions: + name: Publish Version Badge endpoint files + if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }} + needs: + - unit-test + - report + runs-on: ubuntu-latest + steps: + + + - name: Create PostgreSQL Shields.io Endpoint.json + shell: bash + run: | + versions=$(echo '${{ inputs.POSTGRES_VERSIONS }}' | tr -d "[]\"" | tr ',' '|' | xargs) + cat < badge_endpoint_integration_postgres_versions.json + { + "schemaVersion": 1, + "label": "PostgreSQL", + "message": "$versions", + "color": "#336791", + "style": "plastic" + } + EOF + + + - name: Upload Badge Endpoint json + uses: actions/upload-artifact@v4 + with: + name: badge_endpoint_integration_postgres_versions + path: badge_endpoint_integration_postgres_versions.json + + + - name: Create RabbitMQ Shields.io Endpoint.json + shell: bash + run: | + versions=$(echo '${{ inputs.RABBITMQ_VERSIONS }}' | tr -d "[]\"" | tr ',' '|' | xargs) + cat < badge_endpoint_integration_rabbitmq_versions.json + { + "schemaVersion": 1, + "label": "RabbitMQ", + "message": "$versions", + "logoSvg": "", + "color": "#F60", + "style": "plastic" + } + EOF + + + - name: Upload Badge Endpoint json + uses: actions/upload-artifact@v4 + with: + name: badge_endpoint_integration_rabbitmq_versions + path: badge_endpoint_integration_rabbitmq_versions.json From 10634bf942fc5fb9350c41880a3cc2e929b0d550 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 12 Aug 2025 16:34:38 +0930 Subject: [PATCH 063/148] feat(tests): add badges for integration testing versions --- .github/workflows/python-integration.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index cd4a99b..4f46f33 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -40,7 +40,6 @@ jobs: steps: - - uses: actions/checkout@v4 @@ -115,8 +114,7 @@ jobs: name: Publish Version Badge endpoint files if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }} needs: - - unit-test - - report + - integration-test runs-on: ubuntu-latest steps: From 211c3bad14b4137cb5ea53055295b584cdf19059 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 15 Aug 2025 13:53:39 +0930 Subject: [PATCH 064/148] feat(tests): python integration matrix --- .github/workflows/python-integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 4f46f33..9a119ea 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -32,7 +32,7 @@ jobs: name: Integration Test runs-on: ubuntu-latest strategy: - max-parallel: 8 + max-parallel: 5 matrix: postgres-version: ${{ fromJSON(inputs.POSTGRES_VERSIONS) }} rabbitmq-version: ${{ fromJSON(inputs.RABBITMQ_VERSIONS) }} From 7c146d70a16c4de238b779185cb9031816bc3fcb Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 15 Aug 2025 15:44:09 +0930 Subject: [PATCH 065/148] feat(tests): python integration version badges are published to repo --- .github/workflows/python-integration.yaml | 147 ++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 9a119ea..b431ae4 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -162,3 +162,150 @@ jobs: with: name: badge_endpoint_integration_rabbitmq_versions path: badge_endpoint_integration_rabbitmq_versions.json + + + - name: Checkout Endpoint Repo + uses: actions/checkout@v4 + with: + repository: 'nofusscomputing/.github' + ref: 'master' + token: ${{ secrets.WORKFLOW_TOKEN }} + path: 'endpoint_publish' + fetch-depth: '1' + show-progress: true + submodules: false + + + - name: Create Publish Directories + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + cd endpoint_publish; + echo "[Debug] PWD[${PWD}]"; + mkdir -p repositories/${{ github.repository }}/${{ github.ref_name }}; + ls -la; + + + - name: Create Publish Directories + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + # cd repositories/${{ github.repository }}/${{ github.ref_name }}; + echo "[Debug] PWD[${PWD}]"; + + + - name: Download Postgres Version Badge Endpoint json + uses: actions/download-artifact@v4 + with: + name: badge_endpoint_integration_postgres_versions + + + - name: Download RabbitMQ Version Badge Endpoint json + uses: actions/download-artifact@v4 + with: + name: badge_endpoint_integration_rabbitmq_versions + + + - name: Add endpoint file + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + + echo "[Debug] **************************** - cd endpoint_publish"; + + cd endpoint_publish; + + echo "[Debug] **************************** - ls -la"; + + ls -la + + echo "[Debug] ****************************"; + + echo "[Debug] PWD[${PWD}]"; + + echo "[Debug] **************************** - ls -la ../"; + + ls -la ../ + + echo "[Debug] **************************** - cp ../badge_endpoint_integration_postgres_versions.json repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_integration_postgres_versions.json"; + + cp ../badge_endpoint_integration_postgres_versions.json repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_integration_postgres_versions.json; + + echo "[Debug] **************************** - cp ../badge_endpoint_integration_rabbitmq_versions.json repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_integration_rabbitmq_versions.json"; + + cp ../badge_endpoint_integration_rabbitmq_versions.json repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_integration_rabbitmq_versions.json; + + echo "[Debug] **************************** - ls -la repositories/${{ github.repository }}/${{ github.ref_name }}/"; + + ls -la repositories/${{ github.repository }}/${{ github.ref_name }}/; + + + - name: Configure git + shell: bash + run: | + git config --global user.email "helpdesk@nofusscomputing.com"; + git config --global user.name "nfc-bot"; + + + - name: Git add + id: git-add + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git status; + echo "[Debug] ****************************"; + + if [ "$(git status -s)" ]; then + + echo "changed=true" > $GITHUB_OUTPUT; + + echo "[Info] Changes need to be committed"; + + else + + echo "changed=false" > $GITHUB_OUTPUT; + + echo "[Info] NO changes to be committed"; + + fi + + echo "[Debug] ****************************"; + + git add . + + + - name: Git commit + if: ${{ steps.git-add.outputs.changed == 'true' }} + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git commit -m "chore: add versions badge endpount file ${{ github.repository }}/${{ github.ref_name }}" + + + - name: git push + if: ${{ steps.git-add.outputs.changed == 'true' }} + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git push From 8c929a958ac566790877c277fdd7005400e122f4 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 15 Aug 2025 16:30:21 +0930 Subject: [PATCH 066/148] feat(tests): python integration version badges add space between seperator --- .github/workflows/python-integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index b431ae4..56ac16b 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -144,7 +144,7 @@ jobs: - name: Create RabbitMQ Shields.io Endpoint.json shell: bash run: | - versions=$(echo '${{ inputs.RABBITMQ_VERSIONS }}' | tr -d "[]\"" | tr ',' '|' | xargs) + versions=$(echo '${{ inputs.RABBITMQ_VERSIONS }}' | tr -d "[]\"" | tr ',' ' |' | xargs) cat < badge_endpoint_integration_rabbitmq_versions.json { "schemaVersion": 1, From 4841dc6d5bf91b01905796866d552fe0d6b1e924 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 21 Aug 2025 01:18:35 +0930 Subject: [PATCH 067/148] feat(python-integration): checkout tags --- .github/workflows/python-integration.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 56ac16b..f36bc38 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -41,6 +41,8 @@ jobs: - uses: actions/checkout@v4 + with: + fetch-tags: 'true' - name: Set up Docker Compose @@ -122,7 +124,7 @@ jobs: - name: Create PostgreSQL Shields.io Endpoint.json shell: bash run: | - versions=$(echo '${{ inputs.POSTGRES_VERSIONS }}' | tr -d "[]\"" | tr ',' '|' | xargs) + versions=$(echo '${{ inputs.POSTGRES_VERSIONS }}' | tr -d "[]\"" | tr ',' ' |' | xargs) cat < badge_endpoint_integration_postgres_versions.json { "schemaVersion": 1, From 8f243e020991f5bc9c61f02ac8a6a84b19bcdac6 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 21 Aug 2025 02:13:26 +0930 Subject: [PATCH 068/148] feat(tests): pull git tags again --- .github/workflows/python-integration.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index f36bc38..7733443 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -45,6 +45,11 @@ jobs: fetch-tags: 'true' + - name: Git + run: | + git fetch -fpvt + git tags + - name: Set up Docker Compose run: | sudo apt-get update From ab62ac65eecb835c28a672112adbd36d12334f50 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 21 Aug 2025 02:31:59 +0930 Subject: [PATCH 069/148] feat(tests): pull git tags again 3 --- .github/workflows/python-integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 7733443..7d2fdc4 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -48,7 +48,7 @@ jobs: - name: Git run: | git fetch -fpvt - git tags + - name: Set up Docker Compose run: | From 115fee175af87e2d2a191371dd07e03688764faa Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 21 Aug 2025 03:23:42 +0930 Subject: [PATCH 070/148] feat(tests): pull git tags again 4 --- .github/workflows/python-integration.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 7d2fdc4..f07eb9f 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -42,6 +42,7 @@ jobs: - uses: actions/checkout@v4 with: + fetch-depth: 0 fetch-tags: 'true' From 03131a7e4c0d97fc62572809e8d4ef6ec199579c Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 21 Aug 2025 03:24:36 +0930 Subject: [PATCH 071/148] feat(tests): pull git tags again 5 --- .github/workflows/python-integration.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index f07eb9f..cba1d37 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -49,6 +49,7 @@ jobs: - name: Git run: | git fetch -fpvt + echo "latest tag commit $(git rev-list -n 1 $(git describe --tags --abbrev=0)" - name: Set up Docker Compose From c36805f9ecf427eedb82e65422fac8d502f7955f Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 21 Aug 2025 03:40:24 +0930 Subject: [PATCH 072/148] feat(tests): pull git tags again 6 --- .github/workflows/python-integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index cba1d37..8a21204 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -49,7 +49,7 @@ jobs: - name: Git run: | git fetch -fpvt - echo "latest tag commit $(git rev-list -n 1 $(git describe --tags --abbrev=0)" + echo "latest tag commit $(git rev-list -n 1 $(git describe --tags --abbrev=0))" - name: Set up Docker Compose From 6a65c3fc6e29baa0cb44dd5154a489179a186a08 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 27 Aug 2025 14:19:07 +0930 Subject: [PATCH 073/148] feat(tests): upload any centurion logs --- .github/workflows/python.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 907e43f..39ad9a3 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -280,6 +280,14 @@ jobs: path: .coverage include-hidden-files: true + - name: Upload any logs + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: unit-test-centurion-logs-${{ matrix.python-version }} + path: app/logs/* + include-hidden-files: true + functional-test: name: Functional Test @@ -365,6 +373,14 @@ jobs: path: .coverage include-hidden-files: true + - name: Upload any logs + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: functional-test-centurion-logs-${{ matrix.python-version }} + path: app/logs/* + include-hidden-files: true + combines_report: name: Create Combined Test Reports From 60c3d1d4e17e6365925253536eeaf4e2d1c09d1f Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 27 Aug 2025 14:20:29 +0930 Subject: [PATCH 074/148] feat(tests): upload any centurion logs 2 --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 39ad9a3..a6b1fca 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -285,7 +285,7 @@ jobs: if: success() || failure() with: name: unit-test-centurion-logs-${{ matrix.python-version }} - path: app/logs/* + path: app/log/* include-hidden-files: true @@ -378,7 +378,7 @@ jobs: if: success() || failure() with: name: functional-test-centurion-logs-${{ matrix.python-version }} - path: app/logs/* + path: app/log/* include-hidden-files: true From 6af6054be3542e4fa1719707ea081bd640275535 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 27 Aug 2025 15:14:23 +0930 Subject: [PATCH 075/148] feat(tests): upload any centurion logs 3 --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index a6b1fca..d3c640c 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -285,7 +285,7 @@ jobs: if: success() || failure() with: name: unit-test-centurion-logs-${{ matrix.python-version }} - path: app/log/* + path: log/* include-hidden-files: true @@ -378,7 +378,7 @@ jobs: if: success() || failure() with: name: functional-test-centurion-logs-${{ matrix.python-version }} - path: app/log/* + path: log/* include-hidden-files: true From c0fa7656275a75348ce592d642e3fed1048b5080 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 27 Aug 2025 17:59:52 +0930 Subject: [PATCH 076/148] feat(tests): upload any centurion logs for integration tests --- .github/workflows/python-integration.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 8a21204..36e6b26 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -118,6 +118,14 @@ jobs: name: integration-tests-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} path: test/volumes/artifacts/* + - name: Upload any logs from tests + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: integration-test-centurion-logs-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} + path: log/* + include-hidden-files: true + badge-endpoint-versions: name: Publish Version Badge endpoint files From fd5376f8d9b77c48111fabfdc033aa07cb78f96d Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 27 Aug 2025 19:14:55 +0930 Subject: [PATCH 077/148] feat(tests): trace log dir --- .github/workflows/python-integration.yaml | 5 +++++ .github/workflows/python.yaml | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 36e6b26..f1bf1b0 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -126,6 +126,11 @@ jobs: path: log/* include-hidden-files: true + - name: log file check + run: | + ls -la log/ || true; + ls -la app/log/ || true; + badge-endpoint-versions: name: Publish Version Badge endpoint files diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index d3c640c..2eb5aa2 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -288,6 +288,11 @@ jobs: path: log/* include-hidden-files: true + - name: log file check + run: | + ls -la log/ || true; + ls -la app/log/ || true; + functional-test: name: Functional Test @@ -381,6 +386,11 @@ jobs: path: log/* include-hidden-files: true + - name: log file check + run: | + ls -la log/ || true; + ls -la app/log/ || true; + combines_report: name: Create Combined Test Reports From 874b4407b71bb330d138d2fa3bb4933d663c5fe1 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 13 Sep 2025 20:29:28 +0930 Subject: [PATCH 078/148] feat(tests): add base branch for feat-next-release --- .github/workflows/python.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 2eb5aa2..f783e27 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -59,6 +59,10 @@ jobs: BASE_BRANCH=development + elif [ "${CURRENT_BRANCH}" == "feat-next-release" ]; then + + BASE_BRANCH=development + else BASE_BRANCH=feature-next-release From 31585ba03d9050e46181da5e5b52d78310b04fb5 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 17 Sep 2025 15:56:20 +0930 Subject: [PATCH 079/148] feat(tests): always show trace for log output --- .github/workflows/python-integration.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index f1bf1b0..99d59b5 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -127,6 +127,7 @@ jobs: include-hidden-files: true - name: log file check + if: success() || failure() run: | ls -la log/ || true; ls -la app/log/ || true; From fc8e3ae8615afa56473ea45f710a291c375e5255 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 10 Oct 2025 15:12:03 +0930 Subject: [PATCH 080/148] feat(tests): update test reporter v1 -> v2.1 --- .github/workflows/python-integration.yaml | 2 +- .github/workflows/python.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 99d59b5..7eaef82 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -88,7 +88,7 @@ jobs: - name: Test Report if: success() || failure() - uses: dorny/test-reporter@v1 + uses: dorny/test-reporter@v2.1 id: test-report with: name: Integration Test Report [python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}] diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index f783e27..101f4fc 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -553,7 +553,7 @@ jobs: - name: Test Report if: success() || failure() - uses: dorny/test-reporter@v1 + uses: dorny/test-reporter@v2.1 id: test-report with: # artifact: unit-test-results-${{ matrix.python-version }} @@ -628,7 +628,7 @@ jobs: - name: Test Report - uses: dorny/test-reporter@v1 + uses: dorny/test-reporter@v2.1 id: test-report with: # artifact: functional-test-results-${{ matrix.python-version }} From 8aaf6beaef550baf14a97fa9598e0dc839a185d8 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 10 Oct 2025 15:44:31 +0930 Subject: [PATCH 081/148] feat(tests): update test reporter v1 -> v2.1 again --- .github/workflows/python-integration.yaml | 2 +- .github/workflows/python.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 7eaef82..5eaec20 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -88,7 +88,7 @@ jobs: - name: Test Report if: success() || failure() - uses: dorny/test-reporter@v2.1 + uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 id: test-report with: name: Integration Test Report [python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}] diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 101f4fc..46fe156 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -553,7 +553,7 @@ jobs: - name: Test Report if: success() || failure() - uses: dorny/test-reporter@v2.1 + uses: ddorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 id: test-report with: # artifact: unit-test-results-${{ matrix.python-version }} @@ -628,7 +628,7 @@ jobs: - name: Test Report - uses: dorny/test-reporter@v2.1 + uses: ddorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 id: test-report with: # artifact: functional-test-results-${{ matrix.python-version }} From d684dedd9244bb379615dd676bb39928efc8fb37 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 11 Oct 2025 09:13:26 +0930 Subject: [PATCH 082/148] fix(tests): correct test reporter repo name --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 46fe156..42ca589 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -553,7 +553,7 @@ jobs: - name: Test Report if: success() || failure() - uses: ddorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 + uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 id: test-report with: # artifact: unit-test-results-${{ matrix.python-version }} @@ -628,7 +628,7 @@ jobs: - name: Test Report - uses: ddorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 + uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 id: test-report with: # artifact: functional-test-results-${{ matrix.python-version }} From 2b45e923edcf47a258bbcc91a7b5d81d64f3ba87 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 11 Oct 2025 10:21:55 +0930 Subject: [PATCH 083/148] feat(tests): test reporter dont use actions summary --- .github/workflows/python-integration.yaml | 1 + .github/workflows/python.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 5eaec20..4fc5553 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -94,6 +94,7 @@ jobs: name: Integration Test Report [python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}] path: 'integration.JUnit.xml' reporter: java-junit + use-actions-summary: false - name: Upload Junit Test Report diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 42ca589..e2f1971 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -560,6 +560,7 @@ jobs: name: Unit Test Report [Python ${{ matrix.python-version }}] path: '*.xml' reporter: java-junit + use-actions-summary: false - name: Trace 'ls -la' @@ -636,6 +637,7 @@ jobs: path: '*.xml' reporter: java-junit # fail-on-error: false + use-actions-summary: false - name: Trace 'ls -la' From 368ad8aef888e8a5d0a8f6b8031e9ff4e389b169 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 Dec 2025 19:11:10 +0930 Subject: [PATCH 084/148] docs: Add badges to Readme ref: #11 --- .centurion/project_status.json | 8 +++++ README.md | 54 +++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .centurion/project_status.json diff --git a/.centurion/project_status.json b/.centurion/project_status.json new file mode 100644 index 0000000..e686e86 --- /dev/null +++ b/.centurion/project_status.json @@ -0,0 +1,8 @@ +{ + "schemaVersion": 1, + "label": "Project Status", + "message": "Active", + "namedLogo": "github", + "color": "green", + "style": "plastic" +} \ No newline at end of file diff --git a/README.md b/README.md index 40d762d..cb30912 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,45 @@ + + # No Fuss Computing - GH Action / Workflow for Python Projects +
+ +![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fnofusscomputing%2Faction_python%2Frefs%2Fheads%2Fdevelopment%2F.centurion%2Fproject_status.json) + + + +---- + +
+ +![GitHub forks](https://img.shields.io/github/forks/nofusscomputing/action_python?logo=github&style=plastic&color=000000&labell=Forks) ![GitHub stars](https://img.shields.io/github/stars/nofusscomputing/action_python?color=000000&logo=github&style=plastic) ![Github Watchers](https://img.shields.io/github/watchers/nofusscomputing/action_python?color=000000&label=Watchers&logo=github&style=plastic) + + + +
+ +This project is hosted on our [Gitea](https://nofusscomputing.com/git/actions/python) instance and has a read-only copy hosted on [Github](https://nofusscomputing.com/git/nofusscomputing/action_python) + +---- + +**Stable Branch** + +---- + +**Development Branch** + +---- +
+ +
+ +links: + +- [Issues](https://nofusscomputing.com/git/actions/python/issues) + +- [Merge Requests (Pull Requests)](https://nofusscomputing.com/git/actions/python/pulls) + + To use this workflow within your project add a file at path `.github/workflows/ci.yaml` or add the job to your existing CI file. @@ -9,7 +49,6 @@ To use this workflow within your project add a file at path `.github/workflows/c name: 'CI' - on: push: branches: @@ -28,3 +67,16 @@ jobs: WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} ``` + + + +## Contributing + +All contributions for this project must be conducted from our [Gitea](https://nofusscomputing.com/git/pytest/simplified). + +For further details on contributing please refer to the [contribution guide](CONTRIBUTING.md). + + +## Other + +This repo is release under this [license](LICENSE) From aa3c00d6597ef2d11af848a1f63c1b4ac76f8f97 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 Dec 2025 19:19:33 +0930 Subject: [PATCH 085/148] ci: move CC to gitea ref: #11 --- .../workflows/conventional_commits.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/pull_request.yaml => .gitea/workflows/conventional_commits.yaml (100%) diff --git a/.github/workflows/pull_request.yaml b/.gitea/workflows/conventional_commits.yaml similarity index 100% rename from .github/workflows/pull_request.yaml rename to .gitea/workflows/conventional_commits.yaml From dea6985aa7f72bd5cb4642d5e31e48d46703dff2 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 Dec 2025 19:22:56 +0930 Subject: [PATCH 086/148] ci(cc): Run on push to dev ref: #11 --- .gitea/workflows/conventional_commits.yaml | 35 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/conventional_commits.yaml b/.gitea/workflows/conventional_commits.yaml index dd7861b..b160416 100644 --- a/.gitea/workflows/conventional_commits.yaml +++ b/.gitea/workflows/conventional_commits.yaml @@ -1,15 +1,40 @@ - --- -name: Pull Requests +name: Conventional Commits on: pull_request: {} + push: + branches: + - 'development' jobs: - pull-requests: - name: Pull Request - uses: nofusscomputing/action_pull_requests/.github/workflows/pull-requests.yaml@development + conventional-pr-title: + name: Conventional PR Title + runs-on: ubuntu-latest + steps: + + + - name: Conventional Commit PR Title + if: ${{ github.event_name == 'pull_request' }} + uses: agenthunt/conventional-commit-checker-action@v1.0.0 + with: + pr-title-regex: "^(.+)(?:(([^)s]+)))?: (.+)" + pr-body-regex: "(.*)" + + + conventional-commits: + name: Conventional Commits + runs-on: ubuntu-latest + steps: + + - name: Check Commits + uses: taskmedia/action-conventional-commits@v1.1.17 + with: + token: ${{ github.token }} + skip_merge: true + skip_revert: true + types: "build|bump|chore|ci|docs|feat|fix|perf|refactor|revert|style|test" From 981fd60063dedd5fff4b5f9d083152b29de31671 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 Dec 2025 19:45:34 +0930 Subject: [PATCH 087/148] chore: Add github issue redirect to repo home ref: #11 --- .github/ISSUE_TEMPLATE/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..d847e5b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +--- + +blank_issues_enabled: false + +contact_links: + - name: New Issue + url: https://nofusscomputing.com/git/actions/action_python/issues + about: Create a new issue at the repositories home. \ No newline at end of file From dbd231e6d04d5f834375dc4f76301cd1e3f6a6c9 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 Dec 2025 20:49:25 +0930 Subject: [PATCH 088/148] feat: add python package build ref: #11 --- .github/workflows/python-package.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/python-package.yaml diff --git a/.github/workflows/python-package.yaml b/.github/workflows/python-package.yaml new file mode 100644 index 0000000..08ae868 --- /dev/null +++ b/.github/workflows/python-package.yaml @@ -0,0 +1,22 @@ +--- +name: 'Python Package' + + +on: + workflow_call: + + +jobs: + + build-and-inspect-package: + name: Build + runs-on: ubuntu-latest + steps: + + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + + - uses: hynek/build-and-inspect-python-package@v2 From 84589dd03fa24c40d174c164d66b817b07575739 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 21 Dec 2025 23:12:42 +0930 Subject: [PATCH 089/148] feat: add python package publish ref: #11 --- .github/workflows/python-publish.yaml | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/python-publish.yaml diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml new file mode 100644 index 0000000..5ef45e3 --- /dev/null +++ b/.github/workflows/python-publish.yaml @@ -0,0 +1,46 @@ +--- +name: 'Python Publish' + + +on: + workflow_call: + inputs: + PYTHON_PROJECT_NAME: + description: PyPi Package Project + required: true + type: string + + PYTHON_PROJECT_URL: + description: PyPi Package Project + default: pypi.org # pypi.org | test.pypi.org + required: false + type: string + + secrets: + password: + required: true + +jobs: + + + pypi-publish: + name: Upload release to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + + runs-on: ubuntu-latest + environment: + name: pypi + url: https://${{ inputs.PYTHON_PROJECT_URL}}/p/${{ inputs.PYTHON_PROJECT_NAME}}/ + permissions: + id-token: write + steps: + + - name: Download built artifact to dist/ + uses: actions/download-artifact@v4 + with: + name: Packages + path: dist + + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file From 3106c414d79a86eaca943622020450bc755262bb Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 19 Jan 2026 18:17:10 +0930 Subject: [PATCH 090/148] refactor: requirements_test was renamed to requirements_dev ref: https://github.com/nofusscomputing/centurion_erp/issues/1099 --- .github/workflows/python-integration.yaml | 2 +- .github/workflows/python.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 4fc5553..7ea4cf7 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -67,7 +67,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install -r requirements_test.txt + pip install -r requirements_dev.txt - run: | diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index e2f1971..5152b5a 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -142,7 +142,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install -r requirements_test.txt + pip install -r requirements_dev.txt - name: Lint ${{ matrix.python-version }} @@ -228,7 +228,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install -r requirements_test.txt + pip install -r requirements_dev.txt - run: | @@ -327,7 +327,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install -r requirements_test.txt + pip install -r requirements_dev.txt - run: | @@ -422,7 +422,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install -r requirements_test.txt + pip install -r requirements_dev.txt - name: Trace 'ls -la' From 0833f2067301284a286d4cb6549aa7f34c6c923c Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 19 Jan 2026 20:57:17 +0930 Subject: [PATCH 091/148] fix: add missing permissions for sarif upload --- .github/workflows/python.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 5152b5a..7014285 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1173,6 +1173,9 @@ jobs: vulnerability-scan: name: PIP file Scan (requirements.txt) runs-on: ubuntu-latest + permissions: + contents: read # Required to checkout and read repo files + security-events: write # Required to upload SARIF files to Security tab steps: From e07fd3d353d1083b3f8dff2f4ca028d2f59561ae Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 19 Jan 2026 21:41:32 +0930 Subject: [PATCH 092/148] fix: do sarif upload as artifact --- .github/workflows/python.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 7014285..b3d770a 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1200,6 +1200,13 @@ jobs: sarif_file: 'trivy-results.sarif' + - name: Upload scan results sarif Report) + uses: actions/upload-artifact@v4 + with: + name: python-scan-results-sarif + path: trivy-results.sarif + + - name: Run Trivy vulnerability scanner against requirements.txt (json Report) uses: aquasecurity/trivy-action@0.28.0 with: From 8ef02392903d26b97226a5f0f86172c4162f762f Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 19 Jan 2026 22:04:21 +0930 Subject: [PATCH 093/148] feat(vuln): update trivy 0.28.0 -> 0.33.1 --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index b3d770a..611fea4 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1183,7 +1183,7 @@ jobs: - name: Run Trivy vulnerability scanner against requirements.txt - uses: aquasecurity/trivy-action@0.28.0 + uses: aquasecurity/trivy-action@0.33.1 with: scan-type: 'fs' ignore-unfixed: false @@ -1208,7 +1208,7 @@ jobs: - name: Run Trivy vulnerability scanner against requirements.txt (json Report) - uses: aquasecurity/trivy-action@0.28.0 + uses: aquasecurity/trivy-action@0.33.1 with: scan-type: 'fs' ignore-unfixed: false From 1d6ca78032c22c6ae073fd67baebee770c3a2420 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 22 Jan 2026 13:01:20 +0930 Subject: [PATCH 094/148] feat: Add trace to tests --- .github/workflows/python-integration.yaml | 6 ++++++ .github/workflows/python.yaml | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 7ea4cf7..cd5a622 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -86,6 +86,12 @@ jobs: make test-integration + - name: Trace + run: | + echo "PWD is [${PWD}]"; + ls -lar + + - name: Test Report if: success() || failure() uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 611fea4..62ebe80 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -245,6 +245,12 @@ jobs: echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_unit.json) $(jq -r '.totals.num_branches' coverage_unit.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT + - name: Trace + run: | + echo "PWD is [${PWD}]"; + ls -lar + + - name: Upload Test Report uses: actions/upload-artifact@v4 if: success() || failure() @@ -343,6 +349,12 @@ jobs: echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_functional.json) $(jq -r '.totals.num_branches' coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT + - name: Trace + run: | + echo "PWD is [${PWD}]"; + ls -lar + + - name: Upload Test Report uses: actions/upload-artifact@v4 if: success() || failure() From c4cee58dfa54528591b03cc2d5fe211db1669a60 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 22 Jan 2026 13:12:50 +0930 Subject: [PATCH 095/148] fix(test): output reports using full path --- .github/workflows/python-integration.yaml | 2 +- .github/workflows/python.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index cd5a622..d239b20 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -89,7 +89,7 @@ jobs: - name: Trace run: | echo "PWD is [${PWD}]"; - ls -lar + ls -laR - name: Test Report diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 62ebe80..d9a9511 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -240,7 +240,7 @@ jobs: continue-on-error: true shell: bash run: | - pytest --cov-report xml:coverage.xml --cov-report html:coverage/ --cov-report json:coverage_unit.json --junit-xml=unit.JUnit.xml app/**/tests/unit; + pytest --cov-report xml:${PWD}/coverage.xml --cov-report html:${PWD}/coverage/ --cov-report json:${PWD}/coverage_unit.json --junit-xml=${PWD}/unit.JUnit.xml app/**/tests/unit; echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_unit.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_unit.json) $(jq -r '.totals.num_branches' coverage_unit.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT @@ -248,7 +248,7 @@ jobs: - name: Trace run: | echo "PWD is [${PWD}]"; - ls -lar + ls -laR - name: Upload Test Report @@ -344,7 +344,7 @@ jobs: continue-on-error: true shell: bash run: | - pytest --cov-report xml:functional-coverage.xml --cov-report html:coverage/functional/ --cov-report json:coverage_functional.json --junit-xml=functional.JUnit.xml app/**/tests/functional; + pytest --cov-report xml:${PWD}/functional-coverage.xml --cov-report html:${PWD}/coverage/functional/ --cov-report json:${PWD}/coverage_functional.json --junit-xml=${PWD}/functional.JUnit.xml app/**/tests/functional; echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_functional.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_functional.json) $(jq -r '.totals.num_branches' coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT @@ -352,7 +352,7 @@ jobs: - name: Trace run: | echo "PWD is [${PWD}]"; - ls -lar + ls -laR - name: Upload Test Report From ad5f865db53d438ee6ff7766be9e9d0e17e9f65d Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 29 Jan 2026 14:42:57 +0930 Subject: [PATCH 096/148] feat(scan): requirements scan to scan multiple requirements --- .github/workflows/python.yaml | 67 ++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index d9a9511..0b4cd6d 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -36,6 +36,7 @@ jobs: py-changed-files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} py-any-changed: ${{ steps.changed-files.outputs.any_changed}} tesy-changed-files: ${{ steps.changed-files.outputs.test_changed_files }} + requirements_set: ${{ steps.requirements_set.outputs.requirements }} steps: @@ -114,6 +115,16 @@ jobs: + - name: Find requirements files + id: requirements_set + run: | + files=$(ls requirements*.txt | jq -R . | jq -s .) + echo "requirements<> "$GITHUB_OUTPUT" + echo "$files" >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + + + lint: name: Lint needs: @@ -1185,16 +1196,22 @@ jobs: vulnerability-scan: name: PIP file Scan (requirements.txt) runs-on: ubuntu-latest + needs: + - init permissions: contents: read # Required to checkout and read repo files security-events: write # Required to upload SARIF files to Security tab + strategy: + fail-fast: false + matrix: + requirements: ${{ fromJSON(needs.init.outputs.requirements_set) }} steps: - uses: actions/checkout@v4 - - name: Run Trivy vulnerability scanner against requirements.txt + - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} uses: aquasecurity/trivy-action@0.33.1 with: scan-type: 'fs' @@ -1202,24 +1219,24 @@ jobs: format: 'sarif' output: 'trivy-results.sarif' severity: 'LOW,MEDIUM,HIGH,CRITICAL' - scan-ref: requirements.txt + scan-ref: ${{ matrix.requirements }} exit-code: 0 - - name: Upload requirements.txt scan results to GitHub Security tab + - name: Upload ${{ matrix.requirements }} scan results to GitHub Security tab uses: github/codeql-action/upload-sarif@v3 with: sarif_file: 'trivy-results.sarif' - - name: Upload scan results sarif Report) + - name: Upload scan results ${{ matrix.requirements }} sarif Report uses: actions/upload-artifact@v4 with: - name: python-scan-results-sarif + name: python-scan-results-${{ matrix.requirements }}-sarif path: trivy-results.sarif - - name: Run Trivy vulnerability scanner against requirements.txt (json Report) + - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} (json Report) uses: aquasecurity/trivy-action@0.33.1 with: scan-type: 'fs' @@ -1227,14 +1244,14 @@ jobs: format: 'json' output: 'scan-results.json' severity: 'LOW,MEDIUM,HIGH,CRITICAL' - scan-ref: requirements.txt + scan-ref: ${{ matrix.requirements }} exit-code: 0 - - name: Upload scan results (json Report) + - name: Upload scan results ${{ matrix.requirements }}(json Report) uses: actions/upload-artifact@v4 with: - name: python-scan-results-json + name: python-scan-results-${{ matrix.requirements }}-json path: scan-results.json @@ -1242,15 +1259,20 @@ jobs: vulnerability-report: name: Create Reports needs: + - init - vulnerability-scan runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + requirements: ${{ fromJSON(needs.init.outputs.requirements_set) }} steps: - - name: Fetch scan results (json Report) + - name: Fetch scan results ${{ matrix.requirements }}(json Report) uses: actions/download-artifact@v4 with: - name: python-scan-results-json + name: python-scan-results-${{ matrix.requirements }}-json - name: Create Vulnerabilities (Critical/High) @@ -1279,7 +1301,7 @@ jobs: jq -r ' [ - "# Python Scan Results (requirements.txt)", + "# Python Scan Results (${{ matrix.requirements }})", "", "**Scan Date:** _" + ( .CreatedAt // "" ) + "_", "**File:** _" + ( .ArtifactName // "" ) + "_", @@ -1294,7 +1316,7 @@ jobs: def to_md: "| " + (.VulnerabilityID // "") + " | " + (.PkgName // "") + " | " + (.InstalledVersion // "") + " | " + (.Severity // "") + " | " + (.Title // "") + " |"; [ - "## High and Critical Vulnerabilities", + "## High and Critical Vulnerabilities - ${{ matrix.requirements }}", "", "| Vulnerability ID | Package | Version | Severity | Description |", "| --------- | ----- | ----- | ----- | -------|", @@ -1339,7 +1361,7 @@ jobs: jq -r ' [ - "# Full Scan Results", + "# Full Scan Results - ${{ matrix.requirements }}", "", "**Scan Date:** _" + ( .CreatedAt // "" ) + "_", "**File:** _" + ( .ArtifactName // "" ) + "_", @@ -1373,21 +1395,21 @@ jobs: - name: Upload scan results uses: actions/upload-artifact@v4 with: - name: python-vulnerability-report + name: python-vulnerability-report-${{ matrix.requirements }} path: vulnerability-report.md - name: Upload scan results uses: actions/upload-artifact@v4 with: - name: python-vulnerability-report-full + name: python-vulnerability-report-full-${{ matrix.requirements }} path: full-vulnerability-report.md - uses: dtinth/markdown-report-action@v1 with: - name: Python Vulnerability Report - title: Python Vulnerability Report + name: Python Vulnerability Report - ${{ matrix.requirements }} + title: Python Vulnerability Report - ${{ matrix.requirements }} body-file: full-vulnerability-report.md @@ -1395,10 +1417,15 @@ jobs: pull-request-report-comment: if: ${{ github.ref_type != 'tag' }} needs: + - init - vulnerability-scan - vulnerability-report runs-on: ubuntu-latest name: Comment on Pull Request (Python Scan) + strategy: + fail-fast: false + matrix: + requirements: ${{ fromJSON(needs.init.outputs.requirements_set) }} steps: @@ -1413,7 +1440,7 @@ jobs: if: ${{ steps.finder.outputs.pr != '' }} uses: actions/download-artifact@v4 with: - name: python-vulnerability-report + name: python-vulnerability-report-${{ matrix.requirements }} - name: Capture scan results @@ -1430,6 +1457,6 @@ jobs: uses: marocchino/sticky-pull-request-comment@v2 with: number: ${{ steps.finder.outputs.pr }} - header: Python requirements.txt Scan Results + header: Python ${{ matrix.requirements }} Scan Results message: | ${{ env.report }} From 6300911ec1497d34d38575c1fa80e291e43f6eee Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 8 Feb 2026 14:56:41 +0930 Subject: [PATCH 097/148] refactor(python_integration): combine all artifacts as one --- .github/workflows/python-integration.yaml | 25 +++++++---------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index d239b20..72ad826 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -110,28 +110,17 @@ jobs: name: integration-test-report-junit-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} path: integration.JUnit.xml - - name: Upload Artifacts - Logs + - name: Upload Artifacts uses: actions/upload-artifact@v4 if: success() || failure() with: name: integration-logs-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} - path: test/volumes/log/* - - - - name: Upload Artifacts - Tests - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: integration-tests-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} - path: test/volumes/artifacts/* - - - name: Upload any logs from tests - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: integration-test-centurion-logs-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} - path: log/* - include-hidden-files: true + path: | + app/log/ + artifacts/ + log/ + test/volumes/log/ + test/volumes/artifacts/ - name: log file check if: success() || failure() From 4c79128600ac4df7c58a491e60eee8dc9cf33d45 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 12 Feb 2026 15:07:41 +0930 Subject: [PATCH 098/148] feat(python): update nx set shas --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 0b4cd6d..b4d1645 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -75,7 +75,7 @@ jobs: echo BASE_BRANCH=${BASE_BRANCH} > $GITHUB_OUTPUT - - uses: nrwl/nx-set-shas@dbe0650947e5f2c81f59190a38512cf49126fe6b #v4.3.0 + - uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 #v4.4.0 id: setSHAs with: main-branch-name: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} From f84b320b914871df1d20f02341208a78e90c8efc Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 12 Feb 2026 15:21:32 +0930 Subject: [PATCH 099/148] chore(python): add trace to meta --- .github/workflows/python.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index b4d1645..c371a1d 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -75,6 +75,13 @@ jobs: echo BASE_BRANCH=${BASE_BRANCH} > $GITHUB_OUTPUT + - name: Trace + shell: bash + run: | + git log -5; + git branch; + + - uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 #v4.4.0 id: setSHAs with: From ec46249f78751ec6b4f1044838be813dd58b68bc Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 12 Feb 2026 15:35:40 +0930 Subject: [PATCH 100/148] fix(python): ensure correct feat branch used --- .github/workflows/python.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index c371a1d..055c375 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -66,7 +66,17 @@ jobs: else - BASE_BRANCH=feature-next-release + if [ $(git rev-parse --verify feat-next-release) ]; then + + BASE_BRANCH=feat-next-release + + elif [ $(git rev-parse --verify feature-next-release) ]; then + + BASE_BRANCH=feature-next-release + + fi + + echo $BASE_BRANCH fi; From 6f6c75725ae703e133ecc76ee282716ff1cf288b Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 13 May 2026 14:55:28 +0930 Subject: [PATCH 101/148] fix: update trivy action to use found --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 055c375..08e4987 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1229,7 +1229,7 @@ jobs: - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} - uses: aquasecurity/trivy-action@0.33.1 + uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2 with: scan-type: 'fs' ignore-unfixed: false @@ -1254,7 +1254,7 @@ jobs: - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} (json Report) - uses: aquasecurity/trivy-action@0.33.1 + uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2 with: scan-type: 'fs' ignore-unfixed: false From 59c6665e5b1c8425c8643fd3a36394bc96b86243 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 26 Jun 2026 16:05:44 +0930 Subject: [PATCH 102/148] feat: Enable schedule for pip file scanning for python workflow ref: nofusscomputing/centurion_erp#1172 --- .github/workflows/python.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 08e4987..c5e9f44 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -146,6 +146,7 @@ jobs: name: Lint needs: - init + if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: max-parallel: 4 @@ -232,6 +233,7 @@ jobs: runs-on: ubuntu-latest needs: - lint + if: github.event_name != 'schedule' strategy: max-parallel: 4 matrix: @@ -337,6 +339,7 @@ jobs: runs-on: ubuntu-latest needs: - lint + if: github.event_name != 'schedule' strategy: max-parallel: 4 matrix: @@ -441,6 +444,7 @@ jobs: needs: - unit-test - functional-test + if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: max-parallel: 4 @@ -561,6 +565,7 @@ jobs: name: Create Test Reports needs: - unit-test + if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: max-parallel: 4 @@ -638,6 +643,7 @@ jobs: name: Create Test Reports (Functional) needs: - functional-test + if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: max-parallel: 4 @@ -715,6 +721,7 @@ jobs: name: Create Coverage report needs: - unit-test + if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: max-parallel: 4 @@ -784,6 +791,7 @@ jobs: name: Create Coverage report (Functional) needs: - functional-test + if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: max-parallel: 4 @@ -853,7 +861,7 @@ jobs: badge-endpoint: name: Publish Badge endpoint files - if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }} + if: ${{ (github.ref_name == 'master' || github.ref_name == 'development') && github.event_name != 'schedule' }} needs: - unit-test - report @@ -1033,7 +1041,7 @@ jobs: badge-endpoint-functional: name: Publish Badge endpoint files (Functional) - if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }} + if: ${{ (github.ref_name == 'master' || github.ref_name == 'development') && github.event_name != 'schedule' }} needs: - functional-test - functional-report @@ -1247,6 +1255,7 @@ jobs: - name: Upload scan results ${{ matrix.requirements }} sarif Report + if: github.event_name != 'schedule' uses: actions/upload-artifact@v4 with: name: python-scan-results-${{ matrix.requirements }}-sarif @@ -1254,6 +1263,7 @@ jobs: - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} (json Report) + if: github.event_name != 'schedule' uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2 with: scan-type: 'fs' @@ -1266,6 +1276,7 @@ jobs: - name: Upload scan results ${{ matrix.requirements }}(json Report) + if: github.event_name != 'schedule' uses: actions/upload-artifact@v4 with: name: python-scan-results-${{ matrix.requirements }}-json @@ -1278,6 +1289,7 @@ jobs: needs: - init - vulnerability-scan + if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: fail-fast: false @@ -1432,7 +1444,7 @@ jobs: pull-request-report-comment: - if: ${{ github.ref_type != 'tag' }} + if: ${{ github.ref_type != 'tag' && github.event_name != 'schedule' }} needs: - init - vulnerability-scan From cc05d4c970ae25eac43c264764f119af27f8d761 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 30 Jun 2026 15:00:09 +0930 Subject: [PATCH 103/148] feat: Add ability to only run python version matracies for specified default version of python --- .github/workflows/python.yaml | 55 ++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index c5e9f44..9def272 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -5,6 +5,11 @@ name: 'Python' on: workflow_call: inputs: + DEFAULT_ONLY: + default: false + description: Should this run be for the default python version only + required: false + type: boolean LINT: default: true description: Should pylint run @@ -15,6 +20,16 @@ on: description: Should pylint return error on Warning required: false type: boolean + PYTHON_VERSION: + default: '3.11' + description: Default Python Version + required: false + type: string + PYTHON_VERSIONS: + default: '["3.10", "3.11","3.12","3.13"]' + description: Default Python Version + required: false + type: string secrets: WORKFLOW_TOKEN: description: "token to clone with" @@ -37,9 +52,24 @@ jobs: py-any-changed: ${{ steps.changed-files.outputs.any_changed}} tesy-changed-files: ${{ steps.changed-files.outputs.test_changed_files }} requirements_set: ${{ steps.requirements_set.outputs.requirements }} + matrix_python_versions: ${{ steps.matrix_python_versions.outputs.MATRIX_PYTHON_VERSIONS }} steps: + - name: Matrix python versions + id: matrix_python_versions + run: | + if [ "${{ inputs.DEFAULT_ONLY }}" == "true" ]; then + + echo 'MATRIX_PYTHON_VERSIONS=[ "${{ inputs.PYTHON_VERSION }}" ]' >> $GITHUB_OUTPUT + + else + + echo 'MATRIX_PYTHON_VERSIONS=${{ inputs.PYTHON_VERSIONS }}' >> $GITHUB_OUTPUT + + fi; + + - uses: actions/checkout@v4 with: # fetch-depth: 100 @@ -151,7 +181,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.11', '3.12', '3.13'] + python-version: ${{ fromJson(needs.init.outputs.matrix_python_versions) }} steps: @@ -232,12 +262,13 @@ jobs: name: Unit Test runs-on: ubuntu-latest needs: + - init - lint if: github.event_name != 'schedule' strategy: max-parallel: 4 matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] + python-version: ${{ fromJson(needs.init.outputs.matrix_python_versions) }} outputs: unit-test-coverage: ${{ steps.run-unit-test.outputs.coverage }} unit-test-branch_coverage: ${{ steps.run-unit-test.outputs.branch_coverage }} @@ -338,12 +369,13 @@ jobs: name: Functional Test runs-on: ubuntu-latest needs: + - init - lint if: github.event_name != 'schedule' strategy: max-parallel: 4 matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] + python-version: ${{ fromJson(needs.init.outputs.matrix_python_versions) }} outputs: functional-test-coverage: ${{ steps.run-functional-test.outputs.coverage }} functional-test-branch_coverage: ${{ steps.run-functional-test.outputs.branch_coverage }} @@ -442,6 +474,7 @@ jobs: combines_report: name: Create Combined Test Reports needs: + - init - unit-test - functional-test if: github.event_name != 'schedule' @@ -449,7 +482,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] + python-version: ${{ fromJson(needs.init.outputs.matrix_python_versions) }} steps: @@ -564,13 +597,14 @@ jobs: report: name: Create Test Reports needs: + - init - unit-test if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: max-parallel: 4 matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] + python-version: ${{ fromJson(needs.init.outputs.matrix_python_versions) }} steps: @@ -642,13 +676,14 @@ jobs: functional-report: name: Create Test Reports (Functional) needs: + - init - functional-test if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: max-parallel: 4 matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] + python-version: ${{ fromJson(needs.init.outputs.matrix_python_versions) }} steps: @@ -726,7 +761,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.12'] + python-version: [ "${{ inputs.PYTHON_VERSION }}" ] steps: - name: Run Tests @@ -796,7 +831,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.12'] + python-version: [ "${{ inputs.PYTHON_VERSION }}" ] steps: - name: Run Tests @@ -868,7 +903,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.12'] + python-version: [ "${{ inputs.PYTHON_VERSION }}" ] runs-on: ubuntu-latest steps: @@ -1048,7 +1083,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.12'] + python-version: [ "${{ inputs.PYTHON_VERSION }}" ] runs-on: ubuntu-latest steps: From 3c9c0a8fe6297799531dd9296b9abdf8058b0119 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 1 Jul 2026 18:17:04 +0930 Subject: [PATCH 104/148] feat: Enable specifying branch for vuln scan --- .github/workflows/python.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 9def272..7a33d79 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -5,6 +5,10 @@ name: 'Python' on: workflow_call: inputs: + BRANCH: + description: Branch to run the Vulnerability scan on + required: false + type: string DEFAULT_ONLY: default: false description: Should this run be for the default python version only @@ -1267,8 +1271,14 @@ jobs: requirements: ${{ fromJSON(needs.init.outputs.requirements_set) }} steps: + - name: Resolve branch + run: | + echo "BRANCH=${{ inputs.BRANCH || github.ref_name }}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + with: + ref: ${{ env.BRANCH }} - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} From 87e65d43e559a2a39440ca2a7226af28529e42b7 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 27 Jul 2026 13:06:08 +0930 Subject: [PATCH 105/148] feat: Always upload the report as artifact for vuln scan --- .github/workflows/python.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 7a33d79..6e791d4 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1300,7 +1300,6 @@ jobs: - name: Upload scan results ${{ matrix.requirements }} sarif Report - if: github.event_name != 'schedule' uses: actions/upload-artifact@v4 with: name: python-scan-results-${{ matrix.requirements }}-sarif From 2fb19705540a0dc3908d97c7b7a9d1a0d6cfa10c Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 15:09:42 +0930 Subject: [PATCH 106/148] feat: update action `actions/upload-artifact` v4 -> v7.0.1 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python-integration.yaml | 8 ++--- .github/workflows/python.yaml | 42 +++++++++++------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 72ad826..6d84289 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -104,14 +104,14 @@ jobs: - name: Upload Junit Test Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: integration-test-report-junit-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} path: integration.JUnit.xml - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: integration-logs-python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }} @@ -154,7 +154,7 @@ jobs: - name: Upload Badge Endpoint json - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: badge_endpoint_integration_postgres_versions path: badge_endpoint_integration_postgres_versions.json @@ -177,7 +177,7 @@ jobs: - name: Upload Badge Endpoint json - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: badge_endpoint_integration_rabbitmq_versions path: badge_endpoint_integration_rabbitmq_versions.json diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 6e791d4..9787497 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -317,7 +317,7 @@ jobs: - name: Upload Test Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: unit-test-results-${{ matrix.python-version }} @@ -325,7 +325,7 @@ jobs: - name: Upload Coverage Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: coverage-report-${{ matrix.python-version }} @@ -333,7 +333,7 @@ jobs: - name: Upload Coverage Report (json) - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: coverage-report-json-${{ matrix.python-version }} @@ -341,14 +341,14 @@ jobs: - name: Upload Coverage - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: coverage-${{ matrix.python-version }} path: coverage/* - name: Upload Unit Coverage (rc) - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: coverage-rc-unit-${{ matrix.python-version }} @@ -356,7 +356,7 @@ jobs: include-hidden-files: true - name: Upload any logs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: unit-test-centurion-logs-${{ matrix.python-version }} @@ -423,7 +423,7 @@ jobs: - name: Upload Test Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: functional-test-results-${{ matrix.python-version }} @@ -431,7 +431,7 @@ jobs: - name: Upload Coverage Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: functional-coverage-report-${{ matrix.python-version }} @@ -439,7 +439,7 @@ jobs: - name: Upload Coverage Report (json) - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: functional-coverage-report-json-${{ matrix.python-version }} @@ -447,14 +447,14 @@ jobs: - name: Upload Coverage - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: functional-coverage-${{ matrix.python-version }} path: coverage/functional/* - name: Upload Functional Coverage (rc) - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: coverage-rc-functional-${{ matrix.python-version }} @@ -462,7 +462,7 @@ jobs: include-hidden-files: true - name: Upload any logs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: functional-test-centurion-logs-${{ matrix.python-version }} @@ -561,7 +561,7 @@ jobs: - name: Upload Combined Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: coverage-combined-unit-function-html-${{ matrix.python-version }} @@ -669,7 +669,7 @@ jobs: - name: Upload Badge Endpoint json - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: unit-test-shield-endpoint-${{ matrix.python-version }} @@ -748,7 +748,7 @@ jobs: - name: Upload Badge Endpoint json - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: functional-test-shield-endpoint-${{ matrix.python-version }} @@ -818,7 +818,7 @@ jobs: update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" - name: Upload Coverage Summary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: code-coverage-results-${{ matrix.python-version }} @@ -890,7 +890,7 @@ jobs: update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" - name: Upload Coverage Summary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: name: functional-code-coverage-results-${{ matrix.python-version }} @@ -1300,7 +1300,7 @@ jobs: - name: Upload scan results ${{ matrix.requirements }} sarif Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: python-scan-results-${{ matrix.requirements }}-sarif path: trivy-results.sarif @@ -1321,7 +1321,7 @@ jobs: - name: Upload scan results ${{ matrix.requirements }}(json Report) if: github.event_name != 'schedule' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: python-scan-results-${{ matrix.requirements }}-json path: scan-results.json @@ -1466,14 +1466,14 @@ jobs: - name: Upload scan results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: python-vulnerability-report-${{ matrix.requirements }} path: vulnerability-report.md - name: Upload scan results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: python-vulnerability-report-full-${{ matrix.requirements }} path: full-vulnerability-report.md From 38c96ed2fe6b5bfd435f2ed8902b0193cf6ba879 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 15:15:34 +0930 Subject: [PATCH 107/148] feat: update action `actions/checkout` v4 -> v7.0.1 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python-integration.yaml | 4 ++-- .github/workflows/python-package.yaml | 2 +- .github/workflows/python.yaml | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 6d84289..3bec612 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -40,7 +40,7 @@ jobs: steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 fetch-tags: 'true' @@ -184,7 +184,7 @@ jobs: - name: Checkout Endpoint Repo - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: 'nofusscomputing/.github' ref: 'master' diff --git a/.github/workflows/python-package.yaml b/.github/workflows/python-package.yaml index 08ae868..acb8fd3 100644 --- a/.github/workflows/python-package.yaml +++ b/.github/workflows/python-package.yaml @@ -14,7 +14,7 @@ jobs: steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 9787497..86bc42f 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -74,7 +74,7 @@ jobs: fi; - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: # fetch-depth: 100 fetch-depth: 0 @@ -189,7 +189,7 @@ jobs: steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} @@ -280,7 +280,7 @@ jobs: steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Python ${{ matrix.python-version }} @@ -387,7 +387,7 @@ jobs: steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Python ${{ matrix.python-version }} @@ -490,7 +490,7 @@ jobs: steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Set up Python ${{ matrix.python-version }} @@ -612,7 +612,7 @@ jobs: steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Trace 'ls -la' @@ -691,7 +691,7 @@ jobs: steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Trace 'ls -la' @@ -912,7 +912,7 @@ jobs: steps: - name: Checkout Endpoint Repo - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: 'nofusscomputing/.github' ref: 'master' @@ -1092,7 +1092,7 @@ jobs: steps: - name: Checkout Endpoint Repo - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: 'nofusscomputing/.github' ref: 'master' @@ -1276,7 +1276,7 @@ jobs: echo "BRANCH=${{ inputs.BRANCH || github.ref_name }}" >> $GITHUB_ENV - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ env.BRANCH }} From c7930c192298e9679535bead8f6895ae0adf1a25 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 15:18:30 +0930 Subject: [PATCH 108/148] feat: update action `actions/download-artifact` v4 -> v8.0.1 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python-integration.yaml | 4 ++-- .github/workflows/python-publish.yaml | 2 +- .github/workflows/python.yaml | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 3bec612..a547749 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -214,13 +214,13 @@ jobs: - name: Download Postgres Version Badge Endpoint json - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: badge_endpoint_integration_postgres_versions - name: Download RabbitMQ Version Badge Endpoint json - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: badge_endpoint_integration_rabbitmq_versions diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 5ef45e3..3ab639b 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -36,7 +36,7 @@ jobs: steps: - name: Download built artifact to dist/ - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: Packages path: dist diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 86bc42f..44a0a76 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -513,7 +513,7 @@ jobs: - name: Download Unit Test Report - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 if: success() || failure() with: name: coverage-rc-unit-${{ matrix.python-version }} @@ -527,7 +527,7 @@ jobs: - name: Download Functional Test Report - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 if: success() || failure() with: name: coverage-rc-functional-${{ matrix.python-version }} @@ -622,7 +622,7 @@ jobs: - name: Download Test Report - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 if: success() || failure() with: name: unit-test-results-${{ matrix.python-version }} @@ -701,7 +701,7 @@ jobs: - name: Download Test Report - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 if: success() || failure() with: name: functional-test-results-${{ matrix.python-version }} @@ -774,7 +774,7 @@ jobs: ls -l; - name: Download Coverage Artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: coverage-report-${{ matrix.python-version }} github-token: ${{ github.token }} @@ -844,7 +844,7 @@ jobs: ls -l; - name: Download Coverage Artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 if: success() || failure() with: name: functional-coverage-report-${{ matrix.python-version }} @@ -942,7 +942,7 @@ jobs: - name: Download Badge Endpoint json - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: unit-test-shield-endpoint-${{ matrix.python-version }} @@ -1122,7 +1122,7 @@ jobs: - name: Download Badge Endpoint json - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: functional-test-shield-endpoint-${{ matrix.python-version }} @@ -1343,7 +1343,7 @@ jobs: - name: Fetch scan results ${{ matrix.requirements }}(json Report) - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: python-scan-results-${{ matrix.requirements }}-json @@ -1511,7 +1511,7 @@ jobs: - name: Fetch Vulnerability Report if: ${{ steps.finder.outputs.pr != '' }} - uses: actions/download-artifact@v4 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: python-vulnerability-report-${{ matrix.requirements }} From 713598db4c6c275735d89aa61efc38f33c6080ee Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 15:33:06 +0930 Subject: [PATCH 109/148] feat: update action `github/codeql-action/upload-sarif` v3 -> v4.37.3 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 44a0a76..702d8f3 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1294,7 +1294,7 @@ jobs: - name: Upload ${{ matrix.requirements }} scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v3 + uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 with: sarif_file: 'trivy-results.sarif' From 145acdcb326eaa3cd8026c75963816d968a353b6 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 16:27:51 +0930 Subject: [PATCH 110/148] feat: update action `actions/setup-python` v5 -> v7.0.0 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python-integration.yaml | 2 +- .github/workflows/python.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index a547749..8d4724d 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -58,7 +58,7 @@ jobs: sudo apt-get install -y docker-compose - name: Set up Python ${{ inputs.PYTHON_VERSION }} - uses: actions/setup-python@v5 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ inputs.PYTHON_VERSION }} diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 702d8f3..edb778c 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -195,7 +195,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} - uses: actions/setup-python@v5 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} @@ -284,7 +284,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} @@ -391,7 +391,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} @@ -494,7 +494,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} From b7a49c94c97e28b38b8649b2cbad6364d69c1468 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 16:31:26 +0930 Subject: [PATCH 111/148] feat: update action `jwalton/gh-find-current-pr` v1.3.3 -> v1.3.5 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index edb778c..0ac9f30 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1503,7 +1503,7 @@ jobs: - name: Find Current Pull Request - uses: jwalton/gh-find-current-pr@89ee5799558265a1e0e31fab792ebb4ee91c016b #v1.3.3 + uses: jwalton/gh-find-current-pr@f3d61b485d2801773f7a07b2aaa3306bd8f8e653 #v1.3.5 id: finder # with: # sha: ${{ github.event.pull_request.head.sha }} From ec9bc7e90775125107c0c39ccb5493991d6f2753 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 17:50:36 +0930 Subject: [PATCH 112/148] feat: update action `marocchino/sticky-pull-request-comment` v2 -> v3.0.5 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 0ac9f30..5d70f53 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1527,7 +1527,7 @@ jobs: - name: Comment scan results on PR if: ${{ steps.finder.outputs.pr != '' }} - uses: marocchino/sticky-pull-request-comment@v2 + uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 with: number: ${{ steps.finder.outputs.pr }} header: Python ${{ matrix.requirements }} Scan Results From 231e75508fbd817dc4cab579974c0cb63a6abb50 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 17:53:55 +0930 Subject: [PATCH 113/148] feat: update action `aquasecurity/trivy-action` v0.34.2 -> v0.36.0 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 5d70f53..8aa3376 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1282,7 +1282,7 @@ jobs: - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} - uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2 + uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 with: scan-type: 'fs' ignore-unfixed: false @@ -1308,7 +1308,7 @@ jobs: - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} (json Report) if: github.event_name != 'schedule' - uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478 # 0.34.2 + uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 with: scan-type: 'fs' ignore-unfixed: false From 7a501c6bef8b54519a5c69683d78d8ff359f036f Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 17:57:14 +0930 Subject: [PATCH 114/148] feat: update action `nrwl/nx-set-shas` v4.4.0 -> v5.0.1 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 8aa3376..c02f7f5 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -126,7 +126,7 @@ jobs: git branch; - - uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 #v4.4.0 + - uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 #v5.0.1 id: setSHAs with: main-branch-name: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} From 34904b88005633483f84d9067f3345560a59b0f5 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 18:03:27 +0930 Subject: [PATCH 115/148] feat: update action `tj-actions/changed-files` v46.0.5 -> v47.0.6 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index c02f7f5..9bbe854 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -142,7 +142,7 @@ jobs: - name: Get all files that have changed id: changed-files if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} - uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 with: files: | **.py From 41bcbfb0fb417dbc361568351a63ab80bf66d679 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 18:32:48 +0930 Subject: [PATCH 116/148] fix: Add gate to badge endpoint so it only runs on our repo ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python-integration.yaml | 7 +++++-- .github/workflows/python.yaml | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 8d4724d..5b02535 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -23,7 +23,7 @@ on: secrets: WORKFLOW_TOKEN: description: "token to clone with" - required: true + required: false jobs: @@ -131,7 +131,10 @@ jobs: badge-endpoint-versions: name: Publish Version Badge endpoint files - if: ${{ github.ref_name == 'master' || github.ref_name == 'development' }} + if: >- + (github.ref_name == 'master' || github.ref_name == 'development') + && + github.repository == 'nofusscomputing/centurion_erp' needs: - integration-test runs-on: ubuntu-latest diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 9bbe854..360ddd9 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -37,7 +37,7 @@ on: secrets: WORKFLOW_TOKEN: description: "token to clone with" - required: true + required: false env: @@ -900,7 +900,12 @@ jobs: badge-endpoint: name: Publish Badge endpoint files - if: ${{ (github.ref_name == 'master' || github.ref_name == 'development') && github.event_name != 'schedule' }} + if: >- + (github.ref_name == 'master' || github.ref_name == 'development') + && + github.event_name != 'schedule' + && + github.repository == 'nofusscomputing/centurion_erp' needs: - unit-test - report @@ -1080,7 +1085,12 @@ jobs: badge-endpoint-functional: name: Publish Badge endpoint files (Functional) - if: ${{ (github.ref_name == 'master' || github.ref_name == 'development') && github.event_name != 'schedule' }} + if: >- + (github.ref_name == 'master' || github.ref_name == 'development') + && + github.event_name != 'schedule' + && + github.repository == 'nofusscomputing/centurion_erp' needs: - functional-test - functional-report From 2480475262336267a28492287d12ab642be8b639 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 18:40:39 +0930 Subject: [PATCH 117/148] feat: update `dorny/test-reporter` v1 -> v3.0.0 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 360ddd9..cd87b84 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -636,7 +636,7 @@ jobs: - name: Test Report if: success() || failure() - uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 + uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 id: test-report with: # artifact: unit-test-results-${{ matrix.python-version }} @@ -714,7 +714,7 @@ jobs: - name: Test Report - uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 + uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 id: test-report with: # artifact: functional-test-results-${{ matrix.python-version }} @@ -1537,7 +1537,7 @@ jobs: - name: Comment scan results on PR if: ${{ steps.finder.outputs.pr != '' }} - uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 + uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5 with: number: ${{ steps.finder.outputs.pr }} header: Python ${{ matrix.requirements }} Scan Results From a8bdc19594f149c424c54004f278dfe3f91dd0b3 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 18:42:17 +0930 Subject: [PATCH 118/148] feat: update `im-open/process-code-coverage-summaryr` v2.3.0 -> v2.3.1 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index cd87b84..72169a1 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -808,7 +808,7 @@ jobs: - name: create status check/comment for code coverage results id: jest_coverage_check - uses: im-open/process-code-coverage-summary@v2.3.0 + uses: im-open/process-code-coverage-summary@e2984f897702d68619d358a834d80a74aa0d9840 # v2.3.1 if: success() || failure() with: github-token: ${{ github.token }} @@ -879,7 +879,7 @@ jobs: - name: create status check/comment for code coverage results id: jest_coverage_check - uses: im-open/process-code-coverage-summary@v2.3.0 + uses: im-open/process-code-coverage-summary@e2984f897702d68619d358a834d80a74aa0d9840 # v2.3.1 if: success() || failure() with: github-token: ${{ github.token }} From bf4a9203c58a40d6a6a3765e1ce2223d24c59004 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 19:43:48 +0930 Subject: [PATCH 119/148] feat: revert tests only on change GH does not have feature where you can make requirement skip if not exists ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 72169a1..2828071 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -53,6 +53,7 @@ jobs: changed-files: ${{ steps.changed-files.outputs.project_all_changed_files }} doc-changed-files: ${{ steps.changed-files.outputs.docs_changed_files }} py-changed-files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + pip-any-changed: ${{ steps.changed-files-pip.outputs.any_changed}} py-any-changed: ${{ steps.changed-files.outputs.any_changed}} tesy-changed-files: ${{ steps.changed-files.outputs.test_changed_files }} requirements_set: ${{ steps.requirements_set.outputs.requirements }} @@ -166,6 +167,28 @@ jobs: + - name: Get pip-file-changes + id: changed-files-pip + if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} + uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 + with: + files: | + requiremen*.txt + base_sha: ${{ steps.base-branch-name.outputs.BASE_BRANCH }} + + + - name: List all changed pip files + # if: steps.changed-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_PIP_FILES: ${{ steps.changed-files-pip.outputs.all_changed_and_modified_files }} + run: | + echo "changed: ${ALL_CHANGED_PIP_FILES}": + for file in ${ALL_CHANGED_PIP_FILES}; do + echo "$file was changed" + done + + + - name: Find requirements files id: requirements_set run: | From 0e7339b8f0b415889531e96451e1cec16808d876 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 29 Jul 2026 20:42:15 +0930 Subject: [PATCH 120/148] feat: update integration `dorny/test-reporter` v1 -> v3.0.0 ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python-integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 5b02535..7ff95b2 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -94,7 +94,7 @@ jobs: - name: Test Report if: success() || failure() - uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 + uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 id: test-report with: name: Integration Test Report [python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}] From fc65a58391c88379a6fed2159caa476dba1e5a40 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 30 Jul 2026 18:05:39 +0930 Subject: [PATCH 121/148] feat: use sarif report to create pr comment and vuln report ref: https://github.com/nofusscomputing/centurion_erp/pull/1202 https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 167 +++++++--------------------------- 1 file changed, 33 insertions(+), 134 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 2828071..9db6c8d 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1339,27 +1339,6 @@ jobs: path: trivy-results.sarif - - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} (json Report) - if: github.event_name != 'schedule' - uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 - with: - scan-type: 'fs' - ignore-unfixed: false - format: 'json' - output: 'scan-results.json' - severity: 'LOW,MEDIUM,HIGH,CRITICAL' - scan-ref: ${{ matrix.requirements }} - exit-code: 0 - - - - name: Upload scan results ${{ matrix.requirements }}(json Report) - if: github.event_name != 'schedule' - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: python-scan-results-${{ matrix.requirements }}-json - path: scan-results.json - - vulnerability-report: name: Create Reports @@ -1375,127 +1354,61 @@ jobs: steps: - - name: Fetch scan results ${{ matrix.requirements }}(json Report) + - name: Fetch scan results ${{ matrix.requirements }}(sarif Report) uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: - name: python-scan-results-${{ matrix.requirements }}-json - - - - name: Create Vulnerabilities (Critical/High) - run: | - echo "[Debug] jq -r '.Results'=$(jq -r '.Results' scan-results.json)"; - - if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then - - if [ "$(jq -r '.Results[] | .Vulnerabilities' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results[] | .Vulnerabilities' scan-results.json)" != '0' ]; then - - not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; - - else - - not_empty=""; - - fi - - else - - not_empty=""; - - fi + name: python-scan-results-${{ matrix.requirements }}-sarif - echo "[Debug] not_empty=${not_empty}"; - - jq -r ' - [ - "# Python Scan Results (${{ matrix.requirements }})", - "", - "**Scan Date:** _" + ( .CreatedAt // "" ) + "_", - "**File:** _" + ( .ArtifactName // "" ) + "_", - "" - ] | join("\n") - ' scan-results.json > vulnerability-report.md - - if [ "$not_empty" ]; then - jq -r ' - def hr(severity): - if severity == "HIGH" or severity == "CRITICAL" then true else false end; - def to_md: - "| " + (.VulnerabilityID // "") + " | " + (.PkgName // "") + " | " + (.InstalledVersion // "") + " | " + (.Severity // "") + " | " + (.Title // "") + " |"; - [ - "## High and Critical Vulnerabilities - ${{ matrix.requirements }}", - "", - "| Vulnerability ID | Package | Version | Severity | Description |", - "| --------- | ----- | ----- | ----- | -------|", - (.Results[] | .Vulnerabilities[] | select(hr(.Severity)) | to_md), - "" - ] | join("\n") - ' scan-results.json >> vulnerability-report.md - else - - echo "**Nothing Found**" >> vulnerability-report.md + - run: | + echo "${PWD}" || echo "couldnt PWD"; - fi; + echo "1"; + ls -la; + echo "2"; - - name: Create Full Vulnerabilities - run: | - echo "[Debug] jq -r '.Results'=$(jq -r '.Results' scan-results.json)"; + mkdir -p ${{ runner.temp }}/_github_home/ || echo "could not make"; - if [ "$(jq -r '.Results' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results' scan-results.json)" != '0' ]; then + echo "2.1"; - if [ "$(jq -r '.Results[] | .Vulnerabilities' scan-results.json)" != 'null' ] && [ "0$(jq -r '.Results[] | .Vulnerabilities' scan-results.json)" != '0' ]; then + ls -la ${{ runner.temp }}/_github_home/; - not_empty="$(jq -r '.Results[] | .Vulnerabilities[]' scan-results.json)"; + echo "3"; - else + mv -f trivy-results.sarif ${{ runner.temp }}/_github_home/trivy-results.sarif; - not_empty=""; + echo "4"; - fi + ls -la ${{ runner.temp }}/_github_home/; - else - not_empty=""; - fi + - name: Convert Sarif -> Markdown + if: success() || failure() + id: sarif-to-markdown + uses: 11notes/action-sarif-to-markdown@bc689850bd33a1037ea1d0a609ab4ea14b3c4396 # v1.2.0 + with: + sarif_file: trivy-results.sarif - echo "[Debug] not_empty=${not_empty}"; - - - jq -r ' - [ - "# Full Scan Results - ${{ matrix.requirements }}", - "", - "**Scan Date:** _" + ( .CreatedAt // "" ) + "_", - "**File:** _" + ( .ArtifactName // "" ) + "_", - "" - ] | join("\n") - ' scan-results.json > full-vulnerability-report.md - - if [ "$not_empty" ]; then - jq -r ' - def hr(severity): - if severity == "HIGH" or severity == "CRITICAL" then true else true end; - def to_md: - "| " + (.VulnerabilityID // "") + " | " + (.PkgName // "") + " | " + (.InstalledVersion // "") + " | " + (.Severity // "") + " | " + (.Title // "") + " |"; - [ - "## Vulnerabilities", - "", - "| Vulnerability ID | Package | Version | Severity | Description |", - "| --------- | ----- | ----- | ----- | -------|", - (.Results[] | .Vulnerabilities[] | select(.Severity) | to_md), - "" - ] | join("\n") - ' scan-results.json >> full-vulnerability-report.md + - name: Print Report + run: echo ${{ steps.sarif-to-markdown.outputs.markdown }} - else - echo "**Nothing Found**" >> full-vulnerability-report.md + - name: Create Report Artifact + run: | + ls -la ${{ runner.temp }}/_github_home/sarif.md; - fi; + echo "## PIP File Scan of \`${{ matrix.requirements }}\`" > vulnerability-report.md; + echo "" >> vulnerability-report.md; + echo ">[!tip]" >> vulnerability-report.md; + echo ">" >> vulnerability-report.md; + echo "> _If this report shows nothing, it means there was nothing found._" >> vulnerability-report.md; + echo "" >> vulnerability-report.md; + echo -n "#" >> vulnerability-report.md; + cat ${{ runner.temp }}/_github_home/sarif.md >> vulnerability-report.md; - name: Upload scan results @@ -1505,20 +1418,6 @@ jobs: path: vulnerability-report.md - - name: Upload scan results - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: python-vulnerability-report-full-${{ matrix.requirements }} - path: full-vulnerability-report.md - - - - uses: dtinth/markdown-report-action@v1 - with: - name: Python Vulnerability Report - ${{ matrix.requirements }} - title: Python Vulnerability Report - ${{ matrix.requirements }} - body-file: full-vulnerability-report.md - - pull-request-report-comment: if: ${{ github.ref_type != 'tag' && github.event_name != 'schedule' }} From fb5958c8cca1ac623b66722a5d556817d6b879f8 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 31 Jul 2026 16:58:25 +0930 Subject: [PATCH 122/148] feat: When linting, only show GH annotations for primary python version ref: https://github.com/nofusscomputing/centurion_erp/pull/1201 --- .github/workflows/python.yaml | 55 +++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 9db6c8d..d4f8b7f 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -52,7 +52,7 @@ jobs: outputs: changed-files: ${{ steps.changed-files.outputs.project_all_changed_files }} doc-changed-files: ${{ steps.changed-files.outputs.docs_changed_files }} - py-changed-files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} + py-changed-files: ${{ steps.changed-files.outputs.all_changed_files }} pip-any-changed: ${{ steps.changed-files-pip.outputs.any_changed}} py-any-changed: ${{ steps.changed-files.outputs.any_changed}} tesy-changed-files: ${{ steps.changed-files.outputs.test_changed_files }} @@ -231,6 +231,21 @@ jobs: pip install -r requirements_dev.txt + + # + # PyLint C value + # + # [I]nformational messages that Pylint emits (do not contribute to your analysis score) + + # [R]efactor for a "good practice" metric violation + + # [C]onvention for coding standard violation + + # [W]arning for stylistic problems, or minor programming issues + + # [E]rror for important programming issues (i.e. most probably bug) + + # [F]atal for errors which prevented further processing - name: Lint ${{ matrix.python-version }} id: lint if: inputs.LINT && needs.init.outputs.py-any-changed @@ -238,7 +253,43 @@ jobs: env: PY_CHANGED_FILES: ${{ needs.init.outputs.py-changed-files }} run: | - pylint --py-version ${{ matrix.python-version }} --msg-template "::notice file={path},line={line},endLine={end_line},title={msg_id}::{msg} see https://pylint.pycqa.org/en/latest/user_guide/messages/{category}/{symbol}.html" ${PY_CHANGED_FILES} || EXITCODE=$? + set +e; + + echo "Primary Python version [${{ inputs.PYTHON_VERSION }}], Matrix Python Version [${{ matrix.python-version }}]"; + + if [ "${{ inputs.PYTHON_VERSION }}" != "${{ matrix.python-version }}" ]; then + + echo "Only show Github annotations for primary Python version: ${{ inputs.PYTHON_VERSION }}"; + + pylint \ + --py-version ${{ matrix.python-version }} \ + ${PY_CHANGED_FILES} || EXITCODE=$? + + else + + # available are debug, notice, warning, error + + export I=debug; + export R=notice; + export C=warning; + export W=warning; + export E=error; + export F=error; + + pylint --py-version ${{ matrix.python-version }} --msg-template "::${C} file={path},line={line},endLine={end_line},title={msg_id}::{msg} see " ${PY_CHANGED_FILES} | envsubst; + + export EXITCODE=${PIPESTATUS[0]} + + # pylint \ + # --py-version ${{ matrix.python-version }} \ + # --msg-template "::notice \ + # file={path}, \ + # line={line}, \ + # endLine={end_line}, \ + # title={msg_id}::{msg} see https://pylint.pycqa.org/en/latest/user_guide/messages/{category}/{symbol}.html" \ + # ${PY_CHANGED_FILES} || EXITCODE=$? + + fi; echo "Exit code was $EXITCODE"; From 5c6402cf8ed2ded22363d26e317fbc9fc0e4aca8 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 31 Jul 2026 21:42:27 +0930 Subject: [PATCH 123/148] chore: attempt to turn issue on in gitea --- .gitea/ISSUE_TEMPLATE/config.yml | 3 + .github/workflows/python.yaml | 119 +++++++++++++++++++++++++++++-- 2 files changed, 116 insertions(+), 6 deletions(-) create mode 100644 .gitea/ISSUE_TEMPLATE/config.yml diff --git a/.gitea/ISSUE_TEMPLATE/config.yml b/.gitea/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..8b76b04 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,3 @@ +--- + +blank_issues_enabled: true diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index d4f8b7f..425d95e 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -291,6 +291,7 @@ jobs: fi; + echo "Exit code was $EXITCODE"; if [ "${EXITCODE}" ]; then @@ -306,29 +307,135 @@ jobs: echo "Exit code was ${EXITCODE}"; - - name: Fail on Error - if: steps.lint.outputs.exit_code == 1 + + - name: Lint ${{ matrix.python-version }} Bitwise check exit code + id: lint-exit-type + if: inputs.LINT && needs.init.outputs.py-any-changed shell: bash + env: + EXITCODE: ${{ steps.lint.outputs.exit_code }} run: | - echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" + # Check error code for exit type + # https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#exit-codes + + echo "PyLint uses an exit code that is bit-encoded which is bitwise checked for the severities found. "; + + if (( $EXITCODE & 1 )); then + + echo "Bitwise found: fatal"; + + echo "fatal=true" >> $GITHUB_OUTPUT + + else + + echo "fatal=false" >> $GITHUB_OUTPUT + + fi + + + if (( $EXITCODE & 2 )); then + + echo "Bitwise found: error"; + + echo "error=true" >> $GITHUB_OUTPUT + + else + + echo "error=false" >> $GITHUB_OUTPUT + + fi + + + if (( $EXITCODE & 4 )); then + + echo "Bitwise found: warning"; + + echo "warning=true" >> $GITHUB_OUTPUT + + else + + echo "warning=false" >> $GITHUB_OUTPUT + + fi + + + if (( $EXITCODE & 8 )); then + + echo "Bitwise found: refactor"; + + echo "refactor=true" >> $GITHUB_OUTPUT + + else + + echo "refactor=false" >> $GITHUB_OUTPUT + + fi + + + if (( $EXITCODE & 16 )); then + + echo "Bitwise found: convention"; + + echo "convention=true" >> $GITHUB_OUTPUT + + else + + echo "convention=false" >> $GITHUB_OUTPUT + + fi + + + if (( $EXITCODE & 32 )); then + + echo "Bitwise found: usage error"; + + echo "usage_error=true" >> $GITHUB_OUTPUT + + else + + echo "usage_error=false" >> $GITHUB_OUTPUT + + fi + - name: Fail on Fatal - if: steps.lint.outputs.exit_code == 2 + if: steps.lint-exit-type.outputs.fatal == 'true' + shell: bash + run: | + echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" + + + - name: Fail on Error + if: steps.lint-exit-type.outputs.error == 'true' shell: bash run: | echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" - name: Fail on Warning - if: inputs.LINT_ERROR_ON_WARNING && steps.lint.outputs.exit_code == 4 + if: steps.lint-exit-type.outputs.warning == 'true' + shell: bash + run: | + echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" + + + - name: Fail on Refactor + if: steps.lint-exit-type.outputs.refactor == 'true' + shell: bash + run: | + echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" + + + - name: Fail on Convention + if: steps.lint-exit-type.outputs.convention == 'true' shell: bash run: | echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" - name: Fail on Usage Error - if: steps.lint.outputs.exit_code == 32 + if: steps.lint-exit-type.outputs.usage_error == 'true' shell: bash run: | echo "Lint exit code was ${{ steps.lint.outputs.exit_code }}" From d3446c12358a1c3c2e0ec35800480471a1afeef7 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 1 Aug 2026 17:03:29 +0930 Subject: [PATCH 124/148] fix: vuln scan on schedule only requires brnach resolution --- .github/workflows/python.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 425d95e..21c5f40 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1468,9 +1468,13 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + if: github.event_name == 'schedule' with: ref: ${{ env.BRANCH }} + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + if: github.event_name != 'schedule' + - name: Run Trivy vulnerability scanner against ${{ matrix.requirements }} uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 From 431da10a4022f74df250d6c598a9f73b7c29dac2 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 1 Aug 2026 20:30:44 +0930 Subject: [PATCH 125/148] feat: Dont upload scan results to sy tab on forked pr --- .github/workflows/python.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 21c5f40..f9cc5f7 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1489,6 +1489,7 @@ jobs: - name: Upload ${{ matrix.requirements }} scan results to GitHub Security tab + if: github.event_name != 'pull_request' uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 with: sarif_file: 'trivy-results.sarif' From 38196561e50c569225003c8a61763a313e8f5707 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 1 Aug 2026 20:31:36 +0930 Subject: [PATCH 126/148] feat: Add spt for forked pr to find pr num from pull_request event --- .github/workflows/python.yaml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index f9cc5f7..e8f0abc 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1603,16 +1603,32 @@ jobs: # with: # sha: ${{ github.event.pull_request.head.sha }} + - name: Create PR VAR + shell: bash + run: + if [ "0${{ steps.finder.outputs.pr }}" != "0" ]; then + + echo "FOUND_PR_NUM=${{ steps.finder.outputs.pr }}" >> $GITHUB_ENV; + + fi; + + if [ "${{ github.event_name }}" == "pull_request" ]; then + + echo "FOUND_PR_NUM=${{ github.event.pull_request.number }}" >> $GITHUB_ENV; + + fi + + - name: Fetch Vulnerability Report - if: ${{ steps.finder.outputs.pr != '' }} + if: ${{ env.FOUND_PR_NUM != '' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: python-vulnerability-report-${{ matrix.requirements }} - name: Capture scan results - if: ${{ steps.finder.outputs.pr != '' }} + if: ${{ env.FOUND_PR_NUM != '' }} run: | content=$(cat vulnerability-report.md | head -c 65000) echo "report<> $GITHUB_ENV @@ -1621,10 +1637,10 @@ jobs: - name: Comment scan results on PR - if: ${{ steps.finder.outputs.pr != '' }} + if: ${{ env.FOUND_PR_NUM != '' }} uses: marocchino/sticky-pull-request-comment@5770ad5eb8f42dd2c4f34da00c94c5381e49af88 # v3.0.5 with: - number: ${{ steps.finder.outputs.pr }} + number: ${{ env.FOUND_PR_NUM }} header: Python ${{ matrix.requirements }} Scan Results message: | ${{ env.report }} From 5e279aca520dba4fd784be67b49894c63575a6c9 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 1 Aug 2026 20:51:05 +0930 Subject: [PATCH 127/148] feat: Disable PR comment for forked pr --- .github/workflows/python.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index e8f0abc..58f587c 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1583,7 +1583,12 @@ jobs: pull-request-report-comment: - if: ${{ github.ref_type != 'tag' && github.event_name != 'schedule' }} + if: >- + github.ref_type != 'tag' + && + github.event_name != 'schedule' + && + github.event_name != 'pull_request' needs: - init - vulnerability-scan From 57acb472b8691496768e4e1ef6cf1584d12dec30 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 2 Aug 2026 11:03:15 +0930 Subject: [PATCH 128/148] feat: Add Status check permissions --- .github/workflows/python.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 58f587c..8a4f0b8 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -786,6 +786,10 @@ jobs: - unit-test if: github.event_name != 'schedule' runs-on: ubuntu-latest + permissions: + contents: read + actions: read + checks: write strategy: max-parallel: 4 matrix: @@ -865,6 +869,10 @@ jobs: - functional-test if: github.event_name != 'schedule' runs-on: ubuntu-latest + permissions: + contents: read + actions: read + checks: write strategy: max-parallel: 4 matrix: From 6d58823d1dc555f6b54bc729a60a22898f032b21 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 2 Aug 2026 12:23:43 +0930 Subject: [PATCH 129/148] feat: Remove reporting from pr launched --- .github/workflows/python.yaml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 8a4f0b8..c3ebeba 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -784,7 +784,10 @@ jobs: needs: - init - unit-test - if: github.event_name != 'schedule' + if: >- + github.event_name != 'schedule' + && + github.event_name != 'pull_request' runs-on: ubuntu-latest permissions: contents: read @@ -867,7 +870,10 @@ jobs: needs: - init - functional-test - if: github.event_name != 'schedule' + if: >- + github.event_name != 'schedule' + && + github.event_name != 'pull_request' runs-on: ubuntu-latest permissions: contents: read @@ -998,7 +1004,12 @@ jobs: - name: create status check/comment for code coverage results id: jest_coverage_check uses: im-open/process-code-coverage-summary@e2984f897702d68619d358a834d80a74aa0d9840 # v2.3.1 - if: success() || failure() + if: >- + ( + success() || failure() + ) + && + github.event_name != 'pull_request' with: github-token: ${{ github.token }} summary-file: code-coverage-results.md @@ -1069,7 +1080,12 @@ jobs: - name: create status check/comment for code coverage results id: jest_coverage_check uses: im-open/process-code-coverage-summary@e2984f897702d68619d358a834d80a74aa0d9840 # v2.3.1 - if: success() || failure() + if: >- + ( + success() || failure() + ) + && + github.event_name != 'pull_request' with: github-token: ${{ github.token }} summary-file: code-coverage-results.md From 31e2a08927a1a5d432f6f49042e73bdc6cc8bd80 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 4 Aug 2026 13:24:44 +0930 Subject: [PATCH 130/148] feat: Add post python wf for forked branches --- .github/workflows/python-post.yaml | 241 +++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 .github/workflows/python-post.yaml diff --git a/.github/workflows/python-post.yaml b/.github/workflows/python-post.yaml new file mode 100644 index 0000000..d53d97b --- /dev/null +++ b/.github/workflows/python-post.yaml @@ -0,0 +1,241 @@ +name: 'Python - Post' + +on: + workflow_call: +# +# When you import this workflow use this trigger +# as the example +# +# on: +# workflow_run: +# workflows: +# - CI +# branches-ignore: +# - master +# - development +# - feat-* +# types: +# - completed + + +permissions: + contents: read # python-report-test + actions: read # python-report-test + checks: write # python-report-test + + +jobs: + + + trace: + name: Trace + if: >- + github.event.workflow_run.conclusion == 'success' + && + github.event.workflow_run.event == 'pull_request' + && + github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name + runs-on: ubuntu-latest + steps: + + + - name: Trace + shell: bash + run: + echo "***************** export env vars ****************"; + export; + echo "***************** Do PR vars show? ****************"; + echo "${{ github.pull_request }}"; + echo "***************** ****************"; + + echo "***************** ****************"; + + + - name: "[Trace] Dump event payload" + shell: bash + run: | + jq . "$GITHUB_EVENT_PATH" + + + - name: "[Trace] Dump environment" + shell: bash + run: | + env | sort + + + - name: "[Trace] Dump GitHub contexts" + shell: bash + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + INPUTS_CONTEXT: ${{ toJSON(inputs) }} + VARS_CONTEXT: ${{ toJSON(vars) }} + ENV_CONTEXT: ${{ toJSON(env) }} + JOB_CONTEXT: ${{ toJSON(job) }} + STEPS_CONTEXT: ${{ toJSON(steps) }} + RUNNER_CONTEXT: ${{ toJSON(runner) }} + STRATEGY_CONTEXT: ${{ toJSON(strategy) }} + MATRIX_CONTEXT: ${{ toJSON(matrix) }} + NEEDS_CONTEXT: ${{ toJSON(needs) }} + run: | + echo "===== github =====" + echo "$GITHUB_CONTEXT" + + echo "===== inputs =====" + echo "$INPUTS_CONTEXT" + + echo "===== vars =====" + echo "$VARS_CONTEXT" + + echo "===== env =====" + echo "$ENV_CONTEXT" + + echo "===== job =====" + echo "$JOB_CONTEXT" + + echo "===== steps =====" + echo "$STEPS_CONTEXT" + + echo "===== runner =====" + echo "$RUNNER_CONTEXT" + + + + python-report-test-unit: + name: Unit Test Report + if: >- + github.event.workflow_run.conclusion == 'success' + && + github.event.workflow_run.event == 'pull_request' + && + github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name + runs-on: ubuntu-latest + steps: + + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + + - name: Download Unit Test Report + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 + with: + name: unit-test-results-3.11 + repository: nofusscomputing/centurion_erp + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} + + + - name: Unit Test Report + uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + id: test-report-unit + with: + # artifact: unit-test-results-${{ matrix.python-version }} + name: Unit Test Report [Python 3.11] + path: '*.xml' + reporter: java-junit + use-actions-summary: false + + + + python-report-test-functional: + name: Function Test Report + if: >- + github.event.workflow_run.conclusion == 'success' + && + github.event.workflow_run.event == 'pull_request' + && + github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name + runs-on: ubuntu-latest + steps: + + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + + - name: Download Functional Test Report + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 + with: + name: functional-test-results-3.11 + repository: nofusscomputing/centurion_erp + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} + + + - name: Functional Test Report + uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + id: test-report-functional + with: + # artifact: functional-test-results-${{ matrix.python-version }} + name: Functional Test Report [Python 3.11] + path: '*.xml' + reporter: java-junit + # fail-on-error: false + use-actions-summary: false + + + + python-report-coverage-unit: + name: Unit Test Coverage Report + if: >- + github.event.workflow_run.conclusion == 'success' + && + github.event.workflow_run.event == 'pull_request' + && + github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name + runs-on: ubuntu-latest + steps: + + + - name: Download Coverage Artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 + with: + name: code-coverage-results-3.11 + path: code-coverage-results.md + repository: nofusscomputing/centurion_erp + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} + + + - name: create status check/comment for code coverage results + id: jest_coverage_check + uses: im-open/process-code-coverage-summary@e2984f897702d68619d358a834d80a74aa0d9840 # v2.3.1 + with: + github-token: ${{ github.token }} + summary-file: code-coverage-results.md + create-pr-comment: true + update-comment-if-one-exists: true + update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" + + + + python-report-coverage-functional: + name: Functional Test Coverage Report + if: >- + github.event.workflow_run.conclusion == 'success' + && + github.event.workflow_run.event == 'pull_request' + && + github.event.workflow_run.head_repository.full_name != github.event.workflow_run.repository.full_name + runs-on: ubuntu-latest + steps: + + + - name: Download Coverage Artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 + with: + name: functional-code-coverage-results-3.11 + path: code-coverage-results.md + repository: nofusscomputing/centurion_erp + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} + + + - name: create status check/comment for code coverage results + id: jest_coverage_check + uses: im-open/process-code-coverage-summary@e2984f897702d68619d358a834d80a74aa0d9840 # v2.3.1 + with: + github-token: ${{ github.token }} + summary-file: code-coverage-results.md + check-name: 'Functional Code Coverage' + create-pr-comment: true + update-comment-if-one-exists: true + update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" From f3ec561404badcd3e8be11e531dce01972b194e4 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 4 Aug 2026 14:33:47 +0930 Subject: [PATCH 131/148] fix: wrap printing vuln report --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index c3ebeba..8059dfa 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1581,7 +1581,7 @@ jobs: - name: Print Report - run: echo ${{ steps.sarif-to-markdown.outputs.markdown }} + run: echo '${{ steps.sarif-to-markdown.outputs.markdown }}'; - name: Create Report Artifact From c696c244beb1c3d94cca482c4e969685eb4de749 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 4 Aug 2026 15:18:10 +0930 Subject: [PATCH 132/148] fix: add trace step to unit coverage report --- .github/workflows/python-post.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/python-post.yaml b/.github/workflows/python-post.yaml index d53d97b..c5592bc 100644 --- a/.github/workflows/python-post.yaml +++ b/.github/workflows/python-post.yaml @@ -194,6 +194,13 @@ jobs: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ github.token }} + - name: Debug coverage summary + run: | + pwd + ls -la + file code-coverage-results.md || true + stat code-coverage-results.md || true + - name: create status check/comment for code coverage results id: jest_coverage_check From eb9ce33441ab377dcc7ed619f966ec14d33d3a06 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 4 Aug 2026 15:20:12 +0930 Subject: [PATCH 133/148] fix: remove path from coverage rpt download --- .github/workflows/python-post.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/python-post.yaml b/.github/workflows/python-post.yaml index c5592bc..8700414 100644 --- a/.github/workflows/python-post.yaml +++ b/.github/workflows/python-post.yaml @@ -189,7 +189,6 @@ jobs: uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: code-coverage-results-3.11 - path: code-coverage-results.md repository: nofusscomputing/centurion_erp run-id: ${{ github.event.workflow_run.id }} github-token: ${{ github.token }} @@ -230,7 +229,6 @@ jobs: uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 with: name: functional-code-coverage-results-3.11 - path: code-coverage-results.md repository: nofusscomputing/centurion_erp run-id: ${{ github.event.workflow_run.id }} github-token: ${{ github.token }} From a65833c27156ec90f94f8ed692f9f6a28a9df363 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 11 Sep 2026 11:18:29 +0930 Subject: [PATCH 134/148] fix: Add skip existing to pypi publish ref: closes nofusscomputing/centurion_erp#1229 --- .github/workflows/python-publish.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 3ab639b..591bb75 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -43,4 +43,6 @@ jobs: - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true From 85fc832cc522724b216d611ebcf84ca1decce051 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 13 Sep 2026 19:45:30 +0930 Subject: [PATCH 135/148] fix: remove secret from publish ref: nofusscomputing/centurion_erp#1229 --- .gitea/workflows/bump.yaml | 243 ++++++++++++++++++++++++++ .github/workflows/python-publish.yaml | 6 +- 2 files changed, 246 insertions(+), 3 deletions(-) create mode 100644 .gitea/workflows/bump.yaml diff --git a/.gitea/workflows/bump.yaml b/.gitea/workflows/bump.yaml new file mode 100644 index 0000000..b440705 --- /dev/null +++ b/.gitea/workflows/bump.yaml @@ -0,0 +1,243 @@ +--- + +name: 'Bump' + + +on: + workflow_call: + inputs: + CZ_PRE_RELEASE: + default: none + required: false + description: Create Pre-Release {alpha,beta,rc,none} + type: string + CZ_INCREMENT: + default: none + required: false + description: Type of increment to conduct {MAJOR,MINOR,PATCH,none} + type: string + secrets: + WORKFLOW_TOKEN: + description: Token used to create the tag (required to trigger 'tag' workflow) + required: true + + +jobs: + + bump: + name: 'Bump Version' + if: github.event.commits[0].author.name != 'nfc-bot' + runs-on: ubuntu-latest + outputs: + version-current: ${{ steps.version-current.outputs.value-out }} + version-new: ${{ steps.version-new.outputs.value-out }} + steps: + + + - name: Checkout Code - ${{ github.ref_name }} Branch + if: ${{ github.ref_name == 'master' }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + token: ${{ secrets.WORKFLOW_TOKEN }} + ref: development + + + - name: Checkout Code - ${{ github.ref_name }} Branch + if: ${{ github.ref_name != 'master' }} + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + token: ${{ secrets.WORKFLOW_TOKEN }} + ref: ${{ github.ref_name }} + + + - name: Install Commitizen + shell: bash + run: | + pip install \ + commitizen==3.28.0 + + + - name: Fetch Current Version + id: version-current + run: | + echo "value-out=$(cz version --project)" >> $GITHUB_OUTPUT + + + - name: Increment version with .cz.yaml + shell: bash + run: | + if [ "${{ inputs.CZ_PRE_RELEASE }}" != 'none' ]; then + + if [ "0${{ inputs.CZ_PRE_RELEASE }}" != '0' ]; then + + echo "[debug] Pre-Release detected: ${{ inputs.CZ_PRE_RELEASE }}"; + + export pre_release="--prerelease ${{ inputs.CZ_PRE_RELEASE }}"; + + fi; + + fi; + + if [ "${{ inputs.CZ_INCREMENT }}" != 'none' ]; then + + if [ "0${{ inputs.CZ_PRE_RELEASE }}" != '0' ]; then + + echo "[debug] Pre-Release detected: ${{ inputs.CZ_INCREMENT }}"; + + export increment="--increment ${{ inputs.CZ_INCREMENT }}"; + + fi; + + fi; + + cz bump \ + --files-only \ + ${pre_release} \ + ${increment} \ + --yes; + + + - name: Fetch Current Version + id: version-new + run: | + echo "value-out=$(cz version --project)" >> $GITHUB_OUTPUT + + + - name: ls + if: ${{ github.ref_name != 'master' }} + shell: bash + run: | + ls -la + + + - name: Update Changelog + shell: bash + run: | + cz changelog --dry-run --incremental --unreleased-version "${{ steps.version-new.outputs.value-out }}" > changelog-release.md + + + - name: Update Changelog + shell: bash + run: | + cz changelog --unreleased-version "${{ steps.version-new.outputs.value-out }}" + + + - name: Upload Release Changelog + if: ${{ steps.version-new.outputs.value-out }} + uses: actions/upload-artifact@v4 + with: + name: changelog-release + path: changelog-release.md + + + - name: Create Release Changelog + if: ${{ steps.version-new.outputs.value-out }} + shell: bash + run: | + rm changelog-release.md; + git status; + + + - name: Run Additional Actions + if: ${{ steps.version-current.outputs.value-out != steps.version-new.outputs.value-out }} + shell: bash + run: | + echo 'run script'; + if [ -f .github/additional_actions_bump.sh ]; then + + echo "[Info] Set ENV vars for script's usage"; + + export CURRENT_VERSION=${{ steps.version-current.outputs.value-out }} + + export NEW_VERSION=${{ steps.version-new.outputs.value-out }} + + echo "[Info] ***************************************"; + + echo "[Debug]CURRENT_VERSION=${CURRENT_VERSION}"; + + echo "[Debug]NEW_VERSION=${NEW_VERSION}"; + + echo "[Info] ***************************************"; + + chmod +x .github/additional_actions_bump.sh + + echo "[Debug] found additional action script .github/additional_actions_bump.sh"; + + echo "[Info] ***************************************"; + echo "[Debug] cat .github/additional_actions_bump.sh"; + echo "[Info] *************"; + + echo "[Debug] $(cat .github/additional_actions_bump.sh)"; + + echo "[Info] *************"; + echo "[Info] ***************************************"; + + .github/additional_actions_bump.sh + + fi + + + - name: Commit the changelog + if: ${{ steps.version-new.outputs.value-out && github.ref_name == 'master' }} + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: 'build: bump version ${{ steps.version-current.outputs.value-out }} -> ${{ steps.version-new.outputs.value-out }}' + branch: development + # file_pattern: '.' + commit_user_name: nfc-bot + commit_user_email: helpdesk@nofusscomputing.com + commit_author: nfc-bot + tagging_message: ${{ steps.version-new.outputs.value-out }} + skip_dirty_check: true + skip_fetch: true + skip_checkout: true + disable_globbing: true + + + - name: Commit the changelog + if: ${{ steps.version-new.outputs.value-out && github.ref_name != 'master'}} + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: 'build: bump version ${{ steps.version-current.outputs.value-out }} -> ${{ steps.version-new.outputs.value-out }}' + branch: ${{ github.ref_name }} + # file_pattern: '.' + commit_user_name: nfc-bot + commit_user_email: helpdesk@nofusscomputing.com + commit_author: nfc-bot + tagging_message: ${{ steps.version-new.outputs.value-out }} + skip_dirty_check: true + skip_fetch: true + skip_checkout: true + disable_globbing: true + + + - name: Configure git + shell: bash + run: | + git config --global user.email "helpdesk@nofusscomputing.com"; + git config --global user.name "nfc-bot"; + + + - name: Checkout master + if: ${{ github.ref_name == 'master' }} + shell: bash + run: | + git checkout master; + + + - name: Merge changes to master + if: ${{ github.ref_name == 'master' }} + shell: bash + run: | + git merge --no-ff development; + + + - name: Push changes + if: ${{ github.ref_name == 'master' }} + shell: bash + run: | + git push origin master; diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 591bb75..013fe39 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -16,9 +16,9 @@ on: required: false type: string - secrets: - password: - required: true + # secrets: + # password: + # required: true jobs: From 355e4410bda26b8c98467b1c594927a93ec94c52 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 16 Sep 2026 14:15:11 +0930 Subject: [PATCH 136/148] fix(publish): setup up to use token ref: nofusscomputing/centurion_erp#1229 --- .github/workflows/python-publish.yaml | 40 +++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 013fe39..a37f802 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -42,7 +42,41 @@ jobs: path: dist - - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + # - name: Publish package distributions to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # skip-existing: true + # repository-url: https://${{ inputs.PYTHON_PROJECT_URL}}/project/${{ inputs.PYTHON_PROJECT_NAME}}/ + # user: ${{ secrets.NFC_PYPI_USERNAME }} + # password: ${{ secrets.NFC_PYPI_TOKEN }} + + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: - skip-existing: true + python-version: '3.13' + + + - name: Install Twine + run: | + pip install twine + + + - name: Trace + run: | + ls -l; + echo '****************************************************'; + ls -l dist/; + + + - name: Publish package distributions to PyPI + # env: + # TWINE_USERNAME: __token__ + # TWINE_PASSWORD: ${{ secrets.NFC_PYPI_TOKEN }} + # TWINE_REPOSITORY: https://${{ inputs.PYTHON_PROJECT_URL}}/project/${{ inputs.PYTHON_PROJECT_NAME}}/ + run: | + twine upload \ + --verbose \ + --username __token__ \ + --password ${{ secrets.NFC_PYPI_TOKEN }} \ + dist/* From 74a47e83b3ca2a0f7a71de4c964d77e44a846a8e Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 24 Sep 2026 16:34:30 +0930 Subject: [PATCH 137/148] feat: Add reports and endpoint badge for combined test coverage --- .github/workflows/python.yaml | 61 +++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 8059dfa..831feb3 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -738,10 +738,67 @@ jobs: run: | mkdir -p artifacts; coverage html -d artifacts; - mv .coverage artifacts/; + mv .coverage artifacts/coverage/combined/; - - name: Upload Combined Report + - name: Create Combined Report - XML + shell: bash + run: | + coverage xml -o artifacts/combined-coverage.xml; + + + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: artifacts/combined-coverage.xml + badge: true + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: false + indicators: true + output: both + thresholds: '60 85' + + + - name: Create Combined Report - json + shell: bash + run: | + coverage json -o artifacts/combined-coverage.json; + + + - name: Obtain coverage data + id: coverage-combined + shell: bash + run: | + echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_functional.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT + echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_functional.json) $(jq -r '.totals.num_branches' coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT + + + - name: Create Shields.io Endpoint.json for coverage + if: success() || failure() + shell: bash + run: | + echo "[Debug] ****************************"; + + echo "[Debug] PWD[${PWD}]"; + + echo "[Debug] **************************** - create file"; + + echo ' + { + "schemaVersion": 1, + "label": "Code Coverage", + "message": "${{ steps.coverage-combined.outputs.coverage }} Line | ${{ steps.coverage-combined.outputs.branch_coverage }} Branch", + "logoSvg": "python-logo", + "color": "#4584b6", + "style": "plastic" + }' > artifacts/badge_endpoint_coverage_combined.json; + + echo "[Debug] **************************** cat artifacts/badge_endpoint_coverage_combined.json"; + + + - name: Upload Combined Test results artifacts uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() with: From 430cd24a852e5fc9f5b2301ba0828b96e4267874 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 24 Sep 2026 18:18:12 +0930 Subject: [PATCH 138/148] fix: add missing dir forcombined data --- .github/workflows/python.yaml | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 831feb3..e9b6a55 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -733,12 +733,17 @@ jobs: coverage combine; - - name: Create Combined Report + - name: Trace 'ls -la' + shell: bash + run: | + ls -la; + + + - name: Create Combined Report - HTML shell: bash run: | mkdir -p artifacts; coverage html -d artifacts; - mv .coverage artifacts/coverage/combined/; - name: Create Combined Report - XML @@ -747,6 +752,19 @@ jobs: coverage xml -o artifacts/combined-coverage.xml; + - name: Create Combined Report - json + shell: bash + run: | + coverage json -o artifacts/combined-coverage.json; + + + - name: keep combine artifact + shell: bash + run: | + mkdir -p artifacts/coverage/combined; + mv .coverage artifacts/coverage/combined/ || true; + + - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 with: @@ -761,12 +779,6 @@ jobs: thresholds: '60 85' - - name: Create Combined Report - json - shell: bash - run: | - coverage json -o artifacts/combined-coverage.json; - - - name: Obtain coverage data id: coverage-combined shell: bash From b47efa393c744723ee14639d2bb35b24f7f78188 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 25 Sep 2026 14:54:31 +0930 Subject: [PATCH 139/148] feat: create combined status report --- .github/workflows/python.yaml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index e9b6a55..2fbe3e1 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -742,8 +742,8 @@ jobs: - name: Create Combined Report - HTML shell: bash run: | - mkdir -p artifacts; - coverage html -d artifacts; + mkdir -p artifacts/combined-coverage-report-html; + coverage html -d artifacts/html; - name: Create Combined Report - XML @@ -779,6 +779,31 @@ jobs: thresholds: '60 85' + - name: keep combine artifact + shell: bash + run: | + mkdir -p artifacts/coverage/combined; + mv code-coverage-results.md artifacts/coverage/code-coverage-combined-results.md; + + + - name: create status check/comment for code coverage results + id: jest_coverage_check + uses: im-open/process-code-coverage-summary@e2984f897702d68619d358a834d80a74aa0d9840 # v2.3.1 + if: >- + ( + success() || failure() + ) + && + github.event_name != 'pull_request' + with: + github-token: ${{ github.token }} + summary-file: artifacts/coverage/code-coverage-combined-results.md + check-name: 'Combined Code Coverage' + create-pr-comment: true + update-comment-if-one-exists: true + update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" + + - name: Obtain coverage data id: coverage-combined shell: bash @@ -1082,6 +1107,7 @@ jobs: with: github-token: ${{ github.token }} summary-file: code-coverage-results.md + check-name: 'Unit Code Coverage' create-pr-comment: true update-comment-if-one-exists: true update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" From 507b3d2f63b9486962b5783325ca001ffe75d8be Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 25 Sep 2026 15:59:26 +0930 Subject: [PATCH 140/148] feat: only create onecombined status report --- .github/workflows/python.yaml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 2fbe3e1..1c1574a 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -767,6 +767,8 @@ jobs: - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 + if: >- + matrix.python-version == inputs.PYTHON_VERSION with: filename: artifacts/combined-coverage.xml badge: true @@ -781,6 +783,8 @@ jobs: - name: keep combine artifact shell: bash + if: >- + matrix.python-version == inputs.PYTHON_VERSION run: | mkdir -p artifacts/coverage/combined; mv code-coverage-results.md artifacts/coverage/code-coverage-combined-results.md; @@ -795,10 +799,12 @@ jobs: ) && github.event_name != 'pull_request' + && + matrix.python-version == inputs.PYTHON_VERSION with: github-token: ${{ github.token }} summary-file: artifacts/coverage/code-coverage-combined-results.md - check-name: 'Combined Code Coverage' + check-name: 'Combined Code Coverage ${{ matrix.python-version }}' create-pr-comment: true update-comment-if-one-exists: true update-comment-key: "${{ env.GITHUB-JOB }}_${{ env.GITHUB-ACTION }}" @@ -806,14 +812,21 @@ jobs: - name: Obtain coverage data id: coverage-combined + if: >- + matrix.python-version == inputs.PYTHON_VERSION shell: bash run: | - echo coverage=$(echo "$(jq -r '.totals.percent_covered' coverage_functional.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT - echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' coverage_functional.json) $(jq -r '.totals.num_branches' coverage_functional.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT + echo coverage=$(echo "$(jq -r '.totals.percent_covered' artifacts/combined-coverage.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT + echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' artifacts/combined-coverage.json) $(jq -r '.totals.num_branches' artifacts/combined-coverage.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT - name: Create Shields.io Endpoint.json for coverage - if: success() || failure() + if: >- + ( + success() || failure() + ) + && + matrix.python-version == inputs.PYTHON_VERSION shell: bash run: | echo "[Debug] ****************************"; From 472b1f71bb9d95c30cae716307a3f1b305c1967d Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 30 Sep 2026 14:25:31 +0930 Subject: [PATCH 141/148] feat: upload code coverage --- .github/workflows/python.yaml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 1c1574a..c7797ea 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -41,7 +41,7 @@ on: env: - TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 + TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 # see https://github.com/nofusscomputing/action_python/issues/10 jobs: @@ -513,6 +513,21 @@ jobs: path: coverage.xml + - name: Upload Code Coverage + if: >- + ( + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name == github.repository + ) + && + matrix.python-version == inputs.PYTHON_VERSION + uses: actions/upload-code-coverage@bfa741d815a28cb064a8e3a0837e577457a017d5 # v1.4.3 + with: + file: coverage.xml + language: Python + label: Unit-${{ matrix.python-version }} + + - name: Upload Coverage Report (json) uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() @@ -619,6 +634,21 @@ jobs: path: functional-coverage.xml + - name: Upload Code Coverage + if: >- + ( + github.event_name != 'pull_request' + || github.event.pull_request.head.repo.full_name == github.repository + ) + && + matrix.python-version == inputs.PYTHON_VERSION + uses: actions/upload-code-coverage@bfa741d815a28cb064a8e3a0837e577457a017d5 # v1.4.3 + with: + file: functional-coverage.xml + language: Python + label: Unit-${{ matrix.python-version }} + + - name: Upload Coverage Report (json) uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: success() || failure() From febb307d1a230411744e15f1b466630c161b33ed Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 30 Sep 2026 15:03:44 +0930 Subject: [PATCH 142/148] feat: remove upload code coverage even though was auto-activated it claims to occur $10 per active commiter per month. --- .github/workflows/python.yaml | 67 +++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index c7797ea..941ed90 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -513,19 +513,19 @@ jobs: path: coverage.xml - - name: Upload Code Coverage - if: >- - ( - github.event_name != 'pull_request' - || github.event.pull_request.head.repo.full_name == github.repository - ) - && - matrix.python-version == inputs.PYTHON_VERSION - uses: actions/upload-code-coverage@bfa741d815a28cb064a8e3a0837e577457a017d5 # v1.4.3 - with: - file: coverage.xml - language: Python - label: Unit-${{ matrix.python-version }} + # - name: Upload Code Coverage + # if: >- + # ( + # github.event_name != 'pull_request' + # || github.event.pull_request.head.repo.full_name == github.repository + # ) + # && + # matrix.python-version == inputs.PYTHON_VERSION + # uses: actions/upload-code-coverage@bfa741d815a28cb064a8e3a0837e577457a017d5 # v1.4.3 + # with: + # file: coverage.xml + # language: Python + # label: Unit-${{ matrix.python-version }} - name: Upload Coverage Report (json) @@ -634,19 +634,19 @@ jobs: path: functional-coverage.xml - - name: Upload Code Coverage - if: >- - ( - github.event_name != 'pull_request' - || github.event.pull_request.head.repo.full_name == github.repository - ) - && - matrix.python-version == inputs.PYTHON_VERSION - uses: actions/upload-code-coverage@bfa741d815a28cb064a8e3a0837e577457a017d5 # v1.4.3 - with: - file: functional-coverage.xml - language: Python - label: Unit-${{ matrix.python-version }} + # - name: Upload Code Coverage + # if: >- + # ( + # github.event_name != 'pull_request' + # || github.event.pull_request.head.repo.full_name == github.repository + # ) + # && + # matrix.python-version == inputs.PYTHON_VERSION + # uses: actions/upload-code-coverage@bfa741d815a28cb064a8e3a0837e577457a017d5 # v1.4.3 + # with: + # file: functional-coverage.xml + # language: Python + # label: Unit-${{ matrix.python-version }} - name: Upload Coverage Report (json) @@ -782,6 +782,21 @@ jobs: coverage xml -o artifacts/combined-coverage.xml; + # - name: Upload Code Coverage + # if: >- + # ( + # github.event_name != 'pull_request' + # || github.event.pull_request.head.repo.full_name == github.repository + # ) + # && + # matrix.python-version == inputs.PYTHON_VERSION + # uses: actions/upload-code-coverage@bfa741d815a28cb064a8e3a0837e577457a017d5 # v1.4.3 + # with: + # file: artifacts/combined-coverage.xml; + # language: Python + # label: Combined Coverage + + - name: Create Combined Report - json shell: bash run: | From ad4355a1f65e5ded393a9edc6faf6b1cec40389c Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 1 Oct 2026 12:33:12 +0930 Subject: [PATCH 143/148] feat: remove trivy db repo env var to test getting too many requests for this one now --- .github/workflows/python.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 941ed90..070aaee 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -40,8 +40,8 @@ on: required: false -env: - TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 # see https://github.com/nofusscomputing/action_python/issues/10 +# env: +# TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2 # see https://github.com/nofusscomputing/action_python/issues/10 jobs: From c81807f5aae573c27d2da213ac1caa625b0c4be4 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 13 Nov 2026 17:10:20 +0930 Subject: [PATCH 144/148] feat: combine both unit and functional stats to endpoint badge --- .github/workflows/python.yaml | 253 +++++++++++++++++++++++++++++++++- 1 file changed, 247 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 070aaee..b6db100 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -690,8 +690,10 @@ jobs: name: Create Combined Test Reports needs: - init - - unit-test - - functional-test + # - unit-test + - report + # - functional-test + - functional-report if: github.event_name != 'schedule' runs-on: ubuntu-latest strategy: @@ -865,6 +867,64 @@ jobs: echo branch_coverage=$(echo "$(jq -r '.totals.covered_branches' artifacts/combined-coverage.json) $(jq -r '.totals.num_branches' artifacts/combined-coverage.json)" | awk '{covered=$1; total=$2; printf "%.4f%%", (covered/total*100)"%"}') >> $GITHUB_OUTPUT + + - name: Download Unit Test Stats json + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 # v7.0.1 + if: success() || failure() + with: + name: unit-test-stats-${{ matrix.python-version }} + + + + - name: Download Functional Test Stats json + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 + if: success() || failure() + with: + name: functional-test-stats-${{ matrix.python-version }} + + + - name: Obtain coverage data + id: stats-combined + if: >- + matrix.python-version == inputs.PYTHON_VERSION + shell: bash + run: | + echo sudo apt update; + echo sudo apt install -y jq; + ls -la; + echo '*******'; + cat test_stats_unit.json; + echo '*******'; + cat test_stats_functional.json; + echo '*******'; + echo $(jq -r '.passed // 0' test_stats_unit.json); + echo '*******'; + echo $(jq -r '.passed // 0' test_stats_functional.json); + echo '*******'; + echo "passed=$(($(jq -r '.passed // 0' test_stats_unit.json) + $(jq -r '.passed // 0' test_stats_functional.json)))" >> $GITHUB_OUTPUT + echo "skipped=$(($(jq -r '.skipped // 0' test_stats_unit.json) + $(jq -r '.skipped // 0' test_stats_functional.json)))" >> $GITHUB_OUTPUT + echo "failed=$(($(jq -r '.failed // 0' test_stats_unit.json) + $(jq -r '.failed // 0' test_stats_functional.json)))" >> $GITHUB_OUTPUT + cat $GITHUB_OUTPUT; + + + + - name: Create Shields.io Endpoint.json + if: success() || failure() + shell: bash + run: | + echo ' + { + "schemaVersion": 1, + "label": "Combined Tests", + "message": "${{ steps.stats-combined.outputs.passed }} passed | ${{ steps.stats-combined.outputs.skipped }} skipped | ${{ steps.stats-combined.outputs.failed }} failed", + "logoSvg": "python-logo", + "color": "#4584b6", + "style": "plastic" + }' > artifacts/endpoint_combined_stats.json + + + + - name: Create Shields.io Endpoint.json for coverage if: >- ( @@ -883,7 +943,7 @@ jobs: echo ' { "schemaVersion": 1, - "label": "Code Coverage", + "label": "Combined Code Coverage", "message": "${{ steps.coverage-combined.outputs.coverage }} Line | ${{ steps.coverage-combined.outputs.branch_coverage }} Branch", "logoSvg": "python-logo", "color": "#4584b6", @@ -993,6 +1053,27 @@ jobs: ls -la; + - name: Create Test Stats + if: success() || failure() + shell: bash + run: | + echo ' + { + "passed": ${{ steps.test-report.outputs.passed }}, + "skipped": ${{ steps.test-report.outputs.skipped }}, + "failed": ${{ steps.test-report.outputs.failed }} + } + ' > test_stats_unit.json; + + + - name: Upload Test Stats json + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + if: success() || failure() + with: + name: unit-test-stats-${{ matrix.python-version }} + path: test_stats_unit.json + + - name: Create Shields.io Endpoint.json if: success() || failure() shell: bash @@ -1079,6 +1160,27 @@ jobs: ls -la; + - name: Create Test Stats + if: success() || failure() + shell: bash + run: | + echo ' + { + "passed": ${{ steps.test-report.outputs.passed }}, + "skipped": ${{ steps.test-report.outputs.skipped }}, + "failed": ${{ steps.test-report.outputs.failed }} + } + ' > test_stats_functional.json; + + + - name: Upload Test Stats json + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + if: success() || failure() + with: + name: functional-test-stats-${{ matrix.python-version }} + path: test_stats_functional.json + + - name: Create Shields.io Endpoint.json if: success() || failure() shell: bash @@ -1259,7 +1361,7 @@ jobs: badge-endpoint: name: Publish Badge endpoint files if: >- - (github.ref_name == 'master' || github.ref_name == 'development') + (github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'feat-next-release') && github.event_name != 'schedule' && @@ -1444,7 +1546,7 @@ jobs: badge-endpoint-functional: name: Publish Badge endpoint files (Functional) if: >- - (github.ref_name == 'master' || github.ref_name == 'development') + (github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'feat-next-release') && github.event_name != 'schedule' && @@ -1554,6 +1656,145 @@ jobs: + - name: Configure git + shell: bash + run: | + git config --global user.email "helpdesk@nofusscomputing.com"; + git config --global user.name "nfc-bot"; + + + - name: Git add + id: git-add + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git status; + echo "[Debug] ****************************"; + + if [ "$(git status -s)" ]; then + + echo "changed=true" > $GITHUB_OUTPUT; + + echo "[Info] Changes need to be committed"; + + else + + echo "changed=false" > $GITHUB_OUTPUT; + + echo "[Info] NO changes to be committed"; + + fi + + echo "[Debug] ****************************"; + + git add . + + + - name: Git commit + if: ${{ steps.git-add.outputs.changed == 'true' }} + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git commit -m "chore: add badge endpount file ${{ github.repository }}/${{ github.ref_name }}" + + + - name: git push + if: ${{ steps.git-add.outputs.changed == 'true' }} + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + cd endpoint_publish; + echo "[Debug] ****************************"; + ls -la + echo "[Debug] ****************************"; + echo "[Debug] PWD[${PWD}]"; + echo "[Debug] ****************************"; + git push + + + + badge-endpoint-combined: + name: Publish Badge endpoint files (Combined) + if: >- + (github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'feat-next-release') + && + github.event_name != 'schedule' + && + github.repository == 'nofusscomputing/centurion_erp' + needs: + - combines_report + strategy: + max-parallel: 4 + matrix: + python-version: [ "${{ inputs.PYTHON_VERSION }}" ] + runs-on: ubuntu-latest + steps: + + - name: Checkout Endpoint Repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: 'nofusscomputing/.github' + ref: 'master' + token: ${{ secrets.WORKFLOW_TOKEN }} + path: 'endpoint_publish' + fetch-depth: '1' + show-progress: true + submodules: false + + + - name: Create Publish Directories + shell: bash + run: | + echo "[Debug] PWD[${PWD}]"; + cd endpoint_publish; + echo "[Debug] PWD[${PWD}]"; + mkdir -p repositories/${{ github.repository }}/${{ github.ref_name }}; + ls -la; + + + # - name: Create Publish Directories + # shell: bash + # run: | + # echo "[Debug] PWD[${PWD}]"; + # # cd repositories/${{ github.repository }}/${{ github.ref_name }}; + # echo "[Debug] PWD[${PWD}]"; + + + - name: Download Badge Endpoint json + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 + with: + name: coverage-combined-unit-function-html-${{ matrix.python-version }} + + + - name: Add endpoint file + shell: bash + run: | + cd endpoint_publish; + ls -la; + cp ../badge_endpoint_coverage_combined.json repositories/${{ github.repository }}/${{ github.ref_name }}/badge_endpoint_coverage_combined.json; + cp ../endpoint_combined_stats.json repositories/${{ github.repository }}/${{ github.ref_name }}/endpoint_combined_stats.json + echo "[Debug] **************************** - ls -la repositories/${{ github.repository }}/${{ github.ref_name }}/"; + + ls -la repositories/${{ github.repository }}/${{ github.ref_name }}/; + + + + - name: Configure git shell: bash run: | @@ -1825,4 +2066,4 @@ jobs: number: ${{ env.FOUND_PR_NUM }} header: Python ${{ matrix.requirements }} Scan Results message: | - ${{ env.report }} + ${{ env.report }} \ No newline at end of file From bf1afd67f89f990c1e9509bdfa53166e09a593af Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 18 Nov 2026 10:46:53 +0930 Subject: [PATCH 145/148] fix: remove version conditions in combine report required so works on master branch and other python versions. --- .github/workflows/python.yaml | 44 ++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index b6db100..9d69ea9 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -814,8 +814,8 @@ jobs: - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 - if: >- - matrix.python-version == inputs.PYTHON_VERSION + # if: >- + # matrix.python-version == inputs.PYTHON_VERSION with: filename: artifacts/combined-coverage.xml badge: true @@ -830,8 +830,8 @@ jobs: - name: keep combine artifact shell: bash - if: >- - matrix.python-version == inputs.PYTHON_VERSION + # if: >- + # matrix.python-version == inputs.PYTHON_VERSION run: | mkdir -p artifacts/coverage/combined; mv code-coverage-results.md artifacts/coverage/code-coverage-combined-results.md; @@ -840,14 +840,20 @@ jobs: - name: create status check/comment for code coverage results id: jest_coverage_check uses: im-open/process-code-coverage-summary@e2984f897702d68619d358a834d80a74aa0d9840 # v2.3.1 + # if: >- + # ( + # success() || failure() + # ) + # && + # github.event_name != 'pull_request' + # && + # matrix.python-version == inputs.PYTHON_VERSION if: >- ( success() || failure() ) && github.event_name != 'pull_request' - && - matrix.python-version == inputs.PYTHON_VERSION with: github-token: ${{ github.token }} summary-file: artifacts/coverage/code-coverage-combined-results.md @@ -859,8 +865,8 @@ jobs: - name: Obtain coverage data id: coverage-combined - if: >- - matrix.python-version == inputs.PYTHON_VERSION + # if: >- + # matrix.python-version == inputs.PYTHON_VERSION shell: bash run: | echo coverage=$(echo "$(jq -r '.totals.percent_covered' artifacts/combined-coverage.json) " | awk '{printf "%.4f%%", $1"%"}') > $GITHUB_OUTPUT @@ -870,7 +876,7 @@ jobs: - name: Download Unit Test Stats json uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 # v7.0.1 - if: success() || failure() + # if: success() || failure() with: name: unit-test-stats-${{ matrix.python-version }} @@ -878,15 +884,15 @@ jobs: - name: Download Functional Test Stats json uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # V8.0.1 - if: success() || failure() + # if: success() || failure() with: name: functional-test-stats-${{ matrix.python-version }} - name: Obtain coverage data id: stats-combined - if: >- - matrix.python-version == inputs.PYTHON_VERSION + # if: >- + # matrix.python-version == inputs.PYTHON_VERSION shell: bash run: | echo sudo apt update; @@ -909,7 +915,7 @@ jobs: - name: Create Shields.io Endpoint.json - if: success() || failure() + # if: success() || failure() shell: bash run: | echo ' @@ -926,12 +932,12 @@ jobs: - name: Create Shields.io Endpoint.json for coverage - if: >- - ( - success() || failure() - ) - && - matrix.python-version == inputs.PYTHON_VERSION + # if: >- + # ( + # success() || failure() + # ) + # && + # matrix.python-version == inputs.PYTHON_VERSION shell: bash run: | echo "[Debug] ****************************"; From 6304f2b7646527ac33774a50eb3034fb4083ad6e Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 18 Nov 2026 11:20:30 +0930 Subject: [PATCH 146/148] chore: add debug to lint builds now failing for dep install with no changes --- .github/workflows/python.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 9d69ea9..7693b96 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -223,6 +223,29 @@ jobs: python-version: ${{ matrix.python-version }} + - name: Debug Python build environment + run: | + python --version || true; + echo '*******************************************'; + python -c "import sys; print(sys.executable)" || true; + echo '*******************************************'; + python -c "import sysconfig; print(sysconfig.get_config_var('CC'))" || true; + echo '*******************************************'; + gcc --version || true; + echo '*******************************************'; + sha256sum /opt/hostedtoolcache/Python/3.13.18/x64/include/python3.13/Python.h || true; + echo '*******************************************'; + grep -R '_PyInterpreterState_Get' /opt/hostedtoolcache/Python/3.13.18/x64/include/python3.13/ || true; + echo '*******************************************'; + pg_config --version || true; + echo '*******************************************'; + pg_config --includedir || true; + echo '*******************************************'; + pip cache list | grep psycopg || true; + echo '*******************************************'; + + + - name: Install Dependencies ${{ matrix.python-version }} if: ${{ github.ref_name != 'master' && github.ref_name != 'development' && github.ref_type != 'tag' }} run: | From 74e3cb489e503ff393e2e478e1ca33b4c1bda88c Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 18 Nov 2026 13:29:26 +0930 Subject: [PATCH 147/148] chore: add trace for compose install --- .github/workflows/python-integration.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 7ff95b2..729ef72 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -54,8 +54,13 @@ jobs: - name: Set up Docker Compose run: | - sudo apt-get update - sudo apt-get install -y docker-compose + sudo apt-get update; + sudo apt-get install -y docker-compose; + echo '***************************'; + which docker-compose || true; + echo '***************************'; + docker compose version || true; + - name: Set up Python ${{ inputs.PYTHON_VERSION }} uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 From aa5cc7c63db5bf90fe6302165829744c4473e4d2 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 21 Nov 2026 14:12:40 +0930 Subject: [PATCH 148/148] fix: dorny/test-reporter update to correct http gh error --- .github/workflows/python-integration.yaml | 3 ++- .github/workflows/python-post.yaml | 6 ++++-- .github/workflows/python.yaml | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-integration.yaml b/.github/workflows/python-integration.yaml index 729ef72..806e4f8 100644 --- a/.github/workflows/python-integration.yaml +++ b/.github/workflows/python-integration.yaml @@ -99,7 +99,8 @@ jobs: - name: Test Report if: success() || failure() - uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + # uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + uses: dorny/test-reporter@79b4b4400dc2354b89e9dd811ef9caa9bdd4f665 # main fix http errors see: https://github.com/dorny/test-reporter/pull/867 id: test-report with: name: Integration Test Report [python_${{ inputs.PYTHON_VERSION }}-postgres_${{ matrix.postgres-version }}-rabbitmq_${{ matrix.rabbitmq-version }}] diff --git a/.github/workflows/python-post.yaml b/.github/workflows/python-post.yaml index 8700414..6547d60 100644 --- a/.github/workflows/python-post.yaml +++ b/.github/workflows/python-post.yaml @@ -125,7 +125,8 @@ jobs: - name: Unit Test Report - uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + # uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + uses: dorny/test-reporter@79b4b4400dc2354b89e9dd811ef9caa9bdd4f665 # main fix http errors see: https://github.com/dorny/test-reporter/pull/867 id: test-report-unit with: # artifact: unit-test-results-${{ matrix.python-version }} @@ -161,7 +162,8 @@ jobs: - name: Functional Test Report - uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + # uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + uses: dorny/test-reporter@79b4b4400dc2354b89e9dd811ef9caa9bdd4f665 # main fix http errors see: https://github.com/dorny/test-reporter/pull/867 id: test-report-functional with: # artifact: functional-test-results-${{ matrix.python-version }} diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 7693b96..44a74de 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -1065,7 +1065,8 @@ jobs: - name: Test Report if: success() || failure() - uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + # uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + uses: dorny/test-reporter@79b4b4400dc2354b89e9dd811ef9caa9bdd4f665 # main fix http errors see: https://github.com/dorny/test-reporter/pull/867 id: test-report with: # artifact: unit-test-results-${{ matrix.python-version }} @@ -1171,7 +1172,8 @@ jobs: - name: Test Report - uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + # uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 + uses: dorny/test-reporter@79b4b4400dc2354b89e9dd811ef9caa9bdd4f665 # main fix http errors see: https://github.com/dorny/test-reporter/pull/867 id: test-report with: # artifact: functional-test-results-${{ matrix.python-version }}