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

Switch the content from array to string. #1103

Merged
1 commit merged into from
Oct 19, 2020

Conversation

sima-zhu
Copy link
Contributor

Fixed the issue: Azure/azure-sdk-for-js#11827

JS pipeline running super slow on array object of Get-Content.
Tested using -Raw, replacement works correctly and the entire process speeds up.

@sima-zhu sima-zhu requested a review from a team as a code owner October 17, 2020 01:07
@sima-zhu sima-zhu requested review from weshaggard and praveenkuttappan and removed request for a team October 17, 2020 01:08
@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
js - template
net - template
python - template
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@ghost
Copy link

ghost commented Oct 19, 2020

Hello @azure-sdk!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit c9ea0fb into Azure:master Oct 19, 2020
@sima-zhu sima-zhu deleted the replace_raw_content branch October 19, 2020 17:27
@@ -205,7 +205,7 @@ function Upload-Blobs
if ($ReleaseTag) {
foreach ($htmlFile in (Get-ChildItem $DocDir -include *.html -r))
{
$fileContent = Get-Content -Path $htmlFile
$fileContent = Get-Content -Path $htmlFile -Raw
$updatedFileContent = $fileContent -replace $RepoReplaceRegex, "`${1}$ReleaseTag"
if ($updatedFileContent -ne $fileContent) {
Set-Content -Path $htmlFile -Value $updatedFileContent
Copy link
Member

Choose a reason for hiding this comment

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

@sima-zhu since you are now using -Raw have you verified that the Set-Content works correctly? I think you will need to now pass the "-NoNewLine" option to it as well otherwise it will add a new line at the end of the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did not verify newline, but double check with the all release tag works just fine. Will do more check here and submit a new PR if it is a miss.

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 just tested it locally, it actually add new line in the scripts. Thanks for spotting the issue. Will submit another PR.

ghost pushed a commit that referenced this pull request Oct 19, 2020
This is a follow up PR (#1103) which introduced extra new line at the end of the file. 
Local testing indicates we added new line at end.
Checked the github io, and it does not bring too many differences.
E.g.
After PR,
https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-template/1.0.9-beta.22/index.html
Before PR,
https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-template/1.0.9-beta.20/index.html
benbp pushed a commit that referenced this pull request Dec 1, 2020
Fixed the issue: Azure/azure-sdk-for-js#11827

JS pipeline running super slow on array object of `Get-Content`.
Tested using -Raw, replacement works correctly and the entire process speeds up.
benbp pushed a commit that referenced this pull request Dec 1, 2020
This is a follow up PR (#1103) which introduced extra new line at the end of the file. 
Local testing indicates we added new line at end.
Checked the github io, and it does not bring too many differences.
E.g.
After PR,
https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-template/1.0.9-beta.22/index.html
Before PR,
https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-template/1.0.9-beta.20/index.html
This pull request was closed.
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.

4 participants