Tag workflow doesn't work, despite similar setup on other project working

I’ve tried to set up and execute a workflow for one of my projects where I want to automate publishing using Circle CI. Despite the confusing filtering user experience documented at https://circleci.com/docs/2.0/workflows/#using-contexts-and-filtering-in-your-workflows , I got it to work one of my projects.

Now, I’ve tried to apply the same type of concept to another project that has a forking workflow.

The pipeline runs for branches but my publish job doesn’t run, and no workflow execution is created for my 0.9.0 tag linked above. I can see the webhook events being sent by GitHub and a big green checkmark shows me it is being delivered.

Why isn’t this working? What is wrong with my workflow definition?

Hi Mike. Can you share the payload ID for the hook for 0.9.0 so I can check the logs?

You can also open a ticket if you would prefer to share the information privately, just reference this thread if you do.

I think the ID of the payload wouldn’t be sensitive, right?

/shrug

The ID is cbf5ad80-7cf8-11e9-9045-ae1cdbef82d5 sent to https://circleci.com/hooks/github

I don’t consider it as such, but people have different ideas of what they consider sensitive, so I like to provide options.

I’m not seeing this ID in the logs, do you know when it was sent? I wonder if it was during GitHub’s web hook issue yesterday and was somehow lost.

That’s a bummer. I’m seeing 2019-05-22 20:19:22 on the webhook page (not sure what timezone it is on there, but would guess CDT? Or maybe mountain time?). I wasn’t seeing issues with branches around the same time, which is when I came and wrote this post.

A few of the response headers (not sure if they are useful for you) shown on GitHub for that event:

Date: Thu, 23 May 2019 01:19:22 GMT
x-client-trace-id: 
x-request-id: 94459908-fc53-4788-9f77-7bab1a8d8ac6
X-route: /hooks/github

All I can find is https://circleci.com/workflow-run/0613d5ff-4acb-48ea-bd2f-a4154d54f98f

I suspect we treated it as a duplicate build, can you provide the commit id for the tag? Maybe I can locate it that way.

Hey Mike. I did some code diving, can I ask how you created the 0.9.0 tag?

We only act on the following hook events "push", "pull_request", "public", "fork" so if it was via cutting a new release we would not have run it it as we would have expected the commit to have already built.

I feel like we are looking at a feature request her, but need to get all the details so I can make it as clear as possible.

Thanks for digging in, and sorry for not responding sooner.

Commit SHA for 0.9.0 tag

SHA (which you probably already figured out): bd0f462ae17e5e4630e528ce7db9f755279735fc

Copy of event JSON

{
  "ref": "0.9.0",
  "ref_type": "tag",
  "master_branch": "master",
  "description": "Gradle plugin to help with build and test of Jenkins Pipeline Shared Libraries (see https://jenkins.io/doc/book/pipeline/shared-libraries/)",
  "pusher_type": "user",
  "repository": {
    "id": 99977858,
    "node_id": "MDEwOlJlcG9zaXRvcnk5OTk3Nzg1OA==",
    "name": "jenkins-pipeline-shared-libraries-gradle-plugin",
    "full_name": "mkobit/jenkins-pipeline-shared-libraries-gradle-plugin",
    "private": false,
    "owner": {
      "login": "mkobit",
      "id": 1447148,
      "node_id": "MDQ6VXNlcjE0NDcxNDg=",
      "avatar_url": "https://avatars3.githubusercontent.com/u/1447148?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/mkobit",
      "html_url": "https://github.com/mkobit",
      "followers_url": "https://api.github.com/users/mkobit/followers",
      "following_url": "https://api.github.com/users/mkobit/following{/other_user}",
      "gists_url": "https://api.github.com/users/mkobit/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/mkobit/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/mkobit/subscriptions",
      "organizations_url": "https://api.github.com/users/mkobit/orgs",
      "repos_url": "https://api.github.com/users/mkobit/repos",
      "events_url": "https://api.github.com/users/mkobit/events{/privacy}",
      "received_events_url": "https://api.github.com/users/mkobit/received_events",
      "type": "User",
      "site_admin": false
    },
    "html_url": "https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin",
    "description": "Gradle plugin to help with build and test of Jenkins Pipeline Shared Libraries (see https://jenkins.io/doc/book/pipeline/shared-libraries/)",
    "fork": false,
    "url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin",
    "forks_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/forks",
    "keys_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/teams",
    "hooks_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/hooks",
    "issue_events_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/events{/number}",
    "events_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/events",
    "assignees_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/assignees{/user}",
    "branches_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/branches{/branch}",
    "tags_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/tags",
    "blobs_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/languages",
    "stargazers_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/stargazers",
    "contributors_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/contributors",
    "subscribers_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/subscribers",
    "subscription_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/subscription",
    "commits_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/contents/{+path}",
    "compare_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/merges",
    "archive_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/downloads",
    "issues_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues{/number}",
    "pulls_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/labels{/name}",
    "releases_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/releases{/id}",
    "deployments_url": "https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/deployments",
    "created_at": "2017-08-11T01:09:26Z",
    "updated_at": "2019-05-23T01:15:20Z",
    "pushed_at": "2019-05-23T01:19:22Z",
    "git_url": "git://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin.git",
    "ssh_url": "git@github.com:mkobit/jenkins-pipeline-shared-libraries-gradle-plugin.git",
    "clone_url": "https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin.git",
    "svn_url": "https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin",
    "homepage": null,
    "size": 830,
    "stargazers_count": 70,
    "watchers_count": 70,
    "language": "Kotlin",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 9,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 31,
    "license": {
      "key": "mit",
      "name": "MIT License",
      "spdx_id": "MIT",
      "url": "https://api.github.com/licenses/mit",
      "node_id": "MDc6TGljZW5zZTEz"
    },
    "forks": 9,
    "open_issues": 31,
    "watchers": 70,
    "default_branch": "master"
  },
  "sender": {
    "login": "mkobit",
    "id": 1447148,
    "node_id": "MDQ6VXNlcjE0NDcxNDg=",
    "avatar_url": "https://avatars3.githubusercontent.com/u/1447148?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/mkobit",
    "html_url": "https://github.com/mkobit",
    "followers_url": "https://api.github.com/users/mkobit/followers",
    "following_url": "https://api.github.com/users/mkobit/following{/other_user}",
    "gists_url": "https://api.github.com/users/mkobit/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/mkobit/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/mkobit/subscriptions",
    "organizations_url": "https://api.github.com/users/mkobit/orgs",
    "repos_url": "https://api.github.com/users/mkobit/repos",
    "events_url": "https://api.github.com/users/mkobit/events{/privacy}",
    "received_events_url": "https://api.github.com/users/mkobit/received_events",
    "type": "User",
    "site_admin": false
  }
}

Subset of what is enabled on GitHub

Subset of Circle Webhook

How I Created the Tag

Locally executed both of the commands to tag the commit:

git tag 0.9.0 --sign --annotate --message="Latest Jenkins LTS and plugin versions and fix authentication headers for JenkinsIntegrationPlugin"
git push origin 0.9.0
1 Like

No worries. Can you share the headers too? Specifically, I need to know the X-GitHub-Event: one, if it’s not one of the above that’s why we ignored it.

That SHA built under https://circleci.com/workflow-run/61008446-9a82-45d5-b29f-2eb622dd89bf

Here are the headers, only one I left out was the content of X-Hub-Signature.

  • Request URL: https://circleci.com/hooks/github
  • Request method: POST
  • content-type: application/x-www-form-urlencoded
  • Expect:
  • User-Agent: GitHub-Hookshot/4e8a459
  • X-GitHub-Delivery: cbf5ad80-7cf8-11e9-9045-ae1cdbef82d5
  • X-GitHub-Event: create

As a create event, we would ignore this. The commit did run on CircleCI under https://circleci.com/workflow-run/61008446-9a82-45d5-b29f-2eb622dd89bf, we would not re-run it with a tag creation since it didn’t change.

We build it when we received

x_github_delivery
3b05206c-7cf8-11e9-8408-10d52a86dc4e

Ok, that is really strange.

On the other project mentioned with what I believe to be the same setup for tag https://github.com/mkobit/gradle-test-kotlin-extensions/commits/0.7.0

  • Webhook ID: bc506d58-7ce3-11e9-9ddd-bb6832ae82f5
  • X-GitHub-Event: push

I do the same push pattern on both repositories, so now I’m definitely confused.

This seems like the right setup to enable a certain job to run for tags, but it seems that either there is an issue on GitHub’s side or I have something set up wrong. Any thoughts or suggestions?

I tried deleting and repushing the tag, and event Id fd75a182-8151-11e9-8271-4e026a883dc8

with headers

Request URL: https://circleci.com/hooks/github
Request method: POST
content-type: application/x-www-form-urlencoded
Expect: 
User-Agent: GitHub-Hookshot/8a8ac33
X-GitHub-Delivery: fd75a182-8151-11e9-8271-4e026a883dc8
X-GitHub-Event: push

and body starting with

{
  "ref": "refs/tags/0.9.0",
  "before": "0000000000000000000000000000000000000000",
  "after": "416436bb8d081e541caaee4942cb5119c1736724",
  "created": true,
  "deleted": false,
  "forced": false,
  "base_ref": null,
  
   ...
}

Didn’t trigger anything Circle CI side.

¯\(ツ)/¯ guess I’ll try and figure it out again on my next tag.