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

Halibot / halibot / 416 / 2
93%
master: 93%

Build:
Build:
LAST BUILD BRANCH: config-writer
DEFAULT BRANCH: master
Ran 08 Mar 2019 06:39PM UTC
Files 20
Run time 1s
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

05 Mar 2019 11:35PM UTC coverage: 93.493% (+0.01%) from 93.482%
416.2

push

travis-ci

richteer
halibot: implement filters as new halibot object type

Problem: How can we introduce rate limiting, self-censoring, or other kind of
logic into Halibot instances without adding this to each module or agent?

This patch introduces a new Halibot object type "HalFilter". These filters can
be inserted in between a normal message send path, to silently drop or modify
message content. These filters are NOT meant for large behaviors.

Filters are instantiated similarly to other HalObjects, using the
"filter-instances" config key. To "attach" a filter to an agent or module, a
new filter table needs to be defined in config.json.

Here is an example:

"filters": {
    "inbound": {
      "irc0": [ "rlfilter0" ]
    },

    "outbound": {
      "quote0": [ "rlfilter1" ]
    }
}

In this example, "rlfilter0" and "rlfilter1" are instances of a rate-limiting
filter. The above declaration states that all messages from any source being
sent to irc0 must first pass through rlfilter0. Also, any messages flowing out
from module quote0 must first pass through rlfilter1.

As rlfilter0 and rlfilter1 are different instances, they may have different
tolerances for their rate limiter. So, for example, this could restrict the
amount of spam coming from one particular module more strictly than all
messages flowing to an agent.

1135 of 1214 relevant lines covered (93.49%)

0.93 hits per line

Source Files on job 416.2
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 395
  • Travis Job 416.2
  • ce7d9590 on github
  • Prev Job for on filter-ri-injection (#411.2)
  • Next Job for on filter-ri-injection (#434.1)
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

© 2026 Coveralls, Inc