Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventFormattingAgent: Provide access to upstream agent #410

Merged
merged 11 commits into from
Jul 29, 2014
Merged

EventFormattingAgent: Provide access to upstream agent #410

merged 11 commits into from
Jul 29, 2014

Conversation

knu
Copy link
Member

@knu knu commented Jul 22, 2014

Excerpt from the commit log of e55bb4a:

With this enhancement you can, for example, embed the site URL in an
event created by WebsiteAgent by interpolating like
"{{agent.options.url}}", or add a message prefix depending on the type
of upstream agent using the "case" construct of Liquid.

I believe user cannot do harm via AgentDrop, but let me know if I'm missing something.

knu added 4 commits July 22, 2014 21:58
With this enhancement you can, for example, embed the site URL in an
event created by WebsiteAgent by interpolating like
"{{agent.options.url}}", or add a message prefix depending on the type
of upstream agent using the "case" construct of Liquid.
It is now possible to include an agent name without the special flag
just by putting `"agent" => "{{agent.type}}"` in "instructions".

This commit includes automatic migration.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling f79e26d on knu:provide_access_to_agent into 67fcfef on cantino:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-44.77%) when pulling 9823ac7 on knu:provide_access_to_agent into 67fcfef on cantino:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0%) when pulling 9ab66aa on knu:provide_access_to_agent into 67fcfef on cantino:master.

@cantino
Copy link
Member

cantino commented Jul 23, 2014

Very interesting @knu! Do you think we should have specs on AgentDrop itself?

@knu
Copy link
Member Author

knu commented Jul 23, 2014

Sure, added!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling a799408 on knu:provide_access_to_agent into 67fcfef on cantino:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling 6c30b16 on knu:provide_access_to_agent into 67fcfef on cantino:master.

@cantino
Copy link
Member

cantino commented Jul 23, 2014

Awesome, thanks. Do you think we should expose this anywhere we use interpolated in any Agent?

@knu
Copy link
Member Author

knu commented Jul 24, 2014

Probably having an EventDrop that returns the payload + .agent for interpolation is the way to go. Let me try.

To implement this, EventDrop is introduced to represent an Event object
in interpolation.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.11%) when pulling c1f114d on knu:provide_access_to_agent into 67fcfef on cantino:master.

@knu
Copy link
Member Author

knu commented Jul 24, 2014

@cantino It's done! I'll be working on a hover-help for Options to explain Liquid interpolation.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.11%) when pulling 00514d2 on knu:provide_access_to_agent into 67fcfef on cantino:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) when pulling 307ef15 on knu:provide_access_to_agent into 67fcfef on cantino:master.

@knu
Copy link
Member Author

knu commented Jul 24, 2014

@cantino I think this is now in a good shape for merge, thanks for looking!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling 8596bd0 on knu:provide_access_to_agent into 67fcfef on cantino:master.

@cantino
Copy link
Member

cantino commented Jul 24, 2014

Thanks @knu, this looks great. I'll review closely this weekend, deploy to my setup, and merge.

cantino added a commit that referenced this pull request Jul 29, 2014
EventFormattingAgent: Provide access to upstream agent
@cantino cantino merged commit e746bee into huginn:master Jul 29, 2014
@cantino
Copy link
Member

cantino commented Jul 29, 2014

Merged @knu, thanks! Can you update the wiki in the Liquid article about this?

@cantino
Copy link
Member

cantino commented Jul 29, 2014

(Also, did you get the email I sent you to knu@idaemons.org?)

@knu
Copy link
Member Author

knu commented Jul 29, 2014

@cantino Thanks for merging it! I guess skip_created_at also can be deprecated after adding created_at to EventDrop, so I'll try that later.

@knu
Copy link
Member Author

knu commented Jul 29, 2014

@cantino I'm yet to locate your mail. Could you give me any of Message-Id/Date/From?

@cantino
Copy link
Member

cantino commented Jul 30, 2014

Odd. I'm happy to send it again. It's from andrew at andrewcantino.

Message-ID: <CALXA01RwqU5hz9Nni-BJqK7FqXAobCh4L-0WCu7Dtff4bzyB+w@mail.gmail.com>

@knu
Copy link
Member Author

knu commented Jul 30, 2014

I successfully received the mail, for the record.

@knu
Copy link
Member Author

knu commented Jul 30, 2014

@cantino I updated the wiki page, review appreciated!

@cantino
Copy link
Member

cantino commented Jul 30, 2014

Looks good! Would you mind adding an example configuration that shows accessing a property from the event and agent? Something like "{{ event.agent.title }}" right? (Or is it just {{ agent.title }}?)

@knu knu deleted the provide_access_to_agent branch August 13, 2014 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants