🐛 Fix regression in YAML parsing#126
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a regression in workflow YAML parsing where Workflow.getWorkflow() was returning a Promise object instead of a parsed YAML object, causing downstream extraction logic to produce empty result sets.
- Fixed workflow YAML parsing by awaiting
getYaml()before returning the result - Added regression tests to ensure YAML is properly parsed and extraction sets are populated
- Added end-to-end test coverage for report extraction functionality
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/github/workflow.js | Fixed YAML parsing by adding await to getYaml() call |
| test/github/workflow.test.js | Added regression test to verify yaml field is not a Promise |
| test/report/report-extraction.test.js | Added integration test for end-to-end extraction verification |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Fix workflow YAML parsing and add regression coverage
Summary
Ensures
Workflow.getWorkflow()returns a fully parsed YAML object rather than a pending Promise. Previously, the un-awaitedgetYaml()caused downstream extraction (listeners, permissions, runsOn, secrets, vars, uses) to produce empty sets in reports.Problem
yamlfield in workflow objects was a Promise.What Changed
await this.getYaml()insrc/github/workflow.js.result.yamlis not a Promise.${{ secrets.* }}/${{ vars.* }}in test fixture string to avoid template interpolation issues.Verification
Impact / Risk
Low. Change is additive and narrows a previously loose contract (Promise vs object). No public API shape changes; only internal correctness improvement.
Performance
Negligible difference —
awaitwas already required for actual use; now made explicit before returning.Changelog