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 #15246

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 merged commit d93944f into hashicorp:main Jul 21, 2023
4 checks passed
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant