Skip to content
Merged

Dev #2253

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b7b12cf
feature/AB#32485-Filters
JamesPasta Apr 8, 2026
a36f952
Merge pull request #2241 from bcgov/feature/AB#30089-CHEFS-FormNameSynch
JamesPasta Apr 8, 2026
84557bd
feature/AB#32599-Cypress]-Improve-The-Lists-Spec: select Test intake …
Stephan-McColm Apr 9, 2026
3afcc48
AB#32602: Bugfix: Submission Links Not Working in Applicant Profile
aurelio-aot Apr 9, 2026
1d2ac21
Merge pull request #2244 from bcgov/feature/AB#32599-Cypress]-Improve…
DarylTodosichuk Apr 9, 2026
c01d48b
AB#32538: Handle Existing Duplicate Sites in the Database
aurelio-aot Apr 9, 2026
229620b
AB#32538: Bugfix: Dont Include Self-Reference When Getting Parent
aurelio-aot Apr 9, 2026
2179396
AB#32538: Bugfix: Dont Include Self-Reference When Getting Parent
aurelio-aot Apr 9, 2026
98ed4c5
Revert "AB#32538: Bugfix: Dont Include Self-Reference When Getting …
aurelio-aot Apr 9, 2026
74dfdc4
Adding the property of "ApplicantS3Folder" to the appsettings.json
DavidBrightBcGov Apr 9, 2026
fc2638d
AB#31068: Exclude Self-Reference When Getting Parent Link
aurelio-aot Apr 9, 2026
3905fdd
Merge pull request #2247 from bcgov/feature/AB#9075-applicant-profile…
DavidBrightBcGov Apr 9, 2026
aef8b9c
AB#32527: Enable Configure Worksheet By Default for Program Manager
aurelio-aot Apr 9, 2026
313ad1b
AB#32613 Authentication between GitHub and SonarCloud
DarylTodosichuk Apr 10, 2026
1558835
AB#32613 Set version for SonarCloud
DarylTodosichuk Apr 10, 2026
aa9e8e0
AB#32613 Fix version parameter for SonarCloud
DarylTodosichuk Apr 10, 2026
e4c2cc6
AB#32613 Bugfix sonar.token
DarylTodosichuk Apr 10, 2026
62dc4f0
AB#32613 Switch to SonarSource/sonarqube-scan-action@v7
DarylTodosichuk Apr 10, 2026
89acae5
AB#32613 Bugfix sonar.token
DarylTodosichuk Apr 10, 2026
796440d
AB#32613 Bugfix sonar.properties
DarylTodosichuk Apr 10, 2026
6b89515
AB#32613 Bugfix find the sonar-project.properties file
DarylTodosichuk Apr 10, 2026
75b0284
AB#32613 Debugging SONAR_TOKEN issues
DarylTodosichuk Apr 10, 2026
174afaa
AB#32613 Enable Run tests with coverage
DarylTodosichuk Apr 10, 2026
9b97bc6
AB#32613 Fix Node.js 20 actions are deprecated
DarylTodosichuk Apr 10, 2026
4df146d
AB#32613 fix repository variables, not environment variables for vars…
DarylTodosichuk Apr 10, 2026
9e0519a
AB#32613 set fallback version
DarylTodosichuk Apr 10, 2026
a59a4d7
AB#32613 Fix ${{ vars.UGM_BUILD_VERSION }}
DarylTodosichuk Apr 10, 2026
ace6945
AB#32613 github.ref_name as target branch (dev/test/main)
DarylTodosichuk Apr 10, 2026
90c6bac
Merge pull request #2249 from bcgov/feature/AB#32613-SonarQube-GitHub…
JamesPasta Apr 10, 2026
e3c57a1
Merge pull request #2248 from bcgov/bugfix/AB#32527-Enable-Configure-…
JamesPasta Apr 10, 2026
a09dec0
Merge pull request #2246 from bcgov/bugfix/AB#31068-Create-Payment-Re…
JamesPasta Apr 10, 2026
a14474b
Merge pull request #2245 from bcgov/bugfix/AB#32538-Handle-Duplicate-…
JamesPasta Apr 10, 2026
8ad0382
AB#32613 Disable CI runs for sonarcloud using automatic mode
DarylTodosichuk Apr 10, 2026
f27e686
Merge pull request #2250 from bcgov/feature/AB#32613-SonarQube-GitHub…
DarylTodosichuk Apr 10, 2026
3ce40b4
Merge pull request #2243 from bcgov/bugfix/AB#32602-Submission-Link-N…
JamesPasta Apr 10, 2026
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
92 changes: 92 additions & 0 deletions .github/workflows/sonarsource-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: SonarCloud Analysis

on:
push:
branches:
- dev2
# - dev
# - test
# - main
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

permissions:
contents: read
pull-requests: write
checks: write
security-events: write


jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
environment: ${{ github.ref_name == 'main' && 'main' || github.ref_name == 'test' && 'test' || 'dev' }}
steps:
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'zulu'

- uses: actions/checkout@v6
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'

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

- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v5
with:
path: ./.sonar/scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner

- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
run: |
dotnet tool install --global dotnet-sonarscanner

- name: Set version for SonarCloud
run: |
VERSION="${{ vars.UGM_BUILD_VERSION }}"
echo "Debug: UGM_BUILD_VERSION variable value: '$VERSION'"
if [ -z "$VERSION" ]; then
echo "BUILD_VERSION=1.0.0-dev" >> $GITHUB_ENV
echo "Using fallback version: 1.0.0-dev (UGM_BUILD_VERSION variable not set)"
else
echo "BUILD_VERSION=$VERSION" >> $GITHUB_ENV
echo "Using project version: $VERSION"
fi

- name: Restore dependencies
working-directory: ./applications/Unity.GrantManager
run: dotnet restore Unity.GrantManager.sln

- name: Build solution
working-directory: ./applications/Unity.GrantManager
run: dotnet build Unity.GrantManager.sln --no-restore

- name: Run tests with coverage
working-directory: ./applications/Unity.GrantManager
run: dotnet test Unity.GrantManager.sln --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults/

- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v7
with:
projectBaseDir: applications/Unity.GrantManager
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6 changes: 4 additions & 2 deletions applications/Unity.AutoUI/cypress/e2e/lists.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ describe('Grant Manager Login and List Navigation', () => {
cy.get(listboxSel).within(() => {
cy.get('a.dropdown-item[role="option"]').then(($opts) => {
const match = $opts.filter((_, el) => {
const text = el.querySelector('span.text')?.textContent || ''
const textNode = el.querySelector('span.text')
const text = textNode ? textNode.textContent || '' : ''
return text.trim() === 'Test'
})

Expand All @@ -95,7 +96,8 @@ describe('Grant Manager Login and List Navigation', () => {
})
})

cy.get('body').click(0, 0)
cy.get(btnSel).first().click({ force: true })
cy.get(btnSel).first().should('have.attr', 'aria-expanded', 'false')
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ public async Task HandleEventAsync(UpsertSupplierEto eventData)
{
SupplierDto supplierDto = await GetSupplierFromEvent(eventData);
var existingSites = await siteAppService.GetSitesBySupplierIdAsync(supplierDto.Id);
var existingSitesDictionary = existingSites?.ToDictionary(s => s.Number) ?? new Dictionary<string, Site>();
var existingSitesDictionary = existingSites?
.GroupBy(s => s.Number)
.ToDictionary(g => g.Key, g => g.First())
?? new Dictionary<string, Site>();

var defaultPaymentGroup = await ResolveDefaultPaymentGroupAsync(eventData);
await UpsertSitesFromEventDtoAsync(existingSitesDictionary, supplierDto.Id, eventData, defaultPaymentGroup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ private async Task<decimal> GetRemainingAmountAllowedByApplicationAsync(GrantApp

// Get parent links for this application
var allLinks = await applicationLinksService.GetListByApplicationAsync(application.Id);
var parentLink = allLinks.Find(link => link.LinkType == ApplicationLinkType.Parent);
var parentLink = allLinks.Find(link => link.LinkType == ApplicationLinkType.Parent && link.ApplicationId != application.Id);

// Rule 2: No parent link exists
if (parentLink == null)
Expand Down Expand Up @@ -485,7 +485,7 @@ private async Task PopulateParentChildValidationData()
// Parent not in submission, get from first child's link
var firstChild = await applicationService.GetAsync(children[0].CorrelationId);
var allLinks = await applicationLinksService.GetListByApplicationAsync(firstChild.Id);
var parentLink = allLinks.Find(link => link.LinkType == ApplicationLinkType.Parent);
var parentLink = allLinks.Find(link => link.LinkType == ApplicationLinkType.Parent && link.ApplicationId != firstChild.Id);

if (parentLink == null)
{
Expand Down Expand Up @@ -569,7 +569,7 @@ private async Task<List<string>> ValidateParentChildPaymentAmounts()
// Parent not in submission, get from first child's link
var firstChild = await applicationService.GetAsync(children[0].CorrelationId);
var allLinks = await applicationLinksService.GetListByApplicationAsync(firstChild.Id);
var parentLink = allLinks.Find(link => link.LinkType == ApplicationLinkType.Parent);
var parentLink = allLinks.Find(link => link.LinkType == ApplicationLinkType.Parent && link.ApplicationId != firstChild.Id);

if (parentLink == null)
{
Expand Down
34 changes: 34 additions & 0 deletions applications/Unity.GrantManager/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SonarCloud configuration for Unity Grant Manager
sonar.projectKey=bcgov_Unity
sonar.organization=bcgov-sonarcloud
sonar.host.url=https://sonarcloud.io

# Project metadata
sonar.projectName=Unity
sonar.projectDescription=Grant management application for the Province of British Columbia

# Source code settings
sonar.sources=src,modules
sonar.tests=test

# Quality gate settings (from Azure SonarQube)
sonar.qualitygate.wait=true

# SonarQube Exclusions (from existing Azure configuration)
sonar.exclusions=src/Unity.GrantManager.EntityFrameworkCore/Migrations/**,modules/Unity.Payments/src/Unity.Payments.Web/Pages/BatchPayments/Index.js,**/bin/**,**/obj/**,**/wwwroot/lib/**,**/*.Designer.cs,**/node_modules/**

# Test exclusions
sonar.test.exclusions=**/bin/**,**/obj/**

# Code coverage exclusions (from existing Azure configuration)
sonar.coverage.exclusions=modules/Volo.BasicTheme/**,**/Migrations/**,**/*DbContext.cs,**/*EntityTypeConfiguration.cs,**/Program.cs,**/Startup.cs,**/*.Designer.cs,**/DbMigrator/**

# Code duplication exclusions (from existing Azure configuration)
sonar.cpd.exclusions=**/*.aspx,**/*.aspx.designer.cs,**/*.cshtml,**/*.html,**/*.js

# Coverage report paths (adapted for GitHub Actions)
sonar.cs.vscoveragexml.reportsPaths=**/TestResults/**/*.coveragexml,**/coverage.coveragexml
sonar.cs.vstest.reportsPaths=**/TestResults/**/*.trx

# SCM settings
sonar.scm.provider=git
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ await _permissionDataSeeder.SeedAsync(RolePermissionValueProvider.ProviderName,
.. Dashboard_CommonPermissions,
.. Tags_CommonPermissions,
AIPermissions.Configuration.ConfigureAI,
FlexPermissions.Worksheets.Default,
FlexPermissions.Worksheets.Delete
], context.TenantId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const debouncedResizeAwareDataTables = debounce(() => {
$('table[data-resize-aware="true"]:visible').each(function () {
try {
const table = $(this).DataTable();
table.columns.adjust().draw(false);
table.columns.adjust();
}
catch (error) {
console.error('Failed to adjust DataTable columns:', error);
Expand All @@ -104,7 +104,7 @@ function adjustVisibleTablesInContainer(containerId) {
tables.each(function () {
try {
const table = $(this).DataTable();
table.columns.adjust().draw(false);
table.columns.adjust();
}
catch (error) {
console.error('Failed to adjust DataTable in tab:', error);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="px-3 d-flex flex-row justify-content-end align-items-end mb-3">
<div class="px-3 d-flex flex-row justify-content-end align-items-end mb-3" style="margin-top: -50px">
<button type="button" class="btn unt-btn-outline-primary btn-outline-primary me-2" id="btn-toggle-filter-assessment-attachments" title="Filter">
<span>Filter</span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"Bucket": "",
"Endpoint": "",
"SecretAccessKey": "",
"ApplicantS3Folder": "Unity/Applicant",
"ApplicationS3Folder": "Unity/Application",
"AssessmentS3Folder": "Unity/Adjudication",
"DisallowedFileTypes": "[ \"exe\",\"sh\",\"ksh\",\"bat\",\"cmd\" ]",
Expand Down
Loading
Loading