Skip to content

Commit a60bb03

Browse files
committed
artifacts
1 parent 8d3b8d7 commit a60bb03

12 files changed

Lines changed: 154 additions & 150 deletions

File tree

.codex/skills/dotnet-cloc/references/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Goal: Track code size over time in CI.
109109
echo "Total lines: $(jq '.SUM.code' cloc-report.json)"
110110
111111
- name: Upload metrics artifact
112-
uses: actions/upload-artifact@v4
112+
uses: actions/upload-artifact@v7
113113
with:
114114
name: code-metrics
115115
path: cloc-report.json

.codex/skills/dotnet-codeql/references/workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Automatic with `github/codeql-action/analyze`:
242242

243243
```yaml
244244
- name: Upload SARIF as artifact
245-
uses: actions/upload-artifact@v4
245+
uses: actions/upload-artifact@v7
246246
with:
247247
name: sarif-results
248248
path: sarif-results

.codex/skills/dotnet-quality-ci/references/workflows.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
-reporttypes:"HtmlSummary;Cobertura;MarkdownSummaryGithub"
8989
9090
- name: Upload coverage report
91-
uses: actions/upload-artifact@v4
91+
uses: actions/upload-artifact@v7
9292
with:
9393
name: coverage-report
9494
path: coverage/report
@@ -228,7 +228,7 @@ jobs:
228228
-reporttypes:"HtmlSummary;Cobertura"
229229
230230
- name: Upload coverage
231-
uses: actions/upload-artifact@v4
231+
uses: actions/upload-artifact@v7
232232
with:
233233
name: coverage
234234
path: coverage/report
@@ -346,7 +346,7 @@ jobs:
346346
working-directory: ./tests/MyProject.Tests
347347

348348
- name: Upload mutation report
349-
uses: actions/upload-artifact@v4
349+
uses: actions/upload-artifact@v7
350350
with:
351351
name: stryker-report
352352
path: '**/StrykerOutput/**'
@@ -424,7 +424,7 @@ jobs:
424424
--severity=WARNING
425425
426426
- name: Upload inspection report
427-
uses: actions/upload-artifact@v4
427+
uses: actions/upload-artifact@v7
428428
with:
429429
name: inspectcode-report
430430
path: inspectcode-report.xml

.codex/skills/dotnet-stryker/references/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ dotnet stryker --since --since-target main
209209
continue-on-error: true
210210

211211
- name: Upload Mutation Report
212-
uses: actions/upload-artifact@v4
212+
uses: actions/upload-artifact@v7
213213
with:
214214
name: mutation-report
215215
path: StrykerOutput/

.github/workflows/deploy-github-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124

125125
- name: Upload Playwright artifacts
126126
if: always()
127-
uses: actions/upload-artifact@v4
127+
uses: actions/upload-artifact@v7
128128
with:
129129
name: playwright-artifacts-release-pipeline
130130
path: output/playwright/

.github/workflows/pr-validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110

111111
- name: Upload Playwright artifacts
112112
if: always()
113-
uses: actions/upload-artifact@v4
113+
uses: actions/upload-artifact@v7
114114
with:
115115
name: playwright-artifacts-pr-validation
116116
path: output/playwright/

src/PrompterOne.Shared/Editor/Components/EditorMetadataRail.razor

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,43 +50,8 @@
5050

5151
@if (SplitFeedback is not null)
5252
{
53-
<div class="ed-sidebar-note ed-sidebar-note-split ed-meta-split-feedback" data-testid="@UiTestIds.Editor.SplitStatus">
54-
<div class="ed-sidebar-note-head">
55-
<div>
56-
<div class="ed-sidebar-note-kicker" data-testid="@UiTestIds.Editor.SplitResultTitle">@SplitFeedback.Title</div>
57-
<div class="ed-sidebar-note-summary" data-testid="@UiTestIds.Editor.SplitResultSummary">@SplitFeedback.Summary</div>
58-
</div>
59-
<span class="ed-sidebar-note-badge" data-testid="@UiTestIds.Editor.SplitResultBadge">@SplitFeedback.HeadingBadge</span>
60-
</div>
61-
62-
<p class="ed-sidebar-note-copy" data-testid="@UiTestIds.Editor.SplitResultLibrary">@SplitFeedback.DestinationNote</p>
63-
<p class="ed-sidebar-note-copy ed-sidebar-note-copy-muted" data-testid="@UiTestIds.Editor.SplitResultCurrentDraft">@SplitFeedback.DraftNote</p>
64-
65-
@if (SplitFeedback.CreatedTitles.Count > 0)
66-
{
67-
<div class="ed-sidebar-note-list" data-testid="@UiTestIds.Editor.SplitResultList">
68-
@for (var index = 0; index < SplitFeedback.CreatedTitles.Count; index++)
69-
{
70-
<div class="ed-sidebar-note-item" data-testid="@UiTestIds.Editor.SplitResultItem(index)">
71-
<span class="ed-sidebar-note-item-index">@($"{index + 1:00}")</span>
72-
<span class="ed-sidebar-note-item-title">@SplitFeedback.CreatedTitles[index]</span>
73-
</div>
74-
}
75-
</div>
76-
}
77-
78-
@if (SplitFeedback.AdditionalCount > 0)
79-
{
80-
<div class="ed-sidebar-note-more" data-testid="@UiTestIds.Editor.SplitResultMore">@Format(UiTextKey.EditorSplitMoreInLibraryFormat, SplitFeedback.AdditionalCount)</div>
81-
}
82-
83-
<button class="ed-sidebar-note-link"
84-
data-testid="@UiTestIds.Editor.SplitResultOpenLibrary"
85-
type="button"
86-
@onclick="() => OpenLibraryRequested.InvokeAsync()">
87-
@SplitFeedback.OpenLibraryLabel
88-
</button>
89-
</div>
53+
<EditorSplitFeedbackCard Feedback="@SplitFeedback"
54+
OpenLibraryRequested="OpenLibraryRequested" />
9055
}
9156

9257
<div class="ed-meta-field">
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
@namespace PrompterOne.Shared.Components.Editor
2+
@using Microsoft.Extensions.Localization
3+
@using PrompterOne.Shared.Contracts
4+
@using PrompterOne.Shared.Localization
5+
@inject IStringLocalizer<SharedResource> Localizer
6+
7+
<div class="ed-sidebar-note ed-sidebar-note-split ed-meta-split-feedback" data-testid="@UiTestIds.Editor.SplitStatus">
8+
<div class="ed-sidebar-note-head">
9+
<div>
10+
<div class="ed-sidebar-note-kicker" data-testid="@UiTestIds.Editor.SplitResultTitle">@Feedback.Title</div>
11+
<div class="ed-sidebar-note-summary" data-testid="@UiTestIds.Editor.SplitResultSummary">@Feedback.Summary</div>
12+
</div>
13+
<span class="ed-sidebar-note-badge" data-testid="@UiTestIds.Editor.SplitResultBadge">@Feedback.HeadingBadge</span>
14+
</div>
15+
16+
<p class="ed-sidebar-note-copy" data-testid="@UiTestIds.Editor.SplitResultLibrary">@Feedback.DestinationNote</p>
17+
<p class="ed-sidebar-note-copy ed-sidebar-note-copy-muted" data-testid="@UiTestIds.Editor.SplitResultCurrentDraft">@Feedback.DraftNote</p>
18+
19+
@if (Feedback.CreatedTitles.Count > 0)
20+
{
21+
<div class="ed-sidebar-note-list" data-testid="@UiTestIds.Editor.SplitResultList">
22+
@for (var index = 0; index < Feedback.CreatedTitles.Count; index++)
23+
{
24+
<div class="ed-sidebar-note-item" data-testid="@UiTestIds.Editor.SplitResultItem(index)">
25+
<span class="ed-sidebar-note-item-index">@($"{index + 1:00}")</span>
26+
<span class="ed-sidebar-note-item-title">@Feedback.CreatedTitles[index]</span>
27+
</div>
28+
}
29+
</div>
30+
}
31+
32+
@if (Feedback.AdditionalCount > 0)
33+
{
34+
<div class="ed-sidebar-note-more" data-testid="@UiTestIds.Editor.SplitResultMore">@Format(UiTextKey.EditorSplitMoreInLibraryFormat, Feedback.AdditionalCount)</div>
35+
}
36+
37+
<button class="ed-sidebar-note-link"
38+
data-testid="@UiTestIds.Editor.SplitResultOpenLibrary"
39+
type="button"
40+
@onclick="() => OpenLibraryRequested.InvokeAsync()">
41+
@Feedback.OpenLibraryLabel
42+
</button>
43+
</div>
44+
45+
@code {
46+
[Parameter, EditorRequired] public EditorSplitFeedbackViewModel Feedback { get; set; } = null!;
47+
48+
[Parameter] public EventCallback OpenLibraryRequested { get; set; }
49+
50+
private string Format(UiTextKey key, params object[] args) => Localizer[key.ToString(), args];
51+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
namespace PrompterOne.Testing.Editor;
2+
3+
public static class EditorSplitFeedbackTestData
4+
{
5+
public const int MetadataRailAdditionalCount = 2;
6+
public const int PostAutosaveObservationDelayMs = 1_700;
7+
public const string EpisodeOneCardId = "untitled-script-split-01-episode-1-how-to-think-about-systems";
8+
public const string EpisodeOneTitle = "Episode 1 - How to Think About Systems";
9+
public const string EpisodeThreeTitle = "Episode 3 - Event Sourcing and CQRS";
10+
public const string EpisodeTwoCardId = "untitled-script-split-02-episode-2-how-systems-talk-to-each-other";
11+
public const string EpisodeTwoTitle = "Episode 2 - How Systems Talk to Each Other";
12+
public const string SplitActionLabel = "Open in Library";
13+
public const string SplitFeedbackBadge = "From ##";
14+
public const string SplitFeedbackDestination = "New scripts were saved to the library.";
15+
public const string SplitFeedbackDraftNote = "The current draft stayed open.";
16+
public const string SplitFeedbackSummary = "2 new scripts created.";
17+
public const string SplitFeedbackTitle = "Split complete";
18+
public const string SplitSegmentActionLabel = "New scripts from ## headings";
19+
public const string SplitSource =
20+
"""
21+
## [Episode 1 - How to Think About Systems|140WPM|Professional]
22+
Before you write code, / you need to think about the system. //
23+
24+
## [Episode 2 - How Systems Talk to Each Other|140WPM|Professional]
25+
APIs, events, and retries matter. //
26+
""";
27+
28+
public const string EditedSplitSource =
29+
"""
30+
## [Episode 1 - How to Think About Systems|140WPM|Professional]
31+
Before you write code, / you need to think about the system. //
32+
33+
## [Episode 2 - How Systems Talk to Each Other|140WPM|Professional]
34+
APIs, events, and retries matter. //
35+
36+
Notes: keep the current draft open while reviewing the split.
37+
""";
38+
39+
public static IReadOnlyList<string> MetadataRailCreatedTitles { get; } =
40+
[
41+
EpisodeOneTitle,
42+
EpisodeTwoTitle,
43+
EpisodeThreeTitle
44+
];
45+
}

tests/PrompterOne.Web.Tests/Editor/EditorMetadataRailTests.cs

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,15 @@
33
using PrompterOne.Shared.Components.Editor;
44
using PrompterOne.Shared.Contracts;
55
using PrompterOne.Shared.Tests;
6+
using PrompterOne.Testing.Editor;
67

78
namespace PrompterOne.Web.Tests;
89

910
public sealed class EditorMetadataRailTests : BunitContext
1011
{
11-
private const string SplitActionLabel = "Open in Library";
12-
private const string SplitFeedbackBadge = "From ##";
13-
private const string SplitFeedbackDestination = "New scripts were saved to the library.";
14-
private const string SplitFeedbackDraftNote = "The current draft stayed open.";
15-
private const string SplitFeedbackSummary = "2 new scripts created.";
16-
private const string SplitFeedbackTitle = "Split complete";
1712
private const string SplitHint = "Create separate scripts from headings in the current draft.";
1813
private const string SplitSection = "Split Into New Scripts";
1914
private const string SplitTopLevelLabel = "New scripts from # headings";
20-
private const string SplitSegmentLabel = "New scripts from ## headings";
21-
private const string CreatedEpisodeOne = "Episode 1 - How to Think About Systems";
22-
private const string CreatedEpisodeTwo = "Episode 2 - How Systems Talk to Each Other";
23-
private const string CreatedEpisodeThree = "Episode 3 - Event Sourcing and CQRS";
2415

2516
public EditorMetadataRailTests()
2617
{
@@ -44,7 +35,7 @@ public void EditorMetadataRail_SplitActionsInvokeExpectedModes_AndRenderSplitFee
4435
Assert.Contains(SplitSection, cut.Markup, StringComparison.Ordinal);
4536
Assert.Equal(SplitHint, cut.Find($".ed-meta-action-note").TextContent.Trim());
4637
Assert.Equal(SplitTopLevelLabel, cut.FindByTestId(UiTestIds.Editor.SplitTopLevel).TextContent.Trim());
47-
Assert.Equal(SplitSegmentLabel, cut.FindByTestId(UiTestIds.Editor.SplitSegment).TextContent.Trim());
38+
Assert.Equal(EditorSplitFeedbackTestData.SplitSegmentActionLabel, cut.FindByTestId(UiTestIds.Editor.SplitSegment).TextContent.Trim());
4839

4940
cut.FindByTestId(UiTestIds.Editor.SplitTopLevel).Click();
5041
cut.FindByTestId(UiTestIds.Editor.SplitSegment).Click();
@@ -54,31 +45,26 @@ public void EditorMetadataRail_SplitActionsInvokeExpectedModes_AndRenderSplitFee
5445
[TpsDocumentSplitMode.TopLevelHeading, TpsDocumentSplitMode.SegmentHeading],
5546
requestedModes);
5647
Assert.Equal(1, openLibraryRequests);
57-
Assert.Equal(SplitFeedbackTitle, cut.FindByTestId(UiTestIds.Editor.SplitResultTitle).TextContent.Trim());
58-
Assert.Equal(SplitFeedbackSummary, cut.FindByTestId(UiTestIds.Editor.SplitResultSummary).TextContent.Trim());
59-
Assert.Equal(SplitFeedbackBadge, cut.FindByTestId(UiTestIds.Editor.SplitResultBadge).TextContent.Trim());
60-
Assert.Equal(SplitFeedbackDestination, cut.FindByTestId(UiTestIds.Editor.SplitResultLibrary).TextContent.Trim());
61-
Assert.Equal(SplitFeedbackDraftNote, cut.FindByTestId(UiTestIds.Editor.SplitResultCurrentDraft).TextContent.Trim());
62-
Assert.Equal(CreatedEpisodeOne, cut.FindByTestId(UiTestIds.Editor.SplitResultItem(0)).TextContent.Trim().Replace("01", string.Empty).Trim());
63-
Assert.Equal(CreatedEpisodeTwo, cut.FindByTestId(UiTestIds.Editor.SplitResultItem(1)).TextContent.Trim().Replace("02", string.Empty).Trim());
64-
Assert.Equal(CreatedEpisodeThree, cut.FindByTestId(UiTestIds.Editor.SplitResultItem(2)).TextContent.Trim().Replace("03", string.Empty).Trim());
48+
Assert.Equal(EditorSplitFeedbackTestData.SplitFeedbackTitle, cut.FindByTestId(UiTestIds.Editor.SplitResultTitle).TextContent.Trim());
49+
Assert.Equal(EditorSplitFeedbackTestData.SplitFeedbackSummary, cut.FindByTestId(UiTestIds.Editor.SplitResultSummary).TextContent.Trim());
50+
Assert.Equal(EditorSplitFeedbackTestData.SplitFeedbackBadge, cut.FindByTestId(UiTestIds.Editor.SplitResultBadge).TextContent.Trim());
51+
Assert.Equal(EditorSplitFeedbackTestData.SplitFeedbackDestination, cut.FindByTestId(UiTestIds.Editor.SplitResultLibrary).TextContent.Trim());
52+
Assert.Equal(EditorSplitFeedbackTestData.SplitFeedbackDraftNote, cut.FindByTestId(UiTestIds.Editor.SplitResultCurrentDraft).TextContent.Trim());
53+
Assert.Equal(EditorSplitFeedbackTestData.EpisodeOneTitle, cut.FindByTestId(UiTestIds.Editor.SplitResultItem(0)).TextContent.Trim().Replace("01", string.Empty).Trim());
54+
Assert.Equal(EditorSplitFeedbackTestData.EpisodeTwoTitle, cut.FindByTestId(UiTestIds.Editor.SplitResultItem(1)).TextContent.Trim().Replace("02", string.Empty).Trim());
55+
Assert.Equal(EditorSplitFeedbackTestData.EpisodeThreeTitle, cut.FindByTestId(UiTestIds.Editor.SplitResultItem(2)).TextContent.Trim().Replace("03", string.Empty).Trim());
6556
Assert.Equal("+2 more in Library", cut.FindByTestId(UiTestIds.Editor.SplitResultMore).TextContent.Trim());
66-
Assert.Equal(SplitActionLabel, cut.FindByTestId(UiTestIds.Editor.SplitResultOpenLibrary).TextContent.Trim());
57+
Assert.Equal(EditorSplitFeedbackTestData.SplitActionLabel, cut.FindByTestId(UiTestIds.Editor.SplitResultOpenLibrary).TextContent.Trim());
6758
}
6859

6960
private static EditorSplitFeedbackViewModel BuildSplitFeedback() =>
7061
new(
71-
Title: SplitFeedbackTitle,
72-
Summary: SplitFeedbackSummary,
73-
HeadingBadge: SplitFeedbackBadge,
74-
DestinationNote: SplitFeedbackDestination,
75-
DraftNote: SplitFeedbackDraftNote,
76-
OpenLibraryLabel: SplitActionLabel,
77-
CreatedTitles:
78-
[
79-
CreatedEpisodeOne,
80-
CreatedEpisodeTwo,
81-
CreatedEpisodeThree
82-
],
83-
AdditionalCount: 2);
62+
Title: EditorSplitFeedbackTestData.SplitFeedbackTitle,
63+
Summary: EditorSplitFeedbackTestData.SplitFeedbackSummary,
64+
HeadingBadge: EditorSplitFeedbackTestData.SplitFeedbackBadge,
65+
DestinationNote: EditorSplitFeedbackTestData.SplitFeedbackDestination,
66+
DraftNote: EditorSplitFeedbackTestData.SplitFeedbackDraftNote,
67+
OpenLibraryLabel: EditorSplitFeedbackTestData.SplitActionLabel,
68+
CreatedTitles: EditorSplitFeedbackTestData.MetadataRailCreatedTitles,
69+
AdditionalCount: EditorSplitFeedbackTestData.MetadataRailAdditionalCount);
8470
}

0 commit comments

Comments
 (0)