From d740a18f13090c9209edbb19292baea8880277b5 Mon Sep 17 00:00:00 2001 From: Doria Keung Date: Thu, 16 May 2024 11:19:51 -0400 Subject: [PATCH] Only archive and unarchive labels for target modules (#2983) We should only be archiving and unarchiving labels for target modules. --- private/buf/cmd/buf/command/beta/registry/archive/archive.go | 3 +++ .../buf/cmd/buf/command/beta/registry/unarchive/unarchive.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/private/buf/cmd/buf/command/beta/registry/archive/archive.go b/private/buf/cmd/buf/command/beta/registry/archive/archive.go index b82930548e..78ae7d2b45 100644 --- a/private/buf/cmd/buf/command/beta/registry/archive/archive.go +++ b/private/buf/cmd/buf/command/beta/registry/archive/archive.go @@ -106,6 +106,9 @@ func run( } registryToModuleFullNames := map[string][]bufmodule.ModuleFullName{} for _, module := range workspace.Modules() { + if !module.IsTarget() { + continue + } if moduleFullName := module.ModuleFullName(); moduleFullName != nil { moduleFullNames, ok := registryToModuleFullNames[moduleFullName.Registry()] if !ok { diff --git a/private/buf/cmd/buf/command/beta/registry/unarchive/unarchive.go b/private/buf/cmd/buf/command/beta/registry/unarchive/unarchive.go index e815775abc..a50fb1204a 100644 --- a/private/buf/cmd/buf/command/beta/registry/unarchive/unarchive.go +++ b/private/buf/cmd/buf/command/beta/registry/unarchive/unarchive.go @@ -106,6 +106,9 @@ func run( } registryToModuleFullNames := map[string][]bufmodule.ModuleFullName{} for _, module := range workspace.Modules() { + if !module.IsTarget() { + continue + } if moduleFullName := module.ModuleFullName(); moduleFullName != nil { moduleFullNames, ok := registryToModuleFullNames[moduleFullName.Registry()] if !ok {