fix: allow actions artifacts storage migration to complete succesfully (#31251)

Change the copy to use `ActionsArtifact.StoragePath` instead of the
`ArtifactPath`. Skip artifacts that are expired, and don't error if the
file to copy does not exist.

---

When trying to migrate actions artifact storage from local to MinIO, we
encountered errors that prevented the process from completing
successfully:

* The migration tries to copy the files using the per-run
`ArtifactPath`, instead of the unique `StoragePath`.
* Artifacts that have been marked expired and had their files deleted
would throw an error
* Artifacts that are pending, but don't have a file uploaded yet will
throw an error.

This PR addresses these cases, and allow the process to complete
successfully.

(cherry picked from commit 8de8972baf5d82ff7b58ed77d78e8e1869e64eb5)
This commit is contained in:
Rowan Bohde 2024-06-04 23:00:56 -05:00 committed by Earl Warren
parent 96f661e821
commit 4afbfd3946
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1 @@
- `forgejo migrate-storage --type actions-artifacts` always fails because it picks the wrong path