Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helmfile lock update fails if helmfile.yaml is multidoc #31651

Closed
rarkins opened this issue Sep 27, 2024 Discussed in #31572 · 0 comments · Fixed by #31698
Closed

Helmfile lock update fails if helmfile.yaml is multidoc #31651

rarkins opened this issue Sep 27, 2024 Discussed in #31572 · 0 comments · Fixed by #31698
Assignees
Labels
manager:helmfile Related to the helmfile package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality

Comments

@rarkins
Copy link
Collaborator

rarkins commented Sep 27, 2024

Discussed in #31572

Originally posted by BjoernPetersen September 24, 2024

What would you like help with?

I think I found a bug

How are you running Renovate?

Mend Renovate hosted app on github.com

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

No response

Please tell us more about your question or problem

The Helmfile manager has supported multidoc YAMLs for a while (#8682), but it fails to update the corresponding lockfile if a dependency is updated (see logs). Please use the parseYaml instead of the parseSingleYaml function in the artifacts.ts.

Logs (if relevant)

Logs

DEBUG: updateArtifacts for updatedPackageFiles (branch="renovate/argo-cd-7.6.x")
DEBUG: Failed to update Helmfile lock file (branch="renovate/argo-cd-7.6.x")
{
  "err": {
    "name": "YAMLException",
    "reason": "expected a single document in the stream, but found more",
    "message": "expected a single document in the stream, but found more",
    "stack": "YAMLException: expected a single document in the stream, but found more\n    at load (/usr/local/renovate/node_modules/.pnpm/[email protected]/node_modules/js-yaml/lib/loader.js:1722:9)\n    at parseSingleYaml (/usr/local/renovate/lib/util/yaml.ts:63:29)\n    at updateArtifacts (/usr/local/renovate/lib/modules/manager/helmfile/artifacts.ts:73:32)\n    at managerUpdateArtifacts (/usr/local/renovate/lib/workers/repository/update/branch/get-updated.ts:505:12)\n    at getUpdatedPackageFiles (/usr/local/renovate/lib/workers/repository/update/branch/get-updated.ts:360:25)\n    at processBranch (/usr/local/renovate/lib/workers/repository/update/branch/index.ts:476:19)\n    at writeUpdates (/usr/local/renovate/lib/workers/repository/process/write.ts:166:17)\n    at update (/usr/local/renovate/lib/workers/repository/process/extract-update.ts:213:11)\n    at Object.renovateRepository (/usr/local/renovate/lib/workers/repository/index.ts:89:19)\n    at attributes.repository (/usr/local/renovate/lib/workers/global/index.ts:202:11)\n    at start (/usr/local/renovate/lib/workers/global/index.ts:187:7)\n    at /usr/local/renovate/lib/renovate.ts:18:22"
  }
}

DEBUG: Updated 1 package files (branch="renovate/argo-cd-7.6.x")
DEBUG: No updated lock files in branch (branch="renovate/argo-cd-7.6.x")

@rarkins rarkins added type:bug Bug fix of existing functionality priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:helmfile Related to the helmfile package manager labels Sep 27, 2024
rarkins added a commit that referenced this issue Sep 30, 2024
Fixes #31651

Update Helmfile manager to handle multidoc YAMLs correctly.

* Replace `parseSingleYaml` with `parseYaml` in `lib/modules/manager/helmfile/artifacts.ts` to handle multiple YAML documents.
* Update the `doc` variable to handle multiple documents in the `updateArtifacts` function.
* Add a test case in `lib/modules/manager/helmfile/artifacts.spec.ts` for updating the lockfile with a multidoc YAML.
* Mock the `parseYaml` function to handle multiple documents in the test case.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/renovatebot/renovate/issues/31651?shareId=XXXX-XXXX-XXXX-XXXX).
@rarkins rarkins self-assigned this Sep 30, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:helmfile Related to the helmfile package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant