Skip to content

🐛 Fix regression in YAML parsing#126

Merged
stoe merged 1 commit into
mainfrom
stoe/fix-yaml-parsing
Oct 3, 2025
Merged

🐛 Fix regression in YAML parsing#126
stoe merged 1 commit into
mainfrom
stoe/fix-yaml-parsing

Conversation

@stoe
Copy link
Copy Markdown
Owner

@stoe stoe commented Oct 3, 2025

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-awaited getYaml() caused downstream extraction (listeners, permissions, runsOn, secrets, vars, uses) to produce empty sets in reports.

Problem

  • yaml field in workflow objects was a Promise.
  • Report extraction logic expected a plain object and silently produced empty result sets.
  • No regression test guarded this contract.

What Changed

  • Added await this.getYaml() in src/github/workflow.js.
  • Added a regression unit test asserting result.yaml is not a Promise.
  • Added an end-to-end report extraction test confirming all extraction sets are populated from realistic workflow YAML.
  • Escaped ${{ secrets.* }} / ${{ vars.* }} in test fixture string to avoid template interpolation issues.

Verification

  • All Jest suites pass (216 tests).
  • Coverage remains high; regression path now protected at both unit and integration levels.

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 — await was already required for actual use; now made explicit before returning.

Changelog

  • Fixed: Workflow YAML now parsed eagerly (no dangling Promise).
  • Added: Regression tests for YAML materialization and extraction completeness.

Copilot AI review requested due to automatic review settings October 3, 2025 07:50
@stoe stoe self-assigned this Oct 3, 2025
Copy link
Copy Markdown
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 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.

Comment thread test/report/report-extraction.test.js
Comment thread test/report/report-extraction.test.js
@stoe stoe merged commit 40e6020 into main Oct 3, 2025
8 checks passed
@stoe stoe deleted the stoe/fix-yaml-parsing branch October 3, 2025 07:55
@stoe stoe added the bug 🐛 Something not working? label Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐛 Something not working?

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants