Strengthen frontmatter YAML helper tests with table-driven coverage and injection guards#36031
Merged
pelikhan merged 4 commits intoMay 31, 2026
Merged
Conversation
Closed
9 tasks
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve test quality in frontmatter extraction tests
Strengthen frontmatter YAML helper tests with table-driven coverage and injection guards
May 31, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Expands the previously thin frontmatter_extraction_yaml_test.go with table-driven tests for several pure helpers in frontmatter_extraction_yaml.go, standardizes on testify assertions, and adds regression cases for expression-injection-shaped inputs (notably for workflow_run.conclusion).
Changes:
- Adds table-driven coverage for
isGitHubAppNestedField,isValidWorkflowRunConclusion, andindentYAMLLines. - Adds
TestExtractDeploymentStatusStateConditionandTestExtractWorkflowRunConclusionConditionHelper, including injection-attempt rejection. - Switches to testify
assertstyle with descriptive messages, replacing the prior singlet.Fatalcheck.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/frontmatter_extraction_yaml_test.go | Greatly expanded tests for frontmatter YAML helpers; contains a stray ) that breaks compilation. |
| .github/workflows/daily-model-inventory.lock.yml | Regenerated lock metadata (body_hash bump only); no functional change. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
| } | ||
| assert.Equal(t, tt.want, got, "extractWorkflowRunConclusionCondition should return expected expression for %q", tt.name) | ||
| }) | ||
| }) |
Collaborator
|
@copilot review all comments |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Addressed in |
pelikhan
approved these changes
May 31, 2026
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.
pkg/workflow/frontmatter_extraction_yaml_test.gopreviously covered only one helper with a singlet.Fatalcheck. This update expands coverage across core pure helpers infrontmatter_extraction_yaml.go, standardizes on testify assertions with messages, and adds explicit regression checks for expression-injection-shaped inputs.isGitHubAppNestedField: full table-driven coveraget.Fatalpath withassert.Equal/assert-style checks.app-id,client-id,private-key,ignore-if-missing,owner,repositories), repository list items (- ...), and non-matching/near-miss keys.Workflow run conclusion validation hardening
TestIsValidWorkflowRunConclusioncovering all allowed conclusions.indentYAMLLinesbehavior contractCondition-extraction helper coverage
TestExtractDeploymentStatusStateConditionfor missing config, single/multi-state inputs, and mixed-type arrays (string filtering behavior).TestExtractWorkflowRunConclusionConditionHelperfor missing config, valid single/multi conclusions, and invalid/injection conclusion rejection via error path.