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

When using tag_filter, the version reported by 'in' should be the tag name #45

Closed
keymon opened this issue Apr 12, 2016 · 4 comments
Closed

Comments

@keymon
Copy link
Contributor

keymon commented Apr 12, 2016

When using tag_filter, the check command reports the tag name instead of the hash in the version list

But then the in command returns the hash not the tag

I think it should report the tag if available.

@concourse-bot
Copy link
Collaborator

Hi there!

We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.

The current status is as follows:

  • #117431593 When using tag_filter, the version reported by 'in' should be the tag name

This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.

@keymon
Copy link
Contributor Author

keymon commented Apr 12, 2016

Without this patch, a pipeline like this:

screenshot from 2016-04-12 14 14 19

which is triggered by tags, will use the tag as input of the first job and then the hash. The git resource will report these versions:

screenshot from 2016-04-12 14 13 47

Where first is a tag, that is input of the first job, and then a hash that is the input of the next jobs.

@tomwhoiscontrary
Copy link

I've also seen this, but only intermittently:

image

The configuration for this resource is:

- name: broker-release-final
  type: git
  source:
    uri: git@github.com:CLASSIFIED/TOP-SECRET.git
    branch: master
    private_key: {{private_key}}
    tag_filter: "v*"

@keymon
Copy link
Contributor Author

keymon commented Apr 12, 2016

@tomwhoiscontrary Yeah, it matches with my issue description. That is because the hash is generated when the resource is consumed by a task by using the get action.

In our case we trigger the pipeline with that git resource, so every commit triggers a job which calls get. In your case you probably consume that git resource in jobs triggered by other criteria.

You can see which job generated the "hash" version by using it as input by clicking in the version:

screenshot from 2016-04-12 15 54 56

You can see that in our case, that version "inputs to"...

keymon added a commit to keymon/git-resource that referenced this issue Apr 29, 2016
When using tag_filter, the check step will return a list of valid
tags as versions. In order to keep consistency, the get command
should also return the tag if the tag_filter is defined.

This implementation will try to check if $ref is a tag, if not use
the latest tag, if not use the hash reference.

Fixes concourse#45
keymon added a commit to keymon/git-resource that referenced this issue May 3, 2016
When using tag_filter, the check step will return a list of valid
tags as versions. In order to keep consistency, the get command
should also return the tag if the tag_filter is defined.

In this test we verify that we return the latest tag matching tag_filter
that points to $ref, regardless $ref is a tag, a hash or if it matches
or not tag_filter. If no tags match it, we will return the hash pointer
to $ref.

Tests concourse#45
keymon added a commit to keymon/git-resource that referenced this issue May 3, 2016
The in command will check if tag_filter is defined in the source
configuration, and if so, will return the matching tag as a version
or the hash if none match.

In this implementation if several tags match, we order the tags by version
number and return the latest one.

Fixes concourse#45
keymon added a commit to keymon/git-resource that referenced this issue May 3, 2016
The in command does checkout the code at a given ref, but it does not change
it. In consequence it should report the same ref as passed from concourse
as version to checkout.

We only return a different version in the case no version is specified
by concourse (first get).

For instance when using tag_filter, the check step will return a list of valid
tags as versions. In order to keep consistency, the get command
should also return the tag if the tag_filter is defined.

We include a test to verify that get reports the same version for
different ref (hash or tag) pointing to the same commit.

Fixes concourse#45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants