Skip to content

feature/AB#32216-BuildAIBase#2100

Merged
JamesPasta merged 6 commits into
devfrom
feature/AB#32216-BuildAIBaseModule
Mar 10, 2026
Merged

feature/AB#32216-BuildAIBase#2100
JamesPasta merged 6 commits into
devfrom
feature/AB#32216-BuildAIBaseModule

Conversation

@JamesPasta
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new Unity.AI module scaffold into the Unity GrantManager solution, wiring initial project references and EF Core configuration to prepare for future AI-related features.

Changes:

  • Added new Unity.AI module projects (Domain.Shared, Application.Contracts, Application, Web) with localization + permissions scaffolding.
  • Hooked AI model configuration into the tenant DbContext and added project references from the main app to the new module.
  • Added an EF Core migration intended to establish an AI schema.

Reviewed changes

Copilot reviewed 43 out of 44 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
applications/Unity.GrantManager/src/Unity.GrantManager.Web/Unity.GrantManager.Web.csproj Adds reference to AI Web module project
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Unity.GrantManager.EntityFrameworkCore.csproj Adds reference to AI Application project
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/HostMigrations/GrantManagerDbContextModelSnapshot.cs Updates host model snapshot (includes non-AI model changes)
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/HostMigrations/20260306195601_AISchema.cs New migration to ensure AI schema
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/HostMigrations/20260306195601_AISchema.Designer.cs Auto-generated migration designer/model
applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/EntityFrameworkCore/GrantTenantDbContext.cs Calls modelBuilder.ConfigureAI() for tenant DB
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Unity.AI.Web.csproj New AI Web layer project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Properties/launchSettings.json Local launch profile for AI web project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/_ViewImports.cshtml Razor imports for AI web pages
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/FodyWeavers.xsd Fody weaver schema for AI web project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/FodyWeavers.xml Fody weaver config for AI web project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/AIWebModule.cs ABP module definition for AI Web
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/AIWebAutoMapperProfile.cs Placeholder AutoMapper profile for AI Web
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Unity.AI.Shared.csproj New AI Domain.Shared project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Localization/AIResource.cs Defines AI localization resource
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Localization/AI/en.json English localization strings for AI permissions
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/FodyWeavers.xsd Fody weaver schema for AI Domain.Shared project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/FodyWeavers.xml Fody weaver config for AI Domain.Shared project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/AISharedModule.cs ABP module definition for AI Domain.Shared
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/AIErrorCodes.cs Placeholder error code constants
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/Unity.AI.Application.csproj New AI Application project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/FodyWeavers.xsd Fody weaver schema for AI Application project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/FodyWeavers.xml Fody weaver config for AI Application project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/IAIDbContext.cs Defines EF Core DbContext interface for AI
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/AIEntityFrameworkCoreModule.cs Registers AI DbContext in a dedicated ABP module
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/AIDbContextModelCreatingExtensions.cs Adds ConfigureAI() model builder extension
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/AIDbContext.cs AI AbpDbContext implementation
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/Domain/AIDbProperties.cs AI schema/connection string constants
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/AIApplicationModule.cs ABP module definition for AI Application
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/AIApplicationAutoMapperProfile.cs Placeholder AutoMapper profile for AI Application
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/AIAppService.cs Base ApplicationService class with AI localization
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Unity.AI.Application.Contracts.csproj New AI Application.Contracts project
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Permissions/AIPermissions.cs Defines AI permission constants
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Permissions/AIPermissionDefinitionProvider.cs Registers AI permissions with ABP
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/FodyWeavers.xsd Fody weaver schema for AI Application.Contracts
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/FodyWeavers.xml Fody weaver config for AI Application.Contracts
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/AIRemoteServiceConsts.cs Remote service constants for AI
applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/AIApplicationContractsModule.cs ABP module definition for AI Application.Contracts
applications/Unity.GrantManager/modules/Unity.AI/common.props Module-wide build properties + Fody package refs
applications/Unity.GrantManager/modules/Unity.AI/NuGet.Config Module-local NuGet config
applications/Unity.GrantManager/modules/Unity.AI/.prettierrc Module-local Prettier settings
applications/Unity.GrantManager/modules/Unity.AI/.gitignore Module-local gitignore
applications/Unity.GrantManager/modules/Unity.AI/.gitattributes Linguist vendoring for libs
applications/Unity.GrantManager/Unity.GrantManager.sln Adds AI projects to the solution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +12 to +15
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(name: "AI");
}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AISchema is created as a HostMigration for GrantManagerDbContext (Default connection string), but the AI module’s AIDbProperties.ConnectionStringName is Tenant and GrantTenantDbContext is calling modelBuilder.ConfigureAI(). If AI tables are intended to live in the tenant database (like Payments/Flex/Reporting), this migration should be generated under Migrations/TenantMigrations (or the AI schema/connection string should be adjusted to match the host DB).

Copilot uses AI. Check for mistakes.
Comment on lines +28 to 30
<ProjectReference Include="..\..\modules\Unity.AI\src\Unity.AI.Web\Unity.AI.Web.csproj" />
<ProjectReference Include="..\..\modules\Unity.SharedKernel\Unity.SharedKernel.csproj" />
<ProjectReference Include="..\..\modules\Unity.Theme.UX2\src\Unity.Theme.UX2\Unity.AspNetCore.Mvc.UI.Theme.UX2.csproj" /></ItemGroup>
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The solution references Unity.AI.Web, but ABP modules are only activated when included via [DependsOn] from the root module (e.g., GrantManagerWebModule). If this is meant to be enabled at runtime, add AIWebModule to the root module dependency list; otherwise this reference will compile but none of the module configuration/services will be registered.

Copilot uses AI. Check for mistakes.
typeof(AIApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule),
typeof(AbpTenantManagementDomainModule)
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AIEntityFrameworkCoreModule (which registers AIDbContext) is never pulled into the module dependency graph (no [DependsOn] references found). This means AIDbContext won’t be registered unless another root module explicitly depends on it. Consider adding typeof(AIEntityFrameworkCoreModule) to this module’s [DependsOn] list (pattern used by ReportingApplicationModule) or registering the DbContext directly in AIApplicationModule.

Suggested change
typeof(AbpTenantManagementDomainModule)
typeof(AbpTenantManagementDomainModule),
typeof(AIEntityFrameworkCoreModule)

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +11
public static class AIPermissions
{
public const string GroupName = "AI";

public static class Default
{
public const string Management = GroupName + ".Management";
}
}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with other modules’ permission constants (e.g., NotificationsPermissions, FlexPermissions, ReportingPermissions), add a GetAll() helper that returns ReflectionHelper.GetPublicConstantsRecursively(typeof(AIPermissions)). This is commonly used for permission seeding/registration and keeps the module aligned with existing patterns.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 41 out of 42 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread applications/Unity.GrantManager/Unity.GrantManager.sln Outdated
@JamesPasta JamesPasta marked this pull request as draft March 6, 2026 21:26
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 49 out of 50 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +12 to +37
// AI Permission Group
var aiPermissionsGroup = context.AddGroup(
AIPermissions.GroupName,
L("Permission:AI"));


aiPermissionsGroup.AddPermission(
AIPermissions.Default.Reporting.Default,
L("Permission:AI.Reporting"))
.RequireFeatures("Unity.AIReporting");

aiPermissionsGroup.AddPermission(
AIPermissions.Default.ApplicationAnalysis.Default,
L("Permission:AI.ApplicationAnalysis"))
.RequireFeatures("Unity.AI.ApplicationAnalysis");

aiPermissionsGroup.AddPermission(
AIPermissions.Default.AttachmentSummary.Default ,
L("Permission:AI.AttachmentSummary"))
.RequireFeatures("Unity.AI.AttachmentSummaries");

aiPermissionsGroup.AddPermission(
AIPermissions.Default.ScoringAssistant.Default,
L("Permission:AI.ScoringAssistant"))
.RequireFeatures("Unity.AI.Scoring");

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting issues in this provider (extra indentation inside Define, stray space before a comma in AttachmentSummary.Default ,, inconsistent alignment) make diffs noisier and can trip style analyzers. Please normalize indentation and whitespace to match other *PermissionDefinitionProvider implementations in the repo.

Suggested change
// AI Permission Group
var aiPermissionsGroup = context.AddGroup(
AIPermissions.GroupName,
L("Permission:AI"));
aiPermissionsGroup.AddPermission(
AIPermissions.Default.Reporting.Default,
L("Permission:AI.Reporting"))
.RequireFeatures("Unity.AIReporting");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.ApplicationAnalysis.Default,
L("Permission:AI.ApplicationAnalysis"))
.RequireFeatures("Unity.AI.ApplicationAnalysis");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.AttachmentSummary.Default ,
L("Permission:AI.AttachmentSummary"))
.RequireFeatures("Unity.AI.AttachmentSummaries");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.ScoringAssistant.Default,
L("Permission:AI.ScoringAssistant"))
.RequireFeatures("Unity.AI.Scoring");
// AI Permission Group
var aiPermissionsGroup = context.AddGroup(
AIPermissions.GroupName,
L("Permission:AI"));
aiPermissionsGroup.AddPermission(
AIPermissions.Default.Reporting.Default,
L("Permission:AI.Reporting"))
.RequireFeatures("Unity.AIReporting");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.ApplicationAnalysis.Default,
L("Permission:AI.ApplicationAnalysis"))
.RequireFeatures("Unity.AI.ApplicationAnalysis");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.AttachmentSummary.Default,
L("Permission:AI.AttachmentSummary"))
.RequireFeatures("Unity.AI.AttachmentSummaries");
aiPermissionsGroup.AddPermission(
AIPermissions.Default.ScoringAssistant.Default,
L("Permission:AI.ScoringAssistant"))
.RequireFeatures("Unity.AI.Scoring");

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@JamesPasta JamesPasta marked this pull request as ready for review March 10, 2026 17:18
@JamesPasta JamesPasta merged commit 3f5a089 into dev Mar 10, 2026
22 checks passed
@JamesPasta JamesPasta deleted the feature/AB#32216-BuildAIBaseModule branch March 13, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants