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

fix(batect): "Failed to parse newContent" #8632

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

charleskorn
Copy link
Contributor

Changes:

This fixes an issue where all updates with the batect manager would fail.
It also adds logging for errors like this so that they're easier to diagnose in the future.

Context:

Updates to Batect configuration files (either Docker image references or bundle versions) were broken. Logs would contain messages like this:

DEBUG: prAlreadyExisted=false(branch="renovate/docker-golang-1.x")
DEBUG: Checking schedule(at any time, null)(branch="renovate/docker-golang-1.x")
DEBUG: No schedule defined(branch="renovate/docker-golang-1.x")
DEBUG: Branch needs creating(branch="renovate/docker-golang-1.x")
DEBUG: Using reuseExistingBranch: false(branch="renovate/docker-golang-1.x")
DEBUG: manager.getUpdatedPackageFiles()(branch="renovate/docker-golang-1.x")
{
  "reuseExistingBranch": false,
  "branchName": "renovate/docker-golang-1.x"
}
DEBUG: Starting search at index 43(packageFile="batect-bundle.yml", branch="renovate/docker-golang-1.x")
{
  "depName": "golang"
}
DEBUG: Found match at index 43(packageFile="batect-bundle.yml", branch="renovate/docker-golang-1.x")
{
  "depName": "golang"
}
DEBUG: Failed to parse newContent(packageFile="batect-bundle.yml", branch="renovate/docker-golang-1.x")
{
  "manager": "batect"
}
DEBUG: No newUpgrade(packageFile="batect-bundle.yml", branch="renovate/docker-golang-1.x")
{
  "manager": "batect"
}
WARN: Error updating branch: update failure(branch="renovate/docker-golang-1.x")

The error parsing newContent is due to auto-replace.ts expecting the manager to implement extractPackageFile, but the Batect manager doesn't implement this, and instead provided only extractAllPackageFiles (see #8091 for more details).

I haven't added a unit test for this, but if there's an existing pattern for tests that would catch this kind of problem, please let me know and I can add one.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added unit tests, or
  • No new tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@rarkins rarkins changed the title fix: updates to Batect configuration files would fail with "Failed to parse newContent" fix(batect): "Failed to parse newContent" Feb 11, 2021
@rarkins rarkins merged commit 1a9e543 into renovatebot:master Feb 11, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 24.45.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants