Remove unused subscription histories tables#6454
Open
adamzip wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes unused subscription-update tracking and dependency-flow event persistence from Arcade Services (PCS/Maestro), including the associated EF Core models and database tables, and cleans up call sites that were writing to those tables.
Changes:
- Drop
DependencyFlowEvents,SubscriptionUpdates, andSubscriptionUpdateHistoryvia a new EF Core migration and remove the corresponding EF models/DbSets. - Remove dependency-flow event recording / subscription-update action recording code paths in DependencyFlow.
- Remove the legacy subscriptions history API endpoint and add a small BarViz helper for displaying tracked PR age.
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/ProductConstructionService.DependencyFlow.Tests/Mocks/MockRedisCache.cs | Included in PR file list (appears empty in checkout). |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/SubscriptionTriggerer.cs | Removes dependency-flow event persistence helper and its invocation. |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/SubscriptionEventRecorder.cs | Removes event/action recording responsibilities and related dependencies. |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdaters/PullRequestUpdater.cs | Removes calls that recorded dependency-flow events and subscription update actions. |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdaters/DependencyPullRequestUpdater.cs | Removes calls that recorded dependency-flow events and subscription update actions. |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdaters/CodeFlowPullRequestUpdater.cs | Removes calls that recorded subscription update actions / dependency-flow events. |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/Model/SubscriptionUpdateAction.cs | Deletes unused enum. |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/Model/DependencyFlowEvent.cs | Deletes unused enums used for event tracking. |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/ISubscriptionTriggerer.cs | Removes AddDependencyFlowEventAsync from the interface. |
| src/ProductConstructionService/ProductConstructionService.BarViz/Code/Helpers/TrackedPullRequestHelper.cs | Adds helper to compute/display PR age. |
| src/ProductConstructionService/ProductConstructionService.Api/appsettings.Development.json | Changes ApiRedirect dev config (now points at maestro). |
| src/ProductConstructionService/ProductConstructionService.Api/Api/v2018_07_16/Models/SubscriptionHistoryItem.cs | Removes model tied to subscription history endpoint. |
| src/ProductConstructionService/ProductConstructionService.Api/Api/v2018_07_16/Controllers/SubscriptionsController.cs | Removes /subscriptions/{id}/history endpoint and related pagination usage. |
| src/Maestro/Maestro.DataProviders/SqlBarClient.cs | Removes RegisterSubscriptionUpdate and cleanup logic for SubscriptionUpdates. |
| src/Maestro/Maestro.DataProviders/ISqlBarClient.cs | Removes RegisterSubscriptionUpdate contract. |
| src/Maestro/Maestro.DataProviders/ConfigurationIngestion/ConfigurationIngestor.cs | Removes deletion cleanup against SubscriptionUpdates. |
| src/Maestro/Maestro.Data/Models/SubscriptionUpdateHistory.cs | Removes EF model. |
| src/Maestro/Maestro.Data/Models/SubscriptionUpdate.cs | Removes EF model. |
| src/Maestro/Maestro.Data/Models/DependencyFlow.cs | Removes EF model for dependency-flow events. |
| src/Maestro/Maestro.Data/Migrations/BuildAssetRegistryContextModelSnapshot.cs | Updates snapshot to remove dropped entities/tables. |
| src/Maestro/Maestro.Data/Migrations/20260615134416_RemoveDependencyFlowEventsAndSubscriptionUpdates.Designer.cs | Adds generated migration designer for dropping tables. |
| src/Maestro/Maestro.Data/Migrations/20260615134416_RemoveDependencyFlowEventsAndSubscriptionUpdates.cs | Adds migration to drop DependencyFlowEvents and temporal subscription update tables. |
| src/Maestro/Maestro.Data/BuildAssetRegistryContext.cs | Removes DbSets and temporal-query helper types tied to subscription update history. |
Files not reviewed (1)
- src/Maestro/Maestro.Data/Migrations/20260615134416_RemoveDependencyFlowEventsAndSubscriptionUpdates.Designer.cs: Generated file
Comment on lines
30
to
32
| "ApiRedirect": { | ||
| // "Uri": "https://maestro.dot.net/" | ||
| "Uri": "https://maestro.dot.net/" | ||
| }, |
Comment on lines
16
to
19
| /// <summary> | ||
| /// | ||
| /// Exposes methods to Read <see cref="Subscription"/>s | ||
| /// </summary> |
Comment on lines
257
to
260
|
|
||
| return Accepted(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets a paginated list of the Subscription history for the given Subscription | ||
| /// </summary> | ||
| /// <param name="id">The id of the <see cref="Subscription"/> to get history for</param> | ||
| [HttpGet("{id}/history")] | ||
| [SwaggerApiResponse(HttpStatusCode.OK, Type = typeof(List<SubscriptionHistoryItem>), Description = "The list of Subscription history")] | ||
| [Paginated(typeof(SubscriptionHistoryItem))] | ||
| public virtual async Task<IActionResult> GetSubscriptionHistory(Guid id) | ||
| { | ||
| Maestro.Data.Models.Subscription? subscription = await _context.Subscriptions.Where(sub => sub.Id == id) | ||
| .FirstOrDefaultAsync(); | ||
|
|
||
| if (subscription == null) | ||
| { | ||
| return NotFound(); | ||
| } | ||
|
|
||
| IOrderedQueryable<SubscriptionUpdateHistoryEntry> query = _context.SubscriptionUpdateHistory | ||
| .Where(u => u.SubscriptionId == id) | ||
| .OrderByDescending(u => u.Timestamp); | ||
|
|
||
| return Ok(query); | ||
| } | ||
| } |
dkurepa
reviewed
Jun 29, 2026
| @@ -0,0 +1,125 @@ | |||
| // Licensed to the .NET Foundation under one or more agreements. | |||
Member
There was a problem hiding this comment.
We should prob have only one migration, not two
dkurepa
reviewed
Jun 29, 2026
| }, | ||
| "ApiRedirect": { | ||
| // "Uri": "https://maestro.dot.net/" | ||
| "Uri": "https://maestro.dot.net/" |
Member
There was a problem hiding this comment.
guess this was for testing? we should revert it
dkurepa
reviewed
Jun 29, 2026
| @@ -0,0 +1,20 @@ | |||
| // Licensed to the .NET Foundation under one or more agreements. | |||
dkurepa
reviewed
Jun 29, 2026
| Dictionary<UnixPath, TargetRepoDirectoryDependencyUpdates> repoDependencyUpdates = []; | ||
|
|
||
| // Get subscription to access excluded assets | ||
| // Get subscription to access excluded assets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#6191