Skip to content
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

Add ability to test feature branches in TeamCity #1184

Conversation

modular-magician
Copy link
Collaborator

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)

Derived from GoogleCloudPlatform/magic-modules#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

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician requested a review from a team as a code owner July 21, 2023 11:54
@modular-magician modular-magician requested review from iyabchen and removed request for a team July 21, 2023 11:54
@modular-magician modular-magician merged commit 7ceea57 into GoogleCloudPlatform:main Jul 21, 2023
5 checks passed
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.

1 participant