From 8a908339e6147aceec22c429faf7d6b23a3ca52a Mon Sep 17 00:00:00 2001 From: Sarah French <15078782+SarahFrench@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:27:04 +0000 Subject: [PATCH] Update `teamcity-diff-check` script and GHAs to have more explicit calls to action (#10098) --- .../workflows/teamcity-services-diff-check-weekly.yml | 2 +- .github/workflows/teamcity-services-diff-check.yml | 2 +- tools/teamcity-diff-check/main.go | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/teamcity-services-diff-check-weekly.yml b/.github/workflows/teamcity-services-diff-check-weekly.yml index 577924f7cdaf..9626b3c9aa45 100644 --- a/.github/workflows/teamcity-services-diff-check-weekly.yml +++ b/.github/workflows/teamcity-services-diff-check-weekly.yml @@ -51,7 +51,7 @@ jobs: unzip -o artifacts/output.zip -d ./provider rm artifacts/output.zip - - name: Diff Check + - name: Check that new services have been added to the TeamCity configuration code run: | # Create lists of service packages in providers ls provider/google/services > tools/teamcity-diff-check/services_ga.txt diff --git a/.github/workflows/teamcity-services-diff-check.yml b/.github/workflows/teamcity-services-diff-check.yml index 8034d6f87b43..a54137bd48b2 100644 --- a/.github/workflows/teamcity-services-diff-check.yml +++ b/.github/workflows/teamcity-services-diff-check.yml @@ -75,7 +75,7 @@ jobs: unzip -o artifacts/output.zip -d ./provider rm artifacts/output.zip - - name: Diff Check + - name: Check that new services have been added to the TeamCity configuration code run: | # Create lists of service packages in providers ls provider/google/services > tools/teamcity-diff-check/services_ga.txt diff --git a/tools/teamcity-diff-check/main.go b/tools/teamcity-diff-check/main.go index b3a71436e8fa..577bdda526ca 100644 --- a/tools/teamcity-diff-check/main.go +++ b/tools/teamcity-diff-check/main.go @@ -45,7 +45,8 @@ func main() { //////////////////////////////////////////////////////////////////////////////// - f, err := os.Open(fmt.Sprintf("../../mmv1/third_party/terraform/.teamcity/components/inputs/%s", *serviceFile+".kt")) + filePath := fmt.Sprintf("mmv1/third_party/terraform/.teamcity/components/inputs/%s.kt", *serviceFile) + f, err := os.Open(fmt.Sprintf("../../%s", filePath)) // Need to make path relative to where the script is called if err != nil { panic(err) } @@ -79,13 +80,13 @@ func main() { teamcityServices = append(teamcityServices, string(service)) } if len(teamcityServices) == 0 { - fmt.Fprintf(os.Stderr, "teamcityServices error: regex produced no matches.\n") + fmt.Fprintf(os.Stderr, "error: script could not find any services listed in the file %s.kt .\n", filePath) os.Exit(1) } if diff := serviceDifference(googleServices, teamcityServices); len(diff) != 0 { - fmt.Fprintf(os.Stderr, "error: diff in %s\n", *serviceFile) - fmt.Fprintf(os.Stderr, "Missing Services: %s\n", diff) + fmt.Fprintf(os.Stderr, "error: missing services detected in %s\n", filePath) + fmt.Fprintf(os.Stderr, "Please update file to include these new services: %s\n", diff) os.Exit(1) }