diff --git a/.github/workflows/release-process.yaml b/.github/workflows/release-process.yaml index 121d3989d8..2efa095eb8 100644 --- a/.github/workflows/release-process.yaml +++ b/.github/workflows/release-process.yaml @@ -105,6 +105,13 @@ jobs: yarn git checkout "${GITHUB_HEAD_REF}" yarn run release-it --ci --branch="${GITHUB_HEAD_REF}" --git.commitArgs=-n + - name: Enable Auto-Merge + if: steps.checkbox.outputs.result == 'true' && steps.up_to_date.outputs.result == 'true' && steps.pr_approval.outputs.result == 'true' && !github.event.pull_request.draft + run: | + PR_URL="${{ github.event.pull_request.html_url }}" + gh pr merge --auto --merge "$PR_URL" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Uncheck the checkbox if: steps.checkbox.outputs.result == 'true' && steps.up_to_date.outputs.result == 'true' && steps.pr_approval.outputs.result == 'true' && !github.event.pull_request.draft uses: actions/github-script@v7 diff --git a/CHANGELOG.md b/CHANGELOG.md index bf10c6cdfc..2358d12624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## [1.193.2](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.1...v1.193.2) (2024-09-26) + ## [1.193.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.0...v1.193.1) (2024-09-18) ### Bug Fixes diff --git a/app/backend/lib/sow_import/tab_7.ts b/app/backend/lib/sow_import/tab_7.ts index c47905f8dd..fbfd2f92b4 100644 --- a/app/backend/lib/sow_import/tab_7.ts +++ b/app/backend/lib/sow_import/tab_7.ts @@ -27,6 +27,7 @@ const readBudget = async (sow_id, wb, sheet_name) => { fundingFromAllOtherSources: '', amountRequestedFromProvince: '', totalInfrastructureBankFunding: '', + totalFNHAFunding: '', totalFundingRequestedCCBC: '', }, detailedBudget: { @@ -126,6 +127,13 @@ const readBudget = async (sow_id, wb, sheet_name) => { 2627: '', total: '', }, + fnhaFunding: { + 2324: '', + 2425: '', + 2526: '', + 2627: '', + total: '', + }, otherFundingPartners: [], totalFinancialContribution: { 2324: '', @@ -472,6 +480,7 @@ const readBudget = async (sow_id, wb, sheet_name) => { budget[row]['K']; row++; // next 7 are possible other + let fnhaFundingRow = {}; for (let otherRow = row; otherRow < row + 7; otherRow++) { const otherSuspect = budget[otherRow]['B']; let otherValue; @@ -483,8 +492,14 @@ const readBudget = async (sow_id, wb, sheet_name) => { } // if we don't have the predefined phrase, we have a custom other if ( - otherValue.indexOf('Identify other source of funding by name') === -1 + otherValue.indexOf('Identify other source of funding by name') > -1 + ) { + continue; + } else if ( + otherValue.indexOf('First Nations Health Authority (FNHA)') > -1 ) { + fnhaFundingRow = budget[otherRow]; + } else { detailedBudget.summaryOfEstimatedProjectFunding.otherFundingPartners.push( { fundingPartnersName: budget[otherRow]['B'], @@ -497,6 +512,19 @@ const readBudget = async (sow_id, wb, sheet_name) => { ); } } + + // FNHA Funding + detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2324] = + fnhaFundingRow['G'] ?? 0; + detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2425] = + fnhaFundingRow['H'] ?? 0; + detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2526] = + fnhaFundingRow['I'] ?? 0; + detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2627] = + fnhaFundingRow['J'] ?? 0; + detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding.total = + fnhaFundingRow['K'] ?? 0; + detailedBudget.summaryTable.totalFNHAFunding = fnhaFundingRow['K'] ?? 0; } // get totals if (value.indexOf('Total Financial Contributions') > -1) { @@ -632,6 +660,12 @@ const ValidateData = (data) => { error: 'Invalid data: Amount CIB will contribute', }); } + if (typeof data.totalFNHAFunding !== 'number') { + errors.push({ + level: 'cell', + error: 'Invalid data: First Nations Health Authority (FNHA)', + }); + } if (typeof data.fundingFromAllOtherSources !== 'number') { errors.push({ level: 'cell', diff --git a/app/lib/helpers/ccbcSummaryGenerateFormData.tsx b/app/lib/helpers/ccbcSummaryGenerateFormData.tsx index d966b717a8..d3e2656c76 100644 --- a/app/lib/helpers/ccbcSummaryGenerateFormData.tsx +++ b/app/lib/helpers/ccbcSummaryGenerateFormData.tsx @@ -173,7 +173,9 @@ const getSowData = (sowData, baseSowData) => { cibFunding: sowData?.nodes[0]?.sowTab7SBySowId?.nodes[0]?.jsonData?.summaryTable ?.totalInfrastructureBankFunding, - fhnaFunding: null, + fhnaFunding: + sowData?.nodes[0]?.sowTab7SBySowId?.nodes[0]?.jsonData?.summaryTable + ?.totalFNHAFunding, otherFunding: sowData?.nodes[0]?.sowTab7SBySowId?.nodes[0]?.jsonData?.summaryTable ?.fundingFromAllOtherSources, @@ -203,6 +205,7 @@ const getSowData = (sowData, baseSowData) => { fundingRequestedCcbc: 'SOW', applicantAmount: 'SOW', cibFunding: 'SOW', + fhnaFunding: 'SOW', otherFunding: 'SOW', totalProjectBudget: 'SOW', effectiveStartDate: 'SOW', diff --git a/app/package.json b/app/package.json index fb1bbb30a8..a877682a46 100644 --- a/app/package.json +++ b/app/package.json @@ -63,7 +63,7 @@ "archiver": "^7.0.1", "body-parser": "1.20.3", "cheerio": "^1.0.0-rc.12", - "connect-pg-simple": "^7.0.0", + "connect-pg-simple": "^10.0.0", "convict": "^6.2.4", "cookie-parser": "^1.4.6", "dayjs": "^1.11.11", @@ -88,7 +88,7 @@ "luxon": "^3.4.3", "material-react-table": "2.13", "morgan": "^1.10.0", - "next": "^14.1.1", + "next": "^14.2.10", "openid-client": "^5.6.5", "passport": "^0.7.0", "patch-package": "^8.0.0", diff --git a/app/tests/backend/lib/sow_tab_7.test.ts b/app/tests/backend/lib/sow_tab_7.test.ts index b3f7e9bd60..4342e5c0f2 100644 --- a/app/tests/backend/lib/sow_tab_7.test.ts +++ b/app/tests/backend/lib/sow_tab_7.test.ts @@ -9,7 +9,7 @@ import LoadTab7Data from '../../../backend/lib/sow_import/tab_7'; jest.mock('../../../backend/lib/graphql'); -const tab7 = [ +const getTab7 = (includesFNHA = false) => [ { B: 'Universal Broadband Fund' }, { B: 'Step 7. Detailed Budget' }, { @@ -1624,14 +1624,23 @@ const tab7 = [ K: 0, }, { B: 'Other Funding Source', G: 1, H: 2, I: 3, J: 4, K: 10 }, - { - B: 'Identify other source of funding by name', - G: 0, - H: 0, - I: 0, - J: 0, - K: 0, - }, + includesFNHA + ? { + B: 'First Nations Health Authority (FNHA)', + G: 10000, + H: 25000, + I: 35000, + J: 10000, + K: 80000, + } + : { + B: 'Identify other source of funding by name', + G: 0, + H: 0, + I: 0, + J: 0, + K: 0, + }, { B: 'Identify other source of funding by name', G: 0, @@ -1735,6 +1744,9 @@ const tab7 = [ }, ]; +const tab7 = getTab7(); +const tab7WithFNHA = getTab7(true); + describe('sow tab 7 tests', () => { beforeEach(() => { mocked(performQuery).mockImplementation(async () => { @@ -1762,6 +1774,7 @@ describe('sow tab 7 tests', () => { amountRequestedFromProvince: 225000, totalInfrastructureBankFunding: 0, totalFundingRequestedCCBC: 450000, + totalFNHAFunding: 0, }, detailedBudget: { federalSharingRatio: 0.45, @@ -1838,6 +1851,13 @@ describe('sow tab 7 tests', () => { '2627': 25000, total: 225000, }, + fnhaFunding: { + '2324': 0, + '2425': 0, + '2526': 0, + '2627': 0, + total: 0, + }, infrastructureBankFunding: { '2324': 0, '2425': 0, @@ -1915,7 +1935,7 @@ describe('sow tab 7 tests', () => { }); it('should parse the worksheet and return expected errors', async () => { - const broken = { ...tab7 }; + const broken = structuredClone(tab7WithFNHA); broken[23]['H'] = 'garbage'; // Total Eligible Costs broken[24]['H'] = 'garbage'; // Total Ineligible Costs broken[25]['H'] = 'garbage'; // Total Project Cost @@ -1923,6 +1943,7 @@ describe('sow tab 7 tests', () => { broken[27]['J'] = 'garbage'; // Amount requested from the Province broken[28]['H'] = 'garbage'; // Amount Applicant will contribute broken[28]['J'] = 'garbage'; // Amount CIB will contribute + broken[1088]['K'] = 'garbage'; // Total FNHA Contributions broken[29]['H'] = 'garbage'; // Funding from all other sources broken[29]['J'] = 'garbage'; // Total requested from the CCBC Program @@ -1944,6 +1965,10 @@ describe('sow tab 7 tests', () => { error: 'Invalid data: Amount Applicant will contribute', }, { level: 'cell', error: 'Invalid data: Amount CIB will contribute' }, + { + level: 'cell', + error: 'Invalid data: First Nations Health Authority (FNHA)', + }, { level: 'cell', error: 'Invalid data: Funding from all other sources', @@ -1961,6 +1986,182 @@ describe('sow tab 7 tests', () => { expect(data).toEqual(expectedError); }); + it('should parse the worksheet and return fnha funding figures', async () => { + const expectedInput = { + input: { + sowId: 1, + jsonData: { + summaryTable: { + targetingVeryRemoteOrIndigenousOrSatelliteDependentCommunity: false, + totalEligibleCosts: 500000, + totalIneligibleCosts: 250000, + totalProjectCost: 750000, + amountRequestedFromFederalGovernment: 225000, + totalApplicantContribution: 300000, + fundingFromAllOtherSources: 225000, + amountRequestedFromProvince: 225000, + totalInfrastructureBankFunding: 0, + totalFundingRequestedCCBC: 450000, + totalFNHAFunding: 80000, + }, + detailedBudget: { + federalSharingRatio: 0.45, + provincialSharingRatio: 0.45, + }, + summaryOfEstimatedProjectCosts: { + estimatedProjectCosts: { + eligibleRuralBroadband: 500000, + eligibleVeryRemoteSatelliteIndigenousBroadband: 0, + eligibleMobile: 0, + totalEligibleCosts: 500000, + totalIneligibleCosts: 250000, + totalProjectCost: '', + }, + totalCostsPerCostCategory: { + directLabour: { cost: 80000, percentOfTotalEligibleCosts: 0.16 }, + directEquipment: { + cost: 140000, + percentOfTotalEligibleCosts: 0.28, + }, + directMaterials: { + cost: 180000, + percentOfTotalEligibleCosts: 0.36, + }, + directSatellite: { cost: 0, percentOfTotalEligibleCosts: 0 }, + directTravel: { cost: 0, percentOfTotalEligibleCosts: 0 }, + directOther: { cost: 100000, percentOfTotalEligibleCosts: 0.2 }, + totalEligible: { cost: 500000, percentOfTotalEligibleCosts: 1 }, + }, + thirtyPercentOfTotalEligibleCosts: 150000, + projectCosts: { + totalEligibleCosts: { + '2324': 100000, + '2425': 150000, + '2526': 150000, + '2627': 100000, + total: 500000, + }, + totalIneligibleCosts: { + '2324': 50000, + '2425': 100000, + '2526': 100000, + '2627': 0, + total: 250000, + }, + totalProjectCost: { + '2324': 100000, + '2425': 0.2, + '2526': undefined, + '2627': undefined, + total: undefined, + }, + }, + }, + summaryOfEstimatedProjectFunding: { + federalContribution: { + '2324': 0, + '2425': 75000, + '2526': 75000, + '2627': 75000, + total: 225000, + }, + applicationContribution: { + '2324': 125000, + '2425': 100000, + '2526': 75000, + '2627': 0, + total: 300000, + }, + provincialContribution: { + '2324': 25000, + '2425': 75000, + '2526': 100000, + '2627': 25000, + total: 225000, + }, + fnhaFunding: { + '2324': 10000, + '2425': 25000, + '2526': 35000, + '2627': 10000, + total: 80000, + }, + infrastructureBankFunding: { + '2324': 0, + '2425': 0, + '2526': 0, + '2627': 0, + total: 0, + }, + otherFundingPartners: [ + { + '2324': 1, + '2425': 2, + '2526': 3, + '2627': 4, + fundingPartnersName: 'Other Funding Source', + total: 10, + }, + ], + totalFinancialContribution: { + '2324': 150001, + '2425': 250002, + '2526': 250003, + '2627': 100004, + total: 750010, + }, + }, + currentFiscalProvincialContributionForecastByQuarter: { + aprilToJune: { + '2324': 0, + '2425': 18750, + '2526': 25000, + '2627': 8333.333333333334, + total: 52083.333333333336, + }, + julyToSeptember: { + '2324': 8333.333333333334, + '2425': 18750, + '2526': 25000, + '2627': 8333.333333333334, + total: 60416.66666666667, + }, + octoberToDecember: { + '2324': 8333.333333333334, + '2425': 18750, + '2526': 25000, + '2627': 8333.333333333334, + total: 60416.66666666667, + }, + januaryToMarch: { + '2324': 8333.333333333334, + '2425': 18750, + '2526': 25000, + '2627': undefined, + total: 52083.333333333336, + }, + fiscalYearTotal: { + '2324': 25000, + '2425': 75000, + '2526': 100000, + '2627': 25000, + total: 225000, + }, + }, + }, + }, + }; + jest.spyOn(XLSX.utils, 'sheet_to_json').mockReturnValue(tab7WithFNHA); + const wb = XLSX.read(null); + + await LoadTab7Data(1, wb, '7', request); + expect(performQuery).toHaveBeenCalledWith( + expect.anything(), + expectedInput, + expect.anything() + ); + }); + afterEach(() => { jest.clearAllMocks(); }); diff --git a/app/yarn.lock b/app/yarn.lock index 590ed8092c..bb2cbb9eca 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -3354,10 +3354,10 @@ prop-types "^15.8.1" react-transition-group "^4.4.5" -"@next/env@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/env/-/env-14.1.1.tgz#80150a8440eb0022a73ba353c6088d419b908bac" - integrity sha512-7CnQyD5G8shHxQIIg3c7/pSeYFeMhsNbpU/bmvH7ZnDql7mNRgg8O2JZrhrc/soFnfBnKP4/xXNiiSIPn2w8gA== +"@next/env@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.10.tgz#1d3178340028ced2d679f84140877db4f420333c" + integrity sha512-dZIu93Bf5LUtluBXIv4woQw2cZVZ2DJTjax5/5DOs3lzEOeKLy7GxRSr4caK9/SCPdaW6bCgpye6+n4Dh9oJPw== "@next/eslint-plugin-next@13.4.4": version "13.4.4" @@ -3366,50 +3366,50 @@ dependencies: glob "7.1.7" -"@next/swc-darwin-arm64@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.1.tgz#b74ba7c14af7d05fa2848bdeb8ee87716c939b64" - integrity sha512-yDjSFKQKTIjyT7cFv+DqQfW5jsD+tVxXTckSe1KIouKk75t1qZmj/mV3wzdmFb0XHVGtyRjDMulfVG8uCKemOQ== - -"@next/swc-darwin-x64@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.1.tgz#82c3e67775e40094c66e76845d1a36cc29c9e78b" - integrity sha512-KCQmBL0CmFmN8D64FHIZVD9I4ugQsDBBEJKiblXGgwn7wBCSe8N4Dx47sdzl4JAg39IkSN5NNrr8AniXLMb3aw== - -"@next/swc-linux-arm64-gnu@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.1.tgz#4f4134457b90adc5c3d167d07dfb713c632c0caa" - integrity sha512-YDQfbWyW0JMKhJf/T4eyFr4b3tceTorQ5w2n7I0mNVTFOvu6CGEzfwT3RSAQGTi/FFMTFcuspPec/7dFHuP7Eg== - -"@next/swc-linux-arm64-musl@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.1.tgz#594bedafaeba4a56db23a48ffed2cef7cd09c31a" - integrity sha512-fiuN/OG6sNGRN/bRFxRvV5LyzLB8gaL8cbDH5o3mEiVwfcMzyE5T//ilMmaTrnA8HLMS6hoz4cHOu6Qcp9vxgQ== - -"@next/swc-linux-x64-gnu@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.1.tgz#cb4e75f1ff2b9bcadf2a50684605928ddfc58528" - integrity sha512-rv6AAdEXoezjbdfp3ouMuVqeLjE1Bin0AuE6qxE6V9g3Giz5/R3xpocHoAi7CufRR+lnkuUjRBn05SYJ83oKNQ== - -"@next/swc-linux-x64-musl@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.1.tgz#15f26800df941b94d06327f674819ab64b272e25" - integrity sha512-YAZLGsaNeChSrpz/G7MxO3TIBLaMN8QWMr3X8bt6rCvKovwU7GqQlDu99WdvF33kI8ZahvcdbFsy4jAFzFX7og== - -"@next/swc-win32-arm64-msvc@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.1.tgz#060c134fa7fa843666e3e8574972b2b723773dd9" - integrity sha512-1L4mUYPBMvVDMZg1inUYyPvFSduot0g73hgfD9CODgbr4xiTYe0VOMTZzaRqYJYBA9mana0x4eaAaypmWo1r5A== - -"@next/swc-win32-ia32-msvc@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.1.tgz#5c06889352b1f77e3807834a0d0afd7e2d2d1da2" - integrity sha512-jvIE9tsuj9vpbbXlR5YxrghRfMuG0Qm/nZ/1KDHc+y6FpnZ/apsgh+G6t15vefU0zp3WSpTMIdXRUsNl/7RSuw== - -"@next/swc-win32-x64-msvc@14.1.1": - version "14.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.1.tgz#d38c63a8f9b7f36c1470872797d3735b4a9c5c52" - integrity sha512-S6K6EHDU5+1KrBDLko7/c1MNy/Ya73pIAmvKeFwsF4RmBFJSO7/7YeD4FnZ4iBdzE69PpQ4sOMU9ORKeNuxe8A== +"@next/swc-darwin-arm64@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.10.tgz#49d10ca4086fbd59ee68e204f75d7136eda2aa80" + integrity sha512-V3z10NV+cvMAfxQUMhKgfQnPbjw+Ew3cnr64b0lr8MDiBJs3eLnM6RpGC46nhfMZsiXgQngCJKWGTC/yDcgrDQ== + +"@next/swc-darwin-x64@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.10.tgz#0ebeae3afb8eac433882b79543295ab83624a1a8" + integrity sha512-Y0TC+FXbFUQ2MQgimJ/7Ina2mXIKhE7F+GUe1SgnzRmwFY3hX2z8nyVCxE82I2RicspdkZnSWMn4oTjIKz4uzA== + +"@next/swc-linux-arm64-gnu@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.10.tgz#7e602916d2fb55a3c532f74bed926a0137c16f20" + integrity sha512-ZfQ7yOy5zyskSj9rFpa0Yd7gkrBnJTkYVSya95hX3zeBG9E55Z6OTNPn1j2BTFWvOVVj65C3T+qsjOyVI9DQpA== + +"@next/swc-linux-arm64-musl@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.10.tgz#6b143f628ccee490b527562e934f8de578d4be47" + integrity sha512-n2i5o3y2jpBfXFRxDREr342BGIQCJbdAUi/K4q6Env3aSx8erM9VuKXHw5KNROK9ejFSPf0LhoSkU/ZiNdacpQ== + +"@next/swc-linux-x64-gnu@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.10.tgz#086f2f16a0678890a1eb46518c4dda381b046082" + integrity sha512-GXvajAWh2woTT0GKEDlkVhFNxhJS/XdDmrVHrPOA83pLzlGPQnixqxD8u3bBB9oATBKB//5e4vpACnx5Vaxdqg== + +"@next/swc-linux-x64-musl@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.10.tgz#1befef10ed8dbcc5047b5d637a25ae3c30a0bfc3" + integrity sha512-opFFN5B0SnO+HTz4Wq4HaylXGFV+iHrVxd3YvREUX9K+xfc4ePbRrxqOuPOFjtSuiVouwe6uLeDtabjEIbkmDA== + +"@next/swc-win32-arm64-msvc@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.10.tgz#731f52c3ae3c56a26cf21d474b11ae1529531209" + integrity sha512-9NUzZuR8WiXTvv+EiU/MXdcQ1XUvFixbLIMNQiVHuzs7ZIFrJDLJDaOF1KaqttoTujpcxljM/RNAOmw1GhPPQQ== + +"@next/swc-win32-ia32-msvc@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.10.tgz#32723ef7f04e25be12af357cc72ddfdd42fd1041" + integrity sha512-fr3aEbSd1GeW3YUMBkWAu4hcdjZ6g4NBl1uku4gAn661tcxd1bHs1THWYzdsbTRLcCKLjrDZlNp6j2HTfrw+Bg== + +"@next/swc-win32-x64-msvc@14.2.10": + version "14.2.10" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.10.tgz#ee1d036cb5ec871816f96baee7991035bb242455" + integrity sha512-UjeVoRGKNL2zfbcQ6fscmgjBAS/inHBh63mjIlfPg/NG8Yn2ztqylXt5qilYb6hoHIwaU2ogHknHWWmahJjgZQ== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -4538,11 +4538,17 @@ resolve-from "^5.0.0" ts-dedent "^2.0.0" -"@swc/helpers@0.5.2": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.2.tgz#85ea0c76450b61ad7d10a37050289eded783c27d" - integrity sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw== +"@swc/counter@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9" + integrity sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ== + +"@swc/helpers@0.5.5": + version "0.5.5" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.5.tgz#12689df71bfc9b21c4f4ca00ae55f2f16c8b77c0" + integrity sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A== dependencies: + "@swc/counter" "^0.1.3" tslib "^2.4.0" "@szmarczak/http-timer@^4.0.5": @@ -5061,7 +5067,7 @@ resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== -"@types/pg@*", "@types/pg@>=6 <9", "@types/pg@^8.6.1": +"@types/pg@*", "@types/pg@>=6 <9": version "8.6.5" resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.6.5.tgz#2dce9cb468a6a5e0f1296a59aea3ac75dd27b702" integrity sha512-tOkGtAqRVkHa/PVZicq67zuujI4Oorfglsr2IbKofDwBSysnaqSx7W1mDqFqdkGE6Fbgh+PZAl0r/BWON/mozw== @@ -6397,12 +6403,7 @@ camelize@^1.0.0: resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b" integrity sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs= -caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001579: - version "1.0.30001620" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz#78bb6f35b8fe315b96b8590597094145d0b146b4" - integrity sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew== - -caniuse-lite@^1.0.30001646: +caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001579, caniuse-lite@^1.0.30001646: version "1.0.30001651" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz#52de59529e8b02b1aedcaaf5c05d9e23c0c28138" integrity sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg== @@ -6741,13 +6742,12 @@ confusing-browser-globals@^1.0.10: resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== -connect-pg-simple@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/connect-pg-simple/-/connect-pg-simple-7.0.0.tgz#95bfaf9722b35dafea2dd592c5b556125d1139ba" - integrity sha512-fbNZUkxz8m+FRbctoxAU18DzRKp8GQSL+9gTJ0+LgSCElXLon2q8tDE8V74jUzf+w2ARZX8HKKyV0laX1NUZ/Q== +connect-pg-simple@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/connect-pg-simple/-/connect-pg-simple-10.0.0.tgz#972b08d9fc6a1861c523a6c9166240a24b4bc3ca" + integrity sha512-pBGVazlqiMrackzCr0eKhn4LO5trJXsOX0nQoey9wCOayh80MYtThCbq8eoLsjpiWgiok/h+1/uti9/2/Una8A== dependencies: - "@types/pg" "^8.6.1" - pg "^8.7.1" + pg "^8.12.0" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" @@ -8455,9 +8455,9 @@ find-babel-config@^2.1.1: path-exists "^4.0.0" find-my-way@^8.0.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/find-my-way/-/find-my-way-8.2.0.tgz#ef1b83d008114a300118c9c707d8dc65947d9960" - integrity sha512-HdWXgFYc6b1BJcOBDBwjqWuHJj1WYiqrxSh25qtU4DabpMFdj/gSunNBQb83t+8Zt67D7CXEzJWTkxaShMTMOA== + version "8.2.2" + resolved "https://registry.yarnpkg.com/find-my-way/-/find-my-way-8.2.2.tgz#f3e78bc6ead2da4fdaa201335da3228600ed0285" + integrity sha512-Dobi7gcTEq8yszimcfp/R7+owiT4WncAJ7VTTgFH1jYJ5GaG1FbhjwDG820hptN0QDFvzVY3RfCzdInvGPGzjA== dependencies: fast-deep-equal "^3.1.3" fast-querystring "^1.0.0" @@ -11250,28 +11250,28 @@ negotiator@0.6.3: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== -next@^14.1.1: - version "14.1.1" - resolved "https://registry.yarnpkg.com/next/-/next-14.1.1.tgz#92bd603996c050422a738e90362dff758459a171" - integrity sha512-McrGJqlGSHeaz2yTRPkEucxQKe5Zq7uPwyeHNmJaZNY4wx9E9QdxmTp310agFRoMuIYgQrCrT3petg13fSVOww== +next@^14.2.10: + version "14.2.10" + resolved "https://registry.yarnpkg.com/next/-/next-14.2.10.tgz#331981a4fecb1ae8af1817d4db98fc9687ee1cb6" + integrity sha512-sDDExXnh33cY3RkS9JuFEKaS4HmlWmDKP1VJioucCG6z5KuA008DPsDZOzi8UfqEk3Ii+2NCQSJrfbEWtZZfww== dependencies: - "@next/env" "14.1.1" - "@swc/helpers" "0.5.2" + "@next/env" "14.2.10" + "@swc/helpers" "0.5.5" busboy "1.6.0" caniuse-lite "^1.0.30001579" graceful-fs "^4.2.11" postcss "8.4.31" styled-jsx "5.1.1" optionalDependencies: - "@next/swc-darwin-arm64" "14.1.1" - "@next/swc-darwin-x64" "14.1.1" - "@next/swc-linux-arm64-gnu" "14.1.1" - "@next/swc-linux-arm64-musl" "14.1.1" - "@next/swc-linux-x64-gnu" "14.1.1" - "@next/swc-linux-x64-musl" "14.1.1" - "@next/swc-win32-arm64-msvc" "14.1.1" - "@next/swc-win32-ia32-msvc" "14.1.1" - "@next/swc-win32-x64-msvc" "14.1.1" + "@next/swc-darwin-arm64" "14.2.10" + "@next/swc-darwin-x64" "14.2.10" + "@next/swc-linux-arm64-gnu" "14.2.10" + "@next/swc-linux-arm64-musl" "14.2.10" + "@next/swc-linux-x64-gnu" "14.2.10" + "@next/swc-linux-x64-musl" "14.2.10" + "@next/swc-win32-arm64-msvc" "14.2.10" + "@next/swc-win32-ia32-msvc" "14.2.10" + "@next/swc-win32-x64-msvc" "14.2.10" nise@^5.1.4: version "5.1.9" @@ -11866,26 +11866,36 @@ pg-cloudflare@^1.1.1: resolved "https://registry.yarnpkg.com/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz#e6d5833015b170e23ae819e8c5d7eaedb472ca98" integrity sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q== -pg-connection-string@^2.0.0, pg-connection-string@^2.6.4: +pg-connection-string@^2.0.0: version "2.6.4" resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.6.4.tgz#f543862adfa49fa4e14bc8a8892d2a84d754246d" integrity sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA== +pg-connection-string@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.7.0.tgz#f1d3489e427c62ece022dba98d5262efcb168b37" + integrity sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA== + pg-int8@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== -pg-pool@^3.6.2: - version "3.6.2" - resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.6.2.tgz#3a592370b8ae3f02a7c8130d245bc02fa2c5f3f2" - integrity sha512-Htjbg8BlwXqSBQ9V8Vjtc+vzf/6fVUuak/3/XXKA9oxZprwW3IMDQTGHP+KDmVL7rtd+R1QjbnCFPuTHm3G4hg== +pg-pool@^3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.7.0.tgz#d4d3c7ad640f8c6a2245adc369bafde4ebb8cbec" + integrity sha512-ZOBQForurqh4zZWjrgSwwAtzJ7QiRX0ovFkZr2klsen3Nm0aoh33Ls0fzfv3imeH/nw/O27cjdz5kzYJfeGp/g== -pg-protocol@*, pg-protocol@^1.6.1: +pg-protocol@*: version "1.6.1" resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.6.1.tgz#21333e6d83b01faaebfe7a33a7ad6bfd9ed38cb3" integrity sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg== +pg-protocol@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.7.0.tgz#ec037c87c20515372692edac8b63cf4405448a93" + integrity sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ== + pg-sql2@4.13.0: version "4.13.0" resolved "https://registry.yarnpkg.com/pg-sql2/-/pg-sql2-4.13.0.tgz#4515694a8bc445412b8cb9d1ff0f49c077bce253" @@ -11907,14 +11917,14 @@ pg-types@^2.1.0, pg-types@^2.2.0: postgres-date "~1.0.4" postgres-interval "^1.1.0" -"pg@>=6.1.0 <9", pg@^8.11.5, pg@^8.7.1: - version "8.11.5" - resolved "https://registry.yarnpkg.com/pg/-/pg-8.11.5.tgz#e722b0a5f1ed92931c31758ebec3ddf878dd4128" - integrity sha512-jqgNHSKL5cbDjFlHyYsCXmQDrfIX/3RsNwYqpd4N0Kt8niLuNoRNH+aazv6cOd43gPh9Y4DjQCtb+X0MH0Hvnw== +"pg@>=6.1.0 <9", pg@^8.11.5, pg@^8.12.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/pg/-/pg-8.13.0.tgz#e3d245342eb0158112553fcc1890a60720ae2a3d" + integrity sha512-34wkUTh3SxTClfoHB3pQ7bIMvw9dpFU1audQQeZG837fmHfHpr14n/AELVDoOYVDW2h5RDWU78tFjkD+erSBsw== dependencies: - pg-connection-string "^2.6.4" - pg-pool "^3.6.2" - pg-protocol "^1.6.1" + pg-connection-string "^2.7.0" + pg-pool "^3.7.0" + pg-protocol "^1.7.0" pg-types "^2.1.0" pgpass "1.x" optionalDependencies: diff --git a/db/sqitch.plan b/db/sqitch.plan index 9e294d94e1..3538153224 100644 --- a/db/sqitch.plan +++ b/db/sqitch.plan @@ -679,3 +679,4 @@ tables/cbc_data_003_include_change_reason 2024-09-04T15:14:09Z Anthony Bushara < computed_columns/cbc_history 2024-09-03T15:16:07Z Anthony Bushara # Computed column to get application history on cbc project @1.193.0 2024-09-16T23:48:28Z CCBC Service Account # release v1.193.0 @1.193.1 2024-09-18T15:03:37Z CCBC Service Account # release v1.193.1 +@1.193.2 2024-09-26T16:15:41Z CCBC Service Account # release v1.193.2 diff --git a/lib/ci_cd/merge_process.py b/lib/ci_cd/merge_process.py index 51061b5f45..02150a9ff2 100644 --- a/lib/ci_cd/merge_process.py +++ b/lib/ci_cd/merge_process.py @@ -63,53 +63,6 @@ def update_pr_description(pr_url, token): else: print(f"Failed to update PR description: {response.status_code}") -def get_pull_request_id(pr_url, token): - # Extract pull request number from the URL - pr_number = pr_url.split("/")[-1] - - # GraphQL query to get pull request ID - query = """ - query GetPullRequestID { - repository(owner: "%s", name: "%s") { - pullRequest(number: %s) { - id - } - } - } - """ % (repo_owner, repo_name, pr_number) - - # Send GraphQL request - headers = {"Authorization": f"Bearer {token}"} - response = requests.post("https://api.github.com/graphql", json={"query": query}, headers=headers) - - if response.status_code != 200: - print(f"Failed to retrieve pull request ID: {response.status_code}") - return None - - data = response.json() - pull_request_id = data.get("data", {}).get("repository", {}).get("pullRequest", {}).get("id") - return pull_request_id - -def enable_auto_merge(pull_request_id, token): - # GraphQL mutation to enable auto merge - mutation = """ - mutation EnableAutoMerge { - enablePullRequestAutoMerge(input: {pullRequestId: "%s", mergeMethod: MERGE}) { - clientMutationId - } - } - """ % pull_request_id - - # Send GraphQL request - headers = {"Authorization": f"Bearer {token}"} - response = requests.post("https://api.github.com/graphql", json={"query": mutation}, headers=headers) - - if response.status_code != 200: - print(f"Failed to enable auto merge: {response.status_code}") - return - - print("Auto merge enabled successfully!") - def check_header_secret(passed_value): # Get the value of the environment variable named HEADER_SECRET header_secret = os.environ.get('HEADER_SECRET') @@ -144,7 +97,3 @@ def check_header_secret(passed_value): parts = pr_url.split("/") repo_owner = parts[4] repo_name = parts[5] - - pull_request_id = get_pull_request_id(pr_url, token) - if pull_request_id: - enable_auto_merge(pull_request_id, token) diff --git a/package.json b/package.json index 652ffca51b..db1042969a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "CONN-CCBC-portal", - "version": "1.193.1", + "version": "1.193.2", "main": "index.js", "repository": "https://github.com/bcgov/CONN-CCBC-portal.git", "author": "Romer, Meherzad CITZ:EX ",