deal with NoUUID in checkCanProxy

updatecluster, updateproxy: When a remote that has no annex-uuid is
configured as annex-cluster-node, warn and avoid writing bad data to the
git-annex branch.

The proxy.log and cluster.log end up unparseable when a NoUUID gets written
to them.
This commit is contained in:
Joey Hess 2025-03-21 12:29:44 -04:00
parent ec43b25fb7
commit d0b5a09b0e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 29 additions and 13 deletions

View file

@ -1,3 +1,11 @@
git-annex (10.20250321) UNRELEASED; urgency=medium
* updatecluster, updateproxy: When a remote that has no annex-uuid is
configured as annex-cluster-node, warn and avoid writing bad data to
the git-annex branch.
-- Joey Hess <id@joeyh.name> Fri, 21 Mar 2025 12:27:11 -0400
git-annex (10.20250320) upstream; urgency=medium
* Added the compute special remote.

View file

@ -38,7 +38,7 @@ start = startingCustomOutput (ActionItemOther Nothing) $ do
Nothing -> return Nothing
Just [] -> return Nothing
Just clusternames ->
ifM (Command.UpdateProxy.checkCanProxy r "Cannot use this special remote as a cluster node.")
ifM (Command.UpdateProxy.checkCanProxy r "Cannot use this remote as a cluster node.")
( return $ Just $ M.fromList $
zip clusternames (repeat (S.singleton r))
, return Nothing

View file

@ -59,11 +59,19 @@ start = startingCustomOutput (ActionItemOther Nothing) $ do
isproxy r
| remoteAnnexProxy (R.gitconfig r) || not (null (remoteAnnexClusterNode (R.gitconfig r))) =
checkCanProxy r "Cannot proxy to this special remote."
checkCanProxy r "Cannot proxy to this remote."
| otherwise = pure False
checkCanProxy :: Remote -> String -> Annex Bool
checkCanProxy r cannotmessage =
checkCanProxy r cannotmessage
| R.uuid r == NoUUID = do
warning $ UnquotedString $ unwords
[ R.name r
, "is a git remote without a known annex-uuid."
, cannotmessage
]
pure False
| otherwise =
ifM (R.isExportSupported r)
( if annexObjects (R.config r)
then pure True
@ -75,8 +83,8 @@ checkCanProxy r cannotmessage =
where
warnannexobjects = warning $ UnquotedString $ unwords
[ R.name r
, "is configured with exporttree=yes, but without"
, "annexobjects=yes."
, "is a special remote configured with exporttree=yes,"
, "but without annexobjects=yes."
, cannotmessage
, "Suggest you run: git-annex enableremote"
, R.name r