Skip to content

Add ability to test feature branches in TeamCity#8388

Merged
SarahFrench merged 8 commits into
mainfrom
sarah-teamcity-feature-branch-testing
Jul 21, 2023
Merged

Add ability to test feature branches in TeamCity#8388
SarahFrench merged 8 commits into
mainfrom
sarah-teamcity-feature-branch-testing

Conversation

@SarahFrench

@SarahFrench SarahFrench commented Jul 19, 2023

Copy link
Copy Markdown
Contributor

Description

This PR

  • allows TeamCity projects to test a feature branch in the downstream TPG and TPGB repos
  • adds some comments and links to documentation to help people new to this approach of configuring TeamCity
  • changes the default value of environment to "default", away from "public", as we have no concept of public TeamCity projects for the Google provider

These are the requirements that this PR fulfils:

  • TPG
    • has one release branch
    • the release branch will be tested on Thursdays
    • the main branch will have nightly tests run all other days of the week (Mon-Wed, Fri-Sun)
  • TPGB
    • has one release branch
    • the release branch will be tested on Fridays
    • the main branch will have nightly tests run all other days of the week (Mon-Thurs, Sat-Sun)

Changes in this PR

This PR makes the settings.kt file generated, and depending on whether version is ga or beta a different value is set for defaultDaysOfWeek, see here. These are the days that the main branch will be tested.

To determine which days the feature branch tests run, the testConfiguration class in this file is updated to check the environment context parameter and return either the default cron values (for main) or values specific to the feature branch.

How feature branch testing projects are set up in TeamCity

To set up a TeamCity project that tests feature branches one would need to:

  • Manually create a new project, one per GA/Beta
  • Manually create a VCS Root that points to the GA/Beta repo and the feature branch
Screenshot 2023-07-20 at 18 02 57
  • Set up context parameters environment and branch like in the screenshot below (note, other context parameters are needed to supply things like ENVs for configuring the provider during acceptance tests).
how to set up context parameters for

Release Note Template for Downstream PRs (will be copied)

@SarahFrench SarahFrench marked this pull request as draft July 19, 2023 12:20

@SarahFrench SarahFrench Jul 19, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was deleted because it was replaced by mmv1/third_party/terraform/.teamcity/components/generated/settings.erb, when I made this file be generated

SarahFrench added a commit to hashicorp/terraform-provider-google-beta that referenced this pull request Jul 19, 2023
@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 11 files changed, 90 insertions(+), 31 deletions(-))
Terraform Beta: Diff ( 11 files changed, 90 insertions(+), 31 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@SarahFrench SarahFrench force-pushed the sarah-teamcity-feature-branch-testing branch 2 times, most recently from 427fc5d to 979a7a8 Compare July 19, 2023 13:10
@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 11 files changed, 97 insertions(+), 38 deletions(-))
Terraform Beta: Diff ( 11 files changed, 97 insertions(+), 38 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@SarahFrench SarahFrench force-pushed the sarah-teamcity-feature-branch-testing branch from 979a7a8 to dc4b033 Compare July 20, 2023 14:45
@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 10 files changed, 86 insertions(+), 35 deletions(-))
Terraform Beta: Diff ( 10 files changed, 86 insertions(+), 35 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 10 files changed, 93 insertions(+), 36 deletions(-))
Terraform Beta: Diff ( 10 files changed, 93 insertions(+), 36 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@SarahFrench SarahFrench requested a review from shuyama1 July 20, 2023 17:04
@SarahFrench SarahFrench marked this pull request as ready for review July 20, 2023 17:04
@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 10 files changed, 93 insertions(+), 36 deletions(-))
Terraform Beta: Diff ( 10 files changed, 93 insertions(+), 36 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@shuyama1

Copy link
Copy Markdown
Member

Thanks for making the change!

@SarahFrench SarahFrench merged commit f1284db into main Jul 21, 2023
ericayyliu pushed a commit to ericayyliu/magic-modules that referenced this pull request Jul 26, 2023
…#8388)

* Add comments, link to TeamCity Kotlin DSL docs

* Change default value of environment from "public" to "default"

This is because Google provider has no public TeamCity resources

* Enable different default cron values for `ga`/`beta` downstreams

* Enable non-default cron values to be used, based on value of `environment` parameter in TeamCity

* Add ability to make VCS root and nightly trigger use non-main branch

* Update tests to reflect how entrypoint func requires `branch` parameter now

* Update `MAJOR_RELEASE_TESTING` value, and update code to handle unsupported chars

* Update `uniqueID` method to uppercase the environment value
NickElliot pushed a commit to NickElliot/magic-modules that referenced this pull request Jul 31, 2023
…#8388)

* Add comments, link to TeamCity Kotlin DSL docs

* Change default value of environment from "public" to "default"

This is because Google provider has no public TeamCity resources

* Enable different default cron values for `ga`/`beta` downstreams

* Enable non-default cron values to be used, based on value of `environment` parameter in TeamCity

* Add ability to make VCS root and nightly trigger use non-main branch

* Update tests to reflect how entrypoint func requires `branch` parameter now

* Update `MAJOR_RELEASE_TESTING` value, and update code to handle unsupported chars

* Update `uniqueID` method to uppercase the environment value
DanielRieske pushed a commit to bschaatsbergen/magic-modules that referenced this pull request Aug 2, 2023
…#8388)

* Add comments, link to TeamCity Kotlin DSL docs

* Change default value of environment from "public" to "default"

This is because Google provider has no public TeamCity resources

* Enable different default cron values for `ga`/`beta` downstreams

* Enable non-default cron values to be used, based on value of `environment` parameter in TeamCity

* Add ability to make VCS root and nightly trigger use non-main branch

* Update tests to reflect how entrypoint func requires `branch` parameter now

* Update `MAJOR_RELEASE_TESTING` value, and update code to handle unsupported chars

* Update `uniqueID` method to uppercase the environment value
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this pull request Aug 9, 2023
…#8388)

* Add comments, link to TeamCity Kotlin DSL docs

* Change default value of environment from "public" to "default"

This is because Google provider has no public TeamCity resources

* Enable different default cron values for `ga`/`beta` downstreams

* Enable non-default cron values to be used, based on value of `environment` parameter in TeamCity

* Add ability to make VCS root and nightly trigger use non-main branch

* Update tests to reflect how entrypoint func requires `branch` parameter now

* Update `MAJOR_RELEASE_TESTING` value, and update code to handle unsupported chars

* Update `uniqueID` method to uppercase the environment value
@SarahFrench SarahFrench deleted the sarah-teamcity-feature-branch-testing branch March 19, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants