Skip to content

Commit

Permalink
Merge branch 'dependabot/nuget/RabbitMQ.Client-7.0.0' of https://gith…
Browse files Browse the repository at this point in the history
…ub.com/SMI/SmiServices into dependabot/nuget/RabbitMQ.Client-7.0.0
  • Loading branch information
jas88 committed Dec 4, 2024
2 parents aa37099 + 70bd684 commit abb74ad
Show file tree
Hide file tree
Showing 134 changed files with 862 additions and 839 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
schedule:
- cron: "0 5 * * *"

env:
python-version: "3.10"

jobs:
analyze:
name: Analyze
Expand All @@ -23,6 +26,9 @@ jobs:
matrix:
language: ["csharp", "java", "python"]
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
Expand All @@ -32,13 +38,17 @@ jobs:
- name: Build Python
if: ${{ matrix.language == 'python' }}
uses: github/codeql-action/autobuild@v3
- name: setup .NET
if: ${{ matrix.language == 'csharp' }}
# NOTE(rkm 2022-02-20) Uses global.json
uses: actions/[email protected]
- name: Build .Net
if: ${{ matrix.language == 'csharp' }}
run: ./bin/smi/build.py -c Release
run: ./bin/smi/smi_build.py -c Release
- name: Build java
if: ${{ matrix.language == 'java' }}
# NOTE(rkm 2023-03-21) Ensure test code is detected but don't actually run anything
run: ./bin/ctp/test.py --install-libs -DskipTests
run: ./bin/ctp/ctp_test.py --install-libs -DskipTests
- name: SecurityCodescan
if: ${{ matrix.language == 'csharp' }}
run: |
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ env:
java-version: 11
java-distribution: temurin
# python
python-version: 3.6
python-version: "3.10"

jobs:
init:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
build_ref: ${{ steps.build_ref.outputs.build_ref }}
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: checkout
uses: actions/checkout@v4
- name: set matrix
Expand Down Expand Up @@ -59,16 +62,19 @@ jobs:
- name: "[linux] enable disk caching"
if: ${{ matrix.os == 'linux' }}
run: sudo apt-get install -y libeatmydata1
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: checkout
uses: actions/checkout@v4
- name: setup .NET
# NOTE(rkm 2022-02-20) Uses global.json
uses: actions/[email protected]
- name: download tessdata
run: ./bin/smi/downloadTessdata.py
run: ./bin/smi/download_tessdata.py
- name: "[linux] start services"
if: ${{ matrix.os == 'linux' }}
run: ./bin/smi/startDockerLinux.py ${{ env.db-password }}
run: ./bin/smi/smi_start_docker_linux.py ${{ env.db-password }}
- name: "[linux] re-write database strings"
if: ${{ matrix.os == 'linux' }}
run: |
Expand Down Expand Up @@ -96,12 +102,12 @@ jobs:
set -euxo pipefail
cov=""
[ "${{ matrix.os }}" == "windows" ] && cov="--no-coverage"
./bin/smi/buildTestPackage.py \
./bin/smi/smi_build_test_package.py \
${{ needs.init.outputs.build_ref }} \
"$cov"
- name: upload coverage to codecov
if: ${{ matrix.os == 'linux' }}
uses: codecov/[email protected].4
uses: codecov/[email protected].7
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage/
Expand All @@ -126,6 +132,9 @@ jobs:
matrix: ${{ fromJson(needs.init.outputs.matrix) }}
runs-on: ${{ matrix.image }}
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: "[linux] enable disk caching"
if: ${{ matrix.os == 'linux' }}
run: sudo apt-get install -y libeatmydata1
Expand All @@ -139,12 +148,12 @@ jobs:
cache: maven
- name: "[linux] start services"
if: ${{ matrix.os == 'linux' }}
run: ./bin/ctp/startDockerLinux.py
run: ./bin/ctp/ctp_start_docker_linux.py
- name: "[windows] skip integration tests"
if: ${{ matrix.os == 'windows' }}
run: echo "JAVA_TESTS=--skip-integration-tests" >> $GITHUB_ENV
- name: build, test, and package ctp
run: ./bin/ctp/buildTestPackage.py --install-libs ${{ needs.init.outputs.build_ref }} ${{ env.JAVA_TESTS }}
run: ./bin/ctp/ctp_build_test_package.py --install-libs ${{ needs.init.outputs.build_ref }} ${{ env.JAVA_TESTS }}
- name: "[linux] upload packages"
if: ${{ matrix.os == 'linux' }}
uses: actions/upload-artifact@v4
Expand All @@ -155,7 +164,7 @@ jobs:
upload-to-release:
if: contains(github.ref, 'refs/tags/v')
needs: [init, smi, ctp]
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: "[linux] enable disk caching"
run: sudo apt-get install -y libeatmydata1
Expand Down
8 changes: 8 additions & 0 deletions .meta/flake8.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[flake8]

# https://github.com/psf/black
max-line-length = 120

# Ignoring:
# E203 - Whitespace before ':'
extend-ignore = E203
3 changes: 3 additions & 0 deletions .meta/isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[isort]
profile = black
force_single_line = True
9 changes: 9 additions & 0 deletions .meta/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
mypy_path = ./bin
51 changes: 50 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
default_language_version:
python: python3.10
exclude: |
(?x)^(
.*/packages.lock.json|
Expand Down Expand Up @@ -60,7 +62,7 @@ repos:
)$
# Markdown
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.18
rev: 0.7.19
hooks:
- id: mdformat
additional_dependencies:
Expand All @@ -74,3 +76,50 @@ repos:
hooks:
- id: markdown-link-check
args: [--quiet, --config, .meta/markdown-link-check.json]
# Python
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
- id: python-use-type-annotations
- id: python-no-log-warn
- repo: https://github.com/asottile/add-trailing-comma
rev: "v3.1.0"
hooks:
- id: add-trailing-comma
- repo: https://github.com/asottile/pyupgrade
rev: "v3.19.0"
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/asottile/yesqa
rev: "v1.5.0"
hooks:
- id: yesqa
additional_dependencies:
- pep8-naming==0.14.1
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.13.0"
hooks:
- id: mypy
args: [--config-file, .meta/mypy.ini]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: "24.10.0"
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: [--settings=.meta/isort.cfg]
- repo: https://github.com/pycqa/flake8
rev: "7.1.1"
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==24.10.31
- flake8-assert-msg==1.1.1
- pep8-naming==0.14.1
args: [--config, .meta/flake8.conf]
20 changes: 10 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ A raw git diff can be seen [here][unreleased].
- [#1450](https://github.com/SMI/SmiServices/pull/1450) by darshad-github. Update contributing.md with feature branch workflow guidelines
- [#1451](https://github.com/SMI/SmiServices/pull/1451) by rkm. adopt dotnet central package management (CPM)
- [#1468](https://github.com/SMI/SmiServices/pull/1468) by rkm. switch rabbitmq docker-compose images to include management plugin
- [#1494](https://github.com/SMI/SmiServices/pull/1494) by rkm. \[actions\] replace deprecated set-output with GITHUB_OUTPUT
- [#1494](https://github.com/SMI/SmiServices/pull/1494) by rkm. [actions] replace deprecated set-output with GITHUB_OUTPUT
- [#1496](https://github.com/SMI/SmiServices/pull/1496) by rkm. add CodeQL scan

## [5.3.0] 2022-11-08
Expand Down Expand Up @@ -353,7 +353,7 @@ A raw git diff can be seen [here][unreleased].

### Bugfix

- [#1087](https://github.com/SMI/SmiServices/pull/1087) by rkm. \[CI\] Misc. CI
- [#1087](https://github.com/SMI/SmiServices/pull/1087) by rkm. [CI] Misc. CI
fixes
- Fixes the build scripts to respect any intermediate non-zero return
codes
Expand Down Expand Up @@ -927,7 +927,7 @@ A raw git diff can be seen [here][unreleased].

### Added

- \[breaking\] Add identifiable extraction support
- [breaking] Add identifiable extraction support
- New service "FileCopier" which sits in place of CTP for identifiable
extractions and copies source files to their output dirs
- Changes to MongoDB extraction schema, but backwards compatibility has
Expand All @@ -948,7 +948,7 @@ A raw git diff can be seen [here][unreleased].

### Changed

- \[breaking\] Environment variables are no longer required. Previous settings
- [breaking] Environment variables are no longer required. Previous settings
now appear in configuration file
- Environment variable `SMI_LOGS_ROOT` is now `GlobalOptions.LogsRoot`
- Environment variable `MONGO_SERVICE_PASSWORD` is now
Expand Down Expand Up @@ -1050,7 +1050,7 @@ A raw git diff can be seen [here][unreleased].
- Records in the referenced table will blacklist where any UID is found
(StudyInstanceUID, SeriesInstanceUID or SOPInstanceUID). This allows
blacklisting an entire study or only specific images.
- \[breaking\] Config on live system may need updated
- [breaking] Config on live system may need updated
- Change the extraction directory generation to be
`<projname>/image-requests/<extractname>`. Fixes
[MVP Service #159](https://dev.azure.com/smiops/MVP%20Service/_workitems/edit/159/)
Expand Down Expand Up @@ -1103,8 +1103,8 @@ A raw git diff can be seen [here][unreleased].

### Changed

- \[Breaking\] Promote the PT modality to its own collection in MongoDB
- \[Breaking\] Renamed `RedisHost` to `RedisConnectionString` in the config
- [Breaking] Promote the PT modality to its own collection in MongoDB
- [Breaking] Renamed `RedisHost` to `RedisConnectionString` in the config
options for clarity
- Update to .Net Core 3.1 (supported until Dec 2022) since 2.2 support ended
last year
Expand Down Expand Up @@ -1190,12 +1190,12 @@ A raw git diff can be seen [here][unreleased].

## [1.5.0] - 2020-03-05

- \[Breaking\] Updated RabbitMQ extraction config to match extraction plan v2
- [Breaking] Updated RabbitMQ extraction config to match extraction plan v2
- Refactor Java exception handling and use of threads
- `TessDirectory` option in \[IsIdentifiable\] now expects tesseract models file
- `TessDirectory` option in [IsIdentifiable] now expects tesseract models file
to exist (no longer downloads it on demand)
- Added support for outsourcing classification (e.g. NLP) to other processes
via TCP (entered in \[SocketRules\] in `Rules.yaml`)
via TCP (entered in [SocketRules] in `Rules.yaml`)
- IsIdentifiable NLP text classification now outsourced via TCP to any
services configured in
- StanfordNER implementation written in Java
Expand Down
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<LangVersion>12.0</LangVersion>
<LangVersion>13.0</LangVersion>
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
<Nullable>enable</Nullable>
<RestoreLockedMode Condition="'$(CI)' == 'true'">true</RestoreLockedMode>
Expand All @@ -18,7 +19,7 @@
<RuntimeIdentifier Condition="$([MSBuild]::IsOSPlatform('Windows'))">win-x64</RuntimeIdentifier>
<SatelliteResourceLanguages>none</SatelliteResourceLanguages>
<SelfContained>true</SelfContained>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Many build warnings for missing docstrings when enabling this - we may want to fix and enable per-project where needed instead? -->
Expand Down
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
<PackageVersion Include="NLog" Version="5.3.4" />
<PackageVersion Include="RabbitMQ.Client" Version="7.0.0" />
<PackageVersion Include="Spectre.Console" Version="0.49.1" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.16" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.22" />
<PackageVersion Include="System.IO.Abstractions" Version="21.1.3" />
<PackageVersion Include="System.IO.FileSystem" Version="4.3.0" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="Terminal.Gui" Version="1.17.1" />
<PackageVersion Include="YamlDotNet" Version="16.2.0" />
<PackageVersion Include="YamlDotNet" Version="16.2.1" />
<!-- Test Packages -->
<PackageVersion Include="HIC.BadMedicine.Dicom" Version="0.1.1" />
<PackageVersion Include="HIC.RDMP.Plugin.Test" Version="8.3.0" />
<PackageVersion Include="Microsoft.CodeCoverage" Version="17.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="NUnit" Version="4.2.2" />
<PackageVersion Include="NUnit.Analyzers" Version="4.4.0" />
Expand Down
10 changes: 3 additions & 7 deletions bin/checkDocs.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#!/usr/bin/env python3

import collections
import glob
import os
import re
import sys

import common as C

import common as c

_VERB_CS_PATH = f"{C.PROJ_ROOT}/src/SmiServices/ServiceVerbs.cs"
_VERB_CS_PATH = f"{c.PROJ_ROOT}/src/SmiServices/ServiceVerbs.cs"
_VERB_RE = re.compile(r'\[Verb\(("\S*?")')


Expand Down Expand Up @@ -63,7 +59,7 @@ def main() -> int:

for tool_type in ("application", "service"):
for tool in tools[tool_type]:
doc_path = f"{C.PROJ_ROOT}/docs/{tool_type}s/{tool}.md"
doc_path = f"{c.PROJ_ROOT}/docs/{tool_type}s/{tool}.md"
if not os.path.isfile(doc_path):
print(f"Missing {doc_path}")
rc |= 1
Expand Down
Loading

0 comments on commit abb74ad

Please sign in to comment.