Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
[SEASK-96] Update SEA starter kit to include TPDM core (#52)
Browse files Browse the repository at this point in the history
* added tpdm to SEA starter kit

* removed tpdm schema mapping

tpdm schema files not required for loading starter kit data, its presence causes issues with bulk load.

* using tpdm as start template approach with installing the extension

* fixed template setting

* another try on setting tpdm template

* adjusted data scripts for TPDM sample data

* sk extension package update

* build update to include tpdm

* build update to include tpdm

* updated sample data package

* updated postman collections to account for tpdm data set
  • Loading branch information
vimayya authored Dec 3, 2021
1 parent 350a7f9 commit b2443cd
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 21 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ $ErrorActionPreference = 'Stop'
& ([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 3.1 -InstallDir 'C:/Program Files/dotnet'
dotnet user-secrets set --id f1506d66-289c-44cb-a2e2-80411cc690ec 'Plugin:Folder' '../../Plugin'
dotnet user-secrets set --id f1506d66-289c-44cb-a2e2-80411cc690ed 'Plugin:Folder' '../../Plugin'
dotnet user-secrets set --id f1506d66-289c-44cb-a2e2-80411cc690ec 'Plugin:Scripts:0' 'sk'
dotnet user-secrets set --id f1506d66-289c-44cb-a2e2-80411cc690ed 'Plugin:Scripts:0' 'sk'
dotnet user-secrets set --id f1506d66-289c-44cb-a2e2-80411cc690ec 'Plugin:Scripts:0' 'tpdm'
dotnet user-secrets set --id f1506d66-289c-44cb-a2e2-80411cc690ed 'Plugin:Scripts:0' 'tpdm'
dotnet user-secrets set --id f1506d66-289c-44cb-a2e2-80411cc690ec 'Plugin:Scripts:1' 'sk'
dotnet user-secrets set --id f1506d66-289c-44cb-a2e2-80411cc690ed 'Plugin:Scripts:1' 'sk'
. C:/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1
Initialize-DevelopmentEnvironment -RunDotnetTest -RunSdkGen -RunSmokeTest
2 changes: 1 addition & 1 deletion packer/build-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"package_name": "EdFi.Suite3.RestApi.Databases"
},
"sampledata": {
"version": "1.0.255",
"version": "1.0.266",
"package_name": "EdFi.Ods.Populated.Template.SK"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packer/scripts/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
},
"Plugin": {
"Folder": "c:/plugin",
"Scripts": ["sk"]
"Scripts": [ "tpdm","sk" ]
}
}
2 changes: 1 addition & 1 deletion packer/scripts/sk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $pluginPaths = @()

$parameters = @{
packageName = "EdFi.Suite3.Ods.Extensions.SK"
packageVersion = "5.3.36"
packageVersion = "5.3.37"
packageSource = "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
outputDirectory = "$PSScriptRoot"
toolsPath = (Get-ToolsPath)
Expand Down
2 changes: 1 addition & 1 deletion packer/scripts/webapi.appsettings.production.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Plugin": {
"Folder": "c:/plugin",
"Scripts": ["sk"]
"Scripts": [ "tpdm","sk" ]
}
}
1 change: 1 addition & 0 deletions packer/sea-starter-kit-win2019-eval.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ build {
"Copy-Item -Path ./${var.archive_name}/configuration.json -Destination ./${var.databases}",
"Copy-Item -Path ./${var.archive_name}/sampledata.ps1 -Destination ./${var.databases}/Ed-Fi-ODS-Implementation/DatabaseTemplate/Scripts/",
"Copy-Item -Path ./${var.archive_name}/sk.ps1 -Destination c:/plugin -Force",
"Copy-Item -Path ./${var.databases}/Ed-Fi-ODS-Implementation/Plugin/tpdm.ps1 -Destination c:/plugin -Force",
"New-Item -ItemType Directory -Path ./${var.databases}/Ed-Fi-ODS-Implementation/Artifacts/MsSql/Structure/Ods/",
"Get-ChildItem c:/${var.starter_kit_directory}/${var.sample_report}/* -filter '*-Create*.sql' | Move-Item -Destination ./${var.databases}/Ed-Fi-ODS-Implementation/Artifacts/MsSql/Structure/Ods/",
"Copy-Item ./${var.sample_validation}/* ./${var.databases}/Ed-Fi-ODS-Implementation/Artifacts/MsSql/Structure/Ods/ -filter '*.sql' -recurse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,60 @@
{
"name": "Get Existing Schools",
"item": [
{
"name": "Get LEA",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", () => {",
" pm.expect(pm.response.code).to.equal(200);",
"});",
"const __ = require('lodash');",
"const leas = pm.response.json();",
"pm.environment.set(\"known:localEducationAgencyId\",__.first(leas)['localEducationAgencyId']);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "{{ApiBaseUrl}}/data/v3/{{SchoolYear}}/ed-fi/localEducationAgencies",
"host": [
"{{ApiBaseUrl}}"
],
"path": [
"data",
"v3",
"{{SchoolYear}}",
"ed-fi",
"localEducationAgencies"
]
},
"description": "This api post method adds new academicWeeks for particular school .\nThis test method will throw WeekIdentifier is required error when WeekIdentifier is not passed"
},
"response": []
},
{
"name": "Get School",
"event": [
Expand All @@ -29,8 +83,7 @@
"});",
"const __ = require('lodash');",
"const schools = pm.response.json();",
"pm.environment.set(\"known:schoolId\",__.first(schools)['schoolId']);",
"pm.environment.set(\"known:localEducationAgencyId\",__.first(schools)['localEducationAgencyReference'].localEducationAgencyId);"
"pm.environment.set(\"known:schoolId\",__.first(schools)['schoolId']);"
],
"type": "text/javascript"
}
Expand All @@ -47,7 +100,7 @@
}
],
"url": {
"raw": "{{ApiBaseUrl}}/data/v3/{{SchoolYear}}/ed-fi/schools/",
"raw": "{{ApiBaseUrl}}/data/v3/{{SchoolYear}}/ed-fi/schools?localEducationAgencyId=255901",
"host": [
"{{ApiBaseUrl}}"
],
Expand All @@ -56,8 +109,13 @@
"v3",
"{{SchoolYear}}",
"ed-fi",
"schools",
""
"schools"
],
"query": [
{
"key": "localEducationAgencyId",
"value": "255901"
}
]
},
"description": "This api post method adds new academicWeeks for particular school .\nThis test method will throw WeekIdentifier is required error when WeekIdentifier is not passed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,61 @@
"name": "Get Existing Schools",
"item": [
{
"name": "Get School",
"name": "Get LEA",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", () => {",
" pm.expect(pm.response.code).to.equal(200);",
"});",
"const __ = require('lodash');",
"const leas = pm.response.json();",
"pm.environment.set(\"known:localEducationAgencyId\",__.first(leas)['localEducationAgencyId']);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "{{ApiBaseUrl}}/data/v3/{{SchoolYear}}/ed-fi/localEducationAgencies",
"host": [
"{{ApiBaseUrl}}"
],
"path": [
"data",
"v3",
"{{SchoolYear}}",
"ed-fi",
"localEducationAgencies"
]
},
"description": "This api post method adds new academicWeeks for particular school .\nThis test method will throw WeekIdentifier is required error when WeekIdentifier is not passed"
},
"response": []
},
{
"name": "Get School Copy",
"event": [
{
"listen": "prerequest",
Expand All @@ -29,8 +83,7 @@
"});",
"const __ = require('lodash');",
"const schools = pm.response.json();",
"pm.environment.set(\"known:schoolId\",__.first(schools)['schoolId']);",
"pm.environment.set(\"known:localEducationAgencyId\",__.first(schools)['localEducationAgencyReference'].localEducationAgencyId);"
"pm.environment.set(\"known:schoolId\",__.first(schools)['schoolId']);"
],
"type": "text/javascript"
}
Expand All @@ -47,7 +100,7 @@
}
],
"url": {
"raw": "{{ApiBaseUrl}}/data/v3/{{SchoolYear}}/ed-fi/schools/",
"raw": "{{ApiBaseUrl}}/data/v3/{{SchoolYear}}/ed-fi/schools?localEducationAgencyId={{known:localEducationAgencyId}}",
"host": [
"{{ApiBaseUrl}}"
],
Expand All @@ -56,8 +109,13 @@
"v3",
"{{SchoolYear}}",
"ed-fi",
"schools",
""
"schools"
],
"query": [
{
"key": "localEducationAgencyId",
"value": "{{known:localEducationAgencyId}}"
}
]
},
"description": "This api post method adds new academicWeeks for particular school .\nThis test method will throw WeekIdentifier is required error when WeekIdentifier is not passed"
Expand Down
2 changes: 1 addition & 1 deletion sample-data/plugin/configuration.packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": {
"sk": {
"PackageName": "EdFi.Suite3.Ods.Extensions.SK",
"PackageVersion": "5.3.36",
"PackageVersion": "5.3.37",
"PackageSource": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
}
}
Expand Down
2 changes: 1 addition & 1 deletion sample-database-template/modules/create-sk-template.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Get-SKConfiguration([hashtable] $config = @{ }) {
$config = Merge-Hashtables (Get-DefaultTemplateConfiguration), $config
$config.appSettings.Plugin.Folder = "$PSScriptRoot/../../../Ed-Fi-ODS-Implementation/plugin"
$config.appSettings.Plugin.Scripts = @("sk")
$config.appSettings = Merge-Hashtables $config.appSettings, (Get-DefaultTemplateSettingsByEngine)[$config.engine]
$config.appSettings = Merge-Hashtables $config.appSettings, (Get-DefaultTPDMTemplateSettingsByEngine)[$config.engine]

$config.testHarnessJsonConfigLEAs = @(255902, 255903)
$config.testHarnessJsonConfig = "$PSScriptRoot/testHarnessConfiguration.SK.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ SELECT ssa.EntryDate, ssa.SchoolId, st.StudentUSI, sc.LocalEducationAgencyId, sc
FROM edfi.Student st
JOIN edfi.StudentSchoolAssociation ssa ON st.StudentUSI = ssa.StudentUSI
JOIN edfi.School sc ON ssa.SchoolId = sc.SchoolId
WHERE st.StudentUSI NOT IN (SELECT StudentUSI FROM sk.StudentSchoolAssociationExtension)
WHERE st.StudentUSI NOT IN (SELECT StudentUSI FROM sk.StudentSchoolAssociationExtension) AND sc.LocalEducationAgencyId is NOT NULL

GO
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ SELECT ssa.EntryDate, ssa.SchoolId, st.StudentUSI, sc.LocalEducationAgencyId, sc
FROM edfi.Student st
JOIN edfi.StudentSchoolAssociation ssa ON st.StudentUSI = ssa.StudentUSI
JOIN edfi.School sc ON ssa.SchoolId = sc.SchoolId
WHERE st.StudentUSI NOT IN (SELECT StudentUSI FROM sk.StudentSchoolAssociationExtension)
WHERE st.StudentUSI NOT IN (SELECT StudentUSI FROM sk.StudentSchoolAssociationExtension) AND sc.LocalEducationAgencyId is NOT NULL

end $$;

0 comments on commit b2443cd

Please sign in to comment.