Code Monkey home page Code Monkey logo

Comments (9)

mathieubergeron avatar mathieubergeron commented on September 17, 2024 9

It would also be nice to be able to customize the body being sent when using the generic provider.

I was hoping that using the generic provider would allow me to send a repository_dispatch request to a GitHub repository, but it won't work unless I can specify a valid body for the request.

Edit: For GitHub repository_dispatch, see https://fluxcd.io/flux/components/notification/providers/#github-dispatch

from notification-controller.

wosc avatar wosc commented on September 17, 2024 6

I'd very much love being able to template the payload, especially for "generic webhook", because that would open up lots of integrations, e.g. things like sending deployment markers to Honeycomb, setting the currently deployed version in something like Bugsnag, and so on. Having to implement each of those as a custom provider seems (to me at least) to be much more effort than should be necessary. (Also, I'd guess that quite a few of which currently are specialized providers, looking at something like Grafana, for example, could then just as well be "generic webhook" with an appropriate template instead of custom code.)

from notification-controller.

marcuslindfeldt avatar marcuslindfeldt commented on September 17, 2024 4

This feels like an essential feature for the notification controller.
To be effective, notifications need to be easy to read and contain just enough information to be informative.
Exactly what that information is will vary in different organisations.

The event object looks promising. If its intent is something else then maybe its possible to create a new object with a very strict api from the beginning and then adding to it later on?

Github actions solved this nicely with the ${github} context object I think.

from notification-controller.

Adonisbruno avatar Adonisbruno commented on September 17, 2024 3

UP!
I'm trying customize helmrelease notifcation.

image

At image Update Automation I want modify template..

imageupdateautomation/flux-system.review
Committed and pushed change 2a70b3c6b39e2214e26ed3f5dae9999f2466526f to main

Images:
XXXXXXXX.com.br/api-arquivo/review:0.4.2-2

I wanted the result to be like this:

helmrelease/api-arquivo.review
Helm upgrade has started

revision
0.3.3

Image
XXXXXXXX.com.br/api-arquivo/review:0.4.2-2

I already tried using summary and eventMetadata:

helmrelease/api-arquivo.review
Helm upgrade succeeded

revision
0.2.8

summary
{{- with index .Event.Metadata "images" -}}
{{- $tag := last (split ":" (index . 0)) -}}
{{- printf "Upgrade %s/%s %s %s." .Values.namespace .Values.nameApp (index .Event.InvolvedObject.Fields "revision") $tag }}

Still without success, does anyone have any idea how to link the image being updated in the helmRelease message? this in a single message?

from notification-controller.

somtochiama avatar somtochiama commented on September 17, 2024 2

@hkuersten There is a spec.summary field in the alert resource that you use to add more info to the alert

from notification-controller.

phillebaba avatar phillebaba commented on September 17, 2024

This might work but would mean opening up the go template pandoras box which will be difficult to close if it turns out it does not work. We would need to standardize which variables are exposed, which may lead to feature creep as users ask for more and more features in the templating. Saying that I am more in support of this feature than I am against.

I think implementing this might solve #194.

from notification-controller.

mbrancato avatar mbrancato commented on September 17, 2024

Wanted to throw some support on this. I think since already there is a well defined data object (event) being templated using format strings, this would be easy to implement a basic POC.

https://github.com/fluxcd/pkg/blob/11abd078e26f7eaf8c4c415fa1897e1d41993592/runtime/events/event.go#L36-L72

What I'd suggest is that the first implementation of this exposes this object for templating support.

from notification-controller.

FrenchBen avatar FrenchBen commented on September 17, 2024

Glad to see others are in favor of this.
How bad is this go template pandora's box?

from notification-controller.

hkuersten avatar hkuersten commented on September 17, 2024

I, too, would love to have a little bit more flexibility in constructing the message sent to Slack: we use the same channel for all notifications from our various environments (dev, QA, Staging and Prod) and if the message is always

kustomization/some-app.flux-system
Deployment/some-app/some-app-deployment configured
revision
master/abc12345def678

Would it be possible to add at least some info on the cluster, from which the event was emitted?

from notification-controller.

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.