Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

YAML 1.2 compliance possibly breaking VCR

未关闭
#648 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
c, ruby, yaml

调研方向

首先,使用 VCR fixture 的 block scalar header,以及 WebMock 无法识别的 URI fixture,重现解析失败。在 YAML 1.1 和 YAML 1.2 下比较相同的案例,并结合链接的 Psych 和 JRuby pull request 与 issue 了解背景。完成的标准是解释清楚该行为,并通过一个聚焦的回归测试覆盖它。

由索引模型根据 Issue 内容生成。

描述

This is an issue branching off from https://github.com/ruby/psych/pull/613#issuecomment-1709239243.

We're experimenting migrating a Rails app we have to latest JRuby (9.4.3.0), an app that has some large VCR fixtures.

Initially we hit the the code point limit issue that https://github.com/ruby/psych/pull/613 lets us bypass, but after increasing the code point limit that the above PR let's us configure, we came across parsing errors like this one:

the leading empty lines contain more spaces (8) than the first non-empty line. while scanning a block scalar at line 32385 column 5
     # ./config/initializers/psych.rb:6:in `parse_stream'

(the initializer monkey patch is a hack while we can't get https://github.com/ruby/psych/pull/647 to work on our end)

In this case, the fixture had several empty newlines in a multiline field, using a block scalar header like field: |+2.

After deleting that field from the yaml fixture altogether as part of troubleshooting, all fixtures get parsed and we're able to run Rspec specs again using VCR. But some of the specs that were previously passing now fail, with Webmock not recognizing the URIs for the requests recorded in the fixtures.

We suspect this might be happening due to YAML 1.2 not liking how the URIs are escaped, and we're still validating this. @headius asked me to create this issue so it can be tracked together with https://github.com/ruby/psych/issues/642, which might also be related to YAML 1.2 compliance (see also https://github.com/jruby/jruby/pull/7600#issuecomment-1712771885)

I'll update this issue as we find out more about it, ideally with a test comparing the same use case with YAML 1.1 and YAML 1.2.

主要语言
Ruby
星标
597
派生
223
平均合并
6 小时 8 分钟
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ruby/psych 的其他 Issue

查看 ruby/psych 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。