Repository navigation
Leading comments in .yarnrc.yml are removed when updating catalog dependencies
#41756
Unanswered
literat
asked this question in
Request Help
Replies: 1 comment 1 reply
|
I have observed the exact same issue for |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
How are you running Renovate?
A Mend.io-hosted app
Which platform you running Renovate on?
GitHub.com
Which version of Renovate are you using?
43.59.0
Please tell us more about your question or problem
When Renovate updates dependency versions inside the
catalogs:section of.yarnrc.yml, it strips any YAML comments that appear at the very top of the file (before the first key). Comments located between keys further down in the file are preserved correctly.Reproduction
The
.yarnrc.ymlfile starts with:After Renovate updates the catalog versions, the PR removes the two leading comment lines entirely:
Comments that appear between keys later in the file (e.g.
# Compression level employed for zip archives,# Design system tooling) are not affected.Expected behavior
Leading comments at the top of
.yarnrc.ymlshould be preserved in the same way mid-file comments are.Workarounds attempted
Adding a
---document start marker before the comments — did not helpMoving the comment inline onto the
cacheFolder:value line — works, but degrades readabilityAdditional context
A similar issue is documented for JSON5 config files (Renovate's own configMigration feature strips JSON5 comments), so this appears to be a broader pattern in how Renovate handles comment preservation across serialization formats.
Logs (if relevant)
Logs
All reactions