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

[OKD 3.11] Testing GitLab Build Trigger - payload includes 3 commits and triggers build based on wrong commit #23799

Open
miikamoi opened this issue Sep 16, 2019 · 7 comments
Labels
area/usability component/build lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. sig/developer-experience

Comments

@miikamoi
Copy link

Hello you lovely people!

I'm posting in hopes of verifying and/or identifying a bug.

When testing the integration in GitLab to trigger an OpenShift build, the webhook payload sent by GitLab contains an array commits containing the last 3 commits.

OpenShift triggers a build, but clones the oldest commit (which is the last one in the array) and not the newest (meaning it reverts to an older code version)

When instead pushing to the GitLab repository to trigger the webhook, the commit array only contains one entry - the most recent commit - the OpenShift build therefore is OK.

Version

oc v3.11.0+8de5c34
kubernetes v1.10.0+d4cacc0

openshift v3.11.0+1c3e643-87
kubernetes v1.11.0+d4cacc0

Steps To Reproduce

With test from GitLab

  1. Press GitLab build trigger "Test" button
  2. Payload is sent with 3 commits
  3. Build is triggered
  4. Image built with incorrect code

Actual commit to repository

  1. Payload is sent with 1 commit
  2. Build is triggered
  3. Image built with correct code
Current Result

With test - build is potentially initiated with the wrong commit, therefore building the image with outdated code.

Expected Result

When triggering builds when testing the webhook from GitLab the checkout_sha should be used to identify the commit.

Additional Information

JSON Payloads (test and actual commit)

Sensitive information has been redacted

##Payload from test trigger##

{
  "object_kind": "push",
  "event_name": "push",
  "before": "21d9e939eeb4027188eed090463a65297f854480",
  "after": "e011f39148b7c39ec72cb73b5d48a0074d22bb71",
  "ref": "refs/heads/master",
  "checkout_sha": "e011f39148b7c39ec72cb73b5d48a0074d22bb71",
  REDACTED
  },
  "commits": [
    {
      "id": "e011f39148b7c39ec72cb73b5d48a0074d22bb71",
      "message": "REDACTED",
      "timestamp": "2019-09-12T14:28:00Z",
      "url": "https://gitlab.com/REDACTED",
      "author": {
        "name": "REDACTED",
        "email": "REDACTED"
      },
      "added": [],
      "modified": [
        "views/spots/map.jade"
      ],
      "removed": []
    },
    {
      "id": "60a78657b4f808b57e8da21214ba82bb90ab64c9",
      "message": "REDACTED",
      "timestamp": "2019-04-17T21:58:07Z",
      "url": "https://gitlab.com/REDACTED",
      "author": {
        "name": "REDACTED",
        "email": "REDACTED"
      },
      "added": [],
      "modified": [
        "public/spots/map.css",
        "public/spots/map.js",
        "public/stylesheets/style.css",
        "views/spots/map.jade"
      ],
      "removed": []
    },
    {
      "id": "21d9e939eeb4027188eed090463a65297f854480",
      "message": "REDACTED",
      "timestamp": "2019-04-17T21:55:45Z",
      "url": "REDACTED",
      "author": {
        "name": "REDACTED",
        "email": "REDACTED"
      },
      "added": [],
      "modified": [
        "public/spots/map.css",
        "public/spots/map.js",
        "views/spots/map.jade"
      ],
      "removed": []
    }
  ],
  "total_commits_count": 3,
  "push_options": {},
  "repository": {
    "name": "REDACTED",
    "url": "[email protected]:REDACTED",
    "description": null,
    "homepage": "REDACTED",
    "git_http_url": "REDACTED",
    "git_ssh_url": "REDACTED",
    "visibility_level": 0
  }
}

##Payload from actual commit##

{
  "object_kind": "push",
  "event_name": "push",
  "before": "e011f39148b7c39ec72cb73b5d48a0074d22bb71",
  "after": "686e20ccf1d154cd4f29072e802495504950caee",
  "ref": "refs/heads/master",
  "checkout_sha": "686e20ccf1d154cd4f29072e802495504950caee",
  },
  "commits": [
    {
      "id": "686e20ccf1d154cd4f29072e802495504950caee",
      "message": "REDACTED",
      "timestamp": "2019-09-16T14:39:02Z",
      "url": "REDACTED",
      "author": {
        "name": "REDACTED",
        "email": "REDACTED"
      },
      "added": [],
      "modified": [
        "views/spots/map.jade"
      ],
      "removed": []
    }
  ],
  "total_commits_count": 1,
  "push_options": {},
  "repository": {
    "name": "REDACTED",
    "url": "[email protected]:REDACTED",
    "description": null,
    "homepage": "https://gitlab.com/REDACTED",
    "git_http_url": "https://gitlab.com/REDACTED",
    "git_ssh_url": "[email protected]:REDACTED",
    "visibility_level": 0
  }
}
@adambkaplan
Copy link
Contributor

fyi @openshift/openshift-team-developer-experience

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 18, 2019
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 17, 2020
@baer95
Copy link

baer95 commented Jan 18, 2020

/remove-lifecycle rotten

@openshift-ci-robot openshift-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jan 18, 2020
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 17, 2020
@baer95
Copy link

baer95 commented Apr 29, 2020

/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 29, 2020
@baer95
Copy link

baer95 commented Apr 29, 2020

/lifecycle frozen

@openshift-ci-robot openshift-ci-robot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/usability component/build lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. sig/developer-experience
Projects
None yet
Development

No branches or pull requests

5 participants