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

Artifactory .NET Core NuGet Push Selector Error #182

Closed
jorymorrison opened this issue Aug 7, 2020 · 5 comments
Closed

Artifactory .NET Core NuGet Push Selector Error #182

jorymorrison opened this issue Aug 7, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@jorymorrison
Copy link

jorymorrison commented Aug 7, 2020

Describe the bug
When utilizing the Artifactory .NET Core task and using the NuGet Push command, the Deployment repository field dropdown list is not populated.

I see the error displayed in the Azure Devops UI as follows:

Selector could not parse response.. Exception Message: Unexpected character while parsing path query: (

To Reproduce
Azure DevOps Server Version Dev17.M153.5
JFrog Artifactory Extension Version 1.10.0
JFrog Artifactory Service Connection established

Expected behavior
I expect the list field to populate with target artifactory repositories.

Screenshots
https://user-images.githubusercontent.com/1889865/89679765-bed1e000-d8bf-11ea-80d5-73b7c5184383.png

Versions

  • Artifactory Azure DevOps extension version: 1.10
  • Agent operating system: Ubuntu 18
  • JFrog Artifactory version: 7.6.3

Additional context
The correct behavior is observed when using the Artifactory NuGet task. I have used this task to successfully push .nupkg to Artifactory.

Cursory research shows a possibly interesting difference in the bindings between the functioning NuGet task and the non functioning .NET task.

NuGet Push:

        {
            "endpointId": "$(artifactoryService)",
            "endpointURL": "{{endpoint.url}}/api/repositories",
            "target": "targetDeployRepo",
            "resultSelector": "jsonpath:$[?(@.type=='LOCAL' || @.type=='VIRTUAL')]",
            "resultTemplate": "{ \"Value\" : \"{{{key}}}\", \"DisplayValue\" : \"{{{key}}}\" }"
        }

.NET NuGet Push

            "endpointId": "$(artifactoryService)",
            "endpointURL": "{{endpoint.url}}/api/repositories",
            "target": "targetDeployRepo",
            "resultSelector": "jsonpath:$[?(@.packageType=='NuGet' && (@.type=='LOCAL' || @.type=='VIRTUAL'))]",
            "resultTemplate": "{ \"Value\" : \"{{{key}}}\", \"DisplayValue\" : \"{{{key}}}\" }"
@jorymorrison jorymorrison added the bug Something isn't working label Aug 7, 2020
@jorymorrison
Copy link
Author

A manually constructed YAML task based on the task.json functions as expected.

- task: ArtifactoryDotnetCore@1
  name: ExperimentalPush
  inputs:
    command: 'push'
    artifactoryService: 'artifactory'
    targetDeployRepo: 'nuget'
    pathtoNupkg: '$(Build.ArtifactStagingDirectory)/*.nupkg'

@jorymorrison
Copy link
Author

Changing the resultSelector to the following works (I have tested with a local patch release). I have not identified what the problem is with the current one. I suspect it comes down to what implementation of JsonPath is being used, which I assume may be NewtonSoft in this case?

"resultSelector": "jsonpath:$[?(@.type=='LOCAL' || @.type=='VIRTUAL')]",

@sophietait
Copy link

reproduced issue

@RobiNino
Copy link
Contributor

Hi @jorymorrison , @sophietait ,
Thanks for reporting this issue and investing time in finding it's root.
We just released 1.10.2 that includes a fix, and we'd appreciate your feedback for it.

@eyalbe4
Copy link
Contributor

eyalbe4 commented Sep 2, 2020

@jorymorrison and @sophietait,
I'm closing this issue for now, but please let us know if you need further assistance with this.

@eyalbe4 eyalbe4 closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants