Skip to content

Commit

Permalink
Merge pull request #674 from bcgov/yj
Browse files Browse the repository at this point in the history
Yj
  • Loading branch information
ychung-mot authored Sep 23, 2024
2 parents d3ac3d4 + 43c321a commit b7afcec
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 114 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,43 +135,6 @@ jobs:
docker login artifacts.developer.gov.bc.ca -u ${{ secrets.JFROG_USERNAME }} -p ${{ secrets.JFROG_PASSWORD }}
docker push artifacts.developer.gov.bc.ca/sf4a-strdss/strdss-frontend:dev
deploy-silver:
needs: [test-frontend, test-backend, docker-build-frontend, docker-build-backend, docker-build-hangfire]
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
contents: read
environment:
name: dev
url: https://dev-strdata.apps.silver.devops.gov.bc.ca/

steps:
- uses: actions/checkout@v4

- name: Authenticate and set context
uses: redhat-actions/oc-login@v1.3
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
namespace: f4a30d-dev
insecure_skip_tls_verify: true

- name: Deploy apps with Helm chart
run: |
make upgrade \
NAMESPACE=f4a30d-dev \
NAME=strdss-dev \
ENV_NAME=dev \
IMAGE_TAG_FRONTEND=dev \
IMAGE_TAG_BACKEND=dev \
IMAGE_TAG_HANGFIRE=dev \
working-directory: ./helm/main

- name: Wait for deployment to be ready
run: |
oc rollout status deployment/strdss-dev-frontend -n f4a30d-dev
timeout-minutes: 5

deploy-emerald:
needs: [test-frontend, test-backend, docker-build-frontend, docker-build-backend, docker-build-hangfire]
runs-on: ubuntu-22.04
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,42 +87,6 @@ jobs:
docker login artifacts.developer.gov.bc.ca -u ${{ secrets.JFROG_USERNAME }} -p ${{ secrets.JFROG_PASSWORD }}
docker push artifacts.developer.gov.bc.ca/sf4a-strdss/strdss-frontend:${vtag//v}
deploy-silver:
needs: [docker-build-frontend, docker-build-backend, docker-build-hangfire]
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
contents: read
environment:
name: test
url: https://test-strdata.apps.silver.devops.gov.bc.ca/

steps:
- uses: hmarr/debug-action@a701ed95a46e6f2fb0df25e1a558c16356fae35a
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5
with:
ref: main # one source of truth for CI/CD pipeline

- name: Authenticate and set context
uses: redhat-actions/oc-login@9b79eb6d8ec51bce42cb4e77f0a174fc80cf3cb9
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
namespace: f4a30d-dev # dev and test live in the same 'DEV' namespace
insecure_skip_tls_verify: true

- name: Deploy apps with Helm chart
run: |
vtag=${{ github.ref_name }}
make upgrade \
NAMESPACE=f4a30d-dev \
NAME=strdss-test \
ENV_NAME=test \
IMAGE_TAG_FRONTEND=${vtag//v} \
IMAGE_TAG_BACKEND=${vtag//v} \
IMAGE_TAG_HANGFIRE=${vtag//v} \
working-directory: ./helm/main

deploy-emerald:
needs: [docker-build-frontend, docker-build-backend, docker-build-hangfire]
runs-on: ubuntu-22.04
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/deploy-uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,6 @@ name: Deploy UAT Environment
on: workflow_dispatch

jobs:
deploy-silver:
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
contents: read
environment:
name: uat
url: https://uat-strdata.apps.silver.devops.gov.bc.ca/

steps:
- uses: hmarr/debug-action@a701ed95a46e6f2fb0df25e1a558c16356fae35a
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5
with:
ref: main # one source of truth for CI/CD pipeline

- name: Fail on branches
run: exit 1
if: ${{ !startsWith(github.ref, 'refs/tags/') }}

- name: Authenticate and set context
uses: redhat-actions/oc-login@9b79eb6d8ec51bce42cb4e77f0a174fc80cf3cb9
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
namespace: f4a30d-test
insecure_skip_tls_verify: true

- name: Deploy apps with Helm chart
run: |
vtag=${{ github.ref_name }}
make upgrade \
NAMESPACE=f4a30d-test \
NAME=strdss-uat \
ENV_NAME=uat \
IMAGE_TAG_FRONTEND=${vtag//v} \
IMAGE_TAG_BACKEND=${vtag//v} \
IMAGE_TAG_HANGFIRE=${vtag//v} \
working-directory: ./helm/main

deploy-emerald:
runs-on: ubuntu-22.04
Expand Down
6 changes: 6 additions & 0 deletions server/StrDss.Data/Repositories/RentalListingRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public async Task<PagedDto<RentalListingGroupDto>> GetGroupedRentalListings(stri
public async Task<int> GetGroupedRentalListingsCount(string? all, string? address, string? url, string? listingId, string? hostName, string? businessLicence,
bool? prRequirement, bool? blRequirement, long? lgId, string[] statusArray, bool? reassigned, bool? takedownComplete)
{
var stopwatch = Stopwatch.StartNew();

var query = _dbSet.AsNoTracking();

if (_currentUser.OrganizationType == OrganizationTypes.LG)
Expand All @@ -151,6 +153,10 @@ public async Task<int> GetGroupedRentalListingsCount(string? all, string? addres
})
.CountAsync();

stopwatch.Stop();

_logger.LogDebug($"Get Grouped Listings Count - Total Time: {stopwatch.Elapsed.TotalSeconds} seconds");

return count;
}

Expand Down
6 changes: 3 additions & 3 deletions server/StrDss.Data/Repositories/RepositoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ public async Task<PagedDto<TOutput>> Page<TInput, TOutput>(IQueryable<TInput> li

stopwatch.Stop();

_logger.LogDebug($"Get Grouped Listings (group) - Counting groups. Page Size: {pageSize}, Page Number: {pageNumber}, Time: {stopwatch.Elapsed.TotalSeconds} seconds");
_logger.LogDebug($"Get Data - Counting Data. Page Size: {pageSize}, Page Number: {pageNumber}, Time: {stopwatch.Elapsed.TotalSeconds} seconds");

stopwatch.Restart();

var result = await pagedList.ToListAsync();

stopwatch.Stop();

_logger.LogDebug($"Get Grouped Listings (group) - Getting groups. Time: {stopwatch.Elapsed.TotalSeconds} seconds");
_logger.LogDebug($"Get Data Getting Data. Time: {stopwatch.Elapsed.TotalSeconds} seconds");

stopwatch.Restart();

Expand All @@ -104,7 +104,7 @@ public async Task<PagedDto<TOutput>> Page<TInput, TOutput>(IQueryable<TInput> li

stopwatch.Stop();

_logger.LogDebug($"Get Grouped Listings (group) - Mapping groups to DTO. Time: {stopwatch.Elapsed.TotalSeconds} seconds");
_logger.LogDebug($"Get Data - Mapping Data to DTO. Time: {stopwatch.Elapsed.TotalSeconds} seconds");

return pagedDTO;
}
Expand Down

0 comments on commit b7afcec

Please sign in to comment.