Skip to content

Commit a3db0f8

Browse files
pditommasoclaude
andauthored
Simplify plugin download implementation (#6349) [ci fast]
* Simplify plugin download implementation - Remove OciAwareFileDownloader class and use SimpleFileDownloader instead - Remove unnecessary file renaming logic in PluginUpdater - Streamline plugin download process by removing complex OCI authentication This simplifies the plugin download mechanism while maintaining core functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Remove deprecated OCI downloader Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> * Remove deprecated test Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> --------- Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent e146b41 commit a3db0f8

File tree

5 files changed

+4
-603
lines changed

5 files changed

+4
-603
lines changed

modules/nf-commons/src/main/nextflow/plugin/HttpPluginRepository.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import org.pf4j.update.FileDownloader
1717
import org.pf4j.update.FileVerifier
1818
import org.pf4j.update.PluginInfo
1919
import org.pf4j.update.PluginInfo.PluginRelease
20+
import org.pf4j.update.SimpleFileDownloader
2021
import org.pf4j.update.verifier.CompoundVerifier
2122
/**
2223
* Represents an update repository served via an HTTP api.
@@ -99,7 +100,7 @@ class HttpPluginRepository implements PrefetchUpdateRepository {
99100

100101
@Override
101102
FileDownloader getFileDownloader() {
102-
return new OciAwareFileDownloader()
103+
return new SimpleFileDownloader()
103104
}
104105

105106
@Override

modules/nf-commons/src/main/nextflow/plugin/OciAwareFileDownloader.groovy

Lines changed: 0 additions & 201 deletions
This file was deleted.

modules/nf-commons/src/main/nextflow/plugin/PluginUpdater.groovy

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,11 @@ class PluginUpdater extends UpdateManager {
239239
// 2. download to temporary location
240240
Path downloaded = safeDownloadPlugin(id, version);
241241

242-
// 3. rename to match the expected name
243-
if ( downloaded.getFileName().toString() != "${pluginPath.getFileName()}.zip" ) {
244-
final targetName = downloaded.resolveSibling("${pluginPath.getFileName()}.zip")
245-
if ( !Files.move(downloaded, targetName) ) throw new PluginRuntimeException("Failed to rename '$downloaded'")
246-
downloaded = targetName
247-
}
248-
249-
// 4. unzip the content and delete downloaded file
242+
// 3. unzip the content and delete downloaded file
250243
Path dir = FileUtils.expandIfZip(downloaded)
251244
FileHelper.deletePath(downloaded)
252245

253-
// 5. move the final destination the plugin directory
246+
// 4. move the final destination the plugin directory
254247
assert pluginPath.getFileName() == dir.getFileName()
255248
try {
256249
safeMove(dir, pluginPath)

0 commit comments

Comments
 (0)