-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TeamCity diff checker tool #12426
Update TeamCity diff checker tool #12426
Conversation
…hes in both directions. Add unit test.
It's the calling code's responsibility to know where the files are, as the calling code is likely to be what creates the files!
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR hasn't generated any diffs, but I'll let you know if a future commit does. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR hasn't generated any diffs, but I'll let you know if a future commit does. |
1 similar comment
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR hasn't generated any diffs, but I'll let you know if a future commit does. |
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
2 similar comments
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR hasn't generated any diffs, but I'll let you know if a future commit does. |
|
||
# Create lists of service packages in providers. Need to cd into repos where go.mod is to do this command. | ||
cd ${{env.GOOGLE_REPO_PATH}} | ||
go list -f '{{.Name}}' ${{env.GOOGLE_REPO_PATH}}/google/services/... > $GITHUB_WORKSPACE/provider_services_ga.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using go list allows us to list the actual packages present in the services directory. This protects us a bit against people who name the folders differently from the package name (matching names is what is usual).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! Ran the tests locally:
└─(10:05:08 on update-teamcity-diff-checker)──> go test -timeout 30s -run ^Test_ -v ──(Wed,Nov27)─┘
=== RUN Test_main_happyPaths
=== RUN Test_main_happyPaths/something_missing_in_TeamCity_config_present_in_provider_code
=== RUN Test_main_happyPaths/something_missing_in_provider_code_present_in_TeamCity_config
=== RUN Test_main_happyPaths/everything_matches
--- PASS: Test_main_happyPaths (0.00s)
--- PASS: Test_main_happyPaths/something_missing_in_TeamCity_config_present_in_provider_code (0.00s)
--- PASS: Test_main_happyPaths/something_missing_in_provider_code_present_in_TeamCity_config (0.00s)
--- PASS: Test_main_happyPaths/everything_matches (0.00s)
=== RUN Test_main_unhappyPaths
=== RUN Test_main_unhappyPaths/cannot_find_provider_service_file
=== RUN Test_main_unhappyPaths/cannot_find_TeamCity_service_file
=== RUN Test_main_unhappyPaths/empty_TeamCity_service_file
=== RUN Test_main_unhappyPaths/empty_provider_service_file
--- PASS: Test_main_unhappyPaths (0.00s)
--- PASS: Test_main_unhappyPaths/cannot_find_provider_service_file (0.00s)
--- PASS: Test_main_unhappyPaths/cannot_find_TeamCity_service_file (0.00s)
--- PASS: Test_main_unhappyPaths/empty_TeamCity_service_file (0.00s)
--- PASS: Test_main_unhappyPaths/empty_provider_service_file (0.00s)
=== RUN Test_listDifference
=== RUN Test_listDifference/detects_when_lists_match
=== RUN Test_listDifference/detects_when_items_from_list_A_is_missing_items_present_in_list_B_-_1_missing
=== RUN Test_listDifference/detects_when_items_from_list_A_is_missing_items_present_in_list_B_-_2_missing
=== RUN Test_listDifference/doesn't_detect_differences_if_list_A_is_a_superset_of_list_B
--- PASS: Test_listDifference (0.00s)
--- PASS: Test_listDifference/detects_when_lists_match (0.00s)
--- PASS: Test_listDifference/detects_when_items_from_list_A_is_missing_items_present_in_list_B_-_1_missing (0.00s)
--- PASS: Test_listDifference/detects_when_items_from_list_A_is_missing_items_present_in_list_B_-_2_missing (0.00s)
--- PASS: Test_listDifference/doesn't_detect_differences_if_list_A_is_a_superset_of_list_B (0.00s)
PASS
ok github.com/GoogleCloudPlatform/magic-modules/tools/teamcity-diff-check 0.232s
Thanks! I've manually tested the GHA yaml in my fork, but I'll merge this and then run the weekly check GHA on this repo to confirm all's ok |
Description
This PR:
Context
TeamCity diff checker has been failing for a few weeks:
Here is an example:

This error is confusing because:
However:
With better user feedback this could be less confusing