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

Feature: Triggers #85

Closed
ckruegerkpmg opened this Issue May 3, 2018 · 21 comments

Comments

4 participants
@ckruegerkpmg
Copy link

ckruegerkpmg commented May 3, 2018

Hi,

it would be nice to have a trigger option additionally to "show notification" that can run arbritary commands with arguments.

This is working with old XAML builds:
https://docs.microsoft.com/en-us/vsts/tfvc/check-folder-controlled-by-gated-check-build-process?view=vsts
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\BuildNotificationApp.exe

If you use vNext-Builds instead of XAML and use TFVC with gated checkin it's really annoying.

It would be great if AnyStatus could trigger: tf reconcile [-teamProject: Value]
https://msdn.microsoft.com/en-us/library/gg589719(v=vs.100).aspx

greetings
Carsten

@AlonAm AlonAm added the feature label May 11, 2018

@AlonAm AlonAm changed the title Trigger on sucessfull Build Feature: trigger on sucessfull Build May 11, 2018

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented May 20, 2018

This is high on the roadmap.
So far, I was thinking about providing an option to add multiple"reactions" in which the user will configure the state transition (from state - to state) and the action to perform.

Should the feature be called "Triggers" or "Reactions"? What's your opinion?

Thanks

@deggen40

This comment has been minimized.

Copy link

deggen40 commented May 21, 2018

I like triggers. Or maybe "Post Build Events"?

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented May 24, 2018

I would like it to be a generic feature that can be used in any widget so I guess "Triggers" is a better name.

The "trigger" should specify:

  1. When to run: before or after the health/status check.
  2. The state transition. For example: when the state change from OK to Error.
  3. One or more "tasks" (or "actions") that can be a script or an executable or sending an email, etc.

Did I miss anything?

@ckruegerkpmg

This comment has been minimized.

Copy link

ckruegerkpmg commented May 28, 2018

@AlonAm AlonAm added the discussion label Jun 16, 2018

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Jun 26, 2018

So I've started working on this and I'm still trying to figure out how this should work.
Here's a sneak peek of what I have so far. Let me know what you think.
Note, at the moment I don't have much control of how the "Collection Control" looks like but I will be able to replace it further down the road.

triggers1

triggers2

@ckruegerkpmg

This comment has been minimized.

Copy link

ckruegerkpmg commented Jun 26, 2018

@JasonvanderStaaij

This comment has been minimized.

Copy link

JasonvanderStaaij commented Jun 29, 2018

This looks promising, I am curious of the results. Can those triggers set on folder level? I mean that the trigger will be fired when one of the child widgets has change their status. Or can it be set per widget (which will be not useful for my purpose, which is switching the combined status to control one RGB light).
When can we expect the result of the sneak peek implementation?
Kind regards,
Jason

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Jun 29, 2018

I haven't thought about it but now that you mention it I'll make sure it does. Technically, folders are widgets so it shouldn't be a problem to inherit the same behavior.
I hope to release it within a week or two.
Thanks

@JasonvanderStaaij

This comment has been minimized.

Copy link

JasonvanderStaaij commented Jun 29, 2018

Awesome, looking forward to seeing the results.

How will the transition parameters be transferred to the calling executable?
Will it be just fixed like C:\MyApp.exe param1 param2 or will you be using replacement tags like C:\MyApp.exe {TransitionFrom} {TransitionTo}
Where TransitionFrom and TransitionTo will be replaced by the State values. In this case we can be more flexible (and even use something like C:\MyApp.exe -f {TransitionFrom} – t {TransitionTo})
And hopefully in the future do something like:
http://myawsome.url/api/rest/dosomething?from={TransitionFrom}&to={TransitionTo}
Kind regards,
Jason

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Jul 1, 2018

I haven't reached that part yet but your suggestion looks ok to me.

What do you expect to receive in the {TransitionFrom}?
A numeric or textual value?

btw, the HTTP URL is a nice idea too

@JasonvanderStaaij

This comment has been minimized.

Copy link

JasonvanderStaaij commented Jul 2, 2018

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Jul 2, 2018

Sure, I'll make sure the command window is hidden.

Alternatively, If you intend to call something that will send an HTTP request, I prefer to provide that option directly by adding an HTTP trigger. If that is the case, let me know what are your requirements (GET/POST, credentials, etc.) and I'll provide it.

Thanks!

@AlonAm AlonAm added this to the Release 2.2 milestone Jul 3, 2018

@AlonAm AlonAm changed the title Feature: trigger on sucessfull Build Feature: Triggers Jul 3, 2018

AlonAm referenced this issue in AnyStatus/API Jul 3, 2018

AlonAm pushed a commit to AnyStatus/API that referenced this issue Jul 4, 2018

Alon Amsalem

AlonAm pushed a commit to AnyStatus/API that referenced this issue Jul 11, 2018

Alon Amsalem
@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Jul 15, 2018

A basic version is ready and will be released within a few days.
Note, it may take a few additional release cycles to stabilize and provide all of the requested features.

@AlonAm AlonAm self-assigned this Jul 15, 2018

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Jul 16, 2018

Here's an early version of release 2.2 which includes the new feature but without the parameter replacement: https://download.anystat.us/desktop/AnyStatus-2.2.4.msi
Please try it and let me know what you think,
Thanks

@deggen40

This comment has been minimized.

Copy link

deggen40 commented Jul 16, 2018

I know this is an early version, but could you make it so both the working directory and file name use the file selection dialog and/or combine them into one thing?

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Jul 16, 2018

Yes, I will. Thanks

AlonAm pushed a commit to AnyStatus/API that referenced this issue Jul 20, 2018

Alon Amsalem

AlonAm pushed a commit to AnyStatus/API that referenced this issue Jul 20, 2018

Alon Amsalem
AnyStatus/Support#85
command trigger window style
@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Jul 21, 2018

@ckruegerkpmg @deggen40 @JasonvanderStaaij

A pre-release version 2.2 is available for download at https://www.anystat.us/downloads with a few changes:

  • Use {transitionTo} and {transitionFrom} to pass the state (status) number to the executable arguments.
  • Added file and working-folder browsers.
  • Process output is visible in the Activity log.

For example:

image

image

@deggen40

This comment has been minimized.

Copy link

deggen40 commented Aug 6, 2018

I have not been able to get this to work. I have a .bat file that I normally execute once a build finishes to get the latest version of the solution. Can you show me an example how I should set this up? EX. C:\Scripts\GetLatest.bat

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Aug 6, 2018

What was the error message in activity log?

Try this,
File Name: cmd.exe
Arguments: /c c:\scripts\getlatest.bat

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Aug 8, 2018

Here's another example:
image

@AlonAm

This comment has been minimized.

Copy link
Member

AlonAm commented Aug 9, 2018

@deggen40 for your convenience, I've added a new trigger called "Batch Script" that accepts a batch file name directly without the need to specify "cmd.exe" in the file name.
The new trigger is available in v2.2.10 (early access) at https://www.anystat.us/downloads
Here's the source code: https://github.com/AnyStatus/Plugins/tree/master/src/AnyStatus.Plugins/Triggers

image

@AlonAm AlonAm closed this Nov 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment