Skip to content

Implement crude new codeflow page, create mock data for it#5992

Open
dkurepa wants to merge 4 commits intodotnet:mainfrom
dkurepa:dkurepa/CodeflowPage
Open

Implement crude new codeflow page, create mock data for it#5992
dkurepa wants to merge 4 commits intodotnet:mainfrom
dkurepa:dkurepa/CodeflowPage

Conversation

@dkurepa
Copy link
Member

@dkurepa dkurepa commented Feb 19, 2026

The page currently looks like this
image
it's a crude look but it displays all info we want it to (except a link to the newest applicable build)
All further improvements will be made as a part of a different issue

Copilot AI review requested due to automatic review settings February 19, 2026 16:34
Copy link
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

Adds a new (work-in-progress) Codeflows page to the BarViz UI that renders a richer “codeflow row” view using locally-defined mock data, enabling iteration on layout/fields before wiring it to PCS.

Changes:

  • Introduces a new routable Razor page (/codeflows1) that displays codeflow subscription rows with backflow/forward-flow details.
  • Adds a mock-data generator (MockCodeflowData) to populate the new page.
  • Extends BarViz model types to represent the new page’s row/subscription/PR shapes.

Reviewed changes

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

File Description
src/ProductConstructionService/ProductConstructionService.BarViz/Pages/Codeflows1.razor New “Codeflows1” page rendering a Fluent UI data grid for codeflow rows (currently using mock data).
src/ProductConstructionService/ProductConstructionService.BarViz/Model/MockCodeflowData.cs New helper to generate mock CodeflowPage/subscription/build/PR data for the new page.
src/ProductConstructionService/ProductConstructionService.BarViz/Model/CodeflowSubscription.cs Adds new record types (CodeflowPage, CodeflowSubscriptionPageEntry, etc.) to support the new page model.

Comment on lines +49 to +53
<!--<Header>
<FluentSelect TOption="DefaultChannel"
Items="@DefaultChannels"
OptionValue="@(channel => channel.Branch)"
OptionSelected="@(c => c.Id == DefaultChannel?.Id)"
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The <Header> section is commented out with an HTML comment (<!-- ... -->), but Razor still parses @... expressions inside HTML comments. Since DefaultChannels/DefaultChannel/OnDefaultChannelSelected aren’t defined in this component, this will fail to compile. Use a Razor comment (@* ... *@) or remove the block.

Copilot uses AI. Check for mistakes.

<PageTitle>Codeflows – Maestro++</PageTitle>

<GridViewTemplate Title="Codeflows1234" ShowSkeleton="CodeFlows == null">
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

GridViewTemplate title is set to "Codeflows1234", which looks like placeholder/test text and will show up in the UI header. Rename it to the intended user-facing title (e.g., "Codeflows") to avoid shipping debug wording.

Suggested change
<GridViewTemplate Title="Codeflows1234" ShowSkeleton="CodeFlows == null">
<GridViewTemplate Title="Codeflows" ShowSkeleton="CodeFlows == null">

Copilot uses AI. Check for mistakes.
Comment on lines 34 to 36
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

ActivePr.CreatedDate is modeled as DateTime (no offset/kind), but the UI computes age using DateTime.UtcNow - pr.CreatedDate. This can produce incorrect ages if the value is local/unspecified. Prefer DateTimeOffset (or at least ensure UTC kind) for timestamps coming from APIs and for time-difference calculations.

Copilot uses AI. Check for mistakes.
Comment on lines 18 to 20
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

CodeflowPage exposes List<...> via a singularly-named property CodeflowRow, but it actually contains multiple rows/entries. Renaming to a plural (e.g., CodeflowRows/Rows) would make the API clearer and align with the data shape.

Copilot generated this review using guidance from repository custom instructions.
Channel = new Channel(id: Random.Shared.Next(100, 999), channelName, "none"),
LastAppliedBuild = new Build(
id: Random.Shared.Next(10000, 99999),
dateProduced: DateTimeOffset.UtcNow.AddMinutes(-Random.Shared.Next(1, 14 * 24 * 60)),
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

CreateSubscription takes a parameter named lastAppliedBuildDaysAgo, but it’s only used for Build.staleness while dateProduced is randomized independently. Either derive dateProduced from this parameter (e.g., UtcNow.AddDays(-lastAppliedBuildDaysAgo)) or rename the parameter to reflect what it actually controls so the mock data stays consistent/understandable.

Suggested change
dateProduced: DateTimeOffset.UtcNow.AddMinutes(-Random.Shared.Next(1, 14 * 24 * 60)),
dateProduced: DateTimeOffset.UtcNow.AddDays(-lastAppliedBuildDaysAgo),

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +95
ActivePullRequest: new ActivePullRequest(
CreatedDate: new DateTime(2026, 2, 18, 14, 0, 0),
Url: "https://github.com/dotnet/runtime/pull/112345")),
BackflowSubscription: new SubscriptionDetail(
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

These mock PR timestamps are created as new DateTime(...) (kind = Unspecified). Since the UI compares against DateTime.UtcNow, set the kind to UTC (or switch the model to DateTimeOffset) to avoid incorrect age calculations.

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +116
ActivePullRequest: new ActivePullRequest(
CreatedDate: new DateTime(2026, 2, 17, 9, 15, 0),
Url: "https://github.com/dotnet/dotnet/pull/54321"))),
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This mock PR timestamp is created as new DateTime(...) (kind = Unspecified). Since the UI compares against DateTime.UtcNow, set the kind to UTC (or switch the model to DateTimeOffset) to avoid incorrect age calculations.

Copilot uses AI. Check for mistakes.
Comment on lines +149 to +152
protected override void OnInitialized()
{
var mockData = MockCodeflowData.GetMockCodeflowPage();
CodeFlows = mockData.Entries
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This is a routable page (@page "/codeflows1") but it always renders mock data (MockCodeflowData.GetMockCodeflowPage()). If BarViz is deployed, this can mislead users. Consider gating it to development-only (or adding a clear “mock data” banner / feature flag) until it’s wired to real PCS data.

Copilot uses AI. Check for mistakes.
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.

1 participant

Comments