returnparsed,previousErr// <- Keep the previous error as this function should still return an error once everything has been checked if any call failed
returnparsed,previousErr// <- Keep the previous error as this function should still return an error once everything has been checked if any call failed
//lint:ignore SA1019 We use IsAnInteractiveSession because IsWindowsService has a different permissions profile
isAnInteractiveSession,err:=svc.IsAnInteractiveSession()//nolint:staticcheck // must use IsAnInteractiveSession because IsWindowsService has a different permissions profile
func(h*HTMLRender)HTML(wio.Writer,statusint,tplNameTplName,dataany,ctxcontext.Context)error{//nolint:revive // we don't use ctx, only pass it to the template executor
name:=string(tplName)
name:=string(tplName)
ifrespWriter,ok:=w.(http.ResponseWriter);ok{
ifrespWriter,ok:=w.(http.ResponseWriter);ok{
ifrespWriter.Header().Get("Content-Type")==""{
ifrespWriter.Header().Get("Content-Type")==""{
@ -57,7 +57,7 @@ func (h *HTMLRender) HTML(w io.Writer, status int, tplName TplName, data any, ct
func(h*HTMLRender)TemplateLookup(namestring,ctxcontext.Context)(TemplateExecutor,error){//nolint:revive // we don't use ctx, only pass it to the template executor
funcsaveAsPackageBlob(ctxcontext.Context,hsrpackages_module.HashedSizeReader,pci*packages_service.PackageCreationInfo)(*packages_model.PackageBlob,error){//nolint:unparam // PackageBlob is never used
// Examples are various git errors such as the commit the review was based on was gc'ed and hence doesn't exist anymore as well as unrecoverable errors where we should serve a 500 response
// Examples are various git errors such as the commit the review was based on was gc'ed and hence doesn't exist anymore as well as unrecoverable errors where we should serve a 500 response
// Due to the current architecture and physical limitation of needing to compare explicit error messages, we can only choose one approach without the code getting ugly
// Due to the current architecture and physical limitation of needing to compare explicit error messages, we can only choose one approach without the code getting ugly
// For SOME of the errors such as the gc'ed commit, it would be best to mark all files as changed
// For SOME of the errors such as the gc'ed commit, it would be best to mark all files as changed
// But as that does not work for all potential errors, we simply mark all files as unchanged and drop the error which always works, even if not as good as possible
// But as that does not work for all potential errors, we simply mark all files as unchanged and drop the error which always works, even if not as good as possible
iferr!=nil{
iferrIgnored!=nil{
log.Error("Could not get changed files between %s and %s for pull request %d in repo with path %s. Assuming no changes. Error: %w",review.CommitSHA,latestCommit,pull.Index,gitRepo.Path,err)
log.Error("Could not get changed files between %s and %s for pull request %d in repo with path %s. Assuming no changes. Error: %w",review.CommitSHA,latestCommit,pull.Index,gitRepo.Path,err)
funcbuildFilelists(ctxcontext.Context,pv*packages_model.PackageVersion,pfs[]*packages_model.PackageFile,cpackageCache,groupstring)(*repoData,error){//nolint:dupl // duplicates with buildOther
funcbuildOther(ctxcontext.Context,pv*packages_model.PackageVersion,pfs[]*packages_model.PackageFile,cpackageCache,groupstring)(*repoData,error){//nolint:dupl // duplicates with buildFilelists
funcdoMergeAndPush(ctxcontext.Context,pr*issues_model.PullRequest,doer*user_model.User,mergeStylerepo_model.MergeStyle,expectedHeadCommitID,messagestring,pushTriggerrepo_module.PushTrigger)(string,error){//nolint:unparam // non-error result is never used