Skip to content

Teamcity plugin no longer honors plugin-sourced credentials. #572

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

Closed
DanielJRutledge opened this issue Nov 10, 2021 · 8 comments
Closed
Labels
gradle bug Create a report to help us improve

Comments

@DanielJRutledge
Copy link

DanielJRutledge commented Nov 10, 2021

Describe the bug
Teamcity plugin is no longer able to publish gradle artifacts with the Project uses Artifactory Plugin" box checked. It appears that the Teamcity builds are no longer honoring the credentials stored in the plugin and using those stored in the artifactory block of the build.gradle file instead.

To Reproduce
Define a build which uses the artifactory gradle plugin and publishes some artifacts using the artifactory gradle plugin. Define a Teamcity build and publish using the Teamcity artifactory plugin with the "Project uses Artifactory Plugin" box checked.

Sample build.gradle block:

    dependencies {
        classpath "com.pros.ppss:ppss-gradle-plugin:${ppssVersion}"
        classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:latest.release'
    }
...
artifactory {
        contextUrl = "${artifactoryBase}"
        resolve {
            repository {
                repoKey = isReleaseBuild ? 'maven-onprem-release' : 'maven-onprem-dev'
                username = artifactory_user
                password = artifactory_password
            }
        }
        publish {
            repository {
                repoKey = isReleaseBuild ? 'maven-onprem-release' : 'maven-onprem-dev'
                // credentials are missing as they will be injected by the Jfrog CLI, publishing is never done by a local machine.
            }
            defaults {
                publications ('ALL_PUBLICATIONS')
            }
        }
    }

This intended for local use; the publish credentials are supposed to be sourced from the Teamcity plugin. Until this morning, Teamcity did so, but now it is attempting to publish without any credentials according to the build.gradle file.

Expected behavior
We would expect a successful publish, provided the correct credentials are supplied to the agent.

Screenshots
Note that we currently have the "Project uses Artifactory Plugin" box checked in the Teamcity Artifactory plugin. We would expected the credentials present in the artifactory block of the build.gradle file to be overriden, but as of the latest gradle artifactory plugin release, they are not.
image

Versions

  • Gradle Artifactory plugin version: 4.24.22
  • Operating system: RHEL 7
  • Artifactory Version: 7.27.9
  • Teamcity Artifactory Plugin: 2.8.0
@DanielJRutledge DanielJRutledge added the gradle bug Create a report to help us improve label Nov 10, 2021
@DanielJRutledge
Copy link
Author

I just upgraded the Teamcity Artifactory plugin to 2.9.1 and got the same result.

@Or-Geva
Copy link
Contributor

Or-Geva commented Nov 11, 2021

@DanielJRutledge Thanks for reporting this, we are working on a fix right now. As a workaround, If possible, downgrade the extractor for now.
We will release a fix in the next few hours.

@Or-Geva
Copy link
Contributor

Or-Geva commented Nov 11, 2021

One clarification following my previous comment, you can downgrade your org.jfrog.buildinfo:build-info-extractor-gradledependency inside build.gradle to 4.24.21. e.g.

...
    dependencies {
        classpath "com.pros.ppss:ppss-gradle-plugin:${ppssVersion}"
        classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.24.21'
    }
...

@DanielJRutledge
Copy link
Author

Sounds good; downgrading is an option, but with hundreds of repositories downgrading on a bad release isn't really an option.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Nov 11, 2021

@DanielJRutledge -
We're working on the fix as we speak and believe we'll be able to release it really soon.
Our sensor apologies for anyone who got hit by this issue.

@Or-Geva
Copy link
Contributor

Or-Geva commented Nov 11, 2021

@DanielJRutledge, build-info-extractor-gradle:4.24.23 is released and includes a fix for this issue.
Our apologies for the inconvenience. We would be happy to get feedback from you

@DanielJRutledge
Copy link
Author

DanielJRutledge commented Nov 11, 2021

@Or-Geva We're back in business. Was the Teamcity plugin using the "artifactory." prefixed properties? What about the other CI plugins?

@eyalbe4
Copy link
Contributor

eyalbe4 commented Nov 11, 2021

Thanks for the feedback @DanielJRutledge!
We're really happy to hear everything works well now and we're very sorry for this incident.
The "artifactory" prefixed properties are used by all CI plugins. Future versions will move to using the non prefixed form, and we'll make sure old versions won't break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gradle bug Create a report to help us improve
Projects
None yet
Development

No branches or pull requests

3 participants