Skip to content

Commit b3f99ca

Browse files
authored
Merge branch 'Azure:main' into mcp
2 parents 0122b98 + 4900760 commit b3f99ca

File tree

126 files changed

+7942
-2235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+7942
-2235
lines changed

.eslintrc.json

Lines changed: 0 additions & 95 deletions
This file was deleted.

.github/workflows/pr-coverage.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ jobs:
8989
**/types.ts
9090
**/types.tsx
9191
**/styles.ts
92+
**/styles.tsx
93+
**/*.styles.ts
94+
**/*.styles.tsx
9295
**/constants.ts
9396
**/constants/**
9497
# Config files
@@ -128,6 +131,8 @@ jobs:
128131
**/*Provider.ts
129132
**/*Provider.tsx
130133
**/providers/**
134+
# VS Code webview communication (uses acquireVsCodeApi runtime global, cannot be unit tested)
135+
**/webviewCommunication.tsx
131136
132137
- name: Check coverage on changed files
133138
id: coverage-check
@@ -141,6 +146,7 @@ jobs:
141146
if [ -z "$CHANGED_FILES" ]; then
142147
echo "No source files changed in this PR." >> $GITHUB_STEP_SUMMARY
143148
echo "coverage_status=skip" >> $GITHUB_OUTPUT
149+
printf '%s\n\n%s\n' "## 📊 Coverage Check" "No source files changed in this PR." > ./coverage-comment.md
144150
exit 0
145151
fi
146152
@@ -161,6 +167,7 @@ jobs:
161167
echo "" >> $GITHUB_STEP_SUMMARY
162168
echo "❌ **No coverage data found.** Please ensure tests generate coverage reports." >> $GITHUB_STEP_SUMMARY
163169
echo "coverage_status=no_data" >> $GITHUB_OUTPUT
170+
printf '%s\n\n%s\n' "## 📊 Coverage Check" "⚠️ No coverage data found. Please ensure tests generate coverage reports." > ./coverage-comment.md
164171
exit 0
165172
fi
166173
fi
@@ -265,6 +272,27 @@ jobs:
265272
echo "coverage_status=pass" >> $GITHUB_OUTPUT
266273
fi
267274
275+
# Build a concise PR comment with failing files
276+
{
277+
echo "## 📊 Coverage Check"
278+
echo ""
279+
if [ -n "$UNCOVERED_FILES" ] || [ -n "$PARTIAL_FILES" ]; then
280+
echo "The following changed files need attention:"
281+
echo ""
282+
if [ -n "$UNCOVERED_FILES" ]; then
283+
echo -e "$UNCOVERED_FILES"
284+
echo ""
285+
fi
286+
if [ -n "$PARTIAL_FILES" ]; then
287+
echo -e "$PARTIAL_FILES"
288+
echo ""
289+
fi
290+
echo "**Please add tests for the uncovered files before merging.**"
291+
else
292+
echo "🎉 **All changed files have adequate test coverage!**"
293+
fi
294+
} > ./coverage-comment.md
295+
268296
- name: Post coverage comment on PR
269297
if: always()
270298
uses: actions/github-script@v7
@@ -281,17 +309,18 @@ jobs:
281309
return;
282310
}
283311
284-
// Read the step summary
285-
const summaryPath = process.env.GITHUB_STEP_SUMMARY;
312+
const COMMENT_MARKER = '<!-- pr-coverage-check-comment -->';
313+
314+
// Read the coverage comment built by the coverage-check step
286315
let summary = '';
287316
try {
288-
summary = fs.readFileSync(summaryPath, 'utf8');
317+
summary = fs.readFileSync('./coverage-comment.md', 'utf8');
289318
} catch (e) {
290319
summary = '📊 Coverage check completed. See workflow run for details.';
291320
}
292321
293322
try {
294-
// Find existing comment
323+
// Find existing comment by hidden marker
295324
const { data: comments } = await github.rest.issues.listComments({
296325
owner: context.repo.owner,
297326
repo: context.repo.repo,
@@ -300,10 +329,10 @@ jobs:
300329
301330
const botComment = comments.find(comment =>
302331
comment.user.type === 'Bot' &&
303-
comment.body.includes('📊 Coverage Report for Changed Files')
332+
comment.body.includes(COMMENT_MARKER)
304333
);
305334
306-
const commentBody = summary || '📊 Coverage check completed. See workflow run for details.';
335+
const commentBody = COMMENT_MARKER + '\n' + (summary || '📊 Coverage check completed. See workflow run for details.');
307336
308337
if (botComment) {
309338
await github.rest.issues.updateComment({

0 commit comments

Comments
 (0)