Unable to configure Versioned Settings on Root project

Answered

Hi there,

I'm trying to setup versioned settings for our "Root" TeamCity project.

I'm able to successfully configure the VCSRoot to point at our Root project config. However when I enable Versioned Settings, TeamCity automatically generates a commit of the current blank Root repo config.

When I then revert that commit in order to use our config, and then press the "Load project settings from VCS" button, a modal pops up which identified that the VCS is being used by the "Root project", which is fine. After pressing "Load settings from VCS", I get the following log message:

Cannot find previous revision of project: [_Root], skip updating settings to revision d7eba091f258bbe0528bdb30f5e4a1d37647be75. Please commit current project settings into VCS first. 

I'm using the "Kotlin" settings format, and selected the "use settings from VCS" option. I've also left the "Generate portable DSL scripts" option un-checked.

Any ideas on how I can get TeamCity to import the provided Root project?

Our code layout looks like this:
$ tree .teamcity
.
├── ci_projects.json
├── elastic.teamcity.iml
├── pom.xml
├── src
│   ├── GradleSubproject.kt
│   ├── model
│   │   ├── TeamCityProjects.kt
│   │   └── VcsRoot.kt
│   ├── Project.kt
│   ├── projects
│   │   └── SubProject.kt
│   ├── settings.kts
│   └── vcsRoots
│         └── InfraTeamcityRoot.kt
└── tests
└── ProjectTests.kt

Thanks in advance.

0
4 comments
Avatar
Permanently deleted user

OK, after some more poking and prodding, I've managed to get things to go one step further...

I'm now getting this error:

Failed to apply changes from VCS to project settings (revision 6a08e6f220ef9c115b0cd6ebf473cfa8e467ddea): critical configuration errors found. Please fix the errors in VCS and commit again. 
src/project-config.xml: Project src cannot be a child of itself

Edit: If I remove the 'uuid' field from the VCS config, I get this error:

Failed to apply changes from VCS to project settings (revision 6ff84d1352c5d344bae9de4b6d7a1f71a081ae7f): Remove of the project where versioned settings are defined via commit is not supported, you can remove the '' project in UI. Please fix the errors in VCS and commit again.

 

So it looks like it's not correctly working out that the project in VCS is the '_Root' project, despite me settings the 'id' and 'name' to '_Root':

class RootProject(model: TeamCityProjects) : Project({
id("_Root")
name = "<Root project>"
description = "Contains all other projects"
...
})

 

Any pointers?

0

Hello!

Could you please upload the configuration (skipping any sensitive data) and screenshot of your versioned settings tab in the TeamCity here: https://uploads.jetbrains.com/, and then share the upload ID with me? I would check locally what could be wrong with the configuration.

0
Avatar
Permanently deleted user

Hey @...

 

So it look a bit of figuring out, but in the end the important thing was to have the project in a `_Root` directory.

tree -I target .
.
├── ci_projects.json
├── elastic.teamcity.iml
├── pom.xml
├── _Root
│   ├── GradleSubproject.kt
│   ├── model
│   │   ├── TeamCityProjects.kt
│   │   └── VcsRoot.kt
│   ├── projects
│   │   └── SubProject.kt
│   ├── RootProject.kt
│   ├── settings.kts
│   └── vcsRoots
│   └── InfraTeamcityRoot.kt
└── tests
└── ProjectTests.kt

 

However the issue I'm having now is that updates to the project config in `ci_projects.json`, such as updating the VCSRoot branch or similar isn't being applied to the subproject.

If I start from scratch, then the most recent settings are correctly applied.

Any pointers on why config updates to subprojects might not be applied?

0

Hello,

Sorry for the delayed response here. Just as a quick clarification, how ci_projects.json is used with the DSL? (Do you read the file and fetch settings from the file?)

0

Please sign in to leave a comment.