From 1c1a05d867334dba25b337ae0a179812b35b9a88 Mon Sep 17 00:00:00 2001 From: Priyanka Chatterjee Date: Sun, 20 Jul 2025 14:25:02 +0530 Subject: [PATCH 1/8] Implement cleanup of temporary plugin directories on next command execution --- cmd/root.go | 8 ++++- internal/filepaths/collection_temp_dir.go | 41 +++++++++++++++++++++-- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index d33ca2fa..33080900 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,6 +12,7 @@ import ( "github.com/turbot/pipe-fittings/v2/utils" localcmdconfig "github.com/turbot/tailpipe/internal/cmdconfig" "github.com/turbot/tailpipe/internal/constants" + localfilepaths "github.com/turbot/tailpipe/internal/filepaths" ) var exitCode int @@ -69,10 +70,15 @@ func Execute() int { return 0 } - rootCmd := rootCommand() utils.LogTime("cmd.root.Execute start") defer utils.LogTime("cmd.root.Execute end") + // Clean up plugin temporary directories from previous crashes/interrupted installations + // This runs early to ensure cleanup happens for all commands, including --version + localfilepaths.CleanupPluginTmpDirs() + + rootCmd := rootCommand() + if err := rootCmd.Execute(); err != nil { exitCode = -1 } diff --git a/internal/filepaths/collection_temp_dir.go b/internal/filepaths/collection_temp_dir.go index 1e33b0ee..effe828f 100644 --- a/internal/filepaths/collection_temp_dir.go +++ b/internal/filepaths/collection_temp_dir.go @@ -2,12 +2,14 @@ package filepaths import ( "fmt" - "github.com/turbot/pipe-fittings/v2/utils" - "github.com/turbot/tailpipe/internal/config" "log/slog" "os" "path/filepath" "strconv" + + "github.com/turbot/pipe-fittings/v2/app_specific" + "github.com/turbot/pipe-fittings/v2/utils" + "github.com/turbot/tailpipe/internal/config" ) func EnsureCollectionTempDir() string { @@ -54,3 +56,38 @@ func CleanupCollectionTempDirs() { } } } + +// CleanupPluginTmpDirs cleans up old tmp-* directories from the plugin directory +// These directories are created during plugin installation but may be left behind if the process crashes +func CleanupPluginTmpDirs() { + pluginDir := filepath.Join(app_specific.InstallDir, "plugins") + + // ensure the plugin directory exists + if _, err := os.Stat(pluginDir); os.IsNotExist(err) { + slog.Debug("Plugin directory does not exist, skipping tmp cleanup", "dir", pluginDir) + return + } + + files, err := os.ReadDir(pluginDir) + if err != nil { + slog.Warn("failed to list files in plugin dir", "error", err, "dir", pluginDir) + return + } + + var cleanupCount int + for _, file := range files { + // look for directories that start with "tmp-" + if file.IsDir() && len(file.Name()) > 4 && file.Name()[:4] == "tmp-" { + tmpDir := filepath.Join(pluginDir, file.Name()) + slog.Debug("Removing plugin tmp directory", "dir", tmpDir) + err := os.RemoveAll(tmpDir) + if err != nil { + slog.Warn("Failed to remove plugin tmp directory", "dir", tmpDir, "error", err) + } else { + cleanupCount++ + slog.Debug("Successfully removed plugin tmp directory", "dir", tmpDir) + } + } + } + +} From 6d8b89af8eb81b9ac6ec67a798f7bc5279c55e8c Mon Sep 17 00:00:00 2001 From: Priyanka Chatterjee Date: Tue, 29 Jul 2025 02:38:54 +0530 Subject: [PATCH 2/8] Update cleanup mechanism --- cmd/root.go | 5 ++- internal/collector/collector.go | 5 ++- internal/filepaths/collection_temp_dir.go | 51 +++-------------------- 3 files changed, 14 insertions(+), 47 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 33080900..fb9e52a3 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,9 +2,11 @@ package cmd import ( "os" + "path/filepath" "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/turbot/pipe-fittings/v2/app_specific" "github.com/turbot/pipe-fittings/v2/cmdconfig" pconstants "github.com/turbot/pipe-fittings/v2/constants" "github.com/turbot/pipe-fittings/v2/error_helpers" @@ -75,7 +77,8 @@ func Execute() int { // Clean up plugin temporary directories from previous crashes/interrupted installations // This runs early to ensure cleanup happens for all commands, including --version - localfilepaths.CleanupPluginTmpDirs() + pluginDir := filepath.Join(app_specific.InstallDir, "plugins/temp") + localfilepaths.CleanupTempDirs(pluginDir) rootCmd := rootCommand() diff --git a/internal/collector/collector.go b/internal/collector/collector.go index 448fa5d1..8442e734 100644 --- a/internal/collector/collector.go +++ b/internal/collector/collector.go @@ -61,7 +61,10 @@ func New(pluginManager *plugin.PluginManager, partition *config.Partition, cance // get the temp data dir for this collection // - this is located in ~/.turbot/internal/collection// // first clear out any old collection temp dirs - filepaths.CleanupCollectionTempDirs() + // get the collection directory for this workspace + collectionDir := config.GlobalWorkspaceProfile.GetCollectionDir() + + filepaths.CleanupTempDirs(collectionDir) // then create a new collection temp dir collectionTempDir := filepaths.EnsureCollectionTempDir() diff --git a/internal/filepaths/collection_temp_dir.go b/internal/filepaths/collection_temp_dir.go index effe828f..79b3dc51 100644 --- a/internal/filepaths/collection_temp_dir.go +++ b/internal/filepaths/collection_temp_dir.go @@ -7,7 +7,6 @@ import ( "path/filepath" "strconv" - "github.com/turbot/pipe-fittings/v2/app_specific" "github.com/turbot/pipe-fittings/v2/utils" "github.com/turbot/tailpipe/internal/config" ) @@ -28,17 +27,14 @@ func EnsureCollectionTempDir() string { return collectionTempDir } -func CleanupCollectionTempDirs() { - // get the collection directory for this workspace - collectionDir := config.GlobalWorkspaceProfile.GetCollectionDir() - - files, err := os.ReadDir(collectionDir) +func CleanupTempDirs(dir string) { + files, err := os.ReadDir(dir) if err != nil { - slog.Warn("failed to list files in collection dir", "error", err) + slog.Warn("failed to list files in dir", "error", err) return } for _, file := range files { - // if the file is a directory and is not our collection temp dir, remove it + // if the file is a directory and is not our temp dir, remove it if file.IsDir() { // the folder name is the PID - check whether that pid exists // if it doesn't, remove the folder @@ -47,47 +43,12 @@ func CleanupCollectionTempDirs() { pid, err := strconv.ParseInt(file.Name(), 10, 32) if err == nil { if utils.PidExists(int(pid)) { - slog.Info(fmt.Sprintf("Cleaning existing collection temp dirs - skipping directory '%s' as process with PID %d exists", file.Name(), pid)) + slog.Info(fmt.Sprintf("Cleaning existing temp dirs - skipping directory '%s' as process with PID %d exists", file.Name(), pid)) continue } } slog.Debug("Removing directory", "dir", file.Name()) - _ = os.RemoveAll(filepath.Join(collectionDir, file.Name())) + _ = os.RemoveAll(filepath.Join(dir, file.Name())) } } } - -// CleanupPluginTmpDirs cleans up old tmp-* directories from the plugin directory -// These directories are created during plugin installation but may be left behind if the process crashes -func CleanupPluginTmpDirs() { - pluginDir := filepath.Join(app_specific.InstallDir, "plugins") - - // ensure the plugin directory exists - if _, err := os.Stat(pluginDir); os.IsNotExist(err) { - slog.Debug("Plugin directory does not exist, skipping tmp cleanup", "dir", pluginDir) - return - } - - files, err := os.ReadDir(pluginDir) - if err != nil { - slog.Warn("failed to list files in plugin dir", "error", err, "dir", pluginDir) - return - } - - var cleanupCount int - for _, file := range files { - // look for directories that start with "tmp-" - if file.IsDir() && len(file.Name()) > 4 && file.Name()[:4] == "tmp-" { - tmpDir := filepath.Join(pluginDir, file.Name()) - slog.Debug("Removing plugin tmp directory", "dir", tmpDir) - err := os.RemoveAll(tmpDir) - if err != nil { - slog.Warn("Failed to remove plugin tmp directory", "dir", tmpDir, "error", err) - } else { - cleanupCount++ - slog.Debug("Successfully removed plugin tmp directory", "dir", tmpDir) - } - } - } - -} From cdf53a94b410f32ce48712b874b6652dc2a60b0a Mon Sep 17 00:00:00 2001 From: Priyanka Chatterjee Date: Tue, 29 Jul 2025 19:28:30 +0530 Subject: [PATCH 3/8] Enhance plugin command cleanup by integrating temporary directory cleanup across multiple commands. This ensures that any leftover temporary directories from previous crashes or interrupted installations are removed before executing plugin operations. --- cmd/plugin.go | 18 +++++++++ cmd/root.go | 10 ----- internal/collector/collector.go | 9 +++-- internal/filepaths/collection_temp_dir.go | 47 ++--------------------- internal/filepaths/prune.go | 21 ++-------- 5 files changed, 29 insertions(+), 76 deletions(-) diff --git a/cmd/plugin.go b/cmd/plugin.go index 55878629..1feae1f9 100644 --- a/cmd/plugin.go +++ b/cmd/plugin.go @@ -16,6 +16,7 @@ import ( pconstants "github.com/turbot/pipe-fittings/v2/constants" "github.com/turbot/pipe-fittings/v2/contexthelpers" "github.com/turbot/pipe-fittings/v2/error_helpers" + "github.com/turbot/pipe-fittings/v2/filepaths" "github.com/turbot/pipe-fittings/v2/installationstate" pociinstaller "github.com/turbot/pipe-fittings/v2/ociinstaller" pplugin "github.com/turbot/pipe-fittings/v2/plugin" @@ -246,6 +247,9 @@ func runPluginInstallCmd(cmd *cobra.Command, args []string) { } }() + // Clean up plugin temporary directories from previous crashes/interrupted installations + filepaths.CleanupPluginTempDirs() + // args to 'plugin install' -- one or more plugins to install // plugin names can be simple names for "standard" plugins, constraint suffixed names // or full refs to the OCI image @@ -373,6 +377,9 @@ func runPluginUpdateCmd(cmd *cobra.Command, args []string) { } }() + // Clean up plugin temporary directories from previous crashes/interrupted installations + filepaths.CleanupPluginTempDirs() + // args to 'plugin update' -- one or more plugins to update // These can be simple names for "standard" plugins, constraint suffixed names // or full refs to the OCI image @@ -623,6 +630,9 @@ func runPluginUninstallCmd(cmd *cobra.Command, args []string) { } }() + // Clean up plugin temporary directories from previous crashes/interrupted installations + filepaths.CleanupPluginTempDirs() + if len(args) == 0 { fmt.Println() //nolint:forbidigo // ui output error_helpers.ShowError(ctx, fmt.Errorf("you need to provide at least one plugin to uninstall")) @@ -677,6 +687,10 @@ func runPluginListCmd(cmd *cobra.Command, _ []string) { contexthelpers.StartCancelHandler(cancel) utils.LogTime("runPluginListCmd list") + + // Clean up plugin temporary directories from previous crashes/interrupted installations + filepaths.CleanupPluginTempDirs() + defer func() { utils.LogTime("runPluginListCmd end") if r := recover(); r != nil { @@ -719,6 +733,10 @@ func runPluginShowCmd(cmd *cobra.Command, args []string) { contexthelpers.StartCancelHandler(cancel) utils.LogTime("runPluginShowCmd start") + + // Clean up plugin temporary directories from previous crashes/interrupted installations + filepaths.CleanupPluginTempDirs() + defer func() { utils.LogTime("runPluginShowCmd end") if r := recover(); r != nil { diff --git a/cmd/root.go b/cmd/root.go index fb9e52a3..618730c7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,11 +2,9 @@ package cmd import ( "os" - "path/filepath" "github.com/spf13/cobra" "github.com/spf13/viper" - "github.com/turbot/pipe-fittings/v2/app_specific" "github.com/turbot/pipe-fittings/v2/cmdconfig" pconstants "github.com/turbot/pipe-fittings/v2/constants" "github.com/turbot/pipe-fittings/v2/error_helpers" @@ -14,7 +12,6 @@ import ( "github.com/turbot/pipe-fittings/v2/utils" localcmdconfig "github.com/turbot/tailpipe/internal/cmdconfig" "github.com/turbot/tailpipe/internal/constants" - localfilepaths "github.com/turbot/tailpipe/internal/filepaths" ) var exitCode int @@ -74,14 +71,7 @@ func Execute() int { utils.LogTime("cmd.root.Execute start") defer utils.LogTime("cmd.root.Execute end") - - // Clean up plugin temporary directories from previous crashes/interrupted installations - // This runs early to ensure cleanup happens for all commands, including --version - pluginDir := filepath.Join(app_specific.InstallDir, "plugins/temp") - localfilepaths.CleanupTempDirs(pluginDir) - rootCmd := rootCommand() - if err := rootCmd.Execute(); err != nil { exitCode = -1 } diff --git a/internal/collector/collector.go b/internal/collector/collector.go index 8442e734..4ca85411 100644 --- a/internal/collector/collector.go +++ b/internal/collector/collector.go @@ -18,7 +18,8 @@ import ( "github.com/turbot/tailpipe-plugin-sdk/row_source" "github.com/turbot/tailpipe/internal/config" "github.com/turbot/tailpipe/internal/database" - "github.com/turbot/tailpipe/internal/filepaths" + localfilepaths "github.com/turbot/tailpipe/internal/filepaths" + "github.com/turbot/pipe-fittings/v2/filepaths" "github.com/turbot/tailpipe/internal/parquet" "github.com/turbot/tailpipe/internal/plugin" ) @@ -64,9 +65,9 @@ func New(pluginManager *plugin.PluginManager, partition *config.Partition, cance // get the collection directory for this workspace collectionDir := config.GlobalWorkspaceProfile.GetCollectionDir() - filepaths.CleanupTempDirs(collectionDir) + filepaths.CleanupPidTempDirs(collectionDir) // then create a new collection temp dir - collectionTempDir := filepaths.EnsureCollectionTempDir() + collectionTempDir := localfilepaths.EnsureCollectionTempDir() // create the collector c := &Collector{ @@ -301,7 +302,7 @@ func (c *Collector) handlePluginEvent(ctx context.Context, e events.Event) { func (c *Collector) createTableView(ctx context.Context) error { // so we are done writing chunks - now update the db to add a view to this data // Open a DuckDB connection - db, err := database.NewDuckDb(database.WithDbFile(filepaths.TailpipeDbFilePath())) + db, err := database.NewDuckDb(database.WithDbFile(localfilepaths.TailpipeDbFilePath())) if err != nil { return err } diff --git a/internal/filepaths/collection_temp_dir.go b/internal/filepaths/collection_temp_dir.go index 79b3dc51..b635f0ff 100644 --- a/internal/filepaths/collection_temp_dir.go +++ b/internal/filepaths/collection_temp_dir.go @@ -1,54 +1,13 @@ package filepaths import ( - "fmt" - "log/slog" - "os" - "path/filepath" - "strconv" - "github.com/turbot/pipe-fittings/v2/utils" + "github.com/turbot/pipe-fittings/v2/filepaths" "github.com/turbot/tailpipe/internal/config" ) func EnsureCollectionTempDir() string { collectionDir := config.GlobalWorkspaceProfile.GetCollectionDir() - - // add a PID directory to the collection directory - collectionTempDir := filepath.Join(collectionDir, fmt.Sprintf("%d", os.Getpid())) - - // create the directory if it doesn't exist - if _, err := os.Stat(collectionTempDir); os.IsNotExist(err) { - err := os.MkdirAll(collectionTempDir, 0755) - if err != nil { - slog.Error("failed to create collection temp dir", "error", err) - } - } - return collectionTempDir -} - -func CleanupTempDirs(dir string) { - files, err := os.ReadDir(dir) - if err != nil { - slog.Warn("failed to list files in dir", "error", err) - return - } - for _, file := range files { - // if the file is a directory and is not our temp dir, remove it - if file.IsDir() { - // the folder name is the PID - check whether that pid exists - // if it doesn't, remove the folder - // Attempt to find the process - // try to parse the directory name as a pid - pid, err := strconv.ParseInt(file.Name(), 10, 32) - if err == nil { - if utils.PidExists(int(pid)) { - slog.Info(fmt.Sprintf("Cleaning existing temp dirs - skipping directory '%s' as process with PID %d exists", file.Name(), pid)) - continue - } - } - slog.Debug("Removing directory", "dir", file.Name()) - _ = os.RemoveAll(filepath.Join(dir, file.Name())) - } - } + pidTempDir := filepaths.EnsurePidTempDir(collectionDir) + return pidTempDir } diff --git a/internal/filepaths/prune.go b/internal/filepaths/prune.go index e4c73f13..247df1a3 100644 --- a/internal/filepaths/prune.go +++ b/internal/filepaths/prune.go @@ -1,9 +1,9 @@ package filepaths import ( - "io" "os" "path/filepath" + pfilepaths "github.com/turbot/pipe-fittings/v2/filepaths" ) // PruneTree recursively deletes empty directories in the given folder. @@ -12,7 +12,7 @@ func PruneTree(folder string) error { if _, err := os.Stat(folder); os.IsNotExist(err) { return nil } - isEmpty, err := isDirEmpty(folder) + isEmpty, err := pfilepaths.IsDirEmpty(folder) if err != nil { return err } @@ -36,7 +36,7 @@ func PruneTree(folder string) error { } // Check again if the folder is empty after pruning subdirectories - isEmpty, err = isDirEmpty(folder) + isEmpty, err = pfilepaths.IsDirEmpty(folder) if err != nil { return err } @@ -47,18 +47,3 @@ func PruneTree(folder string) error { return nil } - -// isDirEmpty checks if a directory is empty. -func isDirEmpty(dir string) (bool, error) { - f, err := os.Open(dir) - if err != nil { - return false, err - } - defer f.Close() - - _, err = f.Readdir(1) - if err == io.EOF { - return true, nil - } - return false, err -} From 265a4b5ecad4688bde05ff2950db3bac5631f88a Mon Sep 17 00:00:00 2001 From: Priyanka Chatterjee Date: Thu, 11 Sep 2025 00:36:53 +0530 Subject: [PATCH 4/8] update --- internal/collector/collector.go | 69 --------------------------------- 1 file changed, 69 deletions(-) diff --git a/internal/collector/collector.go b/internal/collector/collector.go index 31de879a..49b2fbaa 100644 --- a/internal/collector/collector.go +++ b/internal/collector/collector.go @@ -300,75 +300,6 @@ func (c *Collector) Completed() { func (c *Collector) deletePartitionData(ctx context.Context, fromTime, toTime time.Time) error { slog.Info("Deleting parquet files after the from time", "partition", c.partition.Name, "from", fromTime) _, err := database.DeletePartition(ctx, c.partition, fromTime, toTime, c.db) -// handlePluginEvent handles an event from a plugin -func (c *Collector) handlePluginEvent(ctx context.Context, e events.Event) { - // handlePluginEvent the event - // switch based on the struct of the event - switch ev := e.(type) { - case *events.Started: - slog.Info("Started event", "execution", ev.ExecutionId) - c.execution.state = ExecutionState_STARTED - case *events.Status: - c.statusLock.Lock() - defer c.statusLock.Unlock() - c.status.UpdateWithPluginStatus(ev) - c.updateApp(CollectionStatusUpdateMsg{status: c.status}) - case *events.Chunk: - - executionId := ev.ExecutionId - chunkNumber := ev.ChunkNumber - - // log every 100 chunks - if ev.ChunkNumber%100 == 0 { - slog.Debug("Chunk event", "execution", ev.ExecutionId, "chunk", ev.ChunkNumber) - } - - err := c.parquetConvertor.AddChunk(executionId, chunkNumber) - if err != nil { - slog.Error("failed to add chunk to parquet writer", "error", err) - c.execution.done(err) - } - case *events.Complete: - slog.Info("Complete event", "execution", ev.ExecutionId) - - // was there an error? - if ev.Err != nil { - slog.Error("execution error", "execution", ev.ExecutionId, "error", ev.Err) - // update the execution - c.execution.done(ev.Err) - return - } - // this event means all JSON files have been written - we need to wait for all to be converted to parquet - // we then combine the parquet files into a single file - - // start thread waiting for conversion to complete - // - this will wait for all parquet files to be written, and will then combine these into a single parquet file - slog.Info("handlePluginEvent - waiting for conversions to complete") - go func() { - err := c.waitForConversions(ctx, ev) - if err != nil { - slog.Error("error waiting for execution to complete", "error", err) - c.execution.done(err) - } else { - slog.Info("handlePluginEvent - conversions all complete") - } - }() - - case *events.Error: - // TODO #errors error events are deprecated an will only be sent for plugins not using sdk > v0.2.0 - // TODO #errors decide what (if anything) we should do with error events from old plugins https://github.com/turbot/tailpipe/issues/297 - //ev := e.GetErrorEvent() - //// for now just store errors and display at end - ////c.execution.state = ExecutionState_ERROR - ////c.execution.error = fmt.Errorf("plugin error: %s", ev.Error) - //slog.Warn("plugin error", "execution", ev.ExecutionId, "error", ev.Error) - } -} - -func (c *Collector) createTableView(ctx context.Context) error { - // so we are done writing chunks - now update the db to add a view to this data - // Open a DuckDB connection - db, err := database.NewDuckDb(database.WithDbFile(localfilepaths.TailpipeDbFilePath())) if err != nil { slog.Warn("Failed to delete parquet files after the from time", "partition", c.partition.Name, "from", fromTime, "error", err) From 130c717412296b59a31b25022311cd806b751f05 Mon Sep 17 00:00:00 2001 From: Priyanka Chatterjee Date: Thu, 11 Sep 2025 00:58:30 +0530 Subject: [PATCH 5/8] Remove unused import for the parquet package in collector.go --- internal/collector/collector.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/collector/collector.go b/internal/collector/collector.go index 49b2fbaa..0d04b0a5 100644 --- a/internal/collector/collector.go +++ b/internal/collector/collector.go @@ -21,7 +21,6 @@ import ( "github.com/turbot/tailpipe/internal/database" localfilepaths "github.com/turbot/tailpipe/internal/filepaths" "github.com/turbot/pipe-fittings/v2/filepaths" - "github.com/turbot/tailpipe/internal/parquet" "github.com/turbot/tailpipe/internal/plugin" ) From bd9de162ff0318d39dbaefdcce53cb967bd188ad Mon Sep 17 00:00:00 2001 From: Priyanka Chatterjee Date: Mon, 15 Sep 2025 18:43:15 +0530 Subject: [PATCH 6/8] chore: update dependencies in go.mod and go.sum --- go.mod | 12 ++++++------ go.sum | 23 ++++++++++++----------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index a1b530e7..fa4d8125 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ replace ( ) require ( - github.com/Masterminds/semver/v3 v3.2.1 - github.com/hashicorp/hcl/v2 v2.20.1 + github.com/Masterminds/semver/v3 v3.4.0 + github.com/hashicorp/hcl/v2 v2.24.0 github.com/mattn/go-isatty v0.0.20 github.com/spf13/cobra v1.9.1 github.com/spf13/viper v1.19.0 @@ -21,7 +21,7 @@ require ( github.com/turbot/go-kit v1.3.0 github.com/turbot/pipe-fittings/v2 v2.6.0 github.com/turbot/tailpipe-plugin-sdk v0.9.2 - github.com/zclconf/go-cty v1.14.4 + github.com/zclconf/go-cty v1.16.3 golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 ) @@ -41,7 +41,6 @@ require ( github.com/marcboeker/go-duckdb/v2 v2.3.5 github.com/thediveo/enumflag/v2 v2.0.5 github.com/turbot/tailpipe-plugin-core v0.2.10 - golang.org/x/sync v0.16.0 golang.org/x/text v0.27.0 google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 @@ -178,7 +177,7 @@ require ( github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/go-wordwrap v1.0.0 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/locker v1.0.1 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect @@ -206,7 +205,7 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect - github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/pflag v1.0.10 // indirect github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect github.com/stevenle/topsort v0.2.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect @@ -235,6 +234,7 @@ require ( golang.org/x/mod v0.26.0 // indirect golang.org/x/net v0.42.0 // indirect golang.org/x/oauth2 v0.29.0 // indirect + golang.org/x/sync v0.16.0 // indirect golang.org/x/sys v0.34.0 // indirect golang.org/x/term v0.33.0 // indirect golang.org/x/time v0.11.0 // indirect diff --git a/go.sum b/go.sum index 856b516a..f7968a1d 100644 --- a/go.sum +++ b/go.sum @@ -630,8 +630,8 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0 github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 h1:6/0iUd0xrnX7qt+mLNRwg5c0PGv8wpE8K90ryANQwMI= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0/go.mod h1:otE2jQekW/PqXk1Awf5lmfokJx4uwuqcj1ab5SpGeW0= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= -github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= -github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Microsoft/hcsshim v0.11.7 h1:vl/nj3Bar/CvJSYo7gIQPyRWc9f3c6IeSNavBTSZNZQ= @@ -1037,8 +1037,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.20.1 h1:M6hgdyz7HYt1UN9e61j+qKJBqR3orTWbI1HKBJEdxtc= -github.com/hashicorp/hcl/v2 v2.20.1/go.mod h1:TZDqQ4kNKCbh1iJp99FdPiUaVDDUPivbqxZulxDYqL4= +github.com/hashicorp/hcl/v2 v2.24.0 h1:2QJdZ454DSsYGoaE6QheQZjtKZSUs9Nh2izTWiwQxvE= +github.com/hashicorp/hcl/v2 v2.24.0/go.mod h1:oGoO1FIQYfn/AgyOhlg9qLC6/nOJPX3qGbkZpYAcqfM= github.com/hashicorp/terraform-registry-address v0.2.1 h1:QuTf6oJ1+WSflJw6WYOHhLgwUiQ0FrROpHPYFtwTYWM= github.com/hashicorp/terraform-registry-address v0.2.1/go.mod h1:BSE9fIFzp0qWsJUUyGquo4ldV9k2n+psif6NYkBRS3Y= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -1165,8 +1165,8 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= @@ -1264,8 +1264,9 @@ github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/spiffe/go-spiffe/v2 v2.5.0 h1:N2I01KCUkv1FAjZXJMwh95KK1ZIQLYbPfhaxw8WS0hE= @@ -1327,10 +1328,10 @@ github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= -github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +github.com/zclconf/go-cty v1.16.3 h1:osr++gw2T61A8KVYHoQiFbFd1Lh3JOCXc/jFLJXKTxk= +github.com/zclconf/go-cty v1.16.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= github.com/zclconf/go-cty-yaml v1.0.3 h1:og/eOQ7lvA/WWhHGFETVWNduJM7Rjsv2RRpx1sdFMLc= github.com/zclconf/go-cty-yaml v1.0.3/go.mod h1:9YLUH4g7lOhVWqUbctnVlZ5KLpg7JAprQNgxSZ1Gyxs= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= From 84434371227d14ee2a84271cc622757e2a7a7942 Mon Sep 17 00:00:00 2001 From: Priyanka Chatterjee Date: Mon, 15 Sep 2025 19:51:49 +0530 Subject: [PATCH 7/8] chore: update pipe-fittings dependency to v2.7.0-rc.0 in go.mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index fa4d8125..2a4650cd 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.10.0 github.com/turbot/go-kit v1.3.0 - github.com/turbot/pipe-fittings/v2 v2.6.0 + github.com/turbot/pipe-fittings/v2 v2.7.0-rc.0 github.com/turbot/tailpipe-plugin-sdk v0.9.2 github.com/zclconf/go-cty v1.16.3 golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 From 973b4e86503e8e1eae0a252f21d9a1d3a4512486 Mon Sep 17 00:00:00 2001 From: Priyanka Chatterjee Date: Mon, 15 Sep 2025 20:42:30 +0530 Subject: [PATCH 8/8] chore: comment out local pipe-fittings dependency in go.mod and update go.sum with new version --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2a4650cd..0236b25a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.24.0 replace ( github.com/c-bata/go-prompt => github.com/turbot/go-prompt v0.2.6-steampipe.0.0.20221028122246-eb118ec58d50 - github.com/turbot/pipe-fittings/v2 => ../pipe-fittings + // github.com/turbot/pipe-fittings/v2 => ../pipe-fittings //github.com/turbot/tailpipe-plugin-core => ../tailpipe-plugin-core github.com/turbot/tailpipe-plugin-sdk => ../tailpipe-plugin-sdk ) diff --git a/go.sum b/go.sum index f7968a1d..19ecc374 100644 --- a/go.sum +++ b/go.sum @@ -1308,6 +1308,8 @@ github.com/turbot/go-kit v1.3.0 h1:6cIYPAO5hO9fG7Zd5UBC4Ch3+C6AiiyYS0UQnrUlTV0= github.com/turbot/go-kit v1.3.0/go.mod h1:piKJMYCF8EYmKf+D2B78Csy7kOHGmnQVOWingtLKWWQ= github.com/turbot/go-prompt v0.2.6-steampipe.0.0.20221028122246-eb118ec58d50 h1:zs87uA6QZsYLk4RRxDOIxt8ro/B2V6HzoMWm05Lo7ao= github.com/turbot/go-prompt v0.2.6-steampipe.0.0.20221028122246-eb118ec58d50/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw= +github.com/turbot/pipe-fittings/v2 v2.7.0-rc.0 h1:p9/Hf0BNNjZVs5C4AqZlQgmihKt/nboh5OrfGcH8Mhk= +github.com/turbot/pipe-fittings/v2 v2.7.0-rc.0/go.mod h1:V619+tgfLaqoEXFDNzA2p24TBZVf4IkDL9FDLQecMnE= github.com/turbot/pipes-sdk-go v0.12.0 h1:esbbR7bALa5L8n/hqroMPaQSSo3gNM/4X0iTmHa3D6U= github.com/turbot/pipes-sdk-go v0.12.0/go.mod h1:Mb+KhvqqEdRbz/6TSZc2QWDrMa5BN3E4Xw+gPt2TRkc= github.com/turbot/tailpipe-plugin-core v0.2.10 h1:2+B7W4hzyS/pBr1y5ns9w84piWGq/x+WdCUjyPaPreQ=