Skip to content

Support failed to start build locator#19

Open
goodwinnk wants to merge 1 commit intoJetBrains:masterfrom
goodwinnk:failedToStart
Open

Support failed to start build locator#19
goodwinnk wants to merge 1 commit intoJetBrains:masterfrom
goodwinnk:failedToStart

Conversation

@goodwinnk
Copy link
Contributor

No description provided.

/**
* By default failed to start builds are filtered out, call this method to include them.
*/
fun withAnyFailedToStart(): BuildLocator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'withAnyFailedToStart' name is very confusing. With what? What do you mean be 'any failed'? I would name the method 'includeFailedToStart', but maybe it would be even better to include FAILED_TO_START into BuildStatus. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this will make the option less discoverable and I'm also not sure if there mightn't be a successful build that failed to start. Say, if status had been changed manually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, including this value into BuildStatus will make it a little less discoverable. However, adding 3 functions for such a rarely used option will make all other options in BuildLocator less discoverable.

And I've just checked, there is no 'Mark as successful' option in TeamCity UI for failed to start build.

* By default failed to start builds are filtered out, call this method to include them.
*/
fun withAnyFailedToStart(): BuildLocator
fun withFailedToStart(value: Boolean): BuildLocator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls like withFailedToStart(false) will look confusing. And why do you need this method at all? If value is false it's just a no-op, and if value is true it's equivalent to the previous method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, will rename methods to 'includeFailedToStart()' and 'failedToStartOnly()', thank you! By default failed-to-start builds are ignored.

As a side note, I think there should always be a method to revert an option to default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to have method to revert options? It would complicate API and may be useful only if someone wants to pass BuildLocator instance between methods. Also if we add it behavior of BuildLocator will become dependent on order in which the methods are called, it may cause problems. Do you have any real use case there it's necessary?

@goodwinnk
Copy link
Contributor Author

This pull request is updated.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants