-
Notifications
You must be signed in to change notification settings - Fork 67
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
Specify bot names in the UI #29
Comments
Oh this would be awesome. Take a look here, these are a couple of tiny methods where Builda figures out the name of a bot. Feel free to try to implement this yourself, I'd love to have that in Builda. The only issue with having the PR name in the Bot name is that the PR name can change and Builda uses the name to pair existing bots with PRs. So I guess we'd need to also change bot matching to PRs to do a prefix match, instead of a perfect match. So that it could still be something like "BuildaBot [repo] #PR_NUMBER: PR_NAME", and we'd prefix match for only ""BuildaBot [repo] #PR_NUMBER:", so that even if you change your PR's name, it still matches. |
Thanks. I will take a look at it if I get some time for that! Yeah, matching bots/PR's by name feels a bit weird. Is there no way to get a bot ID or something like that via the API? The natural solution would be to match PR-number -> Bot ID or something like that. |
Well Builda is stateless, so it has to be able to assume the Bot's name from the repo+PR number without saving anything. But that still would work fine, as I said, we'd just need to prefix match instead of exact match. |
Yeah, that could work. On another note: Is there a specific reason for why it is stateless? I imagine this is a very good case for state, to be able to arbitrarily name bots if possible. |
@accatyyc Well, basically on every sync (the thing that happens every ~15 seconds or however long your sync interval is), Builda pulls all PRs from GitHub and Bots from Xcode Server and resolves them into actions. There is nothing saved in memory or on disk. This allows for much simpler logic, where even if you stop Builda, make changes to your PRs and Bots and start it again, it will always do the right thing and recover. In #66 I was hoping to confirm that we could identify bots by custom keys, but that will not be possible unfortunately (see #66 for explanation). This means we still need to rely on the Bot's name to uniquely identify it during resolution time. If you have an idea on how to still make sure we never mix bots incorrectly (even with multi-project support) AND allow for bot name customization, I'm all yours. In the meantime, I will unfortunately have to de-prioritize this, because I don't see a straightforward way of allowing this yet (I'll keep thinking about it though, because I recognize it'd be a pretty nice feature to have). |
OK, I could check this myself ofc but since you know the Xcode Server API's - when returning bots, do they not return anything like a key that could identify the bot (if Builda started saving state, ofc)? |
Yeah there is an id associated with every bot, but that would mean we'd have to start keeping state in Builda, which would introduce a whole new level of complexity. I'm not completely against it, but it doesn't justify the work in my opinion just yet. |
If we end up doing it, let's use Stencil. |
👍 |
I'd definitely appreciate this feature. It's not a particularly elegant solution, but could you potentially start all bot names with the Pull Request number and allow anything after that to be user-defined? |
@rpowelll It sounds like an OK solution to me. To make it even more failsafe, you could add a "magic number". So the bot names could be for example:
|
Problem is multiple repositories might be tested with Buildasaur at the same time. So you might clash with pull request numbers. That's why the name of the repo needs to be in the name as well. |
Hmm. So the problem is matching the server repo against a repo on Github, right? Couldn't you somehow access a Server repo and run |
Hmm that's a pretty good idea. I'll think about it. Unfortunately I won't be able to also find the PR so that the name can be totally custom, because there isn't 1:1 mapping between branches and PRs. But finding out the repo might be possible. |
Cool. If that's possible, then doing |
Technically, it might be, yeah! Okay, I'll take a look at this at some point and I'll add it to the 1.0 milestone. |
Right now, the bots are automatically named
BuildaBot [organisation/repo] PR #pr-no
. In our office, we have all integrations showing up on a big screen, and in this case these bot names make no sense.It would be nice to be able to specify bot names with a small DSL in a field. Especially, more interesting than the PR number is to have the actual PR title.
Suggested solution
Add a text field in the UI where we can input names. Also, supply a few variables that can be used in the string that will be replaced if they exist. For example, the following input:
BurgerBot :: "{pr_name}" (#{pr_no})
where
{pr_name}
and{pr_no}
are variables, would generate this bot name:BurgerBot :: "Flip burgers twice instead of once" (#3)
Additional variables could for example be
organisation
,repo
etc.The text was updated successfully, but these errors were encountered: