Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
ffd4ea5
feat: add sql query hints to code editor
elmilan06 Dec 31, 2025
988c2cb
feat: add SQL query suggestions to code editor
elmilan06 Jan 2, 2026
0e8fb4d
Merge remote-tracking branch 'origin/v11' into backlog/add-sql-hints-…
elmilan06 Jan 2, 2026
7356807
feat(application-event): enhance logging and update index for applica…
mjabascal10 Jan 5, 2026
2ae1190
update windows-events filter
JocLRojas Jan 5, 2026
536049d
feat(plugins): add new CrowdStrike plugin to collect and process secu…
JocLRojas Jan 5, 2026
48669ac
feat: add sql query hints to code editor
elmilan06 Dec 31, 2025
29ae488
feat: add SQL query suggestions to code editor
elmilan06 Jan 2, 2026
603aa81
feat: enhance SQL query suggestions in code editor with limits and ag…
elmilan06 Jan 3, 2026
4f00f34
feat: enhance SQL query suggestions in code editor with limits and ag…
elmilan06 Jan 5, 2026
74ca16f
Merge remote-tracking branch 'origin/backlog/add-sql-hints-to-code-ed…
elmilan06 Jan 5, 2026
a2fddcd
feat(crowdstrike): add integration procedures and configuration for C…
mjabascal10 Jan 5, 2026
b59e62e
Merge remote-tracking branch 'origin/release/v11.2.0' into release/v1…
mjabascal10 Jan 5, 2026
c9feb28
feat(crowdstrike): add integration procedures and configuration for C…
mjabascal10 Jan 5, 2026
cd0dc57
feat(crowdstrike): implement CrowdStrike integration guide and update…
mjabascal10 Jan 5, 2026
2573211
Merge remote-tracking branch 'origin/release/v11.2.0' into release/v1…
mjabascal10 Jan 5, 2026
f48e2a5
add the CrowdStrike plugin build and push it into the event processor…
JocLRojas Jan 5, 2026
3328901
fix: Incorrect cursor behavior in SQL Query Editor
elmilan06 Jan 6, 2026
293def6
fix: Incorrect cursor behavior in SQL Query Editor
elmilan06 Jan 6, 2026
377193e
Merge remote-tracking branch 'origin/backlog/add-sql-hints-to-code-ed…
elmilan06 Jan 6, 2026
f9f2fdf
fix: Incorrect cursor behavior in SQL Query Editor
elmilan06 Jan 6, 2026
a022f65
Merge pull request #1553 from utmstack/backlog/add-sql-hints-to-code-…
mjabascal10 Jan 6, 2026
f3a1ff0
fix(crowdstrike): standardize configuration keys for CrowdStrike module
mjabascal10 Jan 6, 2026
efca0f2
feat(crowdstrike): implement CrowdStrike integration guide and update…
mjabascal10 Jan 6, 2026
7645f19
fix(crowdStrike): fixed configuration parameter names to maintain com…
JocLRojas Jan 6, 2026
0378f3a
Merge branch 'release/v11.2.0' of https://github.com/utmstack/UTMStac…
JocLRojas Jan 6, 2026
8330f12
Merge remote-tracking branch 'origin/release/v11.2.0' into release/v1…
mjabascal10 Jan 6, 2026
959f122
Merge branch 'release/v11.2.0' of https://github.com/utmstack/UTMStac…
JocLRojas Jan 6, 2026
fed0e4b
fix(crowdStrike): fixed informational message to follow standard catcher
JocLRojas Jan 6, 2026
8bfedba
Merge remote-tracking branch 'origin/v11' into release/v11.2.0
mjabascal10 Jan 7, 2026
57ef092
Merge remote-tracking branch 'origin/release/v11.2.0' into release/v1…
mjabascal10 Jan 7, 2026
7afc81b
fix(crowdstrike): standardize configuration keys for CrowdStrike module
mjabascal10 Jan 7, 2026
78a5f99
feat(crowdstrike): update CrowdStrike integration filter and normaliz…
mjabascal10 Jan 8, 2026
ceb4bfd
Merge remote-tracking branch 'origin/v11' into release/v11.2.0
mjabascal10 Jan 8, 2026
17914a2
fix(app-logs): update log detail terminology for clarity
mjabascal10 Jan 8, 2026
b61ceb1
Merge remote-tracking branch 'origin/release/v11.2.0' into release/v1…
mjabascal10 Jan 8, 2026
1789a4b
feat(audit): enhance audit messages with enriched context and impleme…
mjabascal10 Jan 8, 2026
5034287
Merge remote-tracking branch 'origin/release/v11.2.0' into release/v1…
mjabascal10 Jan 8, 2026
5ec71ea
fix(UtmDataInputStatusService): optimize data synchronization and imp…
mjabascal10 Jan 8, 2026
87cd288
refactor: remove unused agent self
yllada Jan 8, 2026
24b8b03
feat(agent): implement UTMStack Updater service
yllada Jan 8, 2026
f538b89
feat(agent): implement updater service installation and update process
yllada Jan 8, 2026
de20f45
feat(modulesConfig): enhance AWS config validation to include log gro…
yllada Jan 8, 2026
1a32799
feat(aws): enhance AWS CloudWatch Logs streaming with dynamic configu…
yllada Jan 8, 2026
e9e395d
feat(pipeline): update build process to include updater service
yllada Jan 8, 2026
b33a779
Revert "feat(pipeline): update build process to include updater service"
yllada Jan 8, 2026
119e7cd
feat(pipeline): update build process to include updater service
yllada Jan 8, 2026
06a0dd6
feat(data-input): add checkpoint table and repository for data input …
mjabascal10 Jan 9, 2026
5183806
Merge remote-tracking branch 'origin/release/v11.2.0' into release/v1…
mjabascal10 Jan 9, 2026
8c09cf4
fix(UtmAlertServiceImpl): filter alerts to process only non parent al…
mjabascal10 Jan 9, 2026
e0db7ba
fix(config): add .exe extension to updater service filenames for Wind…
yllada Jan 9, 2026
aaec2ca
Merge branch 'release/v11.2.0' of github.com:utmstack/UTMStack into r…
yllada Jan 9, 2026
4fe83d3
fix(aws): correct component naming and update routing in email settings
mjabascal10 Jan 9, 2026
7eacd0c
Merge remote-tracking branch 'origin/release/v11.2.0' into release/v1…
mjabascal10 Jan 9, 2026
35cd8a0
chore(CHANGELOG): update release notes for UTMStack v11.2.0
mjabascal10 Jan 12, 2026
b3d17c0
Merge remote-tracking branch 'origin/release/v11.2.0' into release/v1…
mjabascal10 Jan 12, 2026
f127934
chore(CHANGELOG): update release notes for UTMStack v11.2.0
mjabascal10 Jan 12, 2026
c14a3ca
feat(threatwinds): add configuration parameters for ThreatWinds integ…
mjabascal10 Jan 12, 2026
6f60b06
Merge remote-tracking branch 'origin/v11' into release/v11.2.1
mjabascal10 Jan 12, 2026
4d99d23
fix[installer]: solved upload logs problem and comment debug logs
Kbayero Jan 12, 2026
078c732
feat(app-config): enhance configuration handling with version type su…
mjabascal10 Jan 12, 2026
5abcdc2
feat(tw-config): add TwConfigValidatorService for configuration valid…
mjabascal10 Jan 12, 2026
be56051
update crowdstrike filter
JocLRojas Jan 13, 2026
539de4e
feat(macos-integration): add Liquibase changelog for updating MACOS m…
mjabascal10 Jan 13, 2026
67eb897
feat(rule-list): add sortable fields to rule list columns
mjabascal10 Jan 13, 2026
fea0b0d
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 13, 2026
50f8cf6
refactor(pagination): remove unnecessary initialization checks and re…
mjabascal10 Jan 13, 2026
3c47b5c
feat(utm-alert): add filter to exclude false positive alerts
mjabascal10 Jan 13, 2026
9fd2fc5
refactor(assets-view): simplify timestamp formatting and clean up code
mjabascal10 Jan 13, 2026
36096cf
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 13, 2026
8e361ac
feat[ci/installer]: calculate changelog, improve ci/cd workflow, regi…
Kbayero Jan 14, 2026
7c992fd
Merge branch 'release/v11.2.1' of https://github.com/utmstack/UTMStac…
Kbayero Jan 14, 2026
f7bb56e
feat(ci/installer): refactor deployment pipelines and add instance he…
Kbayero Jan 14, 2026
78dac88
feat(assets-view): implement sorting by last input and enhance asset …
mjabascal10 Jan 13, 2026
9c9e59d
feat(assets-view): implement sorting by last input and enhance asset …
mjabascal10 Jan 14, 2026
971e3fc
feat(assets-view): implement sorting by last input and enhance asset …
mjabascal10 Jan 14, 2026
a4faafa
fix(installer): fix log upload content-type, reduce email spam, and s…
Kbayero Jan 14, 2026
7c77a86
feat(plugins): implement ThreadWinds ingestion plugin
JocLRojas Jan 14, 2026
fb490b8
ci(event-processor): add ThreadWinds ingestion plugin to build pipeline
JocLRojas Jan 14, 2026
28e58e6
Merge branch 'release/v11.2.1' of https://github.com/utmstack/UTMStac…
JocLRojas Jan 14, 2026
304a8d3
feat(liquibase): add changelog for updating section instance configur…
mjabascal10 Jan 14, 2026
a99780e
refactor(welcome-to-utmstack): remove instance registration form
mjabascal10 Jan 14, 2026
ad2e220
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 14, 2026
f6fc708
fix(threadwinds-ingestion): Update ThreatWinds sectionID from 6 to 10
JocLRojas Jan 15, 2026
872d62a
fix[ci/cd]: update cm auth secret name and update workflow procedures
Kbayero Jan 15, 2026
942c7e4
Merge branch 'release/v11.2.1' of https://github.com/utmstack/UTMStac…
Kbayero Jan 15, 2026
312164a
fix[dependencies]: updated golang dependencies
Kbayero Jan 15, 2026
70be4f7
Add geolocation/ to .gitignore
osmontero Jan 15, 2026
3601568
refactor(agent-manager): improve logging by adding process context
osmontero Jan 15, 2026
dcdd9cb
Refactor: ensure proper resource cleanup with `defer` statements in f…
osmontero Jan 15, 2026
47bcb50
refactor(plugins): enhance logging by including process context for e…
osmontero Jan 15, 2026
4678991
fix[ci/cd]: add dependencies check before build
Kbayero Jan 15, 2026
8413418
Merge branch 'release/v11.2.1' of https://github.com/utmstack/UTMStac…
Kbayero Jan 15, 2026
039290a
fix[ci/cd]: update golang dependencies updater
Kbayero Jan 15, 2026
62128d4
fix[plugins]: update go-sdk and fix plugins compilation
Kbayero Jan 15, 2026
a18cfb9
refactor(soc-ai): improve error message clarity in elastic error handler
osmontero Jan 15, 2026
9f21d6b
refactor(plugins): simplify plugin initialization and improve error h…
osmontero Jan 15, 2026
34ea89c
feat(exception-handling): implement global exception handling for PDF…
mjabascal10 Jan 16, 2026
27ffdc6
fix: update OpenSearch plugin configuration key from `com.utmstack` t…
osmontero Jan 16, 2026
3c7080f
Merge branch 'release/v11.2.1' of https://github.com/utmstack/UTMStac…
osmontero Jan 16, 2026
e128038
feat: remove http-input and grpc-input plugin configurations and thei…
osmontero Jan 19, 2026
d46fe4f
fix: update menu URL for SOC AI
mjabascal10 Jan 19, 2026
0a3c2a8
fix[plugins]: update dependencies
Kbayero Jan 19, 2026
b35f496
Merge branch 'release/v11.2.1' of https://github.com/utmstack/UTMStac…
Kbayero Jan 19, 2026
e714f0c
feat(api-checker): enhance API availability checks and improve loadin…
mjabascal10 Jan 19, 2026
550c4fa
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 19, 2026
4859241
fix(WebPdfController): update PDF generation response messages for cl…
mjabascal10 Jan 19, 2026
7472900
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
osmontero Jan 19, 2026
dc93b2a
chore(dependencies): update `github.com/threatwinds/go-sdk` to v1.1.5…
osmontero Jan 19, 2026
e4acc56
feat: Add playground mode check to allow plugins to exit early based …
osmontero Jan 19, 2026
bb9a5a6
fix(PdfGenerationService): improve PDF loading wait conditions and re…
mjabascal10 Jan 19, 2026
e10681f
feat(PdfService): enhance PDF generation with improved response handl…
mjabascal10 Jan 19, 2026
86d6d7f
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 19, 2026
6365f57
refactor: improve default time handling and enhance observables in da…
mjabascal10 Jan 19, 2026
050c0a3
refactor(soc-ai): rename queue functions to use consistent casing and…
osmontero Jan 19, 2026
ae129ad
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
osmontero Jan 19, 2026
94ef72f
feat(alerts): add integration tests for deduplication and grouping lo…
osmontero Jan 20, 2026
69cc5cf
chore(dependencies): update `go.mod` and `go.sum` to include `opensea…
osmontero Jan 20, 2026
c293546
chore(dependencies): bump `threatwinds/go-sdk` to v1.1.6 and add `ope…
osmontero Jan 20, 2026
c34ecd4
feat(plugins): add "feeds" to analysis pipeline order
osmontero Jan 20, 2026
65bd80f
refactor(plugins): remove `PLAYGROUND` environment variable checks an…
osmontero Jan 20, 2026
c85ec15
fix[ci/cd]: allow agent manager build
Kbayero Jan 20, 2026
00b5780
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 20, 2026
1b958d6
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 20, 2026
70fa4e3
fix[plugins]: update threatwinds go-sdk to v1.1.7
Kbayero Jan 20, 2026
a1ccb23
fix(compliance-export): update loading state class and enhance time f…
mjabascal10 Jan 20, 2026
0e6bb01
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 20, 2026
e9b4112
feat(correlation-rules): add rule_group_by_def to support grouping in…
mjabascal10 Jan 20, 2026
bf386ad
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 20, 2026
1977726
feat(rule-management): refactor deduplication fields into fields sele…
mjabascal10 Jan 20, 2026
f9dc7e9
fix(app-management-sidebar): comment out unused links for user access…
mjabascal10 Jan 20, 2026
f0bb9f7
feat(rule-management): refactor deduplication fields into fields sele…
mjabascal10 Jan 20, 2026
21514d4
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 20, 2026
210a378
feat(correlation-rules): add rule_group_by_def to support grouping in…
mjabascal10 Jan 21, 2026
229d8be
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 21, 2026
8232fde
refactor(plugins): standardize error handling by replacing `fmt.Error…
osmontero Jan 21, 2026
9f75aec
refactor(plugins): enhance error handling for database operations and…
osmontero Jan 21, 2026
6b1da4e
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
osmontero Jan 21, 2026
69d7629
feat(plugins): add `groupBy` support to rules configuration and datab…
osmontero Jan 21, 2026
cbcbb44
chore(docs): remove `UTMStack/rules/README.md` file
osmontero Jan 21, 2026
afe2209
feat(correlation-rules): update URLs and add rule status filter
mjabascal10 Jan 21, 2026
01907ea
Revert "feat(correlation-rules): update URLs and add rule status filter"
mjabascal10 Jan 21, 2026
a356075
feat(property-filter): add rule status to property filter options
mjabascal10 Jan 21, 2026
48f1df1
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 21, 2026
53dce17
feat(rule-filters): enhance rule filters with status and formatting o…
mjabascal10 Jan 21, 2026
4a6d188
Merge remote-tracking branch 'origin/release/v11.2.1' into release/v1…
mjabascal10 Jan 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/agent/installer" # Location of package manifests
directory: "/agent" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/agent/self" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/agent/service" # Location of package manifests
directory: "/agent/updater" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
Expand Down Expand Up @@ -52,6 +48,10 @@ updates:
directory: "/plugins/config" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/plugins/crowdStrike" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/plugins/events" # Location of package manifests
schedule:
Expand All @@ -68,10 +68,18 @@ updates:
directory: "/plugins/inputs" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/plugins/modules-config" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/plugins/o365" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/plugins/soc-ai" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/plugins/sophos" # Location of package manifests
schedule:
Expand All @@ -80,4 +88,12 @@ updates:
directory: "/plugins/stats" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/plugins/threat-intelligence" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/utmstack-collector" # Location of package manifests
schedule:
interval: "weekly"

3 changes: 3 additions & 0 deletions .github/scripts/golang-updater/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module golang-updater

go 1.24.2
Binary file added .github/scripts/golang-updater/golang-updater
Binary file not shown.
252 changes: 252 additions & 0 deletions .github/scripts/golang-updater/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
package main

import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
)

type Module struct {
Path string
Version string
Update *ModuleUpdate
}

type ModuleUpdate struct {
Version string
}

func main() {
if len(os.Args) < 2 {
printUsage()
os.Exit(1)
}

var checkOnly bool
var discover bool
var targetPath string

for _, arg := range os.Args[1:] {
switch arg {
case "--check":
checkOnly = true
case "--update":
checkOnly = false
case "--discover":
discover = true
case "--help", "-h":
printUsage()
os.Exit(0)
default:
if !strings.HasPrefix(arg, "--") {
targetPath = arg
}
}
}

// Validate arguments
if !discover && targetPath == "" {
fmt.Fprintf(os.Stderr, "Error: must specify a path or use --discover\n")
printUsage()
os.Exit(1)
}

if discover && targetPath != "" {
fmt.Fprintf(os.Stderr, "Error: cannot use both --discover and a specific path\n")
printUsage()
os.Exit(1)
}

var projects []string
var err error

if discover {
projects, err = discoverProjects(".")
if err != nil {
fmt.Fprintf(os.Stderr, "Error discovering projects: %v\n", err)
os.Exit(1)
}
if len(projects) == 0 {
fmt.Println("No Go projects found.")
os.Exit(0)
}
fmt.Printf("🔍 Discovered %d Go projects\n\n", len(projects))
} else {
// Verify the path exists and has a go.mod
goModPath := filepath.Join(targetPath, "go.mod")
if _, err := os.Stat(goModPath); os.IsNotExist(err) {
fmt.Fprintf(os.Stderr, "Error: no go.mod found in %s\n", targetPath)
os.Exit(1)
}
projects = []string{targetPath}
}

hasUpdates := false
allUpdates := make(map[string][]Module)

for _, project := range projects {
updates, err := checkProject(project)
if err != nil {
fmt.Fprintf(os.Stderr, "Error checking %s: %v\n", project, err)
os.Exit(1)
}
if len(updates) > 0 {
hasUpdates = true
allUpdates[project] = updates
}
}

if !hasUpdates {
fmt.Println("✅ All dependencies are up to date.")
return
}

// Print summary of updates needed
fmt.Println("📦 Dependencies with updates available:")
for project, updates := range allUpdates {
fmt.Printf("\n 📁 %s:\n", project)
for _, mod := range updates {
fmt.Printf(" - %s: %s → %s\n", mod.Path, mod.Version, mod.Update.Version)
}
}

if checkOnly {
fmt.Println("\n❌ Please update dependencies before merging.")
os.Exit(1)
}

// Update mode - apply updates
fmt.Println("\n🔄 Updating dependencies...")
for project, updates := range allUpdates {
fmt.Printf("\n 📁 %s:\n", project)
if err := updateProject(project, updates); err != nil {
fmt.Fprintf(os.Stderr, "Error updating %s: %v\n", project, err)
os.Exit(1)
}
}

fmt.Println("\n✅ All dependencies updated successfully.")
}

func printUsage() {
fmt.Println(`Usage: golang-updater [--check|--update] [--discover|<path>]

Modes:
--check Check for outdated dependencies (exit 1 if found)
--update Update outdated dependencies (default)

Target:
--discover Discover all Go projects from current directory
<path> Path to a specific Go project

Examples:
golang-updater --check ./installer
golang-updater --update ./installer
golang-updater --check --discover
golang-updater --update --discover`)
}

func discoverProjects(root string) ([]string, error) {
var projects []string

err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}

// Skip hidden directories and common non-project directories
if info.IsDir() {
name := info.Name()
// Don't skip the root directory itself
if path != root && (strings.HasPrefix(name, ".") || name == "vendor" || name == "node_modules") {
return filepath.SkipDir
}
}

if info.Name() == "go.mod" {
dir := filepath.Dir(path)
projects = append(projects, dir)
}

return nil
})

return projects, err
}

func checkProject(projectPath string) ([]Module, error) {
goModPath := filepath.Join(projectPath, "go.mod")
modFile, err := os.Open(goModPath)
if err != nil {
return nil, fmt.Errorf("error opening go.mod: %w", err)
}
defer modFile.Close()

explicitModules := make(map[string]bool)
scanner := bufio.NewScanner(modFile)
for scanner.Scan() {
line := strings.TrimSpace(scanner.Text())
if strings.HasPrefix(line, "require") || strings.HasPrefix(line, ")") {
continue
}
fields := strings.Fields(line)
if len(fields) >= 1 && !strings.HasPrefix(fields[0], "//") {
explicitModules[fields[0]] = true
}
}
if err := scanner.Err(); err != nil {
return nil, fmt.Errorf("error reading go.mod: %w", err)
}

cmd := exec.Command("go", "list", "-u", "-m", "-json", "all")
cmd.Dir = projectPath
output, err := cmd.Output()
if err != nil {
return nil, fmt.Errorf("error executing go list: %w", err)
}

decoder := json.NewDecoder(bytes.NewReader(output))
var toUpdate []Module

for decoder.More() {
var mod Module
if err := decoder.Decode(&mod); err != nil {
return nil, fmt.Errorf("error parsing JSON output: %w", err)
}
if mod.Update != nil && explicitModules[mod.Path] {
toUpdate = append(toUpdate, mod)
}
}

return toUpdate, nil
}

func updateProject(projectPath string, updates []Module) error {
for _, mod := range updates {
updateStr := fmt.Sprintf("%s@%s", mod.Path, mod.Update.Version)
fmt.Printf(" 🔄 Updating %s\n", updateStr)
cmd := exec.Command("go", "get", updateStr)
cmd.Dir = projectPath
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return fmt.Errorf("error updating %s: %w", updateStr, err)
}
}

fmt.Printf(" 🧹 Running go mod tidy...\n")
cmd := exec.Command("go", "mod", "tidy")
cmd.Dir = projectPath
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return fmt.Errorf("error running go mod tidy: %w", err)
}

return nil
}
Loading
Loading