salesforce / dockerfile-image-update

A tool that helps you get security patches for Docker images into production as quickly as possible without breaking things
BSD 3-Clause "New" or "Revised" License
136 stars 48 forks source link

Fix uncaught UnsupportedOperationException #1122

Closed cjneasbi closed 1 year ago

cjneasbi commented 1 year ago

Addresses the issue of DFIU aborting if the following exception is throw when reading content from Git.

23:11:00  [main] ERROR com.salesforce.dockerfileimageupdate.subcommands.impl.All - Encountered issues while initializing the image tag store or getting its contents. Cannot continue. Exception: 
23:11:00  java.lang.UnsupportedOperationException: Unrecognized encoding: none
23:11:00    at org.kohsuke.github.GHContent.read(GHContent.java:198)
23:11:00    at com.salesforce.dockerfileimageupdate.process.ForkableRepoValidator.hasNoChanges(ForkableRepoValidator.java:99)
23:11:00    at com.salesforce.dockerfileimageupdate.process.ForkableRepoValidator.contentHasChangesInDefaultBranch(ForkableRepoValidator.java:77)
23:11:00    at com.salesforce.dockerfileimageupdate.process.ForkableRepoValidator.shouldFork(ForkableRepoValidator.java:54)
23:11:00    at com.salesforce.dockerfileimageupdate.process.GitHubPullRequestSender.forkRepositoriesFoundAndGetPathToDockerfiles(GitHubPullRequestSender.java:67)
23:11:00    at com.salesforce.dockerfileimageupdate.utils.PullRequests.prepareToCreate(PullRequests.java:22)
23:11:00    at com.salesforce.dockerfileimageupdate.subcommands.impl.All.processImageWithTag(All.java:93)
23:11:00    at com.salesforce.dockerfileimageupdate.subcommands.impl.All.processImagesWithTag(All.java:70)
23:11:00    at com.salesforce.dockerfileimageupdate.subcommands.impl.All.execute(All.java:47)
23:11:00    at com.salesforce.dockerfileimageupdate.CommandLine.main(CommandLine.java:52)
23:11:00  Unable to run DFIU with the command all
23:11:00  Finished: FAILURE
salesforce-cla[bot] commented 1 year ago

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Chris Neasbitt c***@s***.com. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request.

codecov[bot] commented 1 year ago

Codecov Report

Merging #1122 (918ac20) into main (f56ed5e) will not change coverage. The diff coverage is 50.00%.

:exclamation: Current head 918ac20 differs from pull request most recent head c9cca5f. Consider uploading reports for the commit c9cca5f to get more accurate results

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #1122   +/-   ##
=========================================
  Coverage     84.62%   84.62%           
  Complexity      378      378           
=========================================
  Files            27       27           
  Lines          1255     1255           
  Branches        166      166           
=========================================
  Hits           1062     1062           
  Misses          157      157           
  Partials         36       36           
Files Changed Coverage Δ
...fileimageupdate/process/ForkableRepoValidator.java 97.82% <50.00%> (ø)
cjneasbi commented 1 year ago

I've added cneasbitt@salesforce.com to my account. I try to refresh the PR as instructed, https://cla.salesforce.com/status/salesforce/dockerfile-image-update/pull/1122 , and receive an error.

Oops, an error occurred

This exception has been logged with id 83318bd9g.