Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Commit Info #403

Merged
merged 13 commits into from
Aug 30, 2024
Merged

feat: Add Commit Info #403

merged 13 commits into from
Aug 30, 2024

Conversation

davelosert
Copy link
Owner

@davelosert davelosert commented Aug 24, 2024

This PR introduces two things:

  1. Feature-wise, I've added an extraction for the Head-Commit-SHA (for pull requests and workflow runs) or the action SHA (for all other events) to be added to the report for user to be able to easier identify for which commit of a PR the current report is valid
  2. I did a lot of refactoring:
    1. I put all functionality related to finding the current PR-Number into the same location (was previously split out also in the the issue-comment-functions)
    2. I am now using the workflow_run-information directly from the event payload - previously, I was doing an HTTP Request to get the Workflow-Payload (which was unecessary)
    3. I added LOTS of tests, bumping up coverage by orders of magnitude here.
    4. Made this very action generate a comparison report so I see (and also test) this feature regularly
    5. Removed the mock-test-reporting as this is now covered enough by automatic tests

Copy link
Contributor

github-actions bot commented Aug 25, 2024

Coverage Report for Mock Reports (./test/mockReports)

Status Category Percentage Covered / Total
🔵 Lines 41.37% 60 / 145
🔵 Statements 41.33% 62 / 150
🔵 Functions 62.06% 18 / 29
🔵 Branches 39.65% 23 / 58
File CoverageNo changed files found.
Generated in workflow #719 for commit d4bf5f6 by the Vitest Coverage Report Action

Copy link
Contributor

github-actions bot commented Aug 25, 2024

Coverage Report for Root

Status Category Percentage Covered / Total
🔵 Lines 68.89% 474 / 688
🔵 Statements 68.89% 474 / 688
🔵 Functions 85.71% 24 / 28
🔵 Branches 93.63% 103 / 110
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/index.ts 0% 0% 0% 0% 1-6, 10-15, 17, 19-20, 22-23, 25, 27-32, 34-48, 50-55, 57-66, 68, 70-72, 74-91, 93-94, 96-98, 100-101, 103-110, 112-116, 118-124
src/octokit.ts 0% 0% 0% 0% 1-2, 6-9
src/writeSummaryToPR.ts 100% 100% 100% 100%
src/inputs/getCommitSHA.ts 100% 100% 100% 100%
src/inputs/getPullChanges.ts 80.39% 85.71% 100% 80.39% 53-61, 63
src/inputs/getPullRequestNumber.ts 92.06% 90% 100% 92.06% 73-77
src/inputs/options.ts 0% 0% 0% 0% 1-2, 5-9, 23, 25, 27-28, 30-33, 35-38, 40-47, 49, 52-55, 57-59, 61, 63, 65-76
src/inputs/parseCoverageThresholds.ts 100% 100% 100% 100%
src/report/generateCommitSHAUrl.ts 100% 100% 100% 100%
src/report/generateFileCoverageHtml.ts 100% 100% 100% 100%
src/report/generateFileUrl.ts 100% 100% 100% 100%
Unchanged Files
src/icons.ts 100% 100% 100% 100%
src/inputs/FileCoverageMode.ts 100% 100% 100% 100%
src/inputs/getViteConfigPath.ts 97.95% 87.5% 100% 97.95% 47
src/inputs/parseJsonReports.ts 0% 0% 0% 0% 1-4, 8-14, 16-24, 28-29, 32-34, 36-44, 48-52
src/report/generateHeadline.ts 100% 100% 100% 100%
src/report/generateSummaryTableHtml.ts 100% 100% 100% 100%
src/report/getUncoveredLinesFromStatements.ts 100% 100% 100% 100%
Generated in workflow #719 for commit d4bf5f6 by the Vitest Coverage Report Action

Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.89%
⬆️ +18.75%
474 / 688
🔵 Statements 68.89%
⬆️ +18.75%
474 / 688
🔵 Functions 85.71%
⬆️ +5.71%
24 / 28
🔵 Branches 93.63%
⬆️ +1.68%
103 / 110
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/index.ts 0% 0% 0% 0% 1-6, 10-15, 17, 19-20, 22-23, 25, 27-32, 34-48, 50-55, 57-66, 68, 70-72, 74-91, 93-94, 96-98, 100-101, 103-110, 112-116, 118-124
src/octokit.ts 0% 0% 0% 0% 1-2, 6-9
src/writeSummaryToPR.ts 100% 100% 100% 100%
src/inputs/getCommitSHA.ts 100% 100% 100% 100%
src/inputs/getPullChanges.ts 80.39% 85.71% 100% 80.39% 53-61, 63
src/inputs/getPullRequestNumber.ts 92.06% 90% 100% 92.06% 73-77
src/inputs/options.ts 0% 0% 0% 0% 1-2, 5-9, 23, 25, 27-28, 30-33, 35-38, 40-47, 49, 52-55, 57-59, 61, 63, 65-76
src/inputs/parseCoverageThresholds.ts 100% 100% 100% 100%
src/report/generateCommitSHAUrl.ts 100% 100% 100% 100%
src/report/generateFileCoverageHtml.ts 100% 100% 100% 100%
src/report/generateFileUrl.ts 100% 100% 100% 100%
Unchanged Files
src/icons.ts 100% 100% 100% 100%
src/inputs/FileCoverageMode.ts 100% 100% 100% 100%
src/inputs/getViteConfigPath.ts 97.95% 87.5% 100% 97.95% 47
src/inputs/parseJsonReports.ts 0% 0% 0% 0% 1-4, 8-14, 16-24, 28-29, 32-34, 36-44, 48-52
src/report/generateHeadline.ts 100% 100% 100% 100%
src/report/generateSummaryTableHtml.ts 100% 100% 100% 100%
src/report/getUncoveredLinesFromStatements.ts 100% 100% 100% 100%
Generated in workflow #721 for commit b88e89a by the Vitest Coverage Report Action

@davelosert davelosert merged commit 9f92563 into main Aug 30, 2024
5 checks passed
@davelosert davelosert deleted the add-commit-info branch August 30, 2024 18:32
@daves-release-app
Copy link

🎉 This PR is included in version 2.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant