pivotal-cf / pivnet-resource

Concourse Resource to interact with the Tanzu Network API V2 interface.
Apache License 2.0
29 stars 37 forks source link

release type breaks version #121

Closed pnikonowicz closed 4 years ago

pnikonowicz commented 4 years ago

using version:

- name: pivnet
  type: docker-image
  source:
    repository: pivotalcf/pivnet-resource
    tag: latest-final

with the following configuration:

- name: pas-tile-2.8
  type: pivnet
  source:
    api_token: ((pivnet-api-token))
    product_slug: elastic-runtime
    product_version: 2.8.*
    release_type: Security Release

Expected: no results should match

Actual: image

Context: PAS 2.8 has not been released yet to the public. We use a refresh token that can see all PAS Dev Releases. There are 2.8 versions available but there are no 2.8 versions that are publicly available.

rszumlakowski commented 4 years ago

Thank you, Paul. I will add this bug to our tracker.

khng commented 4 years ago

Hi @pnikonowicz.

After investigating, it seems that the expression provided for the product_version is not strict enough. Under the hood, the filtering out for a version uses the regexp.MatchStringhttps://github.com/pivotal-cf/pivnet-resource/blob/7269b361507e0dd2b451f4b8e7f967d7f679239b/filter/filter.go#L40 method provided by the Go regexp library. The asterisk at the end made it so that the period before could be present or not which is why the release of version 2.2.8 was returned.

For the example above, we would recommend writing the product version as 2\.8\.\d+. You should be able to see the expected result of cannot find specified release. Hopefully this was helpful.

Thanks again for submitting this issue! We'll be updating the README to be more clear about this.

khng commented 4 years ago

Seems like there is already a reference to this in the README located here.

Closing this issue.