Skip to content
Snippets Groups Projects

Add variables on pipeline webhook

Merged Pierre Tardy requested to merge tardyp/gitlab-ce:variables_in_events into master

What does this MR do?

Add variables on pipeline webhook

Are there points in the code the reviewer needs to double check?

This is a pretty simple one liner

Why was this MR needed?

Pipeline variables are useful to create custom parametrised pipelines.

Variables can be used to track the purpose of a particular pipeline, and/or link to another higher level automatisation tool.

It is thus useful to get the list of variables in pipeline update events.

Variables are also not available in pipeline API: https://docs.gitlab.com/ee/api/pipelines.html#get-a-single-pipeline

There should be there as well, but this is another MR.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

#28105 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Pipeline #31501815 passed with warnings

Pipeline passed with warnings for 93afe26f on tardyp:variables_in_events

Test coverage 76.32% (0.00%) from 2 jobs

Merged by Kamil TrzcińskiKamil Trzciński 6 years ago (Oct 1, 2018 5:22pm UTC)

Loading

Pipeline #31706587 passed with warnings

Pipeline passed with warnings for 2176477d on master

Test coverage 76.36% (0.00%) from 2 jobs

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Pierre Tardy changed the description

    changed the description

  • Pierre Tardy added 1 commit

    added 1 commit

    • f7388aaf - Add variables on pipeline webhook

    Compare with previous version

  • 👋 Hello @tardyp could you please give a practical example of use in the description of the MR?

    @jramsay I am still a little "young" on this part, but can you please take a 👁 🙏

  • Author Contributor

    Our practical example is slightly complex, I didn't want to confuse the description with our real example.

    We have a bot that is connected to webhooks of gitlab, and is watching various events of our sw line components.

    The bot is for example watching mergerequests, and is triggering pipelines of super projects that are including those components. The pipelines are triggered using the trigger pipeline API: https://docs.gitlab.com/ee/ci/triggers/#making-use-of-trigger-variables

    Then when we get pipeline events, we can figure out from what component merge request this was triggered, and make appropriate external CI status.

    With this method, we implement an Android/repo pre-submit workflow with gitlab-ci. Android is a beast with 700+ projects, and we don't want to maintain 700 .gitlab ci in each project to trigger the main integration project pipeline.

  • Thanks @tardyp - this sounds like a good idea, but I'll @bikebilly and @ayufan review since this relates to ~"CI/CD"

  • added ~2278654 Community contribution ~3260766 labels

  • I don't fully understand the need for having this and what value it brings, and what variables we effectively expose.

    We seem to target only very specific use case: trigger variables, but I wonder if this is the right way to do.

    @tardyp Would you mind to spend some time on describing how exactly the flow looks like and how you interact?

  • Author Contributor

    @ayufan I tried to summarize my main use case here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18171#note_66784429 . not sure if you saw it.

    Please let me know if that comment is unclear.

    I can show you in details over appear.in or similar what we have built with gitlab-ci.

  • Author Contributor

    @ayufan , any feedback on my last answer? thanks

  • Author Contributor

    @ayufan Here are some excerpt of our CI architecture presentation (that we call Nestor), focussed on why we need variable in pipeline events:

    image image image image

    I hope this helps to clarify the complexities we are trying to implement with gitlab-ci.

  • Thanks @tardyp give me a few days to review that :)

  • Author Contributor

    @ayufan Friendly reminder. Times flies! :)

  • @danielgruesso or @vbhupatiraju Can you help here if we want such functionality added?

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading