Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Make ArtifactCallback work for puts to remote repositories #4785

Open
CeylonMigrationBot opened this issue Aug 17, 2015 · 6 comments
Open

Make ArtifactCallback work for puts to remote repositories #4785

CeylonMigrationBot opened this issue Aug 17, 2015 · 6 comments

Comments

@CeylonMigrationBot
Copy link

[@quintesse] Right now the ArtifactCallback is only called when downloading something from a remote repository and ignored when uploading to it.

Although there might be a different way to solve this, because I'd also like for the callback to be used for local operations, so that for example a copy operation from one local repo to another would also use the callback.

That way the progress report for uploading would automatically work because it would really be showing the progress of the read operations of the local repository.

Thing is all those operations go through AbstractNodeRepositoryManager.addContent() and not through RootRepositoryManager.putContent() where the callback is being handled and I'm not sure what the best way is to handle this. Wdyt @alesj ?

[Migrated from ceylon/ceylon-module-resolver#123]

@CeylonMigrationBot
Copy link
Author

[@alesj]
@quintesse Let me check out the code ... after 1M years ...

@CeylonMigrationBot
Copy link
Author

[@alesj]
@quintesse afais, AbstractNodeRepositoryManager.addContent() has it's only impl in RootRepositoryManager.
And that impl always calls RootRepositoryManager::putContent().

@CeylonMigrationBot
Copy link
Author

[@quintesse] @alesj as you can read from the log.debug() statement you put at the beginning of that method (RootRepositoryManager::putContent()) it only gets called when "Creating local copy of external node", in other words: only when downloading.

@CeylonMigrationBot
Copy link
Author

[@quintesse] And after some more debugging I can tell you that when uploading the RootRepositoryManager isn't even used! It's the CachingRepositoryManager that does all the work, putArtifact() in line 99 which delegates to AbstractNodeRepositoryManager.putArtifact() in the line 254 which then goes to putArtifactInternal() which uses OpenNode::addContent() to actually upload the artifact.

@CeylonMigrationBot
Copy link
Author

[@alesj]
@quintesse ok, I must admit I don't follow all the details.
I would say, adjust the callback code as you please.

When I added it, I tried to find the right download place,
I didn't put upload into consideration.

@CeylonMigrationBot
Copy link
Author

[@quintesse] Well it was not so much that I was asking for permission but for help because I'm not sure at all how to do it ;) But I'll just see what I can break ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant