Page MenuHomeDevCentral

Handle Jenkins notification plugin payloads
Closed, ResolvedPublic

Description

https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin offers to send JSON payload following this format:

{
    "name": "asgard",
    "url": "job/asgard/",
    "build": {
        "full_url": "http://localhost:8080/job/asgard/18/",
        "number": 18,
        "phase": "COMPLETED",
        "status": "SUCCESS",
        "url": "job/asgard/18/",
        "scm": {
            "url": "https://github.com/evgeny-goldin/asgard.git",
            "branch": "origin/master",
            "commit": "c6d86dc654b12425e706bcf951adfe5a8627a517"
        },
        "artifacts": {
            "asgard.war": {
                "archive": "http://localhost:8080/job/asgard/18/artifact/asgard.war"
            },
            "asgard-standalone.jar": {
                "archive": "http://localhost:8080/job/asgard/18/artifact/asgard-standalone.jar",
                "s3": "https://s3-eu-west-1.amazonaws.com/evgenyg-bakery/asgard/asgard-standalone.jar"
            }
        }
    }
}

Mapping strategies

The payload contains a scm section.

That could allow to reuse GitHub or Phabricator repo/groups mapping.

We should also provide a job name <> group mapping.

Event Timeline

dereckson moved this task from New services to Working on on the Notifications center board.

An example of notifications for one of our Jenkins job is at P212.

The payload contains a scm section.

Not from Jenkinsfile, I'm filling a bug about that.

Next step is to provide a configuration with:

  • the mapping job/project
  • emulate what we would need at Jenkins plugin level: only fire notifications on job failed

Current status: we've all the code ready.

More unit tests, and we'll deploy it on Nasqueron.