Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.0.0 #79

Merged
merged 93 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
6ad4c5e
bump version
bischoffz Jun 18, 2024
0b34955
Merge branch 'main' of https://github.com/HHS/ASPR-ms-taskit into dev
bischoffz Jun 20, 2024
6d1572b
update pom.xml
bischoffz Jun 20, 2024
804a7ca
fix pom warning
bischoffz Jun 20, 2024
e38946e
update workflow
bischoffz Jun 20, 2024
e48d073
update protobuf engine to use buffered reader (#68)
bischoffz Jun 24, 2024
dbbbbb9
Bump org.sonatype.central:central-publishing-maven-plugin (#67)
dependabot[bot] Jun 24, 2024
87f6155
Bump org.apache.maven.plugins:maven-surefire-plugin (#65)
dependabot[bot] Jun 25, 2024
9a1eb05
work in progress
bischoffz Jul 1, 2024
a947e71
begin changing to new paradigm of read/write/translate
bischoffz Jul 1, 2024
ee11a45
adapt test taskit engine
bischoffz Jul 1, 2024
b1d3d75
change 'convert' to 'translate'
bischoffz Jul 1, 2024
1e72db9
adapt protobuf taskit engine to new paradigm
bischoffz Jul 1, 2024
094e868
change 'convert' to 'translate'
bischoffz Jul 1, 2024
ee4cd99
update folder structure
bischoffz Jul 1, 2024
3faabe6
folder restructure
bischoffz Jul 1, 2024
91e6491
update to new folder structure
bischoffz Jul 1, 2024
daba491
update package name
bischoffz Jul 1, 2024
8b171d7
update package name
bischoffz Jul 1, 2024
8bf5439
update test package structure
bischoffz Jul 1, 2024
17a39f6
update TaskitError to TaskitCoreError
bischoffz Jul 1, 2024
431b94b
update package structure
bischoffz Jul 1, 2024
c1be169
rename TaskitEngineType to TaskitEngineId
bischoffz Jul 2, 2024
8df0e6b
further refactor of core
bischoffz Jul 2, 2024
7b1493f
add abstract protobuftaskitengine to define common methods that are s…
bischoffz Jul 2, 2024
3420f1d
fix taskitenginemanager test
bischoffz Jul 2, 2024
de26e37
testing update
bischoffz Jul 2, 2024
e33ad3f
delete concept of child parent relationship
bischoffz Jul 2, 2024
9e036ab
fix all core taskit tests
bischoffz Jul 3, 2024
c3c1ba5
fix protobuf test errors
bischoffz Jul 3, 2024
ae36472
Bump the test-dependencies group with 2 updates (#69)
dependabot[bot] Jul 8, 2024
3acfe8a
100% test coverage for core
bischoffz Jul 8, 2024
505fee5
update tests based on unit test report
bischoffz Jul 8, 2024
32708bc
update method
bischoffz Jul 8, 2024
6c4b906
update bad logic in translator context
bischoffz Jul 8, 2024
172fbb9
updates protobuf tests to 100% coverage
bischoffz Jul 8, 2024
0dcccde
refactor helper class
bischoffz Jul 8, 2024
c78efb3
add missing tests
bischoffz Jul 8, 2024
6797751
change test method name
bischoffz Jul 8, 2024
6bade82
remove unused code
bischoffz Jul 8, 2024
6c08d64
update test based on unit test report
bischoffz Jul 8, 2024
ca05c09
update to 5.0.0-snapshot
bischoffz Jul 8, 2024
62d34bb
update javadoc
bischoffz Jul 9, 2024
48a8f07
update javadoc
bischoffz Jul 9, 2024
f5d6310
update javadoc
bischoffz Jul 9, 2024
e30898f
add 2 todo statements
bischoffz Jul 9, 2024
526c63f
javadoc update
bischoffz Jul 9, 2024
23cdff8
fix compile error
bischoffz Jul 9, 2024
7e78de6
update javadoc
bischoffz Jul 9, 2024
995cc0f
initial refactor pass
bischoffz Jul 17, 2024
a91a636
fix protobuf
bischoffz Jul 17, 2024
f4d98be
fix tests
bischoffz Jul 17, 2024
00cdb5c
fix protobuf and protobuf tests
bischoffz Jul 17, 2024
60f1bb1
animal descendance example
bischoffz Jul 17, 2024
10d7ee7
solution to spec init problem
bischoffz Jul 17, 2024
1bd84a1
delete test
bischoffz Jul 17, 2024
74c134e
small changes and add todos
bischoffz Jul 17, 2024
515b094
remove animal example
bischoffz Jul 17, 2024
1106b69
Bump org.apache.maven.plugins:maven-surefire-plugin (#71)
dependabot[bot] Jul 18, 2024
cd1f5f5
fix test errors
bischoffz Jul 18, 2024
2c1eae1
Merge pull request #72 from HHS/taskit-refactor-2
bischoffz Jul 18, 2024
b603b3b
implement some TODOs
bischoffz Jul 18, 2024
8ce012b
add translate methods to enginemanager
bischoffz Jul 18, 2024
39a49eb
core engine javadoc update
bischoffz Jul 22, 2024
86d5c40
add bridge class for testing, make method package access
bischoffz Jul 22, 2024
1f619a9
test support javadoc
bischoffz Jul 22, 2024
09f5621
translation javadocs
bischoffz Jul 22, 2024
f8a0473
complete core javadoc and testing
bischoffz Jul 23, 2024
cbdf286
fix test error
bischoffz Jul 23, 2024
1330672
add equals contract comment
bischoffz Jul 23, 2024
b2456df
update protobuf testing
bischoffz Jul 23, 2024
883fc5f
update core javadoc
bischoffz Jul 23, 2024
50b0b46
protobuf javadoc
bischoffz Jul 23, 2024
408d31a
readme update
bischoffz Jul 23, 2024
1d6b70e
Updated java docs
shawnhatch Jul 24, 2024
0efd5fc
Javadoc updates
shawnhatch Jul 24, 2024
f868df9
changes based on review 1
bischoffz Jul 24, 2024
fd3a8a4
update taskit engine to do validation
bischoffz Jul 26, 2024
8f0dfec
change abstract methods to take a file rather than a reader/writer
bischoffz Jul 29, 2024
ac90203
move some validation checks to abstract proto engine
bischoffz Jul 29, 2024
36f1f05
implement abstract methods from abstract proto engine
bischoffz Jul 29, 2024
c6d04f7
update proto engine tests
bischoffz Jul 29, 2024
b522db8
update excludes statement for jacoco
bischoffz Jul 29, 2024
a445344
update test support, remove file
bischoffz Jul 29, 2024
ae7516a
Bump the protobuf-dependencies group with 3 updates (#74)
dependabot[bot] Jul 29, 2024
d17b4bb
Bump org.apache.maven.plugins:maven-javadoc-plugin (#73)
dependabot[bot] Jul 29, 2024
09cd558
Merge pull request #70 from HHS/translation-engine-refactor
bischoffz Jul 29, 2024
b7043f0
fix method signature
bischoffz Jul 30, 2024
baa1022
Merge pull request #75 from HHS/dev-5.0
bischoffz Aug 7, 2024
3acb770
Bump the test-dependencies group with 2 updates (#78)
dependabot[bot] Aug 19, 2024
b4d6ad9
Bump the standard-plugins group across 1 directory with 2 updates (#77)
dependabot[bot] Aug 19, 2024
e82ed0d
update util version
bischoffz Aug 19, 2024
497df53
fix javadoc
bischoffz Aug 19, 2024
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
30 changes: 15 additions & 15 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,51 +59,51 @@ jobs:
generateReleaseNotes: true
skipIfReleaseExists: true

update-gcm-taskit:
if: ${{ !contains(github.event.head_commit.message, 'update-util-to-') }}
update-gcm:
if: ${{ !endsWith(needs.release.outputs.taskit_version, '0') }}
needs: release
runs-on: ubuntu-latest
permissions:
contents: write
env:
VERSION: ${{ needs.release.outputs.taskit_version }}
steps:
- name: Checkout GCM Taskit
- name: Checkout GCM
uses: actions/checkout@v4
with:
repository: HHS/ASPR-ms-gcm-taskit
repository: HHS/ASPR-8
token: ${{ secrets.GHA_BOT }}

- name: Update Taskit version
- name: Update Util version
run : |
echo "$VERSION"
sed -i "0,/<taskit.version>.*<\/taskit.version>/s//<taskit.version>$VERSION<\/taskit.version>/g" pom.xml
sed -i "0,/<util.version>.*<\/util.version>/s//<util.version>$VERSION<\/util.version>/g" pom.xml

- name: Increment GCM Taskit Version
- name: Increment GCM Version
run: |
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml)
echo GCM Taskit Version: $current_version
echo GCM Version: $current_version
parts=( ${current_version//./ } )
bv=$((parts[2] + 1))
new_version="${parts[0]}.${parts[1]}.${bv}"
echo New GCM Taskit Version: $new_version
echo New GCM Version: $new_version
sed -i "0,/<revision>.*<\/revision>/s//<revision>$new_version<\/revision>/g" pom.xml

- name: Setup Git
run: |
git config --global user.name "github-actions"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Make branch in GCM Taskit
- name: Make branch in GCM
run: |
git checkout -b update-taskit-to-$VERSION
git checkout -b update-util-to-$VERSION
git add pom.xml
git commit -m "Update taskit to $VERSION"
git push --set-upstream origin update-taskit-to-$VERSION
git commit -m "Update util to $VERSION"
git push --set-upstream origin update-util-to-$VERSION

- name: Make PR in GCM Taskit
- name: Make PR in GCM
run: |
gh pr create -R HHS/ASPR-ms-gcm-taskit -B main --fill
gh pr create -R HHS/ASPR-8 -B main --fill
gh pr merge -m --auto
env:
GH_TOKEN: ${{ secrets.GHA_BOT }}
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
[![GitHub Workflow Status (with event)][build-shield]][build-url]

# Translation And Serialization Toolkit
The Translation and Serialization Tookkil (Taskit) is a library that was created to faciliate converting from various input files into Java Objects. This is espcially useful for Simulation Models such as [GCM](https://github.com/HHS/ASPR-8).
The Translation and Serialization Toolkit (Taskit) is a library that was created to facilitate converting from various input files into Java Objects. This is especially useful for Simulation Models such as [GCM](https://github.com/HHS/ASPR-8).

Currently there is only 1 supported serialzation format, and that is protobuf. Other formats such as binary will follow in the future.
Currently there is only 1 supported serialization format, and that is protobuf. Other formats such as binary will follow in the future.

As of v3.2.0, this project is in Maven Central.

## License
Distributed under the GPLv3 License. See [LICENSE](LICENSE) for more information.

Please read the [HHS vulnerability discloure](https://www.hhs.gov/vulnerability-disclosure-policy/index.html).
Please read the [HHS vulnerability disclosure](https://www.hhs.gov/vulnerability-disclosure-policy/index.html).

## Usage
To use this project in your project, simply add the following dependency to your `dependencies` section of your pom.xml file.
```
<dependency>
<groupId>gov.hhs.aspr.ms.taskit</groupId>
<artifactId>core</artifactId>
<version>4.0.0</version>
<version>5.0.0</version>
</dependency>
```

Expand All @@ -31,29 +31,34 @@ To use the protobuf library of taskit, simply add the following dependency to yo
<dependency>
<groupId>gov.hhs.aspr.ms.taskit</groupId>
<artifactId>protobuf</artifactId>
<version>4.0.0</version>
<version>5.0.0</version>
</dependency>
```

## Overview
Currently Taskit is composed of a Core library and a Protobuf library.

### Core
[Core](core) is the base taskit engine and contains the root level functionality that drives the translation and serialization.
This library contains the base TranslationController class, the base TranslationSpec class and the base TranslationEngine class.

#### TranslationController
The TranslationController class handles the delgation of reading/writing from/to input/output files.
[Core](core) contains TranslationSpec, TaskitEngine, TaskitEngineId, TaskitEngineManager, and Translator. These classes define the root level functionality of Taskit.

#### TranslationSpec
The TranslationSpec class is an abstract class that must be impleneted to define how to convert between two Java Types, generally the input Java type and the application Java Type.
An abstract class that defines how to translate between two different Java Types. Implementers of this class must define the intricate details on the translation, while the abstract class strictly handles initialization and determining which internal translate method to call based on the given object that needs to be translated.

#### TaskitEngine
An abstract class that contains a mapping of classes to TranslationSpecs. It has the sole responsibility of translating/reading/writing. For translating, it will determine which TranslationSpec to use based on the class of the given object to translate. Implementers of this class must define how to read/write files, as that process can vary between serialization libraries.

#### TaskitEngineId
An identifier for a TaskitEngine, for use in the TaskitEngineManager.

#### TaskitEngineManager
The TaskitEngineManager can handle multiple TaskitEngines and allows the user to read/write/translate using the TaskitEngineId to determine which TaskitEngine to use. Contains the same methods as TaskitEngine, with an additional parameter for the TaskitEngineId.

#### TranslationEngine
The TranslationEngine class delgates the converting of one type to another via TranslationSpecs as well as doing the actual reading/writing as delegated by the TranslationController.
#### Translator
A Translator is simply a class that can wrap a group of TranslationSpecs that should/will often be used together. It also contains a dependency mechanism that allows for Translators to depend on other Translators, which is useful if a given TranslationSpec requires another TranslationSpec that is not provided by the encompassing Translator. Translators must follow a DAG pattern; there cannot be duplicate Translators, missing Translators nor cyclic Translator dependencies.

### Protobuf
[Protobuf](protobuf) is a version of taskit made specifically to be used with protobuf.
This library builds on the Core library described above and adds a distinct TranslationEngine and TranslationSpecs needed to fully support protobuf.
This library builds on the Core library described above and adds a distinct TaskitEngine and TranslationSpecs needed to fully support protobuf.

#### Supported types
This library supports the following proto message types:
Expand Down
1 change: 0 additions & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</parent>

<!-- Artifact -->
<groupId>gov.hhs.aspr.ms.taskit</groupId>
<artifactId>core</artifactId>
<packaging>jar</packaging>

Expand Down

This file was deleted.

This file was deleted.

Loading