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

Scenarios [work in progress] #325

Merged
merged 21 commits into from Jun 19, 2014
Merged

Scenarios [work in progress] #325

merged 21 commits into from Jun 19, 2014

Conversation

cantino
Copy link
Member

@cantino cantino commented May 15, 2014

  • Add the concept of Scenarios (Agent Groups)
  • Allow Scenarios to be exported as JSON dumps
  • Allow Scenarios to be imported
  • Repeated import of the same Scenario should offer to update the existing one
  • Show visual diff when the existing Scenario has been edited
  • Diff options editor

…to scenarios, edit scenarios, and view scenarios. next step: import and export
@dsander
Copy link
Collaborator

dsander commented May 15, 2014

Wow, that is cool! Just as a reference #142 #209 #138

@snicker
Copy link
Contributor

snicker commented May 15, 2014

👍

@dsander dsander mentioned this pull request May 31, 2014
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) when pulling fc878f4 on scenarios into 5e63ae3 on master.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling b25c38c on scenarios into * on master*.

…Scenario guid is now generated and copied to export, as well as a source link when public
@coveralls
Copy link

Coverage Status

Coverage increased (+0.72%) when pulling 6632502 on scenarios into 8e8df24 on master.

@cantino
Copy link
Member Author

cantino commented Jun 1, 2014

Okay, Scenario creation and management is getting close to done. You can also export a JSON serialization of a Scenario. Next step is allowing import!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.75%) when pulling b91faf6 on scenarios into 8e8df24 on master.

@0xdevalias
Copy link
Member

Excited!! :3

@coveralls
Copy link

Coverage Status

Coverage increased (+0.62%) when pulling 5c1fbdb on scenarios into 43d0256 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.83%) when pulling 64564eb on scenarios into 43d0256 on master.

@cantino
Copy link
Member Author

cantino commented Jun 6, 2014

@dsander @alias1 @Anyone-else: This is very close to done. I'd love it if you could play with it, and perhaps offer a code review!

@cantino
Copy link
Member Author

cantino commented Jun 8, 2014

Glad you like it!

Thanks for the suggestions; I'll integrate them and update the PR soon. I'm also changing a bit about how the import works with a differential view, so may want a second code review. :)

@coveralls
Copy link

Coverage Status

Coverage increased (+1.37%) when pulling 827b623 on scenarios into 21e95ae on master.

@dsander
Copy link
Collaborator

dsander commented Jun 9, 2014

I was trying this out in combination with the new services and we probably somehow need to handle them when importing a agents that require a service to be set. Maybe show some services dropboxes in the second import step?

Initially i was thinking we could merge the scenarios and services together but it's probably easier to merge one and adjust the other to work with it, right?

@coveralls
Copy link

Coverage Status

Coverage increased (+1.33%) when pulling 7ecd099 on scenarios into 44834cb on master.

@kprentiss
Copy link

Just cheering your work - very excited for this!

@cantino
Copy link
Member Author

cantino commented Jun 15, 2014

Okay, I think this is ready to merge! I'll continue to test it on my installation for a day or two, then merge it. If anyone else could test it too, that'd be great!

@coveralls
Copy link

Coverage Status

Coverage increased (+1.33%) when pulling a7ed5b5 on scenarios into 94a8465 on master.

@dsander
Copy link
Collaborator

dsander commented Jun 15, 2014

Yeah I too think it is good to merge, even if there are undiscovered issues it will not effect the base functionality of current instances.

@kprentiss
Copy link

I'll do some testing tomorrow- excited to try them.

@cantino
Copy link
Member Author

cantino commented Jun 15, 2014

Awesome, thanks! I'll merge shortly @kprentiss.

One follow-up will be to ensure all agents that use api_keys have LiquidInterpolatable included and applied to those keys, so that Agents in public Scenarios can always use credentials for those values with {{credential foo}}.

@kprentiss
Copy link

Sweet. Wife's out of town. All afternoon to play : )

@ghost ghost mentioned this pull request Jun 16, 2014
@cantino
Copy link
Member Author

cantino commented Jun 16, 2014

How'd it go @kprentiss?

cantino added a commit that referenced this pull request Jun 19, 2014
Scenarios [work in progress]
@cantino cantino merged commit 645d33f into master Jun 19, 2014
@cantino cantino deleted the scenarios branch June 19, 2014 02:52
@cantino
Copy link
Member Author

cantino commented Jun 19, 2014

Okay, MERGED!

@snicker
Copy link
Contributor

snicker commented Jun 19, 2014

Any documentation on this yet? Guess I'll just take a run at it. How do existing installations migrate over?

@cantino
Copy link
Member Author

cantino commented Jun 19, 2014

Not yet. Play with it and let me know what you think! You can import and export. Maybe to gists sometime soon as well.

@0xdevalias
Copy link
Member

Random sidethought (not sure of how useful, but figured i'd tack it on here): Ability to have scenarios use/embed other scenarios. This would probably have to tie in with #390 to be done in a nice way (so it loads the 'sub-scenario' from the url on the directory site.

Almost getting into a Gemfile style dependencies thing, especially when agents become seperated, they could be specified (with versions?) in the scenario file too.

@snicker
Copy link
Contributor

snicker commented Jul 2, 2014

Finally got this running on my deployment, it's awesome! Definitely for organization.

Following up on what @alias1 says above, it would be great if Scenarios could be treated in a similar way to how Agents are now. A Scenario should be able to specify one agent as an output endpoint and one agent as an input endpoint and also specify sources (which could be an Agent or another Scenario). For instance, while organizing my existing agents into Scenarios, I have something that I call "OutputPipeline":

image

Main Notification Output is simply an EventFormattingAgent with no instructions and merge: true, Huginn History is a DataOutputAgent, and LocalGrowler is a GrowlAgent.

Currently, Main Notification Output has sources from the "output" endpoint of most of my other scenarios. It would make more sense that this agent would become the input endpoint for the Scenario, and I could specify the other Scenarios as sources (once their output endpoints are defined)

{
  "name": "OutputPipeline",
  "description": "No description provided",
  "source_url": false,
  "guid": "6eaccaa028cdcd9a3bd47734ed7f9c72",
  "exported_at": "2014-07-02T14:53:32Z",
  "agents": [
    {
      "type": "Agents::EventFormattingAgent",
      "name": "Main Notification Output",
      "disabled": false,
      "guid": "26d0b8bb660549d118275e44b32774a8",
      "options": {
        "mode": "merge",
        "skip_agent": "false",
        "skip_created_at": "true",
        "instructions": {
          "??": "??"
        }
      },
      "keep_events_for": 0,
      "propagate_immediately": true
    },
    {
      "type": "Agents::DataOutputAgent",
      "name": "Huginn History",
      "disabled": false,
      "guid": "1c5cf8422ab930c95de7266b4f3eca8c",
      "options": {
        "secrets": [
          "notmyrealsecret"
        ],
        "expected_receive_period_in_days": 2,
        "template": {
          "title": "Huginn Notification History",
          "description": "A Feed of events Generated by Huginn",
          "item": {
            "subject": "$.subject",
            "message": "$.message",
            "text": "$.text"
          }
        }
      },
      "keep_events_for": 0,
      "propagate_immediately": true
    },
    {
      "type": "Agents::GrowlAgent",
      "name": "LocalGrowler",
      "disabled": false,
      "guid": "8bb20b06777d50acc2356536de36658b",
      "options": {
        "growl_server": "localhost",
        "growl_password": "notmyrealpassword",
        "growl_app_name": "HuginnGrowl",
        "expected_receive_period_in_days": "2",
        "growl_notification_name": "Notification"
      },
      "propagate_immediately": true
    }
  ],
  "links": [
    {
      "source": 0,
      "receiver": 2
    },
    {
      "source": 0,
      "receiver": 1
    }
  ]
}

@cantino
Copy link
Member Author

cantino commented Jul 3, 2014

Great idea @alias1 and @snicker. I hadn't thought about having Scenarios have inputs and outputs, but it makes a ton of sense. I'll think about it!

DataMinerUK pushed a commit to DataMinerUK/huginn that referenced this pull request Oct 6, 2014
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.

None yet

6 participants