Add regression coverage for frontmatter hash parity in OTLP setup metadata#32223
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Validate frontmatter hash parity for OTLP setup metadata
Add regression coverage for frontmatter hash parity in OTLP setup metadata
May 14, 2026
Copilot created this pull request from a session on behalf of
pelikhan
May 14, 2026 22:13
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a regression test in pkg/workflow/aw_info_tmp_test.go to enforce parity between the frontmatter_hash recorded in the lock-file header metadata, the GH_AW_INFO_FRONTMATTER_HASH value embedded in the generated YAML's setup env, and the hash recomputed from the workflow source.
Changes:
- Adds a package-level regex
awInfoFrontmatterHashReto deterministically extract theGH_AW_INFO_FRONTMATTER_HASHenv value from lock file content. - Adds
TestFrontmatterHashParitywhich compiles a workflow, parses lock metadata viaExtractMetadataFromLockFile, and asserts three-way equality withparser.ComputeFrontmatterHashFromFile. - Imports
parser,regexp, andtestify/requireto support the new assertions.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/aw_info_tmp_test.go | Adds regex helper and TestFrontmatterHashParity to guard against drift between the setup env hash, lock metadata hash, and source-computed frontmatter hash. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
Collaborator
|
@copilot remove frontmatter.hash from the otlp attributes |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Collaborator
|
@copilot remove GH_AW_INFO_FRONTMATTER_HASH |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Collaborator
|
@copilot merge main and recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…-frontmatter # Conflicts: # .github/workflows/jsweep.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Fix
The lock header metadata (
gh-aw-metadata.frontmatter_hash) and setup-time OTLP frontmatter hash env (GH_AW_INFO_FRONTMATTER_HASH) can drift, which undermines telemetry correlation stability. This change adds compiler-level regression coverage to enforce parity with the source frontmatter hash.What was the bug?
GH_AW_INFO_FRONTMATTER_HASHchanging independently, creating ambiguity about canonical hash provenance.How did you fix it?
TestFrontmatterHashParityinpkg/workflow/aw_info_tmp_test.go.GH_AW_INFO_FRONTMATTER_HASHfrom generated YAML, and asserts:frontmatter_hashfrontmatter_hash== recomputed source frontmatter hashGH_AW_INFO_FRONTMATTER_HASHfrom lock content.Testing