Skip to content

fix(scripts): add CI annotations and step summary to copyright header check#638

Merged
WilliamBerryiii merged 5 commits intomainfrom
fix/630-copyright-header-ci-annotations
Feb 17, 2026
Merged

fix(scripts): add CI annotations and step summary to copyright header check#638
WilliamBerryiii merged 5 commits intomainfrom
fix/630-copyright-header-ci-annotations

Conversation

@WilliamBerryiii
Copy link
Member

Added per-file Write-CIAnnotation calls and a Write-CIStepSummary block to Test-CopyrightHeaders.ps1, aligning its GitHub Actions output with the existing pattern in Invoke-PSScriptAnalyzer.ps1. Added 9 Pester tests covering the new CI output behavior.

Description

  • Emitted Write-CIAnnotation per failing file with missing header type details, warning level, file path, and line number.
  • Appended a Write-CIStepSummary markdown block with a pass/fail status, compliance metrics table, and per-file failure details.
  • Added 9 Pester tests across two Describe blocks (CI Annotations and Step Summary) validating annotation invocation counts, parameter filters, and summary content.

Related Issue(s)

Fixes #630

Type of Change

Select all that apply:

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with prompt-builder agent and addressed all feedback
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Testing

  • All 24 Pester tests pass, including 9 new tests covering CI annotation and step summary output.
  • PSScriptAnalyzer reports zero warnings with project settings (scripts/linting/PSScriptAnalyzer.psd1).

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)
  • Tests added for new functionality (if applicable)

Required Automated Checks

The following validation commands must pass before merging:

  • Markdown linting: npm run lint:md
  • Spell checking: npm run spell-check
  • Frontmatter validation: npm run lint:frontmatter
  • Link validation: npm run lint:md-links
  • PowerShell analysis: npm run lint:ps

Security Considerations

  • This PR does not contain any sensitive or NDA information
  • Any new dependencies have been reviewed for security issues
  • Security-related scripts follow the principle of least privilege

Additional Notes

The implementation follows the CI output pattern established by Invoke-PSScriptAnalyzer.ps1, using the shared CIHelpers module functions (Write-CIAnnotation, Write-CIStepSummary) that are already imported by the script.

🔧 - Generated by Copilot

… check

- emit Write-CIAnnotation per failing file with missing header details
- append Write-CIStepSummary with pass/fail table and compliance metrics
- add 9 Pester tests covering annotation and summary output

🔧 - Generated by Copilot
Copilot AI review requested due to automatic review settings February 17, 2026 04:28
@WilliamBerryiii WilliamBerryiii requested a review from a team as a code owner February 17, 2026 04:28
@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None
@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.13%. Comparing base (9d3b71d) to head (9bb6f98).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #638      +/-   ##
==========================================
+ Coverage   85.10%   85.13%   +0.02%     
==========================================
  Files          23       23              
  Lines        4491     4506      +15     
==========================================
+ Hits         3822     3836      +14     
- Misses        669      670       +1     
Flag Coverage Δ
pester 85.13% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scripts/linting/Test-CopyrightHeaders.ps1 88.99% <100.00%> (+1.75%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
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

This PR improves the CI ergonomics of the copyright-header lint by emitting GitHub Actions/AzDO annotations per failing file and adding a Markdown step summary, mirroring the CI output pattern used by other linting scripts.

Changes:

  • Emit Write-CIAnnotation warnings per file that is missing required headers.
  • Add a Write-CIStepSummary block with pass/fail status and a failure details table.
  • Add new Pester tests validating annotation and step summary behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
scripts/linting/Test-CopyrightHeaders.ps1 Adds per-file CI annotations and a CI step summary for copyright header validation results.
scripts/tests/linting/Test-CopyrightHeaders.Tests.ps1 Adds unit tests to validate the new annotation and step summary CI output behavior.
- pass $file.FullName to Write-CIAnnotation for correct GitHub Actions file linking
- store fullPath in results and use it in step summary failure table
- matches Invoke-PSScriptAnalyzer.ps1 pattern of using absolute paths

🔧 - Generated by Copilot
@WilliamBerryiii
Copy link
Member Author

Review Comment Responses

Thanks for the review. Addressed the path issues in dd65682, declining the others based on codebase conventions.

✅ Fixed: Annotation file path is scan-relative (Comment 4)

Changed Write-CIAnnotation -File $fileResult.file to -File $file.FullName, matching the pattern in Invoke-PSScriptAnalyzer.ps1 which passes the absolute path and lets GitHub Actions strip the workspace root.

✅ Fixed: Step summary table paths are scan-relative (Comment 5)

Added fullPath property to the result hashtable and use it in the failure table. Paths now resolve correctly regardless of the -Path argument.

🚫 Declined: Success path missing metrics table (Comment 1)

The success-path step summary intentionally uses a simple status line without a metrics table. This matches every peer script in scripts/linting/:

  • Invoke-PSScriptAnalyzer.ps1"✅ Status: Passed — All N files passed linting checks."
  • Invoke-YamlLint.ps1"✅ Status: Passed — All N files passed validation."
  • Invoke-LinkLanguageCheck.ps1"✅ Status: Passed — No URLs detected."

Metrics tables appear only on the failure path across all linting scripts.

🚫 Declined: Brittle -Exactly assertions (Comments 2 & 3)

-Exactly is the exclusive convention in this test suite:

  • 19 occurrences of -Exactly across 4 test files
  • 0 occurrences of -AtLeast anywhere in the repo
  • Invoke-YamlLint.Tests.ps1 uses -Times N without a modifier, which Pester defaults to -Exactly behavior

Switching to -AtLeast would be inconsistent with the codebase and reduce test precision.

Copilot AI review requested due to automatic review settings February 17, 2026 13:05
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

WilliamBerryiii and others added 2 commits February 17, 2026 12:54
- remove fullPath from result hashtable to keep JSON schema stable
- use relative path in step summary table instead of absolute path
- add -File assertion to CI annotation test ParameterFilter

🔧 - Generated by Copilot
Copilot AI review requested due to automatic review settings February 17, 2026 21:00
@WilliamBerryiii WilliamBerryiii merged commit 5fa6328 into main Feb 17, 2026
22 checks passed
@WilliamBerryiii WilliamBerryiii deleted the fix/630-copyright-header-ci-annotations branch February 17, 2026 21:02
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

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

# CI step summary
Write-CIStepSummary -Content "## Copyright Header Validation`n"

if ($output.filesMissingHeaders -eq 0) {
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The new step summary is only written after scanning at least one file. If $filesToCheck.Count -eq 0, the function returns earlier (no step summary), which can still leave the GitHub Actions job summary empty in some configurations (e.g., restrictive -FileExtensions / -ExcludePaths). Consider emitting a minimal Write-CIStepSummary before returning in the "no files found" branch so CI output is consistent.

Suggested change
if ($output.filesMissingHeaders -eq 0) {
if ($output.totalFiles -eq 0) {
Write-CIStepSummary -Content @"
ℹ️ **Status**: No files were checked
No files matched the configured filters. Ensure this is expected for this run.
"@
}
elseif ($output.filesMissingHeaders -eq 0) {
Copilot uses AI. Check for mistakes.
Comment on lines +221 to +225
Write-CIAnnotation `
-Message "Missing required headers: $($missing -join ', ')" `
-Level Warning `
-File $file.FullName `
-Line 1
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The step-summary table later rebuilds the same missing-header label list that’s used to form this annotation message. To avoid drift (e.g., if required headers change), consider centralizing the missing-header computation (e.g., store missingHeaders on $fileResult or extract a helper).

Copilot uses AI. Check for mistakes.
WilliamBerryiii pushed a commit that referenced this pull request Feb 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[3.0.0](hve-core-v2.3.10...hve-core-v3.0.0)
(2026-02-20)


### ⚠ BREAKING CHANGES

* **skills:** migrate PR reference generation to self-contained skill
([#669](#669))
* restructure RPI collection to HVE Core naming convention
([#668](#668))

### ✨ Features

* **agents:** add agile-coach agent
([#562](#562))
([de8d86c](de8d86c))
* **agents:** add DT coach agent with tiered instruction loading
([#656](#656))
([206d3a7](206d3a7))
* **agents:** add product manager advisor and UX/UI designer agents
([#627](#627))
([539eb8a](539eb8a))
* **agents:** add system architecture reviewer for design trade-offs and
ADR creation ([#626](#626))
([de5cfd6](de5cfd6))
* **build:** pin devcontainer image and align tool parity
([#704](#704))
([6258b1c](6258b1c))
* **design-thinking:** add manufacturing industry context template
([#682](#682))
([ce864bf](ce864bf))
* **instructions:** add DT coaching state protocol for session
persistence ([#654](#654))
([5a5be4e](5a5be4e))
* **instructions:** add dt-coaching-identity ambient instruction
([#642](#642))
([6209a0d](6209a0d))
* **instructions:** add dt-method-01-deep for advanced scope
conversation techniques
([#673](#673))
([cc92ef9](cc92ef9))
* **instructions:** add dt-method-03-deep for advanced input synthesis
techniques ([#676](#676))
([0079a4f](0079a4f))
* **instructions:** add dt-method-09-deep instructions for Method 9
advanced coaching
([#703](#703))
([150b2a6](150b2a6))
* **instructions:** add dt-method-sequencing ambient instruction
([#650](#650))
([e465b2f](e465b2f))
* **instructions:** add dt-quality-constraints and design-thinking
collection ([#645](#645))
([17002bd](17002bd))
* **instructions:** add DT-to-RPI handoff contract specification
([#679](#679))
([87f9962](87f9962))
* **instructions:** add energy industry context template
([#687](#687))
([41088d8](41088d8))
* **instructions:** add healthcare industry context template
([#686](#686))
([b2d5281](b2d5281))
* **instructions:** add Method 1 Scope Conversations coaching knowledge
([#651](#651))
([93e2d48](93e2d48))
* **instructions:** add Method 2 Design Research coaching knowledge
([#652](#652))
([30f7f3b](30f7f3b))
* **instructions:** add Method 3 Input Synthesis coaching knowledge
([#653](#653))
([1efdb7d](1efdb7d))
* **instructions:** add Method 7 High-Fidelity Prototypes coaching
instruction ([#666](#666))
([9233eab](9233eab))
* **instructions:** add pull request instructions for PR generation
workflow ([#706](#706))
([73d23eb](73d23eb))
* **instructions:** create DT curriculum content (9 modules)
([#690](#690))
([9f7378f](9f7378f)),
closes [#617](#617)
* **instructions:** create dt-method-02-deep.instructions.md
([#700](#700))
([4d4d0ca](4d4d0ca))
* **instructions:** create dt-method-06-lofi-prototypes.instructions.md
([#684](#684))
([4d5f757](4d5f757))
* **instructions:** create dt-method-07-deep.instructions.md
([#678](#678))
([d3ec70d](d3ec70d))
* **instructions:** Create dt-method-08-deep.instructions.md
([#683](#683))
([d9e1115](d9e1115))
* **instructions:** create dt-method-08-testing.instructions.md
([#681](#681))
([3008ad8](3008ad8))
* **instructions:** create dt-method-09-iteration.instructions.md
([#685](#685))
([9d7f4f5](9d7f4f5))
* **instructions:** create dt-rpi-research-context.instructions.md
([#689](#689))
([34c7b89](34c7b89))
* **instructions:** create manufacturing reference learning scenario
([#692](#692))
([1bd3994](1bd3994))
* **instructions:** Design Thinking Method 4 brainstorming instruction
file ([#664](#664))
([06f90b0](06f90b0))
* **prompts:** add DT start-project prompt for coaching initialization
([#657](#657))
([ce583d5](ce583d5))
* **prompts:** add dt-resume-coaching prompt for session recovery
([#665](#665))
([11b93cb](11b93cb))
* **prompts:** create dt-handoff-problem-space.prompt.md
([#688](#688))
([277963d](277963d))
* **scripts:** add collection-level maturity field with validation,
gating, and notices
([#697](#697))
([7b1c8e8](7b1c8e8))
* **scripts:** add per-violation CI annotations and colorized console
output ([#637](#637))
([bd7d512](bd7d512))
* **skills:** edit SKILL frontmatter schema, add CI validation, and
documentation ([#625](#625))
([0138a78](0138a78))
* **skills:** mandate unit testing and document language support
([#636](#636))
([9263617](9263617))
* **skills:** migrate PR reference generation to self-contained skill
([#669](#669))
([cf8805f](cf8805f))


### 🐛 Bug Fixes

* **collections:** migrate artifacts into collection-based
subdirectories
([#658](#658))
([dfa5261](dfa5261))
* **instructions:** optimize Phase 1 DT token budgets and close
[#564](https://github.com/microsoft/hve-core/issues/564)/[#565](https://github.com/microsoft/hve-core/issues/565)
gaps ([#675](#675))
([4f42f00](4f42f00))
* **scripts:** add CI annotations and step summary to copyright header
check ([#638](#638))
([5fa6328](5fa6328))
* **scripts:** add grouped link-lang console diagnostics and failure
summary ([#661](#661))
([4d6871f](4d6871f))
* **scripts:** add per-violation Write-Host and Write-CIAnnotation
output to Test-DependencyPinning
([#640](#640))
([9d3b71d](9d3b71d))
* **scripts:** align agent frontmatter schema with VS Code spec
([#469](#469))
([254d445](254d445))
* **scripts:** optimize PSScriptAnalyzer linting performance in WSL2
([#667](#667))
([f120b93](f120b93))
* **scripts:** stabilize YAML display key ordering in collection
manifest ([#701](#701))
([73c0d2c](73c0d2c))
* **scripts:** use text stubs for plugin links when symlinks unavailable
([#695](#695))
([d7650a3](d7650a3))
* **skills:** fix powershell test coverage in pr-reference skill
([#699](#699))
([408e6b7](408e6b7))


### 📚 Documentation

* **dt:** add Method 5 Concepts and Method 6 Lo-Fi Prototypes
instructions ([#693](#693))
([cfdcf11](cfdcf11))
* **hve-guide:** add role-based guides and project lifecycle
documentation ([#663](#663))
([17a85da](17a85da))


### ♻️ Refactoring

* restructure RPI collection to HVE Core naming convention
([#668](#668))
([120dde0](120dde0))
* **scripts:** consolidate duplicate logging into shared SecurityHelpers
module ([#655](#655))
([627a877](627a877))
* **scripts:** use shared SecurityHelpers and CIHelpers modules in
security scripts
([#705](#705))
([3a0baa7](3a0baa7))


### 🔧 Maintenance

* **deps-dev:** bump markdownlint-cli2 from 0.20.0 to 0.21.0 in the
npm-dependencies group
([#609](#609))
([1486dd7](1486dd7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: hve-core-release-please[bot] <254602402+hve-core-release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants