Skip to content

fix(deps): update dependency js-yaml to v5#9919

Merged
mldangelo-oai merged 16 commits into
mainfrom
renovate/js-yaml-5.x
Jul 3, 2026
Merged

fix(deps): update dependency js-yaml to v5#9919
mldangelo-oai merged 16 commits into
mainfrom
renovate/js-yaml-5.x

Conversation

@renovate

@renovate renovate Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
js-yaml ^4.1.1^5.0.0 age confidence
js-yaml ^4.1.1^5.0.0 age confidence

Warning

Some dependencies could not be looked up. Check the warning logs for more information.


Release Notes

nodeca/js-yaml (js-yaml)

v5.0.0

Compare Source

Added
  • Added named exports for schemas, tags, parser events and AST utilities.
  • Reworked JSON_SCHEMA and CORE_SCHEMA with spec-compliant scalar resolution
    rules, and added YAML11_SCHEMA.
  • Added realMapTag for lossless mappings with non-string and complex keys.
    Object-based mappings now reject complex keys instead of stringifying them.
  • Added dump() transform option for changing the generated AST before
    rendering.
  • Added dump() options seqInlineFirst, flowBracketPadding,
    flowSkipCommaSpace, flowSkipColonSpace, quoteFlowKeys, quoteStyle and
    tagBeforeAnchor.
  • Added formal data layers (events and AST) for modular data pipelines.
    • Added low-level parser (to events), presenter and visitor APIs.
  • Added the YAML Test Suite to the
    test set.
Changed
  • See the migration guide for upgrade notes.
  • Rewritten in TypeScript and reorganized the public API around flat named
    exports.
  • Reduced the set of exported schemas:
    • YAML 1.2 schemas: CORE_SCHEMA (loader default), JSON_SCHEMA,
      FAILSAFE_SCHEMA.
    • YAML11_SCHEMA, a combination of all YAML 1.1 tags (YAML 1.1 does not
      specify a schema, only "types").
  • load/dump default behaviour is now specified exactly via schemas:
    • load uses CORE_SCHEMA, without !!merge by default.
    • dump uses YAML11_SCHEMA + CORE_SCHEMA for the quoting check, to
      guarantee backward compatibility by default.
  • !!set is now loaded as a JavaScript Set.
  • Replaced the Type API with a tags API. Similar, but more precise and
    simpler. See examples for details. Tags can be defined via
    defineScalarTag(), defineSequenceTag() and defineMappingTag(), or as a
    spread + override of an existing tag.
  • Renamed Schema.extend() to Schema.withTags().
  • Expanded YAML 1.2 conformance and improved handling of directives, document
    markers, block keys, multiline scalars, tag syntax and other things.
  • load() now throws on empty input instead of returning undefined.
  • Moved browser builds to the js-yaml/browser export.
  • Deprecated the loadAll signature with an iterator (still works, but is a
    candidate for removal).
Removed
  • Removed deprecated safeLoad(), safeLoadAll() and safeDump() exports.
  • Removed DEFAULT_SCHEMA and the nested types export.
  • Removed loader options onWarning, legacy and listener.
  • Removed dumper options styles, replacer, noCompatMode, condenseFlow,
    quotingType and forceQuotes. Renamed noArrayIndent to seqNoIndent.
    Formatting and representation are now configured through presenter options,
    schemas and tag definitions. See migration guide on how to replace.
  • Removed support for importing internal files from lib/.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.


Migration notes (manual changes on top of the Renovate bump)

js-yaml v5 is a major rewrite with several breaking changes that affect this repo. The following was done to keep behavior identical to v4 for users:

Module format — v5 is native ESM with no default export. All import yaml from 'js-yaml' default imports were converted to namespace/named imports (including the plugin skill scripts and scripts/generateCitation.ts, which crashed at module instantiation on CI).

Merge keys — v5's default load schema (CORE_SCHEMA) no longer resolves YAML merge keys (<<: *anchor), which promptfoo configs, tests files, vars files, provider configs, and assertion files rely on. A shared loadYaml helper (src/util/yamlLoad.ts, mirrored at src/app/src/utils/yaml.ts for the web UI) restores merge keys via CORE_SCHEMA.withTags(mergeTag) and is now used at every call site that parses user-authored YAML — including the generate assertions/dataset --write and redteam generate --write paths, which would otherwise silently rewrite configs with a literal "<<" key.

Empty documents — v5 throws YAMLException on empty, whitespace-only, or comment-only input where v4 returned undefined (a plain trim() guard misses the comment-only case). loadYaml catches exactly that exception and returns undefined, so empty config/vars/test files and an empty ~/.promptfoo/promptfoo.yaml keep working.

Test mocks — v5's sealed ESM namespace breaks vi.spyOn(yaml, 'dump') and vi.mock factories that only provide a default export; affected tests now use spy-able module mocks with real implementations.

Verification — full backend suite (789 files), full web UI suite (280 files), tsc, and a real npm run local -- eval against a config using <<: anchors in both the provider config and a file://tests.yaml (all 4 cases pass with merged vars/assertions). New regression tests: test/util/yamlLoad.test.ts, src/app/src/utils/yaml.test.ts.

@renovate
renovate Bot requested review from a team, faizan-oai, mldangelo-oai and wholley-oai as code owners June 30, 2026 21:10
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.07143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.44%. Comparing base (b470871) to head (25b8489).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9919      +/-   ##
==========================================
+ Coverage   79.41%   79.44%   +0.02%     
==========================================
  Files         922      924       +2     
  Lines       74029    74053      +24     
  Branches    23830    23836       +6     
==========================================
+ Hits        58791    58828      +37     
+ Misses      15238    15225      -13     
Flag Coverage Δ
backend 81.31% <92.85%> (+0.02%) ⬆️
site 4.58% <85.71%> (+0.63%) ⬆️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de4d3783b0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread package.json
Comment thread package.json
Comment thread package.json
@renovate
renovate Bot force-pushed the renovate/js-yaml-5.x branch from de4d378 to b3b66b2 Compare July 1, 2026 03:09
@renovate
renovate Bot force-pushed the renovate/js-yaml-5.x branch from b3b66b2 to 983c44f Compare July 1, 2026 04:31
@renovate
renovate Bot force-pushed the renovate/js-yaml-5.x branch from 983c44f to 1c7ff61 Compare July 1, 2026 15:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38763ab874

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
Comment thread src/commands/generate/assertions.ts
Comment thread src/util/file.ts Outdated
@renovate

renovate Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

test added 4 commits July 1, 2026 22:09
Add a shared loadYaml helper (src/util/yamlLoad.ts, mirrored in the web UI)
that restores merge-key support (<<:) and returns undefined for empty,
whitespace-only, or comment-only documents instead of throwing, matching
js-yaml v4 behavior. Use it at every call site that parses user-authored
YAML: configs, tests files, vars files, provider configs, assertions,
prompts, redteam configs, the server provider config, and uploaded/typed
YAML in the web UI and docs-site validator.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 037f72b86d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/util/yamlLoad.ts Outdated
test added 3 commits July 1, 2026 22:56
…elpers

- Build loadYaml on yaml.loadAll, which returns [] for empty documents,
  instead of catching and string-matching the empty-input YAMLException;
  multi-document streams still throw like v4's load.
- Drop the web UI's mirrored helper: import the backend loadYaml through
  the established @promptfoo vite alias instead.
- Mirror the helper into the site workspace (site/src/utils/yaml.ts) so
  the config validator handles comment-only input and stops rebuilding
  the merge schema on every keystroke.
- Mock the loadYaml seam in backend suites instead of automocking
  js-yaml for load, removing call-shape assertions on the helper's
  internal js-yaml invocation.
- Route scripts/generateCitation.ts through loadYaml for consistency.

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after dependency GAP analysis, repo updates, local validation, and green CI.

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved at exact head 25b8489 after js-yaml v5 GAP analysis; additive current-main merge; preservation of imports, merge keys, empty documents, binary/timestamp/omap/pairs/set semantics; focused backend/site tests with 100% yamlLoad coverage; full builds/typechecks; clean install and lock idempotence; no-cache merged-YAML eval; resolved review threads; and green CI including the coverage ratchet.

@mldangelo-oai
mldangelo-oai merged commit 9696a2f into main Jul 3, 2026
43 checks passed
@mldangelo-oai
mldangelo-oai deleted the renovate/js-yaml-5.x branch July 3, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant