Closed lionbee closed 6 years ago
@thirty3, Do you have an example for the difference between the two values for a specific build?
@eyalbe4
With a build configured as: Root -> Level 2 -> build
Where Root and Level 2 are projects:
build.getFullName()
will return Root :: Level 2 :: build
. Using this value with the Artifactory API will have to url encode the value and use it as Root%20%3A%3A%20Level%202%20%3A%3A%20build
build.getBuildTypeId()
should return the Build configuration ID
as configured via the interface. In my case this is now Root_Level2_Build
Looks good @thirty3. Thanks for reporting this and suggesting this change! Will you be able to submit a pull request?
@eyalbe4 Happy to do it 👍
It will break some people's integrations. Maybe a better approach is to expose build name as a parameter. If it is left blank carry on using build.getFullName()
. Then users can set the name parameter to %system.teamcity.buildType.id%
if they want?
Sounds good @thirty3. We can add to the UI, next to the Build-Info configuration parameters, a an optional text field named "Override deployed build name". What do you think?
Yup, sounds perfect 👍
Just to clarify. Parameter %system.teamcity.buildType.id% contains user visible id of a build configuration (so called external id). But SBuild.getBuildTypeId() returns internal id. There is also SBuild.getBuildTypeExternalId() and this is external id which should be used instead of build.name.
Also, as of 2018.1, getFullName() generates names separated with slashes, instead of :: as it was before. Apparently this causes problems with Artifactory plugin: https://youtrack.jetbrains.com/issue/TW-56014
Unfortunately we can't revert behavior of getFullName(), so maybe it's time to use external id?
I am the reporter of the issue Pavel Sher links, and currently this functionality is breaking our setup. So all our automated tests are not able to run as they have dependencies that are downloaded via filespec.
Is there a way to get even a nightly build with the suggested changes where builds are linked via the externalid?
Best regards Lars Jakobsen
@pavelsher thanks for the advice, we implemented use of external id in #47 😅
The build name that is assigned to the artifact is difficult to reproduce in TeamCity and makes build promotion difficult.
The problem is this line of code
Should be
That value returned by
build.getBuildTypeId()
is exposed as a variable in TeamCity%system.teamcity.buildType.id%
. As far as I can see there is no way to get the value ofbuild.getFullName()
easily.