fix(releases): retry action missing external indexer identifier (#1612)

* fix(releases): retry action missing external identifier

* fix(actions): arrs set fallback indexer identifier
This commit is contained in:
ze0s 2024-08-11 20:39:11 +02:00 committed by GitHub
parent 3183e15a4b
commit abfac05b66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 105 additions and 18 deletions

View file

@ -375,19 +375,31 @@ func (s *service) Retry(ctx context.Context, req *domain.ReleaseActionRetryReq)
// get release
release, err := s.Get(ctx, &domain.GetReleaseRequest{Id: req.ReleaseId})
if err != nil {
return err
return errors.Wrap(err, "retry error: could not find release by id: %d", req.ReleaseId)
}
indexerInfo, err := s.indexerSvc.GetBy(ctx, domain.GetIndexerRequest{Identifier: release.Indexer.Identifier})
if err != nil {
return errors.Wrap(err, "retry error: could not get indexer by identifier: %s", release.Indexer.Identifier)
}
release.Indexer = domain.IndexerMinimal{
ID: int(indexerInfo.ID),
Name: indexerInfo.Name,
Identifier: indexerInfo.Identifier,
IdentifierExternal: indexerInfo.IdentifierExternal,
}
// get release filter action status
status, err := s.GetActionStatus(ctx, &domain.GetReleaseActionStatusRequest{Id: req.ActionStatusId})
if err != nil {
return err
return errors.Wrap(err, "retry error: could not get release action")
}
// get filter action with action id from status
filterAction, err := s.actionSvc.Get(ctx, &domain.GetActionRequest{Id: int(status.ActionID)})
if err != nil {
return err
return errors.Wrap(err, "retry error: could not get filter action for release")
}
// run filterAction