Skip to content

Commit

Permalink
merge conflict resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
sralla-eq committed Jan 10, 2025
2 parents 96d1191 + 1ea06c9 commit 93343d3
Show file tree
Hide file tree
Showing 234 changed files with 23,036 additions and 607 deletions.
44 changes: 0 additions & 44 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

18 changes: 0 additions & 18 deletions .github/ISSUE_TEMPLATE/maintenance.md

This file was deleted.

23 changes: 0 additions & 23 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md

This file was deleted.

14 changes: 0 additions & 14 deletions .github/PULL_REQUEST_TEMPLATE/vulnerability.md

This file was deleted.

30 changes: 30 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Notes

Please include a summary of the change and which issue is fixed or which feature is added.

## JIRA

- **Related story**: [Jira Ticket](url)

## Checklist

- [ ] PR focuses on a single story.
- [ ] New unit tests added and ensured they pass.
- [ ] Service has been tested in local and it works as expected.
- [ ] Documentation has been updated for this code change (if needed).
- [ ] Code follows the Java Coding Conventions (https://www.oracle.com/java/technologies/javase/codeconventions-programmingpractices.html).

## Types of changes

What types of changes does this PR introduces?

- [ ] Bugfix
- [ ] New feature
- [ ] Breaking change

## Testing

- [ ] Does this PR has >90% code coverage?
- [ ] Is the screenshot attached for code coverage?
- [ ] Does the `gradle build` pass in your local?
- [ ] Is the `gradle build` logs attached?
73 changes: 73 additions & 0 deletions .github/workflows/Build-and-deploy-nnd-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build and push nnd-data-exchange-service image to ECR
on:
push:
branches:
- main
- master
- update-github-action-**
paths-ignore:
- "docker-compose.yml"
- "**.md"
jobs:
sonar_scan:
uses: ./.github/workflows/sonar.yaml
secrets:
CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID: ${{secrets.CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID}}
PASSED_GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
call-build-microservice-container-workflow:
name: Build Container
needs: sonar_scan
uses: CDCgov/NEDSS-Workflows/.github/workflows/Build-gradle-microservice-container.yaml@main
with:
microservice_name: nnd-data-exchange-service
dockerfile_relative_path: -f ./nnd-data-exchange-service/Dockerfile .
environment_classifier: SNAPSHOT
java_version: "21"
secrets:
CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID: ${{secrets.CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID}}
ECR_REPO_BASE_NAME: ${{secrets.ECR_REPO_BASE_NAME}}
GIT_USER_EMAIL: ${{secrets.GIT_USER_EMAIL}}
GIT_USER_NAME: ${{secrets.GIT_USER_NAME}}
HELM_TOKEN: ${{secrets.HELM_TOKEN}}

call-update-helm-nnd-service:
name: Request DEV deployment
needs: call-build-microservice-container-workflow
uses: CDCgov/NEDSS-Workflows/.github/workflows/Update-helm-charts.yaml@main
with:
microservice_name: nnd-data-exchange-service
values_file_with_path: charts/nnd-service/values-dts1.yaml
new_image_tag: ${{ needs.call-build-microservice-container-workflow.outputs.output_image_tag }}
secrets:
GIT_USER_EMAIL: ${{secrets.GIT_USER_EMAIL}}
GIT_USER_NAME: ${{secrets.GIT_USER_NAME}}
HELM_TOKEN: ${{secrets.HELM_TOKEN}}

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'

- name: create-data-sync-service-jar
working-directory: ./nnd-data-poll-service
run: ./gradlew build --no-daemon
- name: upload-data-sync-service-jar
uses: actions/upload-artifact@v4
with:
name: NND-data-sync-service-jar
path: nnd-data-poll-service/build/libs/data-sync-service.jar

- name: create-netss-message-processor-jar
working-directory: ./netss-message-processor
run: ./gradlew build --no-daemon
- name: upload-netss-message-processor-jar
uses: actions/upload-artifact@v4
with:
name: NETSS-message-processor-jar
path: netss-message-processor/build/libs/netss-message-processor.jar
93 changes: 93 additions & 0 deletions .github/workflows/Release-container-nnd-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Release nnd-data-exchange-service image
on:
workflow_dispatch:
inputs:
microservice_name:
description: "Microservice name matching your repository (ex. nnd-data-exchange-service)."
required: true
type: string
default: <microservicename>
dockerfile_relative_path:
description: "Relative path of your dockerfile, may include -f flag (ex. ./apps/<microservice>/Dockerfile)."
required: true
type: string
default: -f ./nnd-data-exchange-service/Dockerfile .
existing-image-tag:
description: "Image tag of existing container in ECR (not used if build-new-container=true)."
required: false
type: string
environment_classifier:
description: Metadata to append to application version (A setting of NONE, indicates all metadata to be stripped). Ex. if version=1.0.0, and environment_classifier=SNAPSHOT result will be 1.0.0-SNAPSHOT.<githubsha>. If version=1.0.0, and environment_classifier=NONE result will be 1.0.0.
required: true
type: string
default: SNAPSHOT
values_file_with_path:
description: What is the path to the helm chart in NBS helm chart repository? (ex. charts/nnd-service/values-int1.yaml)
type: string
default: "charts/<microservice>/<values_filename.yaml>"
build-new-container:
description: "Check the box to create a new container tagged based on the environment_classifier."
required: true
default: false
type: boolean
update_helm_chart:
description: "Do you want to update the specified helm chart"
required: true
default: true
type: boolean

jobs:
call-build-microservice-container-workflow:
uses: CDCgov/NEDSS-Workflows/.github/workflows/Release-gradle-microservice-container.yaml@main
with:
microservice_name: ${{inputs.microservice_name}}
existing-image-tag: ${{inputs.existing-image-tag}}
build-new-container: ${{inputs.build-new-container}}
dockerfile_relative_path: ${{inputs.dockerfile_relative_path}}
environment_classifier: ${{inputs.environment_classifier}}
secrets:
CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID: ${{secrets.CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID}}
ECR_REPO_BASE_NAME: ${{secrets.ECR_REPO_BASE_NAME}}
GIT_USER_EMAIL: ${{secrets.GIT_USER_EMAIL}}
GIT_USER_NAME: ${{secrets.GIT_USER_NAME}}
HELM_TOKEN: ${{secrets.HELM_TOKEN}}

call-update-helm:
needs: call-build-microservice-container-workflow
uses: CDCgov/NEDSS-Workflows/.github/workflows/Update-helm-charts.yaml@main
with:
microservice_name: ${{inputs.microservice_name}}
values_file_with_path: ${{inputs.values_file_with_path}}
new_image_tag: ${{ needs.call-build-microservice-container-workflow.outputs.output_image_tag }}
secrets:
GIT_USER_EMAIL: ${{secrets.GIT_USER_EMAIL}}
GIT_USER_NAME: ${{secrets.GIT_USER_NAME}}
HELM_TOKEN: ${{secrets.HELM_TOKEN}}

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'

- name: create-data-sync-service-jar
working-directory: ./nnd-data-poll-service
run: ./gradlew build --no-daemon
- name: upload-data-sync-service-jar
uses: actions/upload-artifact@v4
with:
name: NND-data-sync-service-jar
path: nnd-data-poll-service/build/libs/data-sync-service.jar

- name: create-netss-message-processor-jar
working-directory: ./netss-message-processor
run: ./gradlew build --no-daemon
- name: upload-netss-message-processor-jar
uses: actions/upload-artifact@v4
with:
name: NETSS-message-processor-jar
path: netss-message-processor/build/libs/netss-message-processor.jar
69 changes: 69 additions & 0 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: SonarCloud
on:
workflow_call:
secrets:
CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID:
description: "Secret named CDC_NBS_SANDBOX_SHARED_SERVICES_ACCOUNTID where ECR resides."
required: true
PASSED_GITHUB_TOKEN:
description: "Secret named GITHUB_TOKEN that references the github token for this repository."
required: true
SONAR_TOKEN:
description: "Secret named SONAR_TOKEN that references the sonar token secret corresponding to the project in sonarcloud."
required: true
pull_request:
paths:
- "nnd-data-exchange-service/**"
- "nnd-data-poll-service/**"
- "netss-message-processor/**"
- ".github/workflows/sonar.yaml"
env:
deployment_env: dev
accountid: ${{secrets.cdc_nbs_sandbox_shared_services_accountid}}

jobs:
pipeline:
name: Build and analyze
runs-on: ubuntu-latest

permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'zulu' # Alternative distribution options are available

- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Build and analyze
working-directory: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
./gradlew build jacocoTestReport sonar "-Dorg.gradle.jvmargs=-Xms512m -Xmx4g -XX:MaxMetaspaceSize=1g"
- name: Publish Testing Reports
uses: actions/upload-artifact@v4
with:
name: testing
path: ./**/build/reports
Loading

0 comments on commit 93343d3

Please sign in to comment.