appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 66 forks source link

Appveyor OnPremise: pushing new tag in gitea does not create new build #3765

Closed DoLearnWhileAlive closed 2 years ago

DoLearnWhileAlive commented 2 years ago

Environment Information

AppVeyor: v7.0.3111 OS: Windows Server 2019

Gitea: gitea-1.15.8-windows-4.0-amd64.exe OS: Windows Server 2016 GitVersion: 2.33.1 DB: SQLite

Issue Description

I have an on-prem gitea instance connected with on-prem AppVeyor server. Creating a new tag for a gitea repo creates below webhook. AppVeyor responsis with 200 but no build is created and also no project event shows up in the AppVeyor Web GUI.

Do not build tags in GUI and skip_tags in appveyor.yml are not checked/set to true.

Problem occurs at least also with Gitea version 1.15.6. I was not able to test other Gitea version.

Gitea Webhook

{
  "ref": "refs/tags/new",
  "before": "0000000000000000000000000000000000000000",
  "after": "bdf92eabb47df1af44f893ae10e596962411e141",
  "compare_url": "https://gitea.test.net/",
  "commits": [],
  "head_commit": null,
  "repository": {
    "id": 53,
    "owner": {"id":21,"login":"iwo","full_name":"","email":"","avatar_url":"https://gitea.test.net/user/avatar/iwo/-1","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2021-07-09T15:44:52+02:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"private","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"iwo"},
    "name": "test",
    "full_name": "iwo/test",
    "description": "",
    "empty": false,
    "private": true,
    "fork": false,
    "template": false,
    "parent": null,
    "mirror": false,
    "size": 33,
    "html_url": "https://gitea.test.net/iwo/test",
    "ssh_url": "fct_infra_gituser@t-si.de:iwo/test.git",
    "clone_url": "https://gitea.test.net/iwo/test.git",
    "original_url": "",
    "website": "",
    "stars_count": 0,
    "forks_count": 1,
    "watchers_count": 9,
    "open_issues_count": 0,
    "open_pr_counter": 0,
    "release_counter": 3,
    "default_branch": "dev",
    "archived": false,
    "created_at": "2021-09-09T11:10:55+02:00",
    "updated_at": "2021-12-22T09:40:22+01:00",
    "permissions": {
      "admin": true,
      "push": true,
      "pull": true
    },
    "has_issues": true,
    "internal_tracker": {
      "enable_time_tracker": true,
      "allow_only_contributors_to_track_time": true,
      "enable_issue_dependencies": true
    },
    "has_wiki": true,
    "has_pull_requests": true,
    "has_projects": true,
    "ignore_whitespace_conflicts": false,
    "allow_merge_commits": true,
    "allow_rebase": true,
    "allow_rebase_explicit": true,
    "allow_squash_merge": true,
    "default_merge_style": "rebase",
    "avatar_url": "",
    "internal": false,
    "mirror_interval": ""
  },
  "pusher": {"id":9,"login":"testuser","full_name":"Testname TestSurname","email":"Testname.TestSurname@t-systems.com","avatar_url":"https://gitea.test.net/user/avatar/testuser/-1","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2018-06-13T17:46:49+02:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":2,"username":"testuser"},
  "sender": {"id":9,"login":"testuser","full_name":"Testname TestSurname","email":"Testname.TestSurname@t-systems.com","avatar_url":"https://gitea.test.net/user/avatar/testuser/-1","language":"","is_admin":false,"last_login":"0001-01-01T00:00:00Z","created":"2018-06-13T17:46:49+02:00","restricted":false,"active":false,"prohibit_login":false,"location":"","website":"","description":"","visibility":"public","followers_count":0,"following_count":0,"starred_repos_count":2,"username":"testuser"}
}
FeodorFitsner commented 2 years ago

Thanks for posting webhook payload. Currently Gitea webhook handler in AppVeyor expects commit information presented in a tag payload, but in the payload above both commits and head_commit are empty. Is it lightweight or annotated tag? How did you create it?

DoLearnWhileAlive commented 2 years ago

I created it via the Gitea Web UI. But I also tested tag creation over the command line with lightweight and annotated tags. In all cases Gitea creates a webhook with empty commits and head_commit. I will open an issue in the Gitea repo.

DoLearnWhileAlive commented 2 years ago

Gitea issue is closed now. Thanks to PR https://github.com/go-gitea/gitea/pull/18116 head_commit is now defined with valid data, but commits still empty, see example below. Creating a new tag still does not trigger a new build. Comparing a tag webhook payload with a normal commit webhook payload shows the commit webhook payload has defined both head_commit and commits with the same commit data.

{
  "ref": "refs/tags/v6",
  "before": "0000000000000000000000000000000000000000",
  "after": "8f774e7bd4e2bc96a1e312987cfa34a4c908e9b9",
  "compare_url": "https://giteaserver.local/git-group/test-group/compare/0000000000000000000000000000000000000000...8f774e7bd4e2bc96a1e312987cfa34a4c908e9b9",
  "commits": [],
  "head_commit": {
    "id": "8f774e7bd4e2bc96a1e312987cfa34a4c908e9b9",
    "message": "„appveyor.yml“ updated\n",
    "url": "https://giteaserver.local/git-group/test-group/commit/8f774e7bd4e2bc96a1e312987cfa34a4c908e9b9",
    "author": {
      "name": "Test User",
      "email": "user.name@company.com",
      "username": "git-user"
    },
    "committer": {
      "name": "Test User",
      "email": "user.name@company.com",
      "username": "git-user"
    },
    "verification": null,
    "timestamp": "2021-12-22T10:07:26+01:00",
    "added": [],
    "removed": [
      "appveyor.yml"
    ],
    "modified": []
  },
  "repository": {
    "id": 53,
    ...
}
FeodorFitsner commented 2 years ago

That's great, thanks for the update!

This is AppVeyor Server build that supports head_commit in the webhook payload: https://appveyordownloads.blob.core.windows.net/appveyor/7.0.3134/appveyor-server-7.0.3134-win-x64.msi

Let me know how it worked for you.

DoLearnWhileAlive commented 2 years ago

AppVeyor Server 7.0.3134 fixed the issue. Many Thanks!

FeodorFitsner commented 2 years ago

Cool, thanks for the update!