GithubHelp home page GithubHelp logo

Webhooks / Subscription in Mock about ngitlab HOT 6 CLOSED

ubisoft avatar ubisoft commented on August 16, 2024
Webhooks / Subscription in Mock

from ngitlab.

Comments (6)

meziantou avatar meziantou commented on August 16, 2024

NGitLab.Mock doesn't support webhooks. However, based on your needs, you can use the events on collections to detect when a change occurs (INotifyCollectionChanged).

from ngitlab.

meziantou avatar meziantou commented on August 16, 2024

I'm not sure what it would take to support webhooks in tests. Feel free to share some ideas :)

from ngitlab.

mvarendorff avatar mvarendorff commented on August 16, 2024

The collection notifier is very close to what I need actually! If there was something like this to listen for the items in the collection to change, that would be immensely useful. So that I could listen for calls to, for instance, gitLab.Issues.EditAsync; the collection notifier does allow listening for gitLab.Issues.CreateAsync though!

I am unsure how that would look like in code but given some guidance I could look into making a PR!

from ngitlab.

meziantou avatar meziantou commented on August 16, 2024

Implementing something that would allow simulating webhooks is more complicated as webhooks, most of the time, has the previous and new values. So, you can't only rely on IPropertyChanged / INotifyCollectionChanged.

I forgot to mention the Server.ClientOperation event that is raised for each method on a client. The event is currently empty, so you don't know which method is called, but we could add more data to it if needed.

from ngitlab.

mvarendorff avatar mvarendorff commented on August 16, 2024

What you mentioned about requiring the previous values definitely is true; we make lots of use of that to check in what ways the assignee or labels for example have changed to react to that accordingly.

Yeah, I saw Server.ClientOperation but couldn't find much use in the empty args indeed. What information would go in there? The way it's currently being invoked makes it quite difficult to pass any result-y sort of thing because the scope is always created before any action happens.

from ngitlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.