Skip to content

Commit

Permalink
MAT-6545 QDM Measure Export - HQMF - Create git repo madie-qdm-service
Browse files Browse the repository at this point in the history
- initial project structure
- okta spring security
- test endpoint with PackageController & couple of test cases
  • Loading branch information
adongare committed Dec 19, 2023
1 parent a7b1e4d commit adf058f
Show file tree
Hide file tree
Showing 20 changed files with 804 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Code owners:
* @MeasureAuthoringTool/madie-developers
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## MADiE PR

Jira Ticket: [MAT-0000](https://jira.cms.gov/browse/MAT-0000)
(Optional) Related Tickets:

### Summary

### All Submissions
* [ ] This PR has the JIRA linked.
* [ ] Required tests are included.
* [ ] No extemporaneous files are included (i.e Complied files or testing results).
* [ ] This PR is merging into the **correct branch**.
* [ ] All Documentation needed for this PR is Complete (or noted in a TODO or other Ticket).
* [ ] Any breaking changes or failing automations are noted by placing a comment on this PR.

### DevSecOps
If there is a question if this PR has a security or infrastructure impact, please contact the Security or DevOps engineer assigned to this project to discuss it further.

* [ ] This PR has NO significant security impact (i.e Changing auth methods, Adding a new user type, Adding a required but vulnerable package).

### Reviewers
By Approving this PR you are attesting to the following:

* Code is maintainable and reusable, reuses existing code and infrastructure where appropriate, and accomplishes the task’s purpose.
* The tests appropriately test the new code, including edge cases.
* If you have any concerns they are brought up either to the developer assigned, security engineer, or leads.
42 changes: 42 additions & 0 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Java CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'

# Github Authentication is required to download artifacts from github packages
# A secret is created for this repo, so that github actions can fetch it, the secret is named after GH_PAT_FOR_ACTIONS_TOKEN
- name: maven-settings
uses: s4u/maven-settings-action@v2
with:
servers: '[{"id": "github", "username": "madieUser", "password": "${GITHUB_TOKEN_REF}"}]'
githubServer: false

- name: Build with Maven
run: mvn clean install --file pom.xml
env:
GITHUB_TOKEN_REF: ${{ secrets.GH_PAT_FOR_ACTIONS_TOKEN }}

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
*~
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### OS Specific ###
.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Ignore .bak files
*.bak
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Use AWS AL2 + Corretto base image
FROM amazoncorretto:17-al2-jdk

## Add compiled jar
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar

## Update packages
RUN yum update -y --security

## Add the wait script to the image
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /wait
RUN chmod +x /wait

## Download new relic java agent
RUN curl -O https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic.jar \
&& curl -O https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic.yml

## Launch the wait tool and then your application
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=it", "app.jar"]
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
# madie-qdm-service
# madie-qdm-service

Quantity Data Model service for MADiE application.

To build
```
mvn clean verify
```

To run:
```
mvn install spring-boot:run
```

or
```
docker compose up
```


To test actuator locally
```
http://localhost:8086/api/actuator/health
```

To test app locally
```
http://localhost:8086/api
```
should give response unauthorized (HTTP ERROR 401)
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3"
services:
madie-qdm-service:
build:
context: .
volumes:
- ./:/app:cached
- ~/.m2:/root/.m2:consistent
ports:
- "8086:8086"
88 changes: 88 additions & 0 deletions madie-checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<property name="charset" value="UTF-8" />

<property name="severity" value="error" />

<property name="fileExtensions" value="java, properties, xml" />

<!-- https://checkstyle.sourceforge.io/config_sizes.html#FileLength -->
<module name="FileLength">
<property name="max" value="605" />
</module>
<module name="SuppressionFilter">
<property name="file" value="suppressions.xml"/>
<property name="optional" value="false"/>
</module>
<!-- https://checkstyle.sourceforge.io/config_sizes.html#LineLength -->
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="100"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="SuppressWarningsFilter" />
<module name="TreeWalker">
<module name="SuppressWarningsHolder" />
<!-- https://checkstyle.sourceforge.io/config_sizes.html#MethodLength -->
<module name="MethodLength">
<property name="tokens" value="METHOD_DEF" />
<property name="max" value="60" />
</module>

<!-- https://checkstyle.sourceforge.io/config_misc.html#OuterTypeFilename -->
<module name="OuterTypeFilename" />

<!-- https://checkstyle.sourceforge.io/config_coding.html#IllegalTokenText -->
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL" />
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)" />
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value." />
</module>

<!-- https://checkstyle.sourceforge.io/config_misc.html#AvoidEscapedUnicodeCharacters -->
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters"
value="true" />
<property name="allowByTailComment" value="true" />
<property name="allowNonPrintableEscapes" value="true" />
</module>

<!-- https://checkstyle.sourceforge.io/config_design.html#OneTopLevelClass -->
<module name="OneTopLevelClass" />

<!-- https://checkstyle.sourceforge.io/config_blocks.html#EmptyBlock -->
<module name="EmptyBlock">
<property name="option" value="TEXT" />
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH" />
</module>

<!-- https://checkstyle.sourceforge.io/config_blocks.html#NeedBraces -->
<module name="NeedBraces" />

<!-- https://checkstyle.sourceforge.io/config_coding.html#MultipleVariableDeclarations -->
<module name="MultipleVariableDeclarations" />

<!-- https://checkstyle.sourceforge.io/config_misc.html#ArrayTypeStyle -->
<module name="ArrayTypeStyle" />

<!-- https://checkstyle.sourceforge.io/config_coding.html#MissingSwitchDefault -->
<module name="MissingSwitchDefault" />

<!-- https://checkstyle.sourceforge.io/config_coding.html#FallThrough -->
<module name="FallThrough" />

<!-- https://checkstyle.sourceforge.io/config_misc.html#UpperEll -->
<module name="UpperEll" />

<!-- https://checkstyle.sourceforge.io/config_modifier.html#ModifierOrder -->
<module name="ModifierOrder"/>

</module>
</module>
Loading

0 comments on commit adf058f

Please sign in to comment.