Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Conversation

@DavidJGapCR
Copy link

No description provided.

@github-actions
Copy link

github-actions bot commented Sep 22, 2025

Test Results

284 tests   283 ✅  10s ⏱️
  3 suites    1 💤
  3 files      0 ❌

Results for commit 11e720a.

♻️ This comment has been updated with latest results.

@DavidJGapCR DavidJGapCR force-pushed the ADMINAPI-1297 branch 3 times, most recently from 4739fce to d8cb78c Compare September 22, 2025 21:09
{
[SwaggerSchema(Description = AdminConsoleConstants.TenantIdDescription, Nullable = false)]
public int TenantId { get; set; }
[SwaggerSchema(Description = AdminConsoleConstants.TenantIdDescription, Nullable = false, Format = "{\r\n \"name\": \"Tenant1\",\r\n \"edfiApiDiscoveryUrl\": \"https://api.ed-fi.org/v7.2/api\"\r\n }")]

Choose a reason for hiding this comment

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

Although this is just an example, let's use 7.3 (latest) here instead of 7.2, please.

{
_log.WarnFormat("Tenant {Key} has an invalid connection string for database {ADMIN_DB_KEY}. Database engine is {engine}",
tenantConfig.Key, ADMIN_DB_KEY, _appSettings.AppSettings.DatabaseEngine);
}

Choose a reason for hiding this comment

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

I'm curious about this... why validating this connection string here?

If validating the Admin database, why not validating the Security database as well?


public override async Task StopAsync(CancellationToken cancellationToken)
{
_log.Info("Stopping background");

Choose a reason for hiding this comment

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

What if there are multiple background processes running?

Copy link
Author

Choose a reason for hiding this comment

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

Talked to Juan about this class to confirm we no longer need it. I will remove it.


namespace EdFi.Ods.AdminApi.Infrastructure.Services;

public class TenantBackgroundService : BackgroundService

Choose a reason for hiding this comment

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

This class would benefit from an XML comment describing its purpose.

}
dynamic document = new ExpandoObject();
document.edfiApiDiscoveryUrl = tenantConfig.Value.EdFiApiDiscoveryUrl;
document.name = tenantConfig.Key;

Choose a reason for hiding this comment

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

I wonder if we could have a regular DTO instead of an ExpandoObject here?

What do you think about including part of the connection string in this payload? There are probably only two parameters to return: the server and database.

  • NPGSQL connection string
    • host and port
    • database
  • MSSQL connection string
    • server or alternative form data source
    • database or alternative form initial catalog

@DavidJGapCR
Copy link
Author

TenantBackgroundService.cs and TenantService.cs (and some others) are files that I moved over from the Admin Console project as they were, with no changes. So, yes, probably these files will required some changes. I still need to review them more closely and adapt them to the new requirements.

@DavidJGapCR DavidJGapCR force-pushed the ADMINAPI-1297 branch 2 times, most recently from 9c41859 to ec9b89a Compare September 23, 2025 21:33
@github-actions
Copy link

github-actions bot commented Sep 23, 2025

🔍 Vulnerabilities of development:latest

📦 Image Reference development:latest
digestsha256:f527b7f7d15b7e81adb73a9c9466a35efb6545875eaf850c2c965bc8c1fb161d
vulnerabilitiescritical: 0 high: 0 medium: 1 low: 2
platformlinux/amd64
size94 MB
packages587
📦 Base Image alpine:3
also known as
  • 3.20
  • 3.20.3
  • latest
digestsha256:33735bd63cf84d7e388d9f6d297d348c523c044410f553bd878c6d7829612735
vulnerabilitiescritical: 0 high: 1 medium: 3 low: 2
critical: 0 high: 0 medium: 1 low: 0 xz 5.6.2-r1 (apk)

pkg:apk/alpine/xz@5.6.2-r1?os_name=alpine&os_version=3.20

medium : CVE--2024--47611

Affected range<=5.6.2-r1
Fixed versionNot Fixed
Description
critical: 0 high: 0 medium: 0 low: 2 busybox 1.36.1-r30 (apk)

pkg:apk/alpine/busybox@1.36.1-r30?os_name=alpine&os_version=3.20

low : CVE--2025--46394

Affected range<=1.36.1-r30
Fixed versionNot Fixed
Description

low : CVE--2024--58251

Affected range<=1.36.1-r30
Fixed versionNot Fixed
Description

@DavidJGapCR DavidJGapCR force-pushed the ADMINAPI-1297 branch 8 times, most recently from 2859a02 to 1f1c513 Compare September 30, 2025 18:51
Copy link

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

This PR implements tenant endpoints on V2 API by creating a new tenant management system that replaces the previous AdminConsole-based implementation. The changes remove the AdminConsole functionality entirely and introduce native V2 tenant endpoints for CRUD operations.

  • Removes AdminConsole module and related configurations
  • Implements new V2 tenant endpoints (GET, POST, DELETE) with proper validation
  • Updates Docker configurations and CI workflows to remove AdminConsole dependencies
  • Adds comprehensive unit and integration tests for the new tenant functionality

Reviewed Changes

Copilot reviewed 91 out of 92 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
docs/http/tenants.http New HTTP file demonstrating V2 tenant API usage
Application/EdFi.Ods.AdminApi/Features/Tenants/* New V2 tenant feature implementation with models, endpoints, and validation
Application/EdFi.Ods.AdminApi/Infrastructure/Services/Tenants/* Core tenant service implementation and file-based configuration management
Application/EdFi.Ods.AdminApi/Infrastructure/Database/Commands/* Commands for adding and deleting tenants from configuration
Application/EdFi.Ods.AdminApi.V1/Features/Tenants/* V1 tenant endpoints for backward compatibility
Application/EdFi.Ods.AdminApi.AdminConsole/* Removed entire AdminConsole module
Docker/* Updated Docker configurations to remove AdminConsole references
Application/EdFi.Ods.AdminApi.UnitTests/Features/Tenants/* Comprehensive unit tests for new tenant functionality

Comment on lines 97 to 98
Console.WriteLine("Error");
Console.WriteLine(ex);
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Debug code should not be committed. Remove these Console.WriteLine statements as they appear to be temporary debugging additions.

Suggested change
Console.WriteLine("Error");
Console.WriteLine(ex);

Copilot uses AI. Check for mistakes.
return new TenantsResponse
{
TenantName = t.TenantName,
AdminConnectrionString = new EdfiConnectrionString()
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Property name has typos: 'AdminConnectrionString' should be 'AdminConnectionString'.

Copilot uses AI. Check for mistakes.
host = adminHostAndDatabase.Host,
database = adminHostAndDatabase.Database
},
SecurityConnectrionString = new EdfiConnectrionString()
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Property name has typos: 'SecurityConnectrionString' should be 'SecurityConnectionString'.

Copilot uses AI. Check for mistakes.
return Results.Ok(new TenantsResponse
{
TenantName = tenant.TenantName,
AdminConnectrionString = new EdfiConnectrionString()
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Property name has typos: 'AdminConnectrionString' should be 'AdminConnectionString'.

Copilot uses AI. Check for mistakes.
host = adminHostAndDatabase.Host,
database = adminHostAndDatabase.Database
},
SecurityConnectrionString = new EdfiConnectrionString()
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Property name has typos: 'SecurityConnectrionString' should be 'SecurityConnectionString'.

Copilot uses AI. Check for mistakes.
public EdfiConnectrionString? SecurityConnectrionString { get; set; }
}

public class EdfiConnectrionString
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Class name has typo: 'EdfiConnectrionString' should be 'EdfiConnectionString'.

Copilot uses AI. Check for mistakes.
var response = new TenantsResponse
{
TenantName = defaultTenant.TenantName,
AdminConnectrionString = new EdfiConnectrionString()
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Property name has typos: 'AdminConnectrionString' should be 'AdminConnectionString'.

Copilot uses AI. Check for mistakes.
host = adminHostAndDatabase.Host,
database = adminHostAndDatabase.Database
},
SecurityConnectrionString = new EdfiConnectrionString()
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Property name has typos: 'SecurityConnectrionString' should be 'SecurityConnectionString'.

Copilot uses AI. Check for mistakes.
Comment on lines 64 to 65
public EdfiConnectrionString? AdminConnectrionString { get; set; }
public EdfiConnectrionString? SecurityConnectrionString { get; set; }
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Class and property names have typos: 'EdfiConnectrionString' should be 'EdfiConnectionString', 'AdminConnectrionString' should be 'AdminConnectionString', and 'SecurityConnectrionString' should be 'SecurityConnectionString'.

Copilot uses AI. Check for mistakes.
public EdfiConnectrionString? SecurityConnectrionString { get; set; }
}

public class EdfiConnectrionString
Copy link

Copilot AI Sep 30, 2025

Choose a reason for hiding this comment

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

Class name has typo: 'EdfiConnectrionString' should be 'EdfiConnectionString'.

Copilot uses AI. Check for mistakes.
@DavidJGapCR DavidJGapCR marked this pull request as ready for review October 2, 2025 17:50
@DavidJGapCR DavidJGapCR requested a review from a team as a code owner October 2, 2025 17:50
@DavidJGapCR DavidJGapCR changed the title [ADMINAPI-1297] - DRAFT - Implements Tenant Endpoints on V2 [ADMINAPI-1297] - Implements Tenant Endpoints on V2 Oct 2, 2025
@DavidJGapCR DavidJGapCR merged commit f9a07fc into main Oct 2, 2025
29 checks passed
@DavidJGapCR DavidJGapCR deleted the ADMINAPI-1297 branch October 2, 2025 20:59
var json = _fileProvider.ReadAllText();
try
{
var root = JsonNode.Parse(json) ?? throw new InvalidOperationException("appsettings.json is empty or invalid.");

Choose a reason for hiding this comment

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

@DavidJGapCR please revert this change. We cannot let the application rewrite the settings file.

stephenfuqua added a commit that referenced this pull request Oct 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants