huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
44 stars 22 forks source link

Feature for TriggerBuildTask: Only check build conditions from the same branch #110

Closed aee11 closed 5 years ago

aee11 commented 5 years ago

We are building build definition A

So what I'm suggesting is a check box under "Trigger Conditions": "Only check builds on current branch" (or something that is worded better). I'm willing to implement this if you think this makes sense.

huserben commented 5 years ago

Hi @aee11

Thanks for the feedback, this sounds like a meaningful addition. However I guess it makes only sense to apply this in case you're working with:

  1. git repositories
  2. the build(s) affected are in the scope of the same repository

So the documentation/help text should be accordingly updated.

I'm planning to make a change for #108 so I could have a look into this also, however timewise this would mean it will be implemented in the next 2-4 weeks (if everything goes according to plan). If you need it earlier feel free to have a look into it on your own (and let me know if I can assist).

What do you think?

aee11 commented 5 years ago

Hey @huserben !

Thanks for the fast response. I completely forgot to say thank you for the already great extension. I think your extension is the "missing link" in order to get our monorepo build dependencies setup correctly. So yes, in my case, the builds are in the scope of the same git repository but to keep the trigger mechanism isolated to a certain release branch or the master branch, this feature would be needed.

Maybe it could work for builds in different repositories if there are teams that keep the branch structure similar between repos but I doubt people do that.

There's no time constraint on my side so if you think this can go alongside the fix for #108 then I would be extremely grateful. I'm also willing to grab it but I'm guessing your more familiar with this code base. I looked a bit into the code and wasn't sure if I'd have have to look into the tfsrestservice package or if you're moving to interacting directly with azure-devops-node-api...

huserben commented 5 years ago

Hi @aee11

so I'm finally getting to look into your feature request. Yeah it could theoretically work with having the same branch structure "by chance", but I think it's best that I'll try to make it clear in the help/documentation that this is inteded for builds within the same git repo (also it's not for anybody using TFVC).

I would propose that we add exactly one checkbox in the condition area that then would apply to all conditions, or would you think we need to be more fine grained and have it on a per condition base? I would assume there is at least at the moment not a use case where this would be needed?

aee11 commented 5 years ago

Yes, a single checkbox would be perfect. I can't imagine a use case where it is needed for each condition.

I look forward to trying this out!

Thanks once again.

On Mon, 1 Jul 2019, 02:09 Benj Huser, notifications@github.com wrote:

Hi @aee11 https://github.com/aee11

so I'm finally getting to look into your feature request. Yeah it could theoretically work with having the same branch structure "by chance", but I think it's best that I'll try to make it clear in the help/documentation that this is inteded for builds within the same git repo (also it's not for anybody using TFVC).

I would propose that we add exactly one checkbox in the condition area that then would apply to all conditions, or would you think we need to be more fine grained and have it on a per condition base? I would assume there is at least at the moment not a use case where this would be needed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/huserben/TfsExtensions/issues/110?email_source=notifications&email_token=ABQS7NHEMTXYSTWZCW355YTP5DSFTA5CNFSM4HZHEWJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY4QACY#issuecomment-507052043, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQS7NEJTNAH76TCEK3BO6DP5DSFTANCNFSM4HZHEWJA .

huserben commented 5 years ago

Hi @aee11

so I have a working version now of what you suggested. You can specify the option within the Conditions: grafik

Which would cause to filter the respective builds for the same branch: grafik

In case someone checked it on a TFVC repo it's ignored and logging a warning.

Is this what you would have imagined?

I'll update some dependencies before I would push the new version, so I would still have time to adjust it in case you have some feedback.

Edit: I now have uploaded the newest version. In case you use Azure DevOps you should automatically get the newest version, in case of standalone TFS/Azure DevOps Server you can install the newest version manually.

Please let me know whether it works as expected or not.

aee11 commented 5 years ago

I just tried it out today and it works perfectly. Thanks for this, truly!

huserben commented 5 years ago

Thanks for the feedback, and please don't hesitate to open another issue in case you find any problems or have a proposal for an improvement or also just in case of a question.