diff --git a/CHANGELOG.md b/CHANGELOG.md index 0664705..73f2ac8 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.1] - 2026-02-14 + +### Fixed +- Load all `.goodchangesrc.json` configs once at startup instead of re-reading from disk per changed file and again during target detection + ## [0.7.0] - 2026-02-14 ### Changed @@ -88,6 +93,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.1]: https://github.com/gooddata/gooddata-goodchanges/compare/v0.7.0...v0.7.1 [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 diff --git a/VERSION b/VERSION index bcaffe1..7deb86f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.0 \ No newline at end of file +0.7.1 \ No newline at end of file diff --git a/internal/rush/rush.go b/internal/rush/rush.go index bec96b5..8755992 100644 --- a/internal/rush/rush.go +++ b/internal/rush/rush.go @@ -139,6 +139,16 @@ func LoadProjectConfig(projectFolder string) *ProjectConfig { return &cfg } +// LoadAllProjectConfigs reads .goodchangesrc.json for every project in the config. +// Returns a map keyed by project folder. Entries are nil for projects without a config file. +func LoadAllProjectConfigs(config *Config) map[string]*ProjectConfig { + result := make(map[string]*ProjectConfig, len(config.Projects)) + for _, rp := range config.Projects { + result[rp.ProjectFolder] = LoadProjectConfig(rp.ProjectFolder) + } + return result +} + // IsIgnored checks if a file path (relative to project root) matches any ignore glob. // The config file itself (.goodchangesrc.json) is always ignored. func (pc *ProjectConfig) IsIgnored(relPath string) bool { @@ -168,7 +178,7 @@ func (pc *ProjectConfig) IsVirtualTarget() bool { // FindChangedProjects determines which projects have files in the changed file list. // Files matching ignore globs in .goodchangesrc.json are excluded. -func FindChangedProjects(config *Config, projectMap map[string]*ProjectInfo, changedFiles []string) map[string]*ProjectInfo { +func FindChangedProjects(config *Config, projectMap map[string]*ProjectInfo, changedFiles []string, configMap map[string]*ProjectConfig) map[string]*ProjectInfo { result := make(map[string]*ProjectInfo) for _, file := range changedFiles { if file == "" { @@ -177,7 +187,7 @@ func FindChangedProjects(config *Config, projectMap map[string]*ProjectInfo, cha for _, rp := range config.Projects { if strings.HasPrefix(file, rp.ProjectFolder+"/") { relPath := strings.TrimPrefix(file, rp.ProjectFolder+"/") - cfg := LoadProjectConfig(rp.ProjectFolder) + cfg := configMap[rp.ProjectFolder] if cfg.IsIgnored(relPath) { break } diff --git a/main.go b/main.go index 5046907..1c6a2d4 100644 --- a/main.go +++ b/main.go @@ -73,7 +73,8 @@ func main() { } projectMap := rush.BuildProjectMap(rushConfig) - changedProjects := rush.FindChangedProjects(rushConfig, projectMap, changedFiles) + configMap := rush.LoadAllProjectConfigs(rushConfig) + changedProjects := rush.FindChangedProjects(rushConfig, projectMap, changedFiles, configMap) // Detect lockfile dep changes per subspace (folder → set of changed dep names) depChangedDeps := findLockfileAffectedProjects(rushConfig, mergeBase) @@ -258,7 +259,7 @@ func main() { } for _, rp := range rushConfig.Projects { - cfg := rush.LoadProjectConfig(rp.ProjectFolder) + cfg := configMap[rp.ProjectFolder] if cfg.IsTarget() { if len(targetPatterns) > 0 && !matchesTargetFilter(rp.PackageName, targetPatterns) {