Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
badfe78
Remove setter from AnalyzeTextOptions (#12777)
sima-zhu Jul 2, 2020
1fb2bda
Javadoc codesnippets for SearchIndexerAsyncClient (#12776)
sima-zhu Jul 2, 2020
ce43c6b
Add ability to specify subscription configuration, location, and ARM …
danieljurek Jul 2, 2020
07d2291
Regenerate LUIS authoring (#12744)
jianghaolu Jul 2, 2020
f794b2c
Update RecognizeOptions to take only optional params (#12625)
samvaity Jul 2, 2020
7a45a5f
Increment version for core releases (#12785)
azure-sdk Jul 2, 2020
d0150c8
Skip Changelog processing for data track (#12787)
JimSuplizio Jul 2, 2020
405219c
ClassCastExceptionForTopQueryWithAggregate (#12633)
xinlian12 Jul 2, 2020
c39454c
Adding namespace and missing exists methods (#12780)
conniey Jul 3, 2020
f27af36
Update README.md (#12756)
justbert Jul 3, 2020
7685539
Not let our sample down if property 'azure.activedirectory.tenant-id'…
Jul 3, 2020
31029c5
Servicebus track2 readme changes 10327 (#12735)
hemanttanwar Jul 3, 2020
22ce2f8
Servicebus track2 live test receive renew lock (#12737)
hemanttanwar Jul 3, 2020
78ed9ef
disable flaky assert (#12793)
weidongxu-microsoft Jul 3, 2020
486c321
fix bug of auto configuration of spring boot starters (#12795)
yiliuTo Jul 3, 2020
e2e242c
mgmt regen resources (#12794)
weidongxu-microsoft Jul 3, 2020
6410184
mgmt fix todo (#12798)
weidongxu-microsoft Jul 6, 2020
0ba3641
Mgmt: Appplatform (#12350)
ChenTanyi Jul 6, 2020
02155b4
[Event Hubs] Consolidate all javadoc codesnippet Java files into a si…
srnagar Jul 6, 2020
60cde34
FormRecognizer Receipt design update (#12380)
samvaity Jul 6, 2020
2fc46dc
Sync eng/common directory with azure-sdk-tools repository (#12738)
azure-sdk Jul 6, 2020
714c26b
Removing bridge API for reactor. (#12827)
hemanttanwar Jul 6, 2020
b730543
Fix single upload retry. (#12834)
kasobol-msft Jul 6, 2020
3d49736
Fixes bug in buffered upload where data would be uploaded incorrectly…
gapra-msft Jul 7, 2020
d8afe9c
mgmt, add url to pom description (#12844)
weidongxu-microsoft Jul 7, 2020
467c9e7
update link in AUTH.md (#12845)
xseeseesee Jul 7, 2020
da149bb
mgmt resources fix TODOs (#12814)
xseeseesee Jul 7, 2020
00e5096
Cache refresh for container recreate with same id (#12747)
xinlian12 Jul 7, 2020
1961116
Migrate integration tests for spring-data-cosmosdb (#12609)
yiliuTo Jul 7, 2020
86afb16
Testing for Tables Autorest Code (#12512)
eboyd23 Jul 7, 2020
927fa43
Update Search APIs Based on Review (#12791)
alzimmermsft Jul 7, 2020
5a6bd8c
Enable blocking operation in batch receive (#12822)
srnagar Jul 7, 2020
9e4911b
update versions. (#12872)
g2vinay Jul 7, 2020
e59b888
Prepping 73 release (#12873)
gapra-msft Jul 7, 2020
aa1e607
Added versions and added REST docs (#12874)
gapra-msft Jul 7, 2020
c548afc
change RNTBD defaults as per learning and to be in par with .Net (#12…
moderakh Jul 7, 2020
c4e54cd
Nio read attr (#12621)
rickle-msft Jul 7, 2020
afe7b59
July patch release preparation for AppConfig, TA and FR (#12833)
mssfang Jul 7, 2020
5dfe115
Sync eng/common directory with azure-sdk-tools repository (#12870)
azure-sdk Jul 7, 2020
9009f12
Add plugin to internal avro to add empty javadoc (#12879)
gapra-msft Jul 8, 2020
34e9894
Add missing changelogs (#12876)
chidozieononiwu Jul 8, 2020
6aea90f
SpotBugs step to use the Maven proxy. (#12889)
mitchdenny Jul 8, 2020
f5fcfa2
Increment package version after release of com.azure azure-ai-textana…
azure-sdk Jul 8, 2020
f8c7aae
Increment version for storage releases (#12877)
azure-sdk Jul 8, 2020
3221338
Remove ServiceBusMessageProcessor (#12885)
conniey Jul 8, 2020
dc84cf7
Increment package version after release of com.azure azure-data-appco…
azure-sdk Jul 8, 2020
67ab775
open to azure-core, for f.setAccessible(true); in FlatteningSerialize…
weidongxu-microsoft Jul 8, 2020
d59bd7c
move AzureServiceClient to fluentcore (#12908)
weidongxu-microsoft Jul 8, 2020
ff484b6
Add Javadoc Escapes to README Overview (#12627)
alzimmermsft Jul 8, 2020
04bf47f
Increment version for formrecognizer release (#12916)
samvaity Jul 8, 2020
3df5560
Ignored flaky CF tests (#12915)
gapra-msft Jul 8, 2020
2a3e40b
Renamed azure-spring-data-cosmosdb to azure-spring-data-cosmos (#12881)
kushagraThapar Jul 8, 2020
9a509bd
Sync eng/common directory with azure-sdk-tools repository (#12912)
azure-sdk Jul 8, 2020
c4b3c17
Update versions for EH July release (#12913)
srnagar Jul 8, 2020
2f4f39f
Added script logging enabled API to CosmosStoredProcedureRequestOptio…
kushagraThapar Jul 8, 2020
2c6eb8a
Creating yml file for ctl image build ci (#12926)
simplynaveen20 Jul 8, 2020
7a9d5f5
Revert storabge blob version in version_client.txt (#12928)
srnagar Jul 8, 2020
a1800e5
Increment version for eventhubs releases (#12927)
azure-sdk Jul 8, 2020
1007365
Use proper variable syntax (#12930)
danieljurek Jul 8, 2020
e896387
Tweaking the Java Cosmos CTL pipeline yml (#12933)
JimSuplizio Jul 9, 2020
46e87cf
add CONTRIBUTING.MD for azure-spring-boot (#12901)
yiliuTo Jul 9, 2020
08bba18
Increment azure core version to 1.7.0-beta.2 (#12958)
jianghaolu Jul 9, 2020
5399396
Close message processor downstream. (#12921)
conniey Jul 9, 2020
d2719b2
Clean up repository resources (#12892)
chidozieononiwu Jul 9, 2020
23b3517
Sync eng/common directory with azure-sdk-tools repository (#12938)
azure-sdk Jul 9, 2020
9bdecc5
mgmt support api version detection (#12907)
xseeseesee Jul 9, 2020
0526b69
Create Migration Guide from Track 1 to Track 2 (#12909)
nickzhums Jul 9, 2020
9361802
add key vault certificate permission (#12965)
ChenTanyi Jul 9, 2020
7d211b4
PR for EH + serializer integration (#12205)
arerlend Jul 9, 2020
e7be51b
Increment version for core releases (#12969)
azure-sdk Jul 9, 2020
037e12d
Add workaround for Checkstyle error, closes #6216 (#6593)
karianna Jul 9, 2020
be3d197
Revert "PR for EH + serializer integration (#12205)" (#12976)
arerlend Jul 9, 2020
8705591
Fix the issue of ChangeFeedProcessorCodeSnippet (#12894)
Melanie-Ma Jul 9, 2020
feaf5d4
Updated azure spring data cosmos group id and artifact id (#12925)
kushagraThapar Jul 9, 2020
9861529
Added an exception to unsupported provider methods instead of no-op'i…
rickle-msft Jul 9, 2020
4bb00ef
Update ctl-image-build.yml (#12973)
simplynaveen20 Jul 9, 2020
32f2037
Remove search model builder classes (#12796)
srnagar Jul 10, 2020
a08a57b
Add some wagon options. (#12991)
mitchdenny Jul 10, 2020
e0772d4
Added idle tcp connection timeout bug where gateway connection overri…
kushagraThapar Jul 10, 2020
f627f82
Use Varargs in Model APIs (#12878)
alzimmermsft Jul 10, 2020
734b8cd
Spring - Remove Intermediate Poms (#12966)
saragluna Jul 10, 2020
eadf80d
Updates prefetch algorithm and test updates. (#12975)
conniey Jul 10, 2020
9bc23c3
Update to deal with use of Spring BOM in samples (#12784)
JimSuplizio Jul 10, 2020
7612f32
Readme (#12972)
rickle-msft Jul 10, 2020
46e9950
Update CHANGELOG and README for preview 4. (#13026)
conniey Jul 10, 2020
593440d
Move AzureTestWatcher into azure-core-test (#12989)
alzimmermsft Jul 10, 2020
7d690ca
Modify javadoc check on spring annotation in README.md (#13012)
yiliuTo Jul 10, 2020
e519435
add readme of spring data cosmos (#12964)
yiliuTo Jul 10, 2020
24e7fb5
Sync eng/common directory with azure-sdk-tools repository (#13027)
azure-sdk Jul 10, 2020
4ffbde3
Renamed getSyncSecretClientCodeSnippets() to getSecretClient() to be …
vcolin7 Jul 10, 2020
2892a1e
Corrected broken link in README and sample with error. (#12464)
vcolin7 Jul 10, 2020
989bb8a
Fix incorrect comments. (#12754)
saurabh500 Jul 10, 2020
661682e
Sync eng/common directory with azure-sdk-tools repository (#13034)
azure-sdk Jul 11, 2020
da37c2d
Review Before Releasing Azure Cognitive Search (#13033)
alzimmermsft Jul 11, 2020
467e370
increment version after azure-identity 1.1.0-beta.6 release (#13037)
jianghaolu Jul 11, 2020
2248f96
[BUG] Cosmos | Addresses GitHub issue #10401 : Operator called defaul…
Jul 11, 2020
978c5e2
modify build command to build the whole project (#12992)
yiliuTo Jul 13, 2020
6f85cf8
mgmt regen appservice and compute (#13022)
weidongxu-microsoft Jul 13, 2020
b26c0da
add correlation id back when use msal (#13070)
Jul 13, 2020
90d84ab
Kusto: generate package-2020-06-14 (#13071)
xseeseesee Jul 13, 2020
d7797ea
remove duplicate plugin definitions (#13086)
saragluna Jul 13, 2020
65a33d3
Fixed release date (#13087)
sima-zhu Jul 13, 2020
acb8f13
Fixed block issue and tier issue (#12978)
gapra-msft Jul 13, 2020
2ff45e1
Azure Tables Sync and Async Code Snippets (#12169)
eboyd23 Jul 13, 2020
fedcd53
Updated CHANGELOG and README files. (#13041)
vcolin7 Jul 13, 2020
0d1a718
Remove Container throughput default value from SDK (#13125)
jacko9et Jul 14, 2020
b0e44ba
modify package name from btoc to b2c (#13126)
yiliuTo Jul 14, 2020
ec51223
Increment package version after release of com.azure azure-search-doc…
azure-sdk Jul 14, 2020
ba15735
Refactor Formrecognizer samples (#12987)
samvaity Jul 14, 2020
511309d
4.2.0 release (#13145)
xinlian12 Jul 14, 2020
653763e
Fix field order to preserve service side field ordering (#13147)
samvaity Jul 14, 2020
cd875c1
Increment package version after release of com.azure azure-cosmos (#1…
azure-sdk Jul 14, 2020
f3fdd21
Artifact grouping (#10564)
mitchdenny Jul 15, 2020
c15f392
Bump package versions for test release. (#13157)
mitchdenny Jul 15, 2020
6704678
mgmt doc on LRO beginCreate/beginDelete (#12899)
weidongxu-microsoft Jul 15, 2020
553f998
mgmt, update user-agent (#13085)
weidongxu-microsoft Jul 15, 2020
2eb4fa6
Sync eng/common directory with azure-sdk-tools repository (#13062)
azure-sdk Jul 15, 2020
b144116
Support AllIgnoreCase and IgnoreCase keywords in Cosmos (#13128)
moarychan Jul 15, 2020
679c08a
Upload incorrect length (#13144)
rickle-msft Jul 15, 2020
6bd5b67
Nio javadocs (#13150)
rickle-msft Jul 15, 2020
d409692
Implemented ORS List Blobs (#13096)
gapra-msft Jul 15, 2020
6163d2c
Regenerated base code and all tests passed (#13153)
mssfang Jul 15, 2020
001c38f
Update Additional Modules in keyvault/ci.yml (#13204)
JimSuplizio Jul 15, 2020
84cd70c
Update for bannedDependency includes and beta_ tags (#13211)
JimSuplizio Jul 15, 2020
de27b1b
Update targeted doc-warden version (#13202)
scbedd Jul 16, 2020
e212192
Increment package version after release of com.azure azure-core-seria…
azure-sdk Jul 16, 2020
5a02525
Increment package version after release of com.azure azure-core-seria…
azure-sdk Jul 16, 2020
b8022e1
Increment package version after release of com.azure azure-core-seria…
azure-sdk Jul 16, 2020
e43256a
Increment package version after release of com.azure azure-core-seria…
azure-sdk Jul 16, 2020
0a71c66
Fix merge conflict
alzimmermsft Jul 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/sdk/core/ @alzimmermsft @jianghaolu @srnagar @hemanttanwar @anuchandy
/sdk/core/azure-core-tracing-opentelemetry/ @samvaity @alzimmermsft
/sdk/cosmos/ @moderakh @kushagraThapar @David-Noble-at-work @kirankumarkolli @mbhaskar
/sdk/cosmos/azure-spring-data-cosmosdb/ @kushagraThapar
/sdk/cosmos/azure-spring-data-cosmos/ @kushagraThapar @saragluna @yiliuTo @chenrujun @zhoufenqin @jialindai
/sdk/eventhubs/ @conniey @srnagar @mssfang
/sdk/formrecognizer/ @samvaity @mssfang @sima-zhu
/sdk/identity/ @schaabs @g2vinay @jianghaolu
Expand All @@ -27,7 +27,7 @@
/sdk/servicebus/ @yvgopal @nemakam @hemanttanwar @conniey
/sdk/storage/ @amishra-dev @rickle-msft @jaschrep-msft @gapra-msft @alzimmermsft @sima-zhu
/sdk/textanalytics/ @samvaity @mssfang @sima-zhu
/sdk/spring/ @saragluna @yiliuTo @chenrujun @jialindai
/sdk/spring/ @saragluna @yiliuTo @chenrujun @zhoufenqin @jialindai

# end to end tests
/sdk/e2e/ @jianghaolu @g2vinay
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ package-lock.json
# VS Code
.vscode/
.factorypath
jacoco.exec
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ Some live tests may have additional steps for setting up live testing resources.
See the CONTRIBUTING.md file for the service you wish to test for additional
information or instructions.

### Workaround for Checkstyle error

When building locally you might run into a Checkstyle such as the following:

```
Execution default of goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0:check failed:
Plugin org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0 or one of its dependencies could not be resolved:
Could not find artifact com.azure:sdk-build-tools:jar:1.0.0 in ossrh (https://oss.sonatype.org/content/repositories/snapshots/)
```

This is because the `sdk-build-tools` project isn't released to Maven. To resolve this issue you'll need to copy the `eng` folder locally then install `sdk-build-tools`.

`mvn clean install eng/code-quality-reports/pom.xml`

All code in the Azure SDKs for Java repository must pass Checkstyle before being merged. The `sdk-build-tools` is updated periodically, so if a new branch fails Checkstyle you'll need to reinstall.

## Versions and versioning

Tooling has been introduced to centralize versioning and help ease the pain of updating artifact versions in POM and README files. Under the eng\versioning directory there exists version text files, one for client ([version_client.txt](./eng/versioning/version_client.txt)) and one for data ([version_data.txt](./eng/versioning/version_data.txt)). The format of the version files is as follows:
Expand Down
43 changes: 0 additions & 43 deletions common/azure-test-watcher/README.md

This file was deleted.

81 changes: 0 additions & 81 deletions common/azure-test-watcher/pom.xml

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion common/perf-test-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<version>1.5.2</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
<version>1.5.3</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@

<!-- Don't apply custom Checkstyle rules to files under samples package -->
<suppress
checks="com\.azure\.tools\.checkstyle\.checks\.(ExternalDependencyExposedCheck|HttpPipelinePolicyCheck|EnforceFinalFieldsCheck|ThrowFromClientLoggerCheck|GoodLoggingCheck)"
checks="com\.azure\.tools\.checkstyle\.checks\.(ExternalDependencyExposedCheck|HttpPipelinePolicyCheck|EnforceFinalFieldsCheck|ThrowFromClientLoggerCheck|GoodLoggingCheck|JavadocThrowsChecks)"
files=".*[/\\]samples[/\\].*\.java"/>

<!-- Don't check for JavaDocPackage in samples or tests -->
Expand Down Expand Up @@ -417,6 +417,8 @@
<suppress checks="LineLength" files="com.azure.ai.formrecognizer.implementation.models"/>
<suppress checks="LineLength" files="com.azure.ai.formrecognizer.Transforms.java"/>

<suppress checks="GoodLoggingCheck" files="com.azure.ai.formrecognizer.models.FieldValueType.java" />

<!-- TODO: Fix with https://github.com/Azure/azure-sdk-for-java/issues#6716 Method name should follow a common vocabulary. -->
<suppress checks="com.azure.tools.checkstyle.checks.ServiceClientCheck" files=".*[/\\]textanalytics[/\\].*"/>

Expand Down Expand Up @@ -472,9 +474,9 @@
<suppress checks="AvoidNestedBlocks" files="com.azure.storage.internal.avro.implementation.schema.AvroSchema.java"/>
<suppress checks="AvoidNestedBlocks" files="com.azure.storage.internal.avro.implementation.schema.AvroType.java"/>
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck"
files="com.microsoft.azure.spring.data.cosmosdb.config.AbstractCosmosConfiguration.java"/>
files="com.azure.spring.data.cosmos.config.AbstractCosmosConfiguration.java"/>
<suppress checks="com.azure.tools.checkstyle.checks.EnforceFinalFieldsCheck"
files="com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest.java"/>
files="com.azure.spring.data.cosmos.core.query.CosmosPageRequest.java"/>

<!-- Checkstyle suppressions for azure-test-watch package -->
<suppress checks="com.azure.tools.checkstyle.checks.ExternalDependencyExposedCheck" files="com.azure.testing.AzureTestWatcher.java"/>
Expand All @@ -483,9 +485,21 @@
<!-- Checkstyle suppressions for resource manager package -->
<suppress checks="com.azure.tools.checkstyle.checks.ServiceClientCheck" files="com.azure.resourcemanager.*"/>

<!-- Checkstyle suppressions for spring-data-cosmosdb package -->
<suppress checks="com.azure.tools.checkstyle.checks.GoodLoggingCheck|ExternalDependencyExposedCheck|ThrowFromClientLoggerCheck" files="com.microsoft.azure.spring.data.cosmosdb.*\.java"/>
<suppress checks="MethodName|MemberName|ParameterName|VisibilityModifier" files="com.microsoft.azure.spring.data.cosmosdb.domain|repository|config.*\.java"/>
<suppress checks="ConstantName" files="com.microsoft.azure.spring.data.cosmosdb.repository|common.*\.java" />
<!-- Checkstyle suppressions for azure-spring AADB2C package name-->
<suppress checks="PackageName" files="com.microsoft.azure.spring.autoconfigure.*|com.azure.spring.*"/>

<!-- Checkstyle suppressions for azure-spring-data-cosmos package -->
<suppress checks="com.azure.tools.checkstyle.checks.GoodLoggingCheck|ExternalDependencyExposedCheck|ThrowFromClientLoggerCheck" files="com.azure.spring.data.cosmos.*\.java"/>
<suppress checks="MethodName|MemberName|ParameterName|VisibilityModifier" files="com.azure.spring.data.cosmos.domain|repository|config.*\.java"/>
<suppress checks="ConstantName" files="com.azure.spring.data.cosmos.repository|common.*\.java" />
<suppress checks="ConstantName|MemberName" files="com.azure.cosmos.UserRepositoryConfiguration|AppConfiguration|MyDocument.java" />

<!-- These suppressions were added due to limitations in our custom Checkstyle rules and should be addressed in the future. -->
<!-- API naming is too restrictive -->
<suppress checks="com.azure.tools.checkstyle.checks.ServiceClientCheck" files="com.azure.search.documents.indexes.SearchIndexerAsyncClient.java"
lines="654,671,699,716"/>
<suppress checks="com.azure.tools.checkstyle.checks.ServiceClientCheck" files="com.azure.search.documents.indexes.SearchIndexerClient.java"
lines="495,513,529,547"/>

<!-- ServiceMethod return type for Collection doesn't check for sub-types -->
</suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"com\\.microsoft\\.spring\\..+",
"javax\\.jms(\\..+)?",
"javax\\.servlet(\\..+)?",
"io\\.micrometer(\\..+)?"
"io\\.micrometer(\\..+)?",
"com\\.azure\\.data\\.cosmos(\\..+)?",
"com\\.azure\\.spring\\.data\\.cosmos\\..+"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@
<!-- Exclude NP_LOAD_OF_KNOWN_NULL_VALUE from the files generated by autorest -->
<Match>
<Package name="~com\.azure\.resourcemanager\.(.+)\.fluent"/>
<Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE,SKIPPED_CLASS_TOO_BIG"/>
<Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE,SIC_INNER_SHOULD_BE_STATIC_ANON,SKIPPED_CLASS_TOO_BIG"/>
</Match>

<!-- Exclude REC_CATCH_EXCEPTION for management samples. All samples in management catch Exception instead of throw it. -->
Expand Down
2 changes: 1 addition & 1 deletion eng/common/TestResources/deploy-test-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ parameters:
# "TestApplicationId": "<test app id>",
# "TestApplicationSecret": "<test app secret>",
# "ProvisionerApplicationId": "<provisoner app id>",
# "ProvisoinerApplicationSecret": "<provisoner app secert>",
# "ProvisionerApplicationSecret": "<provisoner app secert>",
# "Environment": "AzureCloud | AzureGov | AzureChina | <other environment>"
# }

Expand Down
36 changes: 19 additions & 17 deletions eng/common/Update-Change-Log.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ function Get-ChangelogPath($Path)
{
# Check if CHANGELOG.md is present in path
$ChangeLogPath = Join-Path -Path $Path -ChildPath "CHANGELOG.md"
if ((Test-Path -Path $ChangeLogPath) -eq $False){
if ((Test-Path -Path $ChangeLogPath) -eq $False) {
# Check if change log exists with name HISTORY.md
$ChangeLogPath = Join-Path -Path $Path -ChildPath "HISTORY.md"
if ((Test-Path -Path $ChangeLogPath) -eq $False){
if ((Test-Path -Path $ChangeLogPath) -eq $False) {
Write-Host "Change log is not found in path[$Path]"
exit(1)
}
Expand All @@ -45,7 +45,7 @@ function Get-VersionTitle($Version, $Unreleased)
{
# Generate version title
$newVersionTitle = "## $Version $UNRELEASED_TAG"
if ($Unreleased -eq $False){
if ($Unreleased -eq $False) {
$releaseDate = Get-Date -Format "(yyyy-MM-dd)"
$newVersionTitle = "## $Version $releaseDate"
}
Expand All @@ -67,10 +67,10 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi
# Version increment tool passes replaceversion as False and Unreleased as True
$is_version_increment = $ReplaceVersion -eq $False -and $Unreleased -eq $True

for(; $Index -lt $ChangelogLines.Count; $Index++){
if (Version-Matches($ChangelogLines[$Index])){
for (; $Index -lt $ChangelogLines.Count; $Index++) {
if (Version-Matches($ChangelogLines[$Index])) {
# Find current title in change log
if( -not $CurrentTitle){
if( -not $CurrentTitle) {
$CurrentTitle = $ChangelogLines[$Index]
$CurrentIndex = $Index
Write-Host "Current Version title: $CurrentTitle"
Expand All @@ -80,7 +80,7 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi
# update change log script is triggered for all packages with current version for Java ( or any language where version is maintained in common file)
# and this can cause an issue if someone changes changelog manually to prepare for release without updating actual version in central version file
# Do not add new line or replace existing title when version is already present and script is triggered to add new line
if ($is_version_increment -and $ChangelogLines[$Index].Contains($Version)){
if ($is_version_increment -and $ChangelogLines[$Index].Contains($Version)) {
Write-Host "Version is already present in change log."
exit(0)
}
Expand All @@ -90,26 +90,24 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi
# Generate version title
$newVersionTitle = Get-VersionTitle -Version $Version -Unreleased $Unreleased

if( $newVersionTitle -eq $CurrentTitle){
if( $newVersionTitle -eq $CurrentTitle) {
Write-Host "No change is required in change log. Version is already present."
exit(0)
}



if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG))){
if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and $CurrentTitle.Contains($version) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG))) {
Write-Host "Version is already present in change log with a release date."
exit(0)
}

# if current version title already has new version then we should replace title to update it
if ($CurrentTitle.Contains($Version) -and $ReplaceVersion -eq $False){
if ($CurrentTitle.Contains($Version) -and $ReplaceVersion -eq $False) {
Write-Host "Version is already present in title. Updating version title"
$ReplaceVersion = $True
}

# if version is already found and not replacing then nothing to do
if ($ReplaceVersion -eq $False){
if ($ReplaceVersion -eq $False) {
Write-Host "Adding version title $newVersionTitle"
$ChangelogLines.insert($CurrentIndex, "")
$ChangelogLines.insert($CurrentIndex, "")
Expand All @@ -121,24 +119,28 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi
$ChangelogLines[$CurrentIndex] = $newVersionTitle
}

return $ChangelogLines
return $ChangelogLines
}


# Make sure path is valid
if ((Test-Path -Path $ChangeLogPath) -eq $False){
if ((Test-Path -Path $ChangeLogPath) -eq $False) {
Write-Host "Change log path is invalid. [$ChangeLogPath]"
exit(1)
}

# probe change log path if path is directory
if (Test-Path -Path $ChangeLogPath -PathType Container)
{
if (Test-Path -Path $ChangeLogPath -PathType Container) {
$ChangeLogPath = Get-ChangelogPath -Path $ChangeLogPath
}

# Read current change logs and add/update version
$ChangelogLines = [System.Collections.ArrayList](Get-Content -Path $ChangeLogPath)

if ($null -eq $ChangelogLines) {
$ChangelogLines = @()
}

$NewContents = Get-NewChangeLog -ChangelogLines $ChangelogLines -Version $Version -Unreleased $Unreleased -ReplaceVersion $ReplaceVersion

Write-Host "Writing change log to file [$ChangeLogPath]"
Expand Down
Loading