Skip to content

Commit

Permalink
Merge pull request #873 from devinleighsmith/test_to_master
Browse files Browse the repository at this point in the history
Test to master. IS19 release
  • Loading branch information
asanchezr authored Feb 3, 2022
2 parents 4e826de + 5ce3a34 commit 36d9468
Show file tree
Hide file tree
Showing 433 changed files with 57,684 additions and 3,402 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/api-dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
head TestResults/coverage.opencover.xml
- name: Codecov
uses: codecov/codecov-action@v1.5.0
uses: codecov/codecov-action@v2.1.0
with:
# User defined upload name. Visible in Codecov UI
name: PIMS
Expand All @@ -100,7 +100,7 @@ jobs:
- name: SonarScanner for .NET 5 with pull request decoration support
id: scan
uses: highbyte/[email protected]
if: github.event_name == 'push'
if: github.event_name == 'push'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
Expand All @@ -114,16 +114,16 @@ jobs:
sonarProjectName: PIMS-API
# The SonarQube server URL. For SonarCloud, skip this setting.
sonarHostname: ${{secrets.SONAR_URL}}

- name: Find Comment
if: failure() && steps.scan.outcome == 'failure' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
comment-author: "github-actions[bot]"
body-includes: QUALITY GATE STATUS FOR .NET 5

- name: Check Quality Gate and Create Comment
if: failure() && steps.scan.outcome == 'failure' && github.event_name == 'pull_request' && steps.fc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v1
Expand All @@ -135,9 +135,9 @@ jobs:
issue-number: ${{ github.event.pull_request.number }}
body: |
QUALITY GATE STATUS FOR .NET 5: FAILED.
[View and resolve details on][1]
[1]: ${{env.SONAR_HOST_URL}}/dashboard?id=${{env.PROJECT_KEY}}
reactions: confused
- name: Check Quality Gate and Update Comment
Expand All @@ -152,9 +152,9 @@ jobs:
issue-number: ${{ github.event.pull_request.number }}
body: |
QUALITY GATE STATUS FOR .NET 5: FAILED.
[View and resolve details on][1]
[1]: ${{env.SONAR_HOST_URL}}/dashboard?id=${{env.PROJECT_KEY}}
edit-mode: replace
reactions: eyes
2 changes: 1 addition & 1 deletion .github/workflows/app-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
working-directory: ${{env.working-directory}}

- name: Codecov
uses: codecov/codecov-action@v1.5.0
uses: codecov/codecov-action@v2.1.0
with:
# User defined upload name. Visible in Codecov UI
name: PIMS
Expand Down
118 changes: 118 additions & 0 deletions .github/workflows/ci-cd-pims-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: CI-CD PIMS Development
env:
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
# service account: gitaction
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
OPENSHIFT_TOOLS_NAMESPACE: "3cd915-tools"
MS_TEAMS_WEBHOOK_BUILD_CHANNEL: ${{ secrets.MS_TEAMS_WEBHOOK_URI_BUILD_CHANNEL }}

## variables for scripts under git\openshift\4.0\scripts\oc-*.sh
APP_PORT: 8080
DESTINATION: "dev"
OC_JOB_NAME: "dev"
GIT_URL: "${{github.server_url}}/${{github.repository}}"
GIT_BRANCH: "${{github.ref}}"
APP_NAME: "pims"
PROJ_PREFIX: "3cd915"
PROJ_TOOLS: "3cd915-tools"
PROJ_DEV: "dev"
PROJ_TEST: "test"
PROJ_PROD: "prod"
TAG_DEV: "dev"
TAG_TEST: "test"
TAG_PROD: "prod"

on:
push:
branches: [dev]
# paths:
# - ".github/workflows/ci-cd-pims-dev.yml"

jobs:

ci-cd-start-notification:
name: CI-CD Start Notification to Teams Channel
runs-on: ubuntu-latest
steps:
- name: Start notification to Teams Channel
uses: jdcargile/[email protected]
with:
github-token: ${{ github.token }}
ms-teams-webhook-uri: ${{ env.MS_TEAMS_WEBHOOK_BUILD_CHANNEL }}
notification-summary: PIMS CI-CD GitHub Action STARTED in DEV
notification-color: 17a2b8
timezone: America/Los_Angeles

build-frontend:
name: Build frontend
needs: ci-cd-start-notification
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Login to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
- name: Call script to build frontend (pims-app and pims-app-base)
run: |
./openshift/4.0/player.sh build app-base -apply
./openshift/4.0/player.sh build app -apply
build-api:
name: Build api
needs: ci-cd-start-notification
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Login to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
- name: Call script to build backend (pims-api)
run: |
./openshift/4.0/player.sh build api -apply
deploy:
name: Deploy frontend and api to OpenShift
needs: [build-frontend, build-api]
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Login to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
- name: call scripts to deploy api and frontend
run: |
./openshift/4.0/player.sh deploy api $DESTINATION -apply
./openshift/4.0/player.sh deploy app $DESTINATION -apply
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
needs: deploy
if: always()
steps:
- name: check workflow status
uses: martialonline/workflow-status@v2
id: check
- name: End notification to Teams Channel
uses: jdcargile/[email protected]
with:
github-token: ${{ github.token }}
ms-teams-webhook-uri: ${{ env.MS_TEAMS_WEBHOOK_BUILD_CHANNEL }}
notification-summary: PIMS CI-CD GitHub Action COMPLETED in DEV environment with status ${{ steps.check.outputs.status }}
notification-color: 17a2b8
timezone: America/Los_Angeles
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ start-infra: ## Starts infrastructure containers (e.g. keycloak, database, geose

start up: ## Runs the local containers (n=service name)
@echo "$(P) Running client and server..."
@docker-compose up -d $(n)
@docker-compose up -d --no-recreate $(n)

destroy: ## Stops the local containers and removes them (n=service name)
@echo "$(P) Removing docker containers..."
Expand Down Expand Up @@ -250,11 +250,11 @@ db-refresh: | server-run pause-30 db-seed keycloak-sync ## Refresh the database

db-clean: ## create a new, clean database using the script file in the database. defaults to using the folder specified in database/mssql/.env, but can be overriden with n=PSP_PIMS_S15_00.
@echo "$(P) create a clean database with minimal required data for development"
TARGET_SPRINT=$(n) docker-compose up -d --force-recreate database
TARGET_SPRINT=$(n) docker-compose up -d --build database

db-seed: ## create a new, database seeded with test data using the script file in the database. defaults to using the folder specified in database/mssql/.env, but can be overriden with n=PSP_PIMS_S15_00.
@echo "$(P) Seed the database with test data. n=FOLDER_NAME (PSP_PIMS_S15_00)"
TARGET_SPRINT=$(n) SEED=TRUE docker-compose up -d --force-recreate database;
TARGET_SPRINT=$(n) SEED=TRUE docker-compose up -d --build database;

db-drop: ## Drop the database.
@echo "$(P) Drop the database."
Expand All @@ -264,10 +264,10 @@ db-deploy:
@echo "$(P) deployment script that facilitates releasing database changes."
@cd database/mssql/scripts/dbscripts; TARGET_SPRINT=$(n) ./deploy.sh

db-upgrade: ## Script to upgrade an existing database to the latest version (default) or TARGET_VERSION (if passed), n=TARGET_VERSION (16.01).
@echo "$(P) Upgrade an existing database to the latest version (default) or TARGET_VERSION (if passed), n=TARGET_VERSION (16.01)"
db-upgrade: ## Upgrade an existing database to the TARGET_VERSION (if passed) or latest version (default), n=TARGET_VERSION (16.01).
@echo "$(P) Upgrade an existing database to the TARGET_VERSION (if passed) or latest version (default), n=TARGET_VERSION (16.01)"
@cd database/mssql/scripts/dbscripts; TARGET_VERSION=$(n) ./db-upgrade.sh

db-scaffold: ## Requires local install of sqlcmd
@echo "$(P) regenerate ef core entities from database"
@cd backend/dal; eval $(grep -v '^#' .env | xargs) dotnet ef dbcontext scaffold Name=PIMS Microsoft.EntityFrameworkCore.SqlServer -o ../entities/ef --schema dbo --context PimsContext --context-namespace Pims.Dal --context-dir . --startup-project ../api --no-onconfiguring --namespace Pims.Dal.Entities --data-annotations -v -f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Pims.Api.Areas.Admin.Controllers
public class AccessRequestController : Controller
{
#region Properties
private readonly IPimsService _pimsService;
private readonly IPimsRepository _pimsService;
private readonly IMapper _mapper;
#endregion

Expand All @@ -33,7 +33,7 @@ public class AccessRequestController : Controller
/// </summary>
/// <param name="pimsService"></param>
/// <param name="mapper"></param>
public AccessRequestController(IPimsService pimsService, IMapper mapper)
public AccessRequestController(IPimsRepository pimsService, IMapper mapper)
{
_pimsService = pimsService;
_mapper = mapper;
Expand Down
4 changes: 2 additions & 2 deletions backend/api/Areas/Admin/Controllers/ClaimController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Pims.Api.Areas.Admin.Controllers
public class ClaimController : ControllerBase
{
#region Variables
private readonly IPimsService _pimsService;
private readonly IPimsRepository _pimsService;
private readonly IMapper _mapper;
#endregion

Expand All @@ -33,7 +33,7 @@ public class ClaimController : ControllerBase
/// </summary>
/// <param name="pimsService"></param>
/// <param name="mapper"></param>
public ClaimController(IPimsService pimsService, IMapper mapper)
public ClaimController(IPimsRepository pimsService, IMapper mapper)
{
_pimsService = pimsService;
_mapper = mapper;
Expand Down
16 changes: 8 additions & 8 deletions backend/api/Areas/Admin/Controllers/OrganizationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Pims.Api.Areas.Admin.Controllers
public class OrganizationController : ControllerBase
{
#region Variables
private readonly IPimsService _pimsService;
private readonly IPimsRepository _pimsService;
private readonly IPimsKeycloakService _pimsKeycloakService;
private readonly IMapper _mapper;
#endregion
Expand All @@ -37,7 +37,7 @@ public class OrganizationController : ControllerBase
/// <param name="pimsService"></param>
/// <param name="keycloakService"></param>
/// <param name="mapper"></param>
public OrganizationController(IPimsService pimsService, IPimsKeycloakService keycloakService, IMapper mapper)
public OrganizationController(IPimsRepository pimsService, IPimsKeycloakService keycloakService, IMapper mapper)
{
_pimsService = pimsService;
_pimsKeycloakService = keycloakService;
Expand All @@ -57,7 +57,7 @@ public OrganizationController(IPimsService pimsService, IPimsKeycloakService key
[SwaggerOperation(Tags = new[] { "admin-organization" })]
public IActionResult GetOrganizations()
{
var organizations = _pimsService.Organization.GetAll();
var organizations = _pimsService.UserOrganization.GetAll();
return new JsonResult(_mapper.Map<Model.OrganizationModel[]>(organizations));
}

Expand All @@ -73,7 +73,7 @@ public IActionResult GetOrganizations()
[SwaggerOperation(Tags = new[] { "admin-organization" })]
public IActionResult GetOrganizations(EModel.OrganizationFilter filter)
{
var page = _pimsService.Organization.Get(filter);
var page = _pimsService.UserOrganization.Get(filter);
var result = _mapper.Map<Api.Models.PageModel<Model.OrganizationModel>>(page);
return new JsonResult(result);
}
Expand All @@ -90,7 +90,7 @@ public IActionResult GetOrganizations(EModel.OrganizationFilter filter)
[SwaggerOperation(Tags = new[] { "admin-organization" })]
public IActionResult GetOrganization(long id)
{
var organization = _pimsService.Organization.Get(id);
var organization = _pimsService.UserOrganization.Get(id);
return new JsonResult(_mapper.Map<Model.OrganizationModel>(organization));
}

Expand All @@ -107,7 +107,7 @@ public IActionResult GetOrganization(long id)
public async Task<IActionResult> AddOrganizationAsync([FromBody] Model.OrganizationModel model)
{
var entity = _mapper.Map<Entity.PimsOrganization>(model);
_pimsService.Organization.Add(entity);
_pimsService.UserOrganization.Add(entity);

// TODO: This isn't ideal as the db update may be successful but this request may not.
await entity.PimsUserOrganizations.ForEachAsync(async u =>
Expand All @@ -134,7 +134,7 @@ await entity.PimsUserOrganizations.ForEachAsync(async u =>
public async Task<IActionResult> UpdateOrganizationAsync([FromBody] Model.OrganizationModel model)
{
var entity = _mapper.Map<Entity.PimsOrganization>(model);
_pimsService.Organization.Update(entity);
_pimsService.UserOrganization.Update(entity);

// TODO: This isn't ideal as the db update may be successful but this request may not.
await entity.PimsUserOrganizations.ForEachAsync(async u =>
Expand All @@ -160,7 +160,7 @@ await entity.PimsUserOrganizations.ForEachAsync(async u =>
public async Task<IActionResult> DeleteOrganizationAsync([FromBody] Model.OrganizationModel model)
{
var entity = _mapper.Map<Entity.PimsOrganization>(model);
_pimsService.Organization.Delete(entity);
_pimsService.UserOrganization.Delete(entity);

// TODO: This isn't ideal as the db update may be successful but this request may not.
await entity.PimsUserOrganizations.ForEachAsync(async u =>
Expand Down
4 changes: 2 additions & 2 deletions backend/api/Areas/Admin/Controllers/RoleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Pims.Api.Areas.Admin.Controllers
public class RoleController : ControllerBase
{
#region Variables
private readonly IPimsService _pimsService;
private readonly IPimsRepository _pimsService;
private readonly IMapper _mapper;
#endregion

Expand All @@ -33,7 +33,7 @@ public class RoleController : ControllerBase
/// </summary>
/// <param name="pimsService"></param>
/// <param name="mapper"></param>
public RoleController(IPimsService pimsService, IMapper mapper)
public RoleController(IPimsRepository pimsService, IMapper mapper)
{
_pimsService = pimsService;
_mapper = mapper;
Expand Down
4 changes: 2 additions & 2 deletions backend/api/Areas/Admin/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Pims.Api.Areas.Admin.Controllers
public class UserController : ControllerBase
{
#region Variables
private readonly IPimsService _pimsService;
private readonly IPimsRepository _pimsService;
private readonly IMapper _mapper;
#endregion

Expand All @@ -34,7 +34,7 @@ public class UserController : ControllerBase
/// </summary>
/// <param name="pimsService"></param>
/// <param name="mapper"></param>
public UserController(IPimsService pimsService, IMapper mapper)
public UserController(IPimsRepository pimsService, IMapper mapper)
{
_pimsService = pimsService;
_mapper = mapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Pims.Api.Areas.Autocomplete.Controllers
public class AutocompleteController : ControllerBase
{
#region Variables
private readonly IPimsService _pimsService;
private readonly IPimsRepository _pimsService;
private readonly IMapper _mapper;
#endregion

Expand All @@ -37,7 +37,7 @@ public class AutocompleteController : ControllerBase
/// <param name="pimsService"></param>
/// <param name="mapper"></param>
///
public AutocompleteController(IPimsService pimsService, IMapper mapper)
public AutocompleteController(IPimsRepository pimsService, IMapper mapper)
{
_pimsService = pimsService;
_mapper = mapper;
Expand Down
Loading

0 comments on commit 36d9468

Please sign in to comment.