posit-dev / posit-dev/images-shared

Fix yq -i reformatting that breaks helm chart lint

Open
#687 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug cicd cvp:0 docker tdp:2
Dominant language
Python
Stars
2
Forks
0
Avg merge
4d 13h
Merged PRs (30d)
22

Description

The product-release.yml workflow in rstudio/helm uses yq -i to
update values.yaml in place, which re-serializes the whole file and
drops formatting that ct lint requires. This broke the auto-generated
release PR's lint check.

rstudio/helm PR #917 (dispatched from this repo's images-connect
production release) failed with:

479:27 [comments] too few spaces before comment
480:28 [comments] too few spaces before comment
482:29 [comments] too few spaces before comment

The diff shows why: yq's re-serialization collapsed inline comment
padding from 2 spaces to 1 (e.g. ServiceLogLevel: INFO # ... became
ServiceLogLevel: INFO # ...) and stripped ~75 blank lines that
separated top-level and nested keys throughout the file. ct lint's
embedded yamllint config requires min-spaces-from-content: 2, so any
comment yq collapses to 1 space fails the job.

The "Sync Connect interpreter paths" step is the culprit — it's the
only step that rewrites values.yaml as a whole document (the
Chart.yaml bump step only touches Chart.yaml):

yq -i ".config.Python.Executable = [...]" "charts/${CHART_NAME}/values.yaml"

Possible directions:

  • Replace the yq -i on values.yaml with a targeted substitution
    (e.g. sed) that touches only the one field, avoiding a
    full-document re-serialization.

  • Add a normalization step after any yq -i call that restores
    minimum-2-space comment padding before the PR is opened.

  • https://github.com/rstudio/helm/pull/917

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the “Sync Connect interpreter paths” step in product-release.yml and inspect how it rewrites charts/${CHART_NAME}/values.yaml. Run the chart lint workflow or ct lint against the generated values.yaml, then verify that the release PR passes without collapsing comment spacing or removing blank-line formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.