-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Address issues in TeamCity configuration code #8560
Conversation
…nt in Google service packages
Sweepers running after each build config will clash with other running tests
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…out need for refactoring code
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
… update how maps are generated, update tools/teamcity-generator to match
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.
Added some notes to parts of the code to help with review.
@@ -10,7 +10,7 @@ | |||
var defaultStartHour = 4 | |||
|
|||
// specifies the default level of parallelism per-service-package | |||
var defaultParallelism = 12 | |||
var defaultParallelism = 20 |
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.
Parallelism set to 20, matching the current test project.
I have previously mentioned how this could need reducing once tests are split into multiple packages.
mmv1/third_party/terraform/.teamcity/components/build_config_package.kt
Outdated
Show resolved
Hide resolved
After getting some input from @alexsomesan I realised that the dependencies can be made simpler following the recent refactor I did. Instead of defining dependencies on the build configurations themselves, I'll use code similar to this pseudocode below when I register the build configurations in the project: sequential {
buildType(preSweeperConfig)
parallel {
<all service packages + other packages>.forEach { buildConfiguration ->
buildType(buildConfiguration)
}
}
buildType(postSweeperConfig)
}
See commit d41e116 below for this |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 11 files changed, 882 insertions(+), 238 deletions(-)) |
// Register build configs in the project | ||
buildType(preSweeperConfig) | ||
(packageConfigs + servicePackageConfigs).forEach { buildConfiguration -> | ||
buildType(buildConfiguration) | ||
} | ||
buildType(postSweeperConfig) | ||
|
||
// Set up dependencies between builds using `sequential` block | ||
// Acc test builds run in parallel | ||
sequential { | ||
buildType(preSweeperConfig) | ||
|
||
parallel{ | ||
(packageConfigs + servicePackageConfigs).forEach { buildConfiguration -> | ||
buildType(buildConfiguration) | ||
} | ||
} | ||
|
||
buildType(postSweeperConfig) | ||
} |
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.
This code is where all the build configurations are put in the Project being created, and the sequential
and nested parallel
block are what create dependencies between builds.
// Add trigger to last step of build chain (post-sweeper) | ||
val triggerConfig = NightlyTriggerConfiguration(environment, branchRef) | ||
postSweeperConfig.addTrigger(triggerConfig) |
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.
This is the only place where CRON triggers are defined and attached to a build.
mmv1/third_party/terraform/.teamcity/components/generated/project.erb
Outdated
Show resolved
Hide resolved
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.
LGTM. Thanks for working hard on this. Just left a couple of refactor comments.
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.
Thanks for the work, @SarahFrench!
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 11 files changed, 859 insertions(+), 238 deletions(-)) |
This comment was marked as outdated.
This comment was marked as outdated.
* Refactor: Pass `packageName` into packageDetails constructor instead * Refactor how nightly trigger information is passed to where build configs are made * Remove lingering references to `"public"` environment * Remove unnecessary assignments and func parameters * Fix inconsistent use of `var`/`val` * Refactor test steps into separate functions, to help with later refactoring * Remove `DetermineWorkingDirectory` as /tests directories aren't present in Google service packages * Remove sweeper steps from per-service build configurations Sweepers running after each build config will clash with other running tests * Stop setting `SWEEPER_REGIONS` when sweepers aren't in a build config * Add ability to set build ID as git commit hash * Refactor other script to use multiline string * Refactor how build config ids are built * Add pre-sweeper build and make acc tests dependent on it finishing * Add post-sweeper and ability to make it dependent on all other builds * Make tests run even if there are no new commits * Add timeout failure conditon to all builds * Increase parallelism from 12 -> 20 to match old TC project * Make sure sweepers have parameters to configure tests * Add ability to run tests from `google/-beta` package, and comments about need for refactoring code * Add properties to cron trigger present in old project * Make build step names more informative, update comment * Fix error where two parameters called `timeout`; clarify distinction between both * Initial refactor of how package lists made, and how used in Kotlin code * WIP: separate addition of build configs to project * Refactor TeamCity config to use different structure of maps as input, update how maps are generated, update tools/teamcity-generator to match * Change how builds are triggered Avoid duplicate builds being queued due to cron and dependency requirements. Instead trigger fewer things and let dependency relationships trigger the rest. * Make packages.kt provide pre-migration path for sweepers * Remove excess argument left from refactoring * Update ignored folders in generation of packages.kt * Simplify how dependencies are created, and remove code that's no longer needed as a result * Combine `failureConditions` blocks * Fix test prefix * Refactor to reduce code repetition around sweepers
* Refactor: Pass `packageName` into packageDetails constructor instead * Refactor how nightly trigger information is passed to where build configs are made * Remove lingering references to `"public"` environment * Remove unnecessary assignments and func parameters * Fix inconsistent use of `var`/`val` * Refactor test steps into separate functions, to help with later refactoring * Remove `DetermineWorkingDirectory` as /tests directories aren't present in Google service packages * Remove sweeper steps from per-service build configurations Sweepers running after each build config will clash with other running tests * Stop setting `SWEEPER_REGIONS` when sweepers aren't in a build config * Add ability to set build ID as git commit hash * Refactor other script to use multiline string * Refactor how build config ids are built * Add pre-sweeper build and make acc tests dependent on it finishing * Add post-sweeper and ability to make it dependent on all other builds * Make tests run even if there are no new commits * Add timeout failure conditon to all builds * Increase parallelism from 12 -> 20 to match old TC project * Make sure sweepers have parameters to configure tests * Add ability to run tests from `google/-beta` package, and comments about need for refactoring code * Add properties to cron trigger present in old project * Make build step names more informative, update comment * Fix error where two parameters called `timeout`; clarify distinction between both * Initial refactor of how package lists made, and how used in Kotlin code * WIP: separate addition of build configs to project * Refactor TeamCity config to use different structure of maps as input, update how maps are generated, update tools/teamcity-generator to match * Change how builds are triggered Avoid duplicate builds being queued due to cron and dependency requirements. Instead trigger fewer things and let dependency relationships trigger the rest. * Make packages.kt provide pre-migration path for sweepers * Remove excess argument left from refactoring * Update ignored folders in generation of packages.kt * Simplify how dependencies are created, and remove code that's no longer needed as a result * Combine `failureConditions` blocks * Fix test prefix * Refactor to reduce code repetition around sweepers
(Apologies for the size of this PR/refactor 🙏 )
To see the config changes from this PR in action, see this test project in TeamCity: https://hashicorp.teamcity.com/project/TerraformProviders_Google_SarahTestMainBranchPr8560applied
Description
This PR updates code in
.teammcity/
to change:Release Note Template for Downstream PRs (will be copied)