• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

StackStorm / st2 / 8401
76%
master: 73%

Build:
Build:
LAST BUILD BRANCH: stevedore-runners
DEFAULT BRANCH: master
Ran 10 Mar 2016 01:07AM UTC
Jobs 3
Files 466
Run time 5min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
8401

push

travis-ci

Edward Medvedev
Add the `extras` field to action aliases

Different chat adapters have special capabilities which are sometimes
very handy and nice. Slack has attachment colors and parsing/unfurling
options for better formatting; HipChat has Connect features; and so on.
It’s hard for users to add support for those right now, because you
have to modify the schema and the DB connector in st2, and only then
submit a PR to `hubot-stackstorm` utilizing the new parameter. More
importantly, if we had a lot of requests for this, our schema would be
overblown with rarely used parameters.

A solution for this,—which has been discussed some weeks ago, but I
only got around to it now,—is an `extras` object inside the alias with
a “free” schema. It will allow people to easily add support for extra
features without modifying `st2` (which would imply only getting a
feature out in the next `st2` release and complicating the schema) and
with relative ease. While this is not ideal architecturally (a reason
the schema exists in the first place is to have order, and this breaks
it a bit), I feel like pros outweigh the cons, and it’s worth to
introduce this. We still maintain strict schema outside `extras`.

Another neat feature this PR includes is rendering extras with Jinja
sharing the context with `ack` or `result`, depending on the placement.
E.g. different colors depending on the execution status.

This can also be useful for possible usage of action aliases outside
chat (e-mails, sms, tweets, and whatnot).

An example:
```
name: "tesla.honk_horn"
action_ref: "tesla.honk_horn"
description: "Honk your horn"
formats:
- “honk-honk”
result:
format: "**Honk Honk**"
extras:
color: “<% if result.succeeded %> green <% else %> red <% endif %>”
```

8 of 8 new or added lines in 3 files covered. (100.0%)

15435 of 20326 relevant lines covered (75.94%)

0.94 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
100.0
st2api/st2api/controllers/v1/aliasexecution.py
Jobs
ID Job ID Ran Files Coverage
2 8401.2 (TASK=unit) 10 Mar 2016 01:08AM UTC 0
73.26
Travis Job 8401.2
3 8401.3 (TASK=integration) 10 Mar 2016 01:07AM UTC 0
20.37
Travis Job 8401.3
5 8401.5 (TASK=packs-tests) 10 Mar 2016 01:12AM UTC 0
Travis Job 8401.5
Source Files on build 8401
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Travis Build #8401
  • c65ffc15 on github
  • Next Build on alias-extras (#8404)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc