Issue: Can not load latest .drone.yml when using refs/tags/ to trigger pipeline

Environment

  • Drone 1.2.1
  • Kubernetes
  • Gogs 0.11.79.1211

Steps to reproduce this issue

1. Create .drone.yml

kind: pipeline
name: default
steps:
- name: test-tag-v1
  image: alpine
  commands:
  - echo 'test-tag-v1'
  when:
    ref:
    - refs/tags/v*

2. Create and push tag

git tag v1.0 && git push origin v1.0

3. Triggered successfully

4. Edit .drone.yml
I increased version from 1 to 2.

kind: pipeline
name: default
steps:
- name: test-tag-v2
  image: alpine
  commands:
  - echo 'test-tag-v2'
  when:
    ref:
    - refs/tags/v*

6. Push and Create tag

git add . && git commit -a -m ‘update .drone.yml’
git tag v2.0 && git push origin v2.0

7. Output was not corrected

It seems that it was caused by cache. The cache key are all the same for different tags.
contents.go#L20

// content key pattern used in the cache, comprised of the
// repository slug, commit and path.
const contentKey = "%s/%s/%s"

See the following issues:

There are two issues / features that need to be resolved / implemented by gogs. Note that these have already been implemented by gitea. These are:

  1. gogs does not allow fetching a file by reference
  2. gogs does not include commit sha in the tag payload

Hi @bradrydzewski,
The issue still exists after I upgrade Gogs. The commit sha was included in the tag payload.

The commit sha was included in the tag payload.

Drone requires a code change to read the value. There is an open pull request for this and we hope to include in our next release.

1 Like