-
Notifications
You must be signed in to change notification settings - Fork 157
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
bug/fixes#326 #335
bug/fixes#326 #335
Conversation
…ST request is not allowed. #326
@@ -63,6 +63,11 @@ function _callAPI { | |||
$params.Add('Uri', $Url) | |||
$params.Add('UserAgent', (_getUserAgent)) | |||
|
|||
#always use utf8 and json as default content type instead of xml | |||
if ($false -eq $PSBoundParameters.ContainsKey("ContentType")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DarqueWarrior can you check if you agree? I thing it is a good approach because
- we use json by default anyways and never xml
- UTF8 should always be used if not configured otherwise.
A next step could be to remove the content types in all the other cmdlet so this problem does not occur anymore. We had this now the third time.
Running tests now. |
I have no idea why I can never push changes to your branches. I will push to another branch and merge |
Merging from another branch that includes my changes. |
$tmpReleaseDef1 = (New-TemporaryFile).FullName | ||
$srcReleaseDef | ConvertTo-Json -Depth 10 | Set-Content -Path $tmpReleaseDef1 | ||
|
||
Invoke-VSTeamRequest -ProjectName $newProjectName -Method Post -SubDomain vsrm -Area Release -Resource definitions -Version "5.1" -InFile $tmpReleaseDef1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard coding the version will cause these tests to fail on TFS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused of what you are trying to do here. Why are you using Invoke-VSTeamRequest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the version is corrected it appears to work on TFS2018 and above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think have the tests fixed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for correcting! I don't know anymore why I used the wrong command for testing release definitions. Doesn't make sense to me anymore. Maybe a brain hickup...
Fixes #326
fix the encoding issue for all future cmdlets. Added a default ContentType with JSON and UTF8 encoding if not specified otherwise. Also removed the encoding from the build/release definition functions to have default UTF 8.
Additionally, I added integration tests for handling release definitions with special characters in them.