Skip to content

Commit

Permalink
Merge pull request #3975 from cisagov/release/12.2.3.0
Browse files Browse the repository at this point in the history
Release/12.2.3.0
  • Loading branch information
randywoods committed Jun 24, 2024
2 parents e2bce93 + 12db265 commit 388e1c6
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void CopyDBAcrossServersTest()
{
string clientCode = "DHS";
string appCode = "CSET";
DbManager manager = new DbManager(new Version("12.2.2.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.2.3.0"), clientCode, appCode);
//TODO finish this.
//manager.CopyDBAcrossServers();
}
Expand All @@ -42,7 +42,7 @@ public void CopyDBFromInstallationSource()
//setup a destination file
string clientCode = "DHS";
string appCode = "CSET";
DbManager manager = new DbManager(new Version("12.2.2.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.2.3.0"), clientCode, appCode);
//run the same test twice and make sure that the number increment works
string mdf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest.mdf";
string ldf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest_log.ldf";
Expand All @@ -68,7 +68,7 @@ public void TestUpgrade()
//setup a destination file
string clientCode = "Test";
string appCode = "Test";
DbManager manager = new DbManager(new Version("12.2.2.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.2.3.0"), clientCode, appCode);

//manager.ForceCloseAndDetach(DbManager.localdb2019_ConnectionString, "TestWeb");
//manager.AttachTest("TestWeb", testdb, testlog);
Expand All @@ -81,7 +81,7 @@ public void TestUpgrade()

manager.SetupDb();

upgrader.UpgradeOnly(new Version("12.2.2.0"), "data source=(localdb)\\inllocaldb2022;initial catalog=TestWeb;persist security info=True;Integrated Security=SSPI;MultipleActiveResultSets=True");
upgrader.UpgradeOnly(new Version("12.2.3.0"), "data source=(localdb)\\inllocaldb2022;initial catalog=TestWeb;persist security info=True;Integrated Security=SSPI;MultipleActiveResultSets=True");


}
Expand All @@ -94,7 +94,7 @@ public void TestSetup()
//setup a destination file
string clientCode = "DHS";
string appCode = "CSET";
DbManager manager = new DbManager(new Version("12.2.2.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.2.3.0"), clientCode, appCode);
manager.SetupDb();
}

Expand All @@ -106,7 +106,7 @@ public void CopyDBFromInstallationSourceTest2()
string mdf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest.mdf";
string ldf = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\CSETWebTest_log.ldf";

DbManager manager = new DbManager(new Version("12.2.2.0"), clientCode, appCode);
DbManager manager = new DbManager(new Version("12.2.3.0"), clientCode, appCode);
//run the same test twice and make sure that the number increment works
string conString = "Server=(localdb)\\inllocaldb2022;Integrated Security=true;AttachDbFileName=" + mdf;
using (SqlConnection conn = new SqlConnection(conString))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ItemGroup>
<PackageReference Include="Npoi.Mapper" Version="6.2.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.6.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.6.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyVersion>12.2.2.0</AssemblyVersion>
<AssemblyVersion>12.2.3.0</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
////////////////////////////////
//
// Copyright 2024 Battelle Energy Alliance, LLC
//
//
////////////////////////////////
using System;
using Microsoft.Data.SqlClient;
using System.IO;
namespace UpgradeLibrary.Upgrade
{
internal class ConvertDatabase12230 : ConvertSqlDatabase
{
public ConvertDatabase12230(string path) : base(path)
{
myVersion = new Version("12.2.3.0");
}

/// <summary>
/// Runs the database update script
/// </summary>
/// <param name="conn"></param>F
public override void Execute(SqlConnection conn)
{
try
{
RunFile(Path.Combine(this.applicationPath, "VersionUpgrader", "SQL", "12220_to_12230.sql"), conn);
this.UpgradeToVersionLocalDB(conn, myVersion);
}
catch (Exception e)
{
throw new DatabaseUpgradeException("Error in upgrading database version 12.2.2.0 to 12.2.3.0: " + e.Message);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
Run this script on:
(localdb)\INLLocalDB2022.CSETWeb12220 - This database will be modified
to synchronize it with:
(localdb)\INLLocalDB2022.CSETWeb12230
You are recommended to back up your database before running this script
Script created by SQL Compare version 14.10.9.22680 from Red Gate Software Ltd at 6/21/2024 2:50:37 PM
*/
SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL Serializable
GO
BEGIN TRANSACTION
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
PRINT N'Altering [dbo].[ASSESSMENT_CONTACTS]'
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
ALTER TABLE [dbo].[ASSESSMENT_CONTACTS] ADD
[Last_Q_Answered] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
COMMIT TRANSACTION
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
-- This statement writes to the SQL Server Log so SQL Monitor can show this deployment.
IF HAS_PERMS_BY_NAME(N'sys.xp_logevent', N'OBJECT', N'EXECUTE') = 1
BEGIN
DECLARE @databaseName AS nvarchar(2048), @eventMessage AS nvarchar(2048)
SET @databaseName = REPLACE(REPLACE(DB_NAME(), N'\', N'\\'), N'"', N'\"')
SET @eventMessage = N'Redgate SQL Compare: { "deployment": { "description": "Redgate SQL Compare deployed to ' + @databaseName + N'", "database": "' + @databaseName + N'" }}'
EXECUTE sys.xp_logevent 55000, @eventMessage
END
GO
DECLARE @Success AS BIT
SET @Success = 1
SET NOEXEC OFF
IF (@Success = 1) PRINT 'The database update succeeded'
ELSE BEGIN
IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION
PRINT 'The database update failed'
END
GO
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public VersionUpgrader(string path)
converters.Add("12.1.8.0", new ConvertDatabase12200(path));
converters.Add("12.2.0.0", new ConvertDatabase12210(path));
converters.Add("12.2.1.0", new ConvertDatabase12220(path));
converters.Add("12.2.2.0", new ConvertDatabase12230(path));
}

public void UpgradeOnly(Version currentVersion, string tempConnect)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyVersion>12.2.2.0</AssemblyVersion>
<AssemblyVersion>12.2.3.0</AssemblyVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(RunConfiguration)' == 'CSETWeb_ApiCore' " />
Expand Down
8 changes: 5 additions & 3 deletions CSETWebNg/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CSETWebNg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "csetweb-ng",
"version": "12.2.2",
"version": "12.2.3",
"license": "MIT",
"main": "main-electron.js",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion CSETWebNg/src/assets/settings/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"NOTENODE": "Casing on config chain matters, the only item that should be changed here is the current ConfigChain value. Once that is changed everything else should be set",
"currentConfigChain": ["CF"],
"currentConfigChain": ["CSET"],
"defaultLang": "en",
"isRunningAnonymous": false,
"app": {
Expand Down
4 changes: 2 additions & 2 deletions CSETWebNg/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const environment = {
apiUrl: '',
docUrl: '',
csetGithubApiUrl: '',
visibleVersion: '12.2.2.0',
version: '12.2.2.0',
visibleVersion: '12.2.3.0',
version: '12.2.3.0',
helpContactEmail: '',
helpContactPhone: ''
};
4 changes: 2 additions & 2 deletions CSETWebNg/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const environment = {
apiUrl: 'https://localhost:5001/api/',
docUrl: 'https://localhost:5001/Documents/',
csetGithubApiUrl: 'https://api.github.com/repos/cisagov/cset/releases/latest',
visibleVersion: '12.2.2.0',
version: '12.2.2.0',
visibleVersion: '12.2.3.0',
version: '12.2.3.0',
helpContactEmail: 'cset@cisa.dhs.gov',
helpContactPhone: ''
};

0 comments on commit 388e1c6

Please sign in to comment.