Skip to content

Commit

Permalink
Fixed issues with diff-processor caused by GA-only compilation errors (
Browse files Browse the repository at this point in the history
…GoogleCloudPlatform#10250)

* Added file to trigger google-only failure

* Check if cleaning the diff processor up properly solves the issue

* Revert "Check if cleaning the diff processor up properly solves the issue"

This reverts commit 85c358e.

* Clean up diff processor before building instead of after

* Revert "Added file to trigger google-only failure"

This reverts commit 0e44860.
  • Loading branch information
melinath authored Mar 21, 2024
1 parent 2089d74 commit 96be339
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions .ci/magician/cmd/generate_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,6 @@ func execGenerateComment(prNumber int, ghTokenMagicModules, buildId, buildStep,
for _, serviceLabel := range serviceLabels {
uniqueServiceLabels[serviceLabel] = struct{}{}
}

err = cleanDiffProcessor(diffProcessorPath, rnr)
if err != nil {
fmt.Println("cleaning up diff processor: ", err)
errors[repo.Title] = append(errors[repo.Title], "The diff processor failed to clean up properly.")
}
}
breakingChangesSlice := maps.Keys(uniqueBreakingChanges)
sort.Strings(breakingChangesSlice)
Expand Down Expand Up @@ -376,6 +370,11 @@ func computeDiff(repo *source.Repo, oldBranch string, ctlr *source.Controller) (

// Build the diff processor for tpg or tpgb
func buildDiffProcessor(diffProcessorPath, providerLocalPath string, env map[string]string, rnr ExecRunner) error {
for _, path := range []string{"old", "new", "bin"} {
if err := rnr.RemoveAll(filepath.Join(diffProcessorPath, path)); err != nil {
return err
}
}
if err := rnr.PushDir(diffProcessorPath); err != nil {
return err
}
Expand Down Expand Up @@ -442,15 +441,6 @@ func changedSchemaLabels(prNumber int, currentLabels []string, diffProcessorPath
return labels, nil
}

func cleanDiffProcessor(diffProcessorPath string, rnr ExecRunner) error {
for _, path := range []string{"old", "new", "bin"} {
if err := rnr.RemoveAll(filepath.Join(diffProcessorPath, path)); err != nil {
return err
}
}
return nil
}

// Run the missing test detector and return the results.
// Returns an empty string unless there are missing tests.
// Error will be nil unless an error occurs during setup.
Expand Down

0 comments on commit 96be339

Please sign in to comment.