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

GH-2127 - allow json and buildserver output at the same time #2128

Merged
merged 3 commits into from
Feb 26, 2020

Conversation

arturcic
Copy link
Member

@arturcic arturcic commented Feb 22, 2020

Closes #2127 Closes #1236

Copy link
Member

@asbjornu asbjornu left a comment

Choose a reason for hiding this comment

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

Great stuff! What happens if you duplicate -output json, for instance? Also, it's now impossible to not output JSON, true?

@arturcic
Copy link
Member Author

What happens if you duplicate -output json, for instance?

We use ISet, that means only one instance will be saved.

Also, it's now impossible to not output JSON, true?

We add by default in the constructor of Arguments the json because we need to preserve the way it worked before

@arturcic
Copy link
Member Author

But not using json at all, I think the old behavior allowed that. Let me check

@arturcic
Copy link
Member Author

@asbjornu now it's possible to add only -output buildserver without output json as well as multiple times -output json or -output buildserver or a combination of those

@gep13
Copy link
Member

gep13 commented Feb 24, 2020

Interesting! This will help with one of the long time issues with using GitVersion and Cake on CI system. Namely that you would have to run GitVersion twice, once to set the BuildServer version and then again to get the asserted variables to use in rest of script.

@arturcic
Copy link
Member Author

Interesting! This will help with one of the long time issues with using GitVersion and Cake on CI system. Namely that you would have to run GitVersion twice, once to set the BuildServer version and then again to get the asserted variables to use in rest of script.

Right, that was one of the reasons I implemented this, to avoid running twice.

@arturcic arturcic force-pushed the feature/gh-2127 branch 2 times, most recently from 7227f18 to 6f05594 Compare February 24, 2020 13:18
Copy link
Member

@asbjornu asbjornu left a comment

Choose a reason for hiding this comment

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

Brilliant!

@arturcic
Copy link
Member Author

@gep13 I think this change will break cake alias for GitVersion, am I right?

@gep13
Copy link
Member

gep13 commented Feb 24, 2020

Off the top of my head, I am not sure. I would need to check. Travelling at the minute, so not in a position to look at this just now.

@arturcic
Copy link
Member Author

@gep13 I think this will still work with the cake aliases, just whoever uses the cake aliases will not be able to specify both the json and buildserver output. So I think we can merge this. @asbjornu ?

@asbjornu
Copy link
Member

Sure. But just to be clear: This closes #1236 and probably makes #983 obsolete as well, no? Writing the console output to a file is just > GitVersion.json in most console environments.

@asbjornu
Copy link
Member

Unless we use the implementation of #983 to fix #1031. 🤔

@arturcic
Copy link
Member Author

arturcic commented Feb 26, 2020

I think it will close #1236,
As for #983 just > GitVersion.json might work except when the tool fails it will write the error to the GitVersion.json file so I'd prefer a new output type instead.
As for #1031 it might partially fix the issue as we will only call it once instead of twice, making it less probable, but in the case of GitVersionTask it might occur as for each task it calls the GitVersion (something to refactor I think)

@arturcic arturcic linked an issue Feb 26, 2020 that may be closed by this pull request
@asbjornu
Copy link
Member

asbjornu commented Feb 26, 2020

Good analysis. Please add Closes #1236 in your PR description so it gets closed automatically on merge and then just merge ahead. :shipit:

@arturcic arturcic merged commit a030aa2 into GitTools:master Feb 26, 2020
@arturcic arturcic deleted the feature/gh-2127 branch February 26, 2020 11:36
@arturcic arturcic added this to the 5.1.4 milestone Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants