diff --git a/.github/workflows/build-and-push-image.yml b/.github/workflows/build-and-push-image.yml index afdb07486..c838bc58b 100644 --- a/.github/workflows/build-and-push-image.yml +++ b/.github/workflows/build-and-push-image.yml @@ -27,13 +27,12 @@ jobs: release: ${{ steps.var.outputs.release }} checked-out-sha: ${{ steps.var.outputs.checked-out-sha }} steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} + - name: Checkout + uses: actions/checkout@v4 - id: var run: | - GIT_REF=${{ env.branch_ref }} + GIT_REF=${{ github.ref_name }} GIT_BRANCH=${GIT_REF##*/} INPUT=${{ github.event.inputs.environment }} ENVIRONMENT=${INPUT:-"development"} @@ -47,7 +46,7 @@ jobs: deploy-image: name: Deploy '${{ needs.set-env.outputs.branch }}' to ${{ needs.set-env.outputs.environment }} needs: [ set-env ] - uses: DFE-Digital/deploy-azure-container-apps-action/.github/workflows/build-push-deploy.yml@v1.1.0 + uses: DFE-Digital/deploy-azure-container-apps-action/.github/workflows/build-push-deploy.yml@v2.1.0 with: docker-image-name: 'aca-app' docker-build-file-name: './Dockerfile' @@ -55,9 +54,8 @@ jobs: docker-build-args: | COMMIT_SHA="${{ needs.set-env.outputs.checked-out-sha }}" secrets: - azure-acr-client-id: ${{ secrets.AZURE_ACR_CLIENTID }} - azure-acr-secret: ${{ secrets.AZURE_ACR_SECRET }} - azure-acr-url: ${{ secrets.AZURE_ACR_URL }} + azure-acr-name: ${{ secrets.ACR_NAME }} + azure-acr-credentials: ${{ secrets.ACR_CREDENTIALS }} azure-aca-credentials: ${{ secrets.AZURE_ACA_CREDENTIALS }} azure-aca-name: ${{ secrets.AZURE_ACA_NAME }} azure-aca-resource-group: ${{ secrets.AZURE_ACA_RESOURCE_GROUP }} diff --git a/Dfe.Academies.Academisation.Data/Repositories/TransferProjectRepository.cs b/Dfe.Academies.Academisation.Data/Repositories/TransferProjectRepository.cs index 1bd682e24..950727374 100644 --- a/Dfe.Academies.Academisation.Data/Repositories/TransferProjectRepository.cs +++ b/Dfe.Academies.Academisation.Data/Repositories/TransferProjectRepository.cs @@ -1,4 +1,5 @@ -using Dfe.Academies.Academisation.Domain.SeedWork; +using System.Threading; +using Dfe.Academies.Academisation.Domain.SeedWork; using Dfe.Academies.Academisation.Domain.TransferProjectAggregate; using Dfe.Academies.Academisation.IDomain.TransferProjectAggregate; using Microsoft.EntityFrameworkCore; @@ -21,7 +22,7 @@ public TransferProjectRepository(AcademisationContext context) : base(context) } public async Task<(IEnumerable, int totalcount)> SearchProjects(IEnumerable? states, string? title, IEnumerable? deliveryOfficers, int page, int count) { - IQueryable queryable = this.dbSet; + IQueryable queryable = DefaultIncludes(); // Region & Local Authority isn't on Transfers right now //queryable = FilterByRegion(regions, queryable); @@ -65,29 +66,16 @@ private static IQueryable FilterByKeyword(string? title, IQuery { if (!string.IsNullOrWhiteSpace(title)) { - - queryable = FilterIncomingTrust(title, queryable); - queryable = FilterOutgoingTrust(title, queryable); - queryable = FilterURN(title, queryable); - + queryable = queryable.Where(p => + p.TransferringAcademies.Any(x => + EF.Functions.Like(x.IncomingTrustName, $"%{title}%")) + || EF.Functions.Like(p.OutgoingTrustName, $"%{title}%") + || EF.Functions.Like(p.Urn.ToString(), $"%{title}%")); } return queryable; } - private static IQueryable FilterIncomingTrust(string title, IQueryable queryable) - { - return queryable.Where(p => - p.TransferringAcademies.Any(x => - x.IncomingTrustName != null && - x.IncomingTrustName.Contains(title, StringComparison.CurrentCultureIgnoreCase) - ) - ); - } - private static IQueryable FilterOutgoingTrust(string title, IQueryable queryable) - { - return queryable.Where(p => p.OutgoingTrustName != null && p.OutgoingTrustName.Contains(title, StringComparison.CurrentCultureIgnoreCase)); - } private static IQueryable FilterURN(string title, IQueryable queryable) { return queryable.Where(p => p.Urn.ToString().Contains(title, StringComparison.CurrentCultureIgnoreCase)); diff --git a/Dfe.Academies.Academisation.IDomain/TransferProjectAggregate/ITransferringAcademy.cs b/Dfe.Academies.Academisation.IDomain/TransferProjectAggregate/ITransferringAcademy.cs index 599437eef..5c4354e9d 100644 --- a/Dfe.Academies.Academisation.IDomain/TransferProjectAggregate/ITransferringAcademy.cs +++ b/Dfe.Academies.Academisation.IDomain/TransferProjectAggregate/ITransferringAcademy.cs @@ -4,7 +4,7 @@ public interface ITransferringAcademy { int Id { get; } string? IncomingTrustUkprn { get; } - string IncomingTrustName { get; } + string? IncomingTrustName { get; } string? KeyStage2PerformanceAdditionalInformation { get; } string? KeyStage4PerformanceAdditionalInformation { get; } string? KeyStage5PerformanceAdditionalInformation { get; } diff --git a/Dfe.Academies.Academisation.IService/ServiceModels/TransferProject/TransferringAcademiesResponse.cs b/Dfe.Academies.Academisation.IService/ServiceModels/TransferProject/TransferringAcademiesResponse.cs index 6728ed807..b6f194f25 100644 --- a/Dfe.Academies.Academisation.IService/ServiceModels/TransferProject/TransferringAcademiesResponse.cs +++ b/Dfe.Academies.Academisation.IService/ServiceModels/TransferProject/TransferringAcademiesResponse.cs @@ -6,7 +6,7 @@ public class TransferringAcademiesResponse { public string OutgoingAcademyUkprn { get; set; } public string? IncomingTrustUkprn { get; set; } - public string IncomingTrustName { get; set; } + public string? IncomingTrustName { get; set; } public string PupilNumbersAdditionalInformation { get; set; } diff --git a/Dfe.Academies.Academisation.Service/Queries/ConversionProjectExportService.cs b/Dfe.Academies.Academisation.Service/Queries/ConversionProjectExportService.cs index 5e74511f8..c66eae80c 100644 --- a/Dfe.Academies.Academisation.Service/Queries/ConversionProjectExportService.cs +++ b/Dfe.Academies.Academisation.Service/Queries/ConversionProjectExportService.cs @@ -3,7 +3,6 @@ using Dfe.Academies.Academisation.IService.Commands.Legacy.Project; using Dfe.Academies.Academisation.IService.Query; using Dfe.Academies.Academisation.IService.ServiceModels.Legacy.ProjectAggregate; -using Dfe.Academisation.ExtensionMethods; namespace Dfe.Academies.Academisation.Service.Queries { @@ -39,65 +38,61 @@ private async Task GenerateSpreadsheet(IEnumerable GenerateSpreadsheet(IEnumerable [container\_health\_probe\_path](#input\_container\_health\_probe\_path) | Specifies the path that is used to determine the liveness of the Container | `string` | n/a | yes | | [container\_scale\_http\_concurrency](#input\_container\_scale\_http\_concurrency) | When the number of concurrent HTTP requests exceeds this value, then another replica is added. Replicas continue to add to the pool up to the max-replicas amount. | `number` | `10` | no | | [container\_secret\_environment\_variables](#input\_container\_secret\_environment\_variables) | Container secret environment variables | `map(string)` | n/a | yes | +| [dns\_mx\_records](#input\_dns\_mx\_records) | DNS MX records to add to the DNS Zone |
map(
object({
ttl : optional(number, 300),
records : list(
object({
preference : number,
exchange : string
})
)
})
)
| `{}` | no | | [dns\_ns\_records](#input\_dns\_ns\_records) | DNS NS records to add to the DNS Zone |
map(
object({
ttl : optional(number, 300),
records : list(string)
})
)
| n/a | yes | | [dns\_txt\_records](#input\_dns\_txt\_records) | DNS TXT records to add to the DNS Zone |
map(
object({
ttl : optional(number, 300),
records : list(string)
})
)
| n/a | yes | | [dns\_zone\_domain\_name](#input\_dns\_zone\_domain\_name) | DNS zone domain name. If created, records will automatically be created to point to the CDN. | `string` | n/a | yes | @@ -194,6 +195,7 @@ No resources. | [project\_name](#input\_project\_name) | Project name. Will be used along with `environment` as a prefix for all resources. | `string` | n/a | yes | | [registry\_admin\_enabled](#input\_registry\_admin\_enabled) | Do you want to enable access key based authentication for your Container Registry? | `bool` | `false` | no | | [registry\_managed\_identity\_assign\_role](#input\_registry\_managed\_identity\_assign\_role) | Assign the 'AcrPull' Role to the Container App User-Assigned Managed Identity. Note: If you do not have 'Microsoft.Authorization/roleAssignments/write' permission, you will need to manually assign the 'AcrPull' Role to the identity | `bool` | `false` | no | +| [registry\_server](#input\_registry\_server) | Container registry server (required if `enable_container_registry` is false) | `string` | `""` | no | | [registry\_use\_managed\_identity](#input\_registry\_use\_managed\_identity) | Create a User-Assigned Managed Identity for the Container App. Note: If you do not have 'Microsoft.Authorization/roleAssignments/write' permission, you will need to manually assign the 'AcrPull' Role to the identity | `bool` | `true` | no | | [statuscake\_api\_token](#input\_statuscake\_api\_token) | API token for StatusCake | `string` | `"00000000000000000000000000000"` | no | | [statuscake\_contact\_group\_email\_addresses](#input\_statuscake\_contact\_group\_email\_addresses) | List of email address that should receive notifications from StatusCake | `list(string)` | `[]` | no | diff --git a/terraform/container-apps-hosting.tf b/terraform/container-apps-hosting.tf index c1a0b1ca4..70ff54897 100644 --- a/terraform/container-apps-hosting.tf +++ b/terraform/container-apps-hosting.tf @@ -12,6 +12,7 @@ module "azure_container_apps_hosting" { registry_admin_enabled = local.registry_admin_enabled registry_use_managed_identity = local.registry_use_managed_identity registry_managed_identity_assign_role = local.registry_managed_identity_assign_role + registry_server = local.registry_server image_name = local.image_name container_command = local.container_command @@ -35,6 +36,7 @@ module "azure_container_apps_hosting" { dns_zone_domain_name = local.dns_zone_domain_name dns_ns_records = local.dns_ns_records dns_txt_records = local.dns_txt_records + dns_mx_records = local.dns_mx_records enable_cdn_frontdoor = local.enable_cdn_frontdoor cdn_frontdoor_forwarding_protocol = local.cdn_frontdoor_forwarding_protocol diff --git a/terraform/locals.tf b/terraform/locals.tf index 16f9c7214..319d2be7e 100644 --- a/terraform/locals.tf +++ b/terraform/locals.tf @@ -8,6 +8,7 @@ locals { registry_admin_enabled = var.registry_admin_enabled registry_use_managed_identity = var.registry_use_managed_identity registry_managed_identity_assign_role = var.registry_managed_identity_assign_role + registry_server = var.registry_server image_name = var.image_name container_command = var.container_command container_secret_environment_variables = var.container_secret_environment_variables @@ -27,6 +28,7 @@ locals { dns_zone_domain_name = var.dns_zone_domain_name dns_ns_records = var.dns_ns_records dns_txt_records = var.dns_txt_records + dns_mx_records = var.dns_mx_records enable_cdn_frontdoor = var.enable_cdn_frontdoor container_apps_allow_ips_inbound = var.container_apps_allow_ips_inbound cdn_frontdoor_enable_rate_limiting = var.cdn_frontdoor_enable_rate_limiting diff --git a/terraform/variables.tf b/terraform/variables.tf index ba50051cc..afc84596e 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -38,6 +38,12 @@ variable "enable_container_registry" { type = bool } +variable "registry_server" { + description = "Container registry server (required if `enable_container_registry` is false)" + type = string + default = "" +} + variable "registry_admin_enabled" { description = "Do you want to enable access key based authentication for your Container Registry?" type = bool @@ -265,6 +271,22 @@ variable "dns_ns_records" { ) } +variable "dns_mx_records" { + description = "DNS MX records to add to the DNS Zone" + type = map( + object({ + ttl : optional(number, 300), + records : list( + object({ + preference : number, + exchange : string + }) + ) + }) + ) + default = {} +} + variable "dns_txt_records" { description = "DNS TXT records to add to the DNS Zone" type = map(