Conversation
This branch has not been deployed
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.
Part 1 of 2 for #944.
rstudio-library's ini helpers render a config file from a map, and Go templates iterate maps in sorted key order. For files whose behavior depends on the order of their sections or entries —/etc/rstudio/profiles,launcher.*.profiles.conf,launcher.*.resources.conf,repos.conf— that silently changes what the file does, and nothing invalues.yamlshows it.This PR adds the order-preserving form to the library. Part 2 bumps
rstudio-workbenchonto it, adds the deprecation warning for the map form, and updates the docs — it has to wait untilrstudio-library0.1.38 is published, since consumers resolve the library fromhelm.rstudio.comrather than the working tree.Changes
A file's contents may now be a list, and it renders in the order written:
Each list item is a map, rendered as one of:
[name]section with its key=value linesname=valuelinerstudio-library.config.ini(_config.tpl) accepts the list form anywhere it renders a file, via a newrstudio-library.config.ini.entryhelper. Previously a list of single-entry maps rendered broken lines like*=map[max-memory-mb:1024], with no section headers at all.rstudio-library.profiles.ini.advanced,.singleFile, and.json-from-overrides-config(_profiles.tpl) accept the same list form for a profiles file's sections, including thejob-json-overridesmerging. When an ordered list omits a[*]section, the chart-suppliedjob-json-overridesdefaults are prepended as one, matching what the map form produced.rstudio-library.config.entrieshelper normalizes either form into an ordered list of entries.Compatibility
The multi-key record shape is deliberate:
config.session.r-versionsalready uses a list, and/etc/rstudio/r-versionsseparates R entries by blank lines. Keying on item arity — the "list of one-entry maps" from #944 — lets both forms coexist.Verified byte-identical output: rendering every values file under
charts/rstudio-workbench/{lint,ci}/andcharts/rstudio-connect/{lint,ci}/before and after this change produces identical manifests.One behavior change: a list item with exactly one key and a scalar value no longer emits a trailing blank line, since it is now an ordered entry rather than a one-field record. This only affects a single-field
r-versionsrecord (e.g. a lone- Path: /opt/R/4.0.2); two-or-more-field records are unchanged.Testing
other-charts/rstudio-library-testcovers, for bothconfig.iniand the profiles helpers:launcher.conf'scluster:list) — unchangedRan the CI test loop (
helm dependency update+helm unittestper chart) against a clean worktree: 452 tests pass across all 5 charts, with the other product charts still on their published library pins.check-uncommitted-changes.shandcheck-news-entries.shboth pass.