diff --git a/CHANGELOG.md b/CHANGELOG.md index bdb882d..0664705 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.7.0] - 2026-02-14 + +### Changed +- Skip expensive target detection (file scanning, taint import checks) for targets excluded by `TARGETS` filter + ## [0.6.0] - 2026-02-14 ### Added @@ -83,6 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Multi-stage Docker build - Automated vendor upgrade workflow +[0.7.0]: https://github.com/gooddata/gooddata-goodchanges/compare/v0.6.0...v0.7.0 [0.6.0]: https://github.com/gooddata/gooddata-goodchanges/compare/v0.5.1...v0.6.0 [0.5.1]: https://github.com/gooddata/gooddata-goodchanges/compare/v0.5.0...v0.5.1 [0.5.0]: https://github.com/gooddata/gooddata-goodchanges/compare/v0.4.0...v0.5.0 diff --git a/VERSION b/VERSION index 09a3acf..bcaffe1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0 \ No newline at end of file +0.7.0 \ No newline at end of file diff --git a/main.go b/main.go index e3232e5..5046907 100644 --- a/main.go +++ b/main.go @@ -251,10 +251,19 @@ func main() { } changedE2E := make(map[string]*TargetResult) + // Parse TARGETS filter early to skip expensive detection for non-matching targets + var targetPatterns []string + if targetsEnv := os.Getenv("TARGETS"); targetsEnv != "" { + targetPatterns = strings.Split(targetsEnv, ",") + } + for _, rp := range rushConfig.Projects { cfg := rush.LoadProjectConfig(rp.ProjectFolder) if cfg.IsTarget() { + if len(targetPatterns) > 0 && !matchesTargetFilter(rp.PackageName, targetPatterns) { + continue + } // Target detection with 4 conditions: // 1. Direct file changes (outside ignores) // 2. External dep changes in lockfile @@ -312,6 +321,9 @@ func main() { } } } else if cfg.IsVirtualTarget() && cfg.TargetName != nil { + if len(targetPatterns) > 0 && !matchesTargetFilter(*cfg.TargetName, targetPatterns) { + continue + } // Virtual target: check changeDirs for file changes or tainted imports. // Normal dirs trigger a full run; fine-grained dirs collect specific affected files. normalTriggered := false @@ -365,18 +377,6 @@ func main() { return e2eList[i].Name < e2eList[j].Name }) - // Filter targets if TARGETS env is set (comma-delimited, supports * globs) - if targetsEnv := os.Getenv("TARGETS"); targetsEnv != "" { - patterns := strings.Split(targetsEnv, ",") - var filtered []*TargetResult - for _, result := range e2eList { - if matchesTargetFilter(result.Name, patterns) { - filtered = append(filtered, result) - } - } - e2eList = filtered - } - if flagLog { logf("Affected e2e packages (%d):\n", len(e2eList)) for _, result := range e2eList {