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

Add URL to PipelineEvent > ObjectAttributes #1753

Merged
merged 1 commit into from
Jul 16, 2023

Conversation

nikk-gr
Copy link
Contributor

@nikk-gr nikk-gr commented Jul 12, 2023

Fix missed url field in PipelineEvent > ObjectAttributes

github.com/xanzy/go-gitlab@v0.86.0/event_webhook_types.go L807

go struct:

ObjectAttributes struct {
		ID             int      `json:"id"`
		IID            int      `json:"iid"`
		Ref            string   `json:"ref"`
		Tag            bool     `json:"tag"`
		SHA            string   `json:"sha"`
		BeforeSHA      string   `json:"before_sha"`
		Source         string   `json:"source"`
		Status         string   `json:"status"`
		DetailedStatus string   `json:"detailed_status"`
		Stages         []string `json:"stages"`
		CreatedAt      string   `json:"created_at"`
		FinishedAt     string   `json:"finished_at"`
		Duration       int      `json:"duration"`
		QueuedDuration int      `json:"queued_duration"`
		Variables      []struct {
			Key   string `json:"key"`
			Value string `json:"value"`
		} `json:"variables"`
	} `json:"object_attributes"`

https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#pipeline-events
reference json:

"object_attributes":{
      "id": 31,
      "iid": 3,
      "name": "Pipeline for branch: master",
      "ref": "master",
      "tag": false,
      "sha": "bcbb5ec396a2c0f828686f14fac9b80b780504f2",
      "before_sha": "bcbb5ec396a2c0f828686f14fac9b80b780504f2",
      "source": "merge_request_event",
      "status": "success",
      "stages":[
         "build",
         "test",
         "deploy"
      ],
      "created_at": "2016-08-12 15:23:28 UTC",
      "finished_at": "2016-08-12 15:26:29 UTC",
      "duration": 63,
      "variables": [
        {
          "key": "NESTOR_PROD_ENVIRONMENT",
          "value": "us-west-1"
        }
      ],
      "url": "http://example.com/gitlab-org/gitlab-test/-/pipelines/31"
   },

Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix it, but in the docs url is below variables. Please follow the ordering in the docs when adding fields 👍🏻

@svanharmelen svanharmelen merged commit 978f132 into xanzy:master Jul 16, 2023
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants