Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ODS-6375] Rebuild Templates action improvements #1070

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f97c4f1
Check Previous Workflow Runs Step Added
semalaiappan Jul 2, 2024
86c81f2
Updating for new CodeGen version
EdFiBuildAgent Jul 2, 2024
d40c6b9
Check Previous Workflow Runs Step Added
semalaiappan Jul 2, 2024
c1f031b
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
150415d
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
a1a2330
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
0e6154f
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
4f0ee1e
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
096deb7
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
b7f32b7
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
778527c
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
09d11ac
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
7c1ec5e
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
97913d7
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
a8b630c
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
3593503
Check Previous Workflow Runs Updated
semalaiappan Jul 2, 2024
b388435
Check for Successful Workflow Runs of Pkg EdFi.Ods.CodeGen.yml
semalaiappan Jul 2, 2024
883807a
Commented Code
semalaiappan Jul 2, 2024
a35a9e7
Updating for new CodeGen version
EdFiBuildAgent Jul 2, 2024
edc9eb2
Updating for new Extensions- TPDM, Sample, Homograph package version
EdFiBuildAgent Jul 2, 2024
ea1f175
Compare Codegen Package Version
semalaiappan Jul 3, 2024
04e8863
Compare Codegen Package Version
semalaiappan Jul 3, 2024
46f238f
Compare Codegen Package Version
semalaiappan Jul 3, 2024
b0e7ce9
Compare Codegen Package Version
semalaiappan Jul 3, 2024
a8cfc41
Compare Codegen Package Version
semalaiappan Jul 3, 2024
48ced68
Compare Codegen Package Version
semalaiappan Jul 3, 2024
27b0e50
Compare Codegen Package Version
semalaiappan Jul 3, 2024
d32066c
Compare Codegen Package Version
semalaiappan Jul 3, 2024
02a0287
Compare Codegen Package Version
semalaiappan Jul 3, 2024
3dbd7f5
Compare Codegen Package Version
semalaiappan Jul 4, 2024
6b3b93d
Compare Codegen Package Version
semalaiappan Jul 4, 2024
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
104 changes: 103 additions & 1 deletion .github/workflows/Rebuild Database Templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,109 @@ jobs:
$current_branch = '${{env.HEAD_REF}}'
}
Write-Host "Current Branch: $current_branch"
echo "current_branch=$current_branch" >> $Env:GITHUB_ENV
echo "current_branch=$current_branch" >> $Env:GITHUB_ENV
if ($current_branch -eq 'main') {
Write-Host "Current branch is main. Stopping the build."
exit 1
}
- name: Check Previous Workflow Runs
shell: pwsh
run: |
$branch = "${{ env.current_branch }}"
$url = "https://api.github.com/repos/Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation/actions/runs?branch=${{ env.current_branch }}"

$headers = @{
Authorization = "Bearer ${{ env.EDFI_ODS_TOKEN }}"
Accept = "application/vnd.github.v3+json"
}
$response = Invoke-RestMethod -Uri $url -Headers $headers

if ($response.total_count -gt 0) {
Write-Host "Found previous failed of $response.total_count workflow runs on branch ${{ env.current_branch }}. Stopping the build."
$response.workflow_runs | ForEach-Object {
Write-Host "Run ID: $_.id"
Write-Host "Run Name: $_.name"
Write-Host "Run Number: $_.run_number"
Write-Host "Event: $_.event"
Write-Host "Status: $_.status"
Write-Host "Conclusion: $_.conclusion"
Write-Host "Created At: $_.created_at"
Write-Host "Updated At: $_.updated_at"
Write-Host "URL: $_.html_url"
}
## exit 1
} else {
Write-Host "No previous failed workflow runs found on branch $branch."
}
- name: Check for Successful Workflow Runs of Pkg EdFi.Ods.CodeGen.yml
shell: pwsh
run: |
$branch = "${{ env.current_branch }}"
$workflow_file_name = "Pkg EdFi.Ods.CodeGen.yml"
$url = "https://api.github.com/repos/Ed-Fi-Alliance-OSS/Ed-Fi-ODS/actions/workflows/$workflow_file_name/runs?branch=$branch&status=success"

$headers = @{
Authorization = "Bearer ${{ env.EDFI_ODS_TOKEN }}"
Accept = "application/vnd.github.v3+json"
}
$response = Invoke-RestMethod -Uri $url -Headers $headers

if ($response.workflow_runs.Count -gt 0) {
Write-Host "Found successful workflow runs for '$workflow_file_name' on branch $branch."
$responseJson = $response | ConvertTo-Json -Depth 10
Write-Host "Response JSON: $responseJson"
} else {
Write-Host "No successful workflow runs found for '$workflow_file_name' on branch $branch."
}
- name: Compare Codegen Package Version
shell: pwsh
run: |
$branch = '${{ env.current_branch }}'

$headers = @{
Authorization = "Bearer ${{ env.EDFI_ODS_TOKEN }}"
Accept = "application/vnd.github+json"
}

# Function to get the file content from a specific branch
function Get-FileContent($branch) {
$url = "https://api.github.com/repos/Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation/contents/configuration.packages.json?ref=$branch"
$response = Invoke-RestMethod -Uri $url -Headers $headers
$content = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($response.content))
#Write-Host "Response content: $content"
return $content | ConvertFrom-Json
}


Write-Host "branch name is $branch"

# Get the file content from both branches
$mainContent = Get-FileContent "main"
$currentContent = Get-FileContent $branch

#Write-Host "Response JSON: $mainContent"
#Write-Host "Response JSON: $currentContent"

Write-Host "Main Content: $($mainContent | ConvertTo-Json -Depth 10)"
Write-Host "Current Content: $($currentContent | ConvertTo-Json -Depth 10)"

# Extract the package version for EdFi.Suite3.Ods.CodeGen
$mainVersion = $mainContent.packages."EdFi.Ods.CodeGen".PackageVersion
$currentVersion = $currentContent.packages."EdFi.Ods.CodeGen".PackageVersion


Write-Host "mainVersion: $mainVersion"
Write-Host "currentVersion: $currentVersion"


# Compare the versions
if ($mainVersion -eq $currentVersion) {
Write-Host "The package version for EdFi.Suite3.Ods.CodeGen is the same in both branches: $mainVersion"
} else {
Write-Host "The package version for EdFi.Suite3.Ods.CodeGen has changed."
Write-Host "Main branch version: $mainVersion"
Write-Host "Current branch version: $currentVersion"
}
- name: Dispatch EdFi.Ods.CodeGen workflow
uses: codex-/return-dispatch@03a7fcd260cce601805567f86c892bd06d2719e1 #v1.12.0
id: return_dispatch_codegen
Expand Down
10 changes: 5 additions & 5 deletions configuration.packages.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"packages": {
"EdFiMinimalTemplate": {
"PackageName": "EdFi.Suite3.Ods.Minimal.Template.Standard.{StandardVersion}",
Expand Down Expand Up @@ -42,7 +42,7 @@
},
"homograph": {
"PackageName": "EdFi.Suite3.Ods.Extensions.Homograph.1.0.0.Standard.{StandardVersion}",
"PackageVersion": "7.3.4",
"PackageVersion": "7.3.16",
"PackageSource": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
},
"profiles.sample": {
Expand All @@ -52,17 +52,17 @@
},
"sample": {
"PackageName": "EdFi.Suite3.Ods.Extensions.Sample.1.0.0.Standard.{StandardVersion}",
"PackageVersion": "7.3.13",
"PackageVersion": "7.3.18",
"PackageSource": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
},
"tpdm": {
"PackageName": "EdFi.Suite3.Ods.Extensions.TPDM.Core.{ExtensionVersion}.Standard.{StandardVersion}",
"PackageVersion": "7.3.4",
"PackageVersion": "7.3.15",
"PackageSource": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
},
"EdFi.Ods.CodeGen": {
"PackageName": "EdFi.Suite3.Ods.CodeGen",
"PackageVersion": "7.3.11",
"PackageVersion": "7.3.105",
"PackageSource": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
},
"EdFi.Db.Deploy": {
Expand Down
Loading