Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.7.1
14 changes: 12 additions & 2 deletions internal/rush/rush.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 == "" {
Expand All @@ -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
}
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down