Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
2c45fe7
Merge tag '20.0.0' into develop
felliott Jul 1, 2020
206f3ee
Add toggles for keen event logging
felliott Oct 21, 2020
fe04087
Merge branch 'hotfix/stop-logging-keen'
felliott Oct 21, 2020
a11ffc8
bump version & update changelog
felliott Oct 21, 2020
33c59c3
Merge branch 'hotfix/20.0.1'
felliott Oct 21, 2020
a4da985
Merge tag '20.0.1' into develop
felliott Oct 21, 2020
a7bbd46
Remove old pin to certifi
mfraezz Sep 30, 2021
7d1583d
Merge branch 'hotfix/20.0.2'
mfraezz Sep 30, 2021
682b8a1
Merge branch 'hotfix/20.0.2' into develop
mfraezz Sep 30, 2021
ccc4a6c
convert travis ci to github actions
felliott Dec 9, 2021
fc20c5d
Merge branch 'feature/github-actions' into develop
felliott Dec 23, 2021
8ca1f92
update hypothes.is turnon switch to accept parent url
felliott May 12, 2022
822245c
Merge branch 'feature/hypo.is-referrer' into develop
felliott May 24, 2022
b2020a7
update Dockerfile to py3.6; reorg like WB
felliott Jan 7, 2022
f724ecc
deps: bump reportlab dep to build
felliott Jan 7, 2022
419bc2a
Merge branch 'feature/dockerfile-updates' into develop
felliott May 26, 2022
37ba1a2
render .boa files with the codepygments renderer
felliott Apr 1, 2022
d411b5a
Merge branch 'feature/boa-support' into develop
felliott May 26, 2022
6f842ce
update docs to reflect py3.6 minimum
felliott May 26, 2022
06721ac
bump version & update changelog
felliott May 27, 2022
9908bc8
Merge branch 'release/22.0.0'
felliott May 27, 2022
36a1511
Merge tag '22.0.0' into develop
felliott May 27, 2022
8bab3a7
2023 repo updates: copyright date + job urls
felliott Mar 31, 2023
dfaa999
Merge branch 'feature/2023-repo-maintenance' into develop
felliott Mar 31, 2023
9abc47a
bump version & update changelog
felliott Mar 31, 2023
b9b3a66
Merge branch 'release/23.0.0'
felliott Mar 31, 2023
5634c86
Merge tag '23.0.0' into develop
felliott Apr 14, 2023
cc404f0
fix: handle quotes in tabular sheet names
aaxelb Jan 5, 2023
36db5cc
fix: handle percent signs in tabular sheet names
felliott Apr 14, 2023
4c9a864
tl;dr forgot the semicolon
felliott Apr 14, 2023
ed9136b
encode sheet names to dom-compliant name
felliott Apr 17, 2023
f11219a
Merge branch 'feature/quotes-in-workbooks' into develop
felliott Apr 17, 2023
b5a9734
bump version & update changelog
felliott Apr 17, 2023
b61d621
Merge branch 'release/23.1.0'
felliott Apr 17, 2023
64a0487
Merge tag '23.1.0' into develop
felliott Apr 17, 2023
7018678
install java certs before java
felliott Dec 19, 2023
658933d
Merge branch 'feature/dockerfile-java-certs' into develop
felliott Dec 30, 2023
254f851
jamovi: update to accomodate new manifest location
jonathon-love Jun 25, 2022
eb9df48
Requested changes
jonathon-love Aug 2, 2023
191d6ee
Fixes
jonathon-love Aug 2, 2023
9e148c4
preserve test for old jamovi manifest
felliott Dec 18, 2023
eff2d90
Merge branch 'feature/jamovi-new-manifest' into develop
felliott Dec 30, 2023
8ab1e69
update jasp renderer for new manifest format
felliott Dec 23, 2023
794bee6
Merge branch 'feature/jasp-new-manifest' into develop
felliott Dec 30, 2023
d2f64bc
bump version & update changelog
felliott Dec 30, 2023
878881d
Merge branch 'release/24.0.0'
felliott Jan 3, 2024
a7ef407
Merge tag '24.0.0' into develop
felliott Jan 3, 2024
de59e1e
ENG-7595 Update MFR Dockerfile and (dev-)requirements.txt files to ma…
mkovalua Apr 23, 2025
dc995b9
raven is outdated for py3.13 replace it with sentry_sdk to make it po…
mkovalua Apr 23, 2025
943e5f7
fix some dockerfile lints
felliott Apr 29, 2025
f6b1adf
Merge branch 'feature/dockerfile-updates' into feature/buff-worms
felliott Apr 29, 2025
44b707c
fix Deprecated function, class, or module
mkovalua Apr 23, 2025
2466680
fix incorrect call arguments
mkovalua Apr 23, 2025
9159990
fix Deprecated function, class, or module
mkovalua Apr 24, 2025
be346fa
fix Incorrect type
mkovalua Apr 24, 2025
672260c
fix Unbound local variables
mkovalua Apr 24, 2025
389c57a
use pip install pyupgrade and find . -type f -name '*.py' -exec pyupg…
mkovalua Apr 24, 2025
12cc556
fix single quoted docstring
mkovalua Apr 24, 2025
9eccd05
fix shadowing names from outer scopes
mkovalua Apr 24, 2025
b1fc8a3
fix redundant parentheses
mkovalua Apr 24, 2025
21af2e0
fix shadowing build in names
mkovalua Apr 24, 2025
c6a9490
fix Method is not declared static
mkovalua Apr 24, 2025
ab37d31
Todo: Qodana told about Dictionary can be rewritten by dictionary lit…
mkovalua Apr 24, 2025
0e3ca91
# Todo: not see Name implementation in child classes
mkovalua Apr 24, 2025
106e3de
# Todo: maybe it is needed to use logger and specific message for exc…
mkovalua Apr 24, 2025
9c6fb7c
fix Incorrect docstring (not confident about 'action' and 'metadata' …
mkovalua Apr 24, 2025
c3925b7
add todo about mismatched signature
mkovalua Apr 24, 2025
87b5366
Merge branch 'feature/py3.13-syntax-deprecations' into feature/buff-w…
felliott Apr 29, 2025
1ce7762
Fixup Github Actions to start to run
mkovalua Apr 25, 2025
8426f5b
ci/cd yml update
mkovalua Apr 25, 2025
4aa8b94
Update test-build.yml
mkovalua Apr 25, 2025
e51d9ad
Merge branch 'feature/update-gh-ci' into feature/buff-worms
felliott Apr 29, 2025
651f07e
update MFR dev-requirements.txt
mkovalua Apr 25, 2025
48ff1a0
update MFR doc-requirements.txt
mkovalua Apr 28, 2025
d722f6f
Merge branch 'feature/dep-group-dev-doc' into feature/buff-worms
felliott Apr 29, 2025
f978ec2
Bump dependencies for ext-code and ext-doc
futa-ikeda May 12, 2025
3dbe97e
Merge branch 'feature/dep-group-ext-code-doc' into feature/buff-worms
felliott May 19, 2025
1b4da16
ENG-7603 upgrade infra deps
mkovalua May 30, 2025
99ac9cc
Merge branch 'feature/dep-group-infra' into feature/buff-worms
felliott Jun 14, 2025
1e7e46f
[tool:pytest] is a way to work with python3.13
mkovalua Jun 3, 2025
1476ce7
update test requirements
mkovalua Jun 4, 2025
2a561f2
fix bad async with call for py3.13
mkovalua Jun 4, 2025
9ab77ae
replace ContentEncodingError for python3.13
mkovalua Jun 4, 2025
ec8a0d2
Merge branch 'feature/dep-group-tests' into feature/buff-worms
felliott Jun 14, 2025
e5d4bdc
ENG-7602 | MFR Dep-group 4 upgrade: ext-tabular + util
sh-andriy Jun 4, 2025
eed2348
Merge branch 'feature/dep-group-tabular-util' into feature/buff-worms
felliott Jun 14, 2025
536efe0
fix for py3.13: don't await aiohttp.request
mkovalua Jun 5, 2025
715b3de
Todo: for possible agent lib removal
mkovalua Jun 5, 2025
9b22a5d
Merge branch 'feature/dep-group-wb' into feature/buff-worms
felliott Jun 14, 2025
89ca7c1
Match existing requirements to pinned WB versions
futa-ikeda Jun 5, 2025
f8102ad
Remove imghdr related test failures
futa-ikeda Jun 5, 2025
cafc909
Update image related dependencies
futa-ikeda Jun 5, 2025
851fa80
Update ipython dep group
futa-ikeda Jun 9, 2025
211c03a
Deprecation updates
futa-ikeda Jun 9, 2025
c0925a9
Update tests to not call fixtures directly
futa-ikeda Jun 9, 2025
4013211
Some test fixes
futa-ikeda Jun 12, 2025
28dea64
Fix ipynb test failures
futa-ikeda Jun 12, 2025
0127867
Fix md tests
futa-ikeda Jun 12, 2025
fa2c865
Update bmp test
futa-ikeda Jun 12, 2025
9eb5c7a
Remove pydocx dependency
futa-ikeda Jun 13, 2025
adc4bc2
Merge branch 'feature/dep-group-image-ipy' into feature/buff-worms
felliott Jun 14, 2025
5e2595f
ENG-7737 | MFR convert to Poetry
sh-andriy Jun 11, 2025
6f84694
update poetry deps after dep-group updates
felliott Jun 14, 2025
2df7510
Merge branch 'feature/mfr-poetry' into feature/buff-worms
felliott Jun 14, 2025
55e7f46
fix wrong fixture call usage in tabular t
mkovalua Jun 12, 2025
fe7453c
fix 0 index access error
mkovalua Jun 13, 2025
ef7940e
update deprecated arg in ipynb renderer
mkovalua Jun 13, 2025
c6e6503
update how markdown deregisters html blocks
mkovalua Jun 13, 2025
773079a
update pandas tabular tool
mkovalua Jun 13, 2025
4fe4322
fix testing event loop error
mkovalua Jun 18, 2025
ad99d26
fix xrld tabular renderer tool
sh-andriy Jun 18, 2025
b33ab5b
remove unused pydocx from deps
futa-ikeda Jun 13, 2025
6e51aac
fix syntax in sentry handling of errors
mkovalua Jun 18, 2025
7b2dcc3
fix flake8 remarks to run tests
mkovalua Jun 23, 2025
e85dd26
infra: update mfr installation method
mkovalua Jun 24, 2025
1d49a28
infra: try switching to implicit namespaces
mkovalua Jun 24, 2025
684aa96
infra: update license declaration
felliott Jul 7, 2025
b585dde
infra: use egg_info
mkovalua Jun 24, 2025
7406f82
tests: fix up some deprecation warnings
felliott Jul 7, 2025
7ca4004
Merge branch 'feature/fix-mfr-tests' into feature/buff-worms
felliott Jul 7, 2025
5953766
fixed mfr rendering files
opaduchak Jul 17, 2025
1eff57f
fixed ci and flake8
opaduchak Jul 17, 2025
45bc54d
fixed tests
opaduchak Jul 17, 2025
1b3510e
Merge branch 'feature/toolchain-updates' into feature/buff-worms
felliott Jul 17, 2025
fea43c1
added celery to mfr
opaduchak Jul 18, 2025
6a1dc10
fixed flake8
opaduchak Jul 18, 2025
ecfe0e9
added concurrency option
opaduchak Jul 18, 2025
34340cd
Merge branch 'feature/mfr-worker' into feature/buff-worms
felliott Jul 22, 2025
12277e4
ENG-8355 | MFR Update libreoffice version in dockerfile
sh-andriy Jul 15, 2025
72a927c
Merge branch 'feature/upgrade-lo' into feature/buff-worms
felliott Jul 22, 2025
ed1b701
ENG-8357 replace unoconv with unoserver
mkovalua Jul 16, 2025
8aa8251
Merge branch 'feature/unoserver-update' into feature/buff-worms
felliott Jul 25, 2025
96ece99
fixed files with cyrillic names not rendering
opaduchak Jul 26, 2025
d3cd6e4
made content-dispositon header use modern filename* syntax
opaduchak Jul 28, 2025
46f5c3b
fixed filename=* syntax
opaduchak Jul 28, 2025
ffaba86
Merge pull request #392 from opaduchak/fix/ENG-8472
opaduchak Jul 29, 2025
d4da5a8
[ENG-8475] Fix unable to render spreadsheet files (.xls and .xlsx) (#…
sh-andriy Jul 29, 2025
92a05d9
fix(mfr): fix not all xlsx files render error
sh-andriy Jul 30, 2025
dc2a053
Merge pull request #394 from sh-andriy/fix/xlsx-file-render-error
opaduchak Jul 30, 2025
66b1859
[ENG-8488] MFR: .xlsx file not rendering correctly in OSF Storage (#…
opaduchak Aug 4, 2025
231f5be
[ENG-8489] Enforce MAX_SIZE on .xls rendering just like was on .xlsx …
sh-andriy Aug 5, 2025
a54c91a
[ENG-8501] Upgrade tornado version to "6.5.1" (#399)
mkovalua Aug 12, 2025
9e2e128
[ENG-8488] Fix inconsistent Excel rendering by enforcing binary mode …
sh-andriy Aug 12, 2025
5fa2054
ENG-8426 | Update README with Poetry-based setup steps for local MFR …
sh-andriy Aug 12, 2025
7d7caad
Merge branch 'feature/update-readme' into feature/buff-worms
felliott Aug 17, 2025
73b02b7
Update readthedocs config
Vlad0n20 Aug 13, 2025
3fa803e
update sphinx documentation meta and build
felliott Aug 17, 2025
6498822
Merge branch 'feature/rtd-updates' into feature/buff-worms
felliott Aug 17, 2025
18c07ca
flake fix in rtd conf
felliott Aug 20, 2025
374d392
Merge branch 'feature/rtd-flake-fix' into feature/buff-worms
felliott Aug 20, 2025
983f5ce
removed libreoffice install from dockerfile
opaduchak Aug 20, 2025
69b7309
Merge branch 'feature/fix-docker-build' into feature/buff-worms
felliott Aug 20, 2025
c7b3018
add ruff formatting option
mkovalua Aug 8, 2025
5fd07dc
remove redundant extend-ignore constraints
mkovalua Aug 12, 2025
a080e58
Merge branch 'feature/ruff-support' into feature/buff-worms
felliott Aug 21, 2025
7b643df
Added Celery-powered render
opaduchak Jul 23, 2025
0f0b4e8
Merge branch 'feature/unoserver-celery' into feature/buff-worms
felliott Sep 9, 2025
e9f9e06
ENG-8627 | Fix .3ds files not rendering in MFR viewer
sh-andriy Aug 20, 2025
aea8068
Merge branch 'feature/fix-3ds' into feature/buff-worms
felliott Oct 17, 2025
7ff05de
Fix search in .xlsx files
Vlad0n20 Aug 22, 2025
2ddf4a9
Merge branch 'feature/fix-xlsx-search' into feature/buff-worms
felliott Oct 21, 2025
9006ee7
update wb dep for oathpit workaround
felliott Nov 18, 2025
8e3a82a
Merge branch 'feature/oathpit' into feature/buff-worms
felliott Nov 18, 2025
79117b3
Merge pull request #407 from CenterForOpenScience/feature/buff-worms
felliott Nov 18, 2025
a176d21
bump version & update changelog
felliott Nov 18, 2025
2b789f8
Merge branch 'release/25.0.0'
felliott Nov 18, 2025
920b1ce
Merge tag '25.0.0' into develop
felliott Nov 19, 2025
ec064ef
reword error when table lacks row or col count
felliott Dec 19, 2025
9cbb16d
Merge branch 'feature/better-tabular-error' into develop
felliott Dec 19, 2025
3393e76
convert date to string when parsing xlsx
antkryt Dec 12, 2025
6a51169
Merge branch 'feature/tabular-datetime' into develop
felliott Dec 19, 2025
4475561
new mobile detection code for image iframe
felliott Oct 2, 2025
9963baf
Merge branch 'feature/image-popup-fix' into develop
felliott Dec 19, 2025
551aeb3
add newrelic support
antkryt Dec 11, 2025
1a3cac6
Merge branch 'feature/newrelic' into develop
felliott Jan 4, 2026
76205e2
bump version & update changelog
felliott Mar 26, 2026
8532602
Merge branch 'release/26.0.0'
felliott Mar 26, 2026
c17fe0c
Merge tag '26.0.0' into develop
felliott Mar 26, 2026
c643f54
bump newrelic version to fix w/ celery
felliott Apr 2, 2026
854062c
Merge branch 'hotfix/newrelic-celery'
felliott Apr 6, 2026
d499c4a
bump version & update changelog
felliott Apr 6, 2026
9ca887b
Merge branch 'release/26.0.1'
felliott Apr 6, 2026
4da9b7d
Merge tag '26.0.1' into develop
felliott Apr 6, 2026
c6146c5
fix redirect on legacy osf download route
antkryt Apr 9, 2026
682420c
Merge branch 'feature/legacy-redirect' into develop
felliott Apr 21, 2026
93a90ac
Revert "Merge branch 'feature/legacy-redirect' into develop"
felliott Apr 23, 2026
f34a1b8
rewrite some osf provider urls
felliott Apr 26, 2026
304ef40
Merge branch 'feature/legacy-redirect-2' into develop
felliott Apr 28, 2026
309fb4e
bump version & update changelog
felliott Apr 28, 2026
b645862
Merge branch 'release/26.1.0'
felliott Apr 28, 2026
549b853
Merge tag '26.1.0' into develop
felliott Apr 28, 2026
519291c
Add build_spec.yaml
mfraezz Aug 27, 2026
29247d6
Merge pull request #412 from CenterForOpenScience/hotfix/oci-cicd
adlius Sep 1, 2026
c103ba9
bump version & update changelog
adlius Sep 1, 2026
1da64d3
Merge branch 'hotfix/26.1.1'
adlius Sep 1, 2026
f7b293c
Merge tag '26.1.1' into develop
adlius Sep 1, 2026
7f101d1
[ENG-11824] fix(cors): always send Cache-Control: no-store even witho…
Vlad0n20 Sep 10, 2026
f0e2ffa
Revert "[ENG-11824] fix(cors): always send Cache-Control: no-store ev…
brianjgeiger Sep 30, 2026
08fd2b3
Merge pull request #413 from CenterForOpenScience/revert-411-fix/ENG-…
felliott Sep 30, 2026
84d10b4
bump wb dep to a version w/ modern newrelic
felliott Oct 5, 2026
4f8572b
Merge branch 'feature/resolve-newrelic' into develop
felliott Oct 6, 2026
6cdc13d
bump version & update changelog
felliott Oct 6, 2026
9172b18
Merge branch 'release/26.2.0'
felliott Oct 6, 2026
17de734
Merge tag '26.2.0' into develop
felliott Oct 6, 2026
40afb49
Merge CenterForOpenScience develop into RCOSDP integration branch
yacchin1205 Oct 8, 2026
5bff722
Add Trivy container image vulnerability scan to CI
miyamoto83 Sep 25, 2026
97e49cb
Update vulnerable dependencies and isolate build tools
yacchin1205 Oct 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.pyc
**/*.pyc
Dockerfile
*venv*
128 changes: 128 additions & 0 deletions .github/scripts/ci/render-trivy-report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import argparse
import json
from collections import Counter


SEVERITIES = ('CRITICAL', 'HIGH', 'MEDIUM', 'LOW', 'UNKNOWN')
SEVERITY_ORDER = {severity: index for index, severity in enumerate(SEVERITIES)}
COMMENT_MARKER = '<!-- trivy-image-scan -->'


def markdown_escape(value):
return str(value or '-').replace('\n', ' ').replace('|', '\\|')


def get_vulnerabilities(report):
return [
vulnerability
for result in report.get('Results', [])
for vulnerability in result.get('Vulnerabilities') or []
]


def render_report(report, image, commit, run_url):
vulnerabilities = get_vulnerabilities(report)
counts = Counter(
vulnerability.get('Severity', 'UNKNOWN').upper()
for vulnerability in vulnerabilities
)
fixable_counts = Counter(
vulnerability.get('Severity', 'UNKNOWN').upper()
for vulnerability in vulnerabilities
if vulnerability.get('FixedVersion')
)

lines = [
COMMENT_MARKER,
'## Container image vulnerability scan',
'',
f'- Image: `{markdown_escape(image)}`',
f'- Commit: [`{commit[:12]}`]({run_url.rsplit("/actions/runs/", 1)[0]}/commit/{commit})',
f'- Workflow run: [details]({run_url})',
f'- Findings: **{len(vulnerabilities)}** '
f'({sum(fixable_counts.values())} with a fix available)',
'',
'| Severity | Total | Fix available |',
'| --- | ---: | ---: |',
]
for severity in SEVERITIES:
lines.append(
f'| {severity} | {counts[severity]} | {fixable_counts[severity]} |',
)

important = sorted(
(
vulnerability
for vulnerability in vulnerabilities
if vulnerability.get('Severity', 'UNKNOWN').upper() in {'CRITICAL', 'HIGH'}
),
key=lambda vulnerability: (
SEVERITY_ORDER.get(
vulnerability.get('Severity', 'UNKNOWN').upper(),
len(SEVERITIES),
),
vulnerability.get('VulnerabilityID', ''),
vulnerability.get('PkgName', ''),
),
)
lines.extend([
'',
'### High-priority findings',
'',
])
if important:
lines.extend([
'| Severity | Vulnerability | Package | Installed | Fixed |',
'| --- | --- | --- | --- | --- |',
])
for vulnerability in important[:20]:
lines.append(
'| {severity} | {identifier} | {package} | {installed} | {fixed} |'.format(
severity=markdown_escape(vulnerability.get('Severity')),
identifier=markdown_escape(vulnerability.get('VulnerabilityID')),
package=markdown_escape(vulnerability.get('PkgName')),
installed=markdown_escape(vulnerability.get('InstalledVersion')),
fixed=markdown_escape(vulnerability.get('FixedVersion')),
),
)
if len(important) > 20:
lines.extend([
'',
f'_Showing 20 of {len(important)} HIGH/CRITICAL findings._',
])
else:
lines.append('No HIGH or CRITICAL findings were detected.')

lines.extend([
'',
'> This scan is currently reporting-only and establishes the vulnerability baseline.',
'> The complete JSON and SARIF reports are attached to the workflow run.',
'',
])
return '\n'.join(lines)


def main():
parser = argparse.ArgumentParser()
parser.add_argument('--input', required=True)
parser.add_argument('--output', required=True)
parser.add_argument('--image', required=True)
parser.add_argument('--commit', required=True)
parser.add_argument('--run-url', required=True)
args = parser.parse_args()

with open(args.input, encoding='utf-8') as report_file:
report = json.load(report_file)

rendered = render_report(
report,
image=args.image,
commit=args.commit,
run_url=args.run_url,
)
with open(args.output, 'w', encoding='utf-8') as output_file:
output_file.write(rendered)


if __name__ == '__main__':
main()
19 changes: 9 additions & 10 deletions .github/scripts/ci/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ REPO_ROOT=$(git rev-parse --show-toplevel)
cd "$REPO_ROOT"

read -r -d '' container_script <<'BASH' || true
export WHEELHOUSE=$HOME/wheelhouse
pip install --upgrade pip
pip install setuptools==37.0.0
pip install wheel==0.26.0
pip install invoke==0.13.0
invoke wheelhouse --develop
invoke install --develop
invoke test
set -euo pipefail
apt-get update
apt-get install -y --no-install-recommends git build-essential
python -m ensurepip --default-pip
pip install poetry==2.5.1
poetry install --without=docs --with=dev
poetry run invoke test
BASH

docker run --rm -t \
docker run --rm \
-e TEST_BUILD="$TEST_BUILD" \
${MFR_TEST_IMAGE} bash -lc "$container_script"
"${MFR_TEST_IMAGE}" bash -lc "$container_script"
75 changes: 75 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: mfr_ci_testing

on: [push, pull_request, workflow_dispatch]

jobs:

build:
runs-on: ubuntu-24.04
env:
GHA_DISTRO: ubuntu-24.04
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
python-version: [3.13]
steps:
- name: Git checkout
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache Build Requirements
id: pip-cache-step
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ env.GHA_DISTRO }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}

- name: Install dependencies
run: |
python -m pip install poetry==2.5.1 setuptools==80.10.2
poetry install --no-root --without=docs --with=dev

runtests:
name: Run unit tests
needs: build
runs-on: ubuntu-24.04
env:
GHA_DISTRO: ubuntu-24.04
strategy:
matrix:
python-version: [3.13]
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ env.GHA_DISTRO }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'poetry.lock') }}

- name: Install test dependencies
run: |
python -m pip install poetry==2.5.1
python -m pip install setuptools==80.10.2
poetry install --without=docs --with=dev

- name: Run flake8
run: poetry run flake8 .

- name: Run unit tests
run: |
poetry run pytest --cov-report term-missing --cov mfr tests

- name: Upload coverage to Coveralls
run: poetry run coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111 changes: 111 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,117 @@ jobs:
id: meta
run: echo "image=rdm-mfr-test:${{ github.sha }}" >> "$GITHUB_OUTPUT"

scan-image:
runs-on: ubuntu-latest
needs: build-image
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: rdm-mfr-image
path: /tmp

- name: Scan Docker image with Trivy
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
scan-type: image
input: /tmp/rdm-mfr-image.tar
scanners: vuln
vuln-type: os,library
format: json
output: trivy-results.json
exit-code: '0'
list-all-pkgs: 'true'

- name: Convert Trivy report to SARIF
env:
TRIVY_SCANNERS: ''
run: |
trivy convert \
--format sarif \
--output trivy-results.sarif \
trivy-results.json

- name: Render vulnerability summary
env:
IMAGE: ${{ needs.build-image.outputs.image }}
COMMIT: ${{ github.sha }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
python3 .github/scripts/ci/render-trivy-report.py \
--input trivy-results.json \
--output trivy-report.md \
--image "$IMAGE" \
--commit "$COMMIT" \
--run-url "$RUN_URL"
tee -a "$GITHUB_STEP_SUMMARY" < trivy-report.md

- name: Upload vulnerability reports
uses: actions/upload-artifact@v4
with:
name: trivy-image-scan
path: |
trivy-results.json
trivy-results.sarif
trivy-report.md
retention-days: 14

- name: Upload SARIF to GitHub Code Scanning
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
uses: github/codeql-action/upload-sarif@bce182f857edf1feab116e9795a3393d21977282 # v4
with:
sarif_file: trivy-results.sarif
category: trivy-container-image

comment-image-scan:
runs-on: ubuntu-latest
needs: scan-image
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
permissions:
actions: read
contents: read
issues: write
pull-requests: write
steps:
- name: Download vulnerability summary
uses: actions/download-artifact@v4
with:
name: trivy-image-scan

- name: Create or update PR comment
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
comments_endpoint="repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments"
comment_id="$({
gh api --paginate "$comments_endpoint" --jq \
'.[] | select(.user.login == "github-actions[bot]" and (.body | contains("<!-- trivy-image-scan -->"))) | .id'
} | sed -n '1p')"
if [[ -n "$comment_id" ]]; then
gh api \
--method PATCH \
"repos/${GITHUB_REPOSITORY}/issues/comments/${comment_id}" \
-F body=@trivy-report.md
else
gh api \
--method POST \
"$comments_endpoint" \
-F body=@trivy-report.md
fi

tests:
runs-on: ubuntu-latest
needs: build-image
Expand Down
1 change: 0 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Eric Bower <neurosnap@gmail.com>
Erin Braswell <erin.braswell@gmail.com> erinspace <erin.braswell@gmail.com>
Fitz Elliott <fitz@cos.io> Fitz Elliott <felliott@fiskur.org>
Haoyu Chen <hc6as@virginia.edu> haoyuchen1992 <hc6as@virginia.edu>
Jeffrey Spies <jspies@gmail.com> Jeffrey Spies <github@jeffspies.com>
John Tordoff <john@cos.io> Johnetordoff <Johnetordoff@users.noreply.github.com>
Jonathon Love <jon@thon.cc>
Joshua Carp <jm.carp@gmail.com>
Expand Down
Loading
Loading