Skip to content

Commit 4e6c799

Browse files
authored
Use user changelog if present (#2485)
1 parent 56309a3 commit 4e6c799

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

db/service/src/main/java/org/commonjava/indy/db/service/ServiceStoreDataManager.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555

5656
import static java.util.Collections.emptyMap;
5757
import static java.util.Collections.emptySet;
58+
import static org.apache.commons.lang3.StringUtils.isBlank;
5859
import static org.commonjava.indy.db.common.StoreUpdateAction.STORE;
60+
import static org.commonjava.indy.model.core.ArtifactStore.METADATA_CHANGELOG;
5961
import static org.commonjava.indy.model.core.StoreType.hosted;
6062

6163
@SuppressWarnings( "unchecked" )
@@ -142,8 +144,12 @@ protected ArtifactStore putArtifactStoreInternal( StoreKey key, ArtifactStore st
142144
try
143145
{
144146
Class<ArtifactStore> storeCls = (Class<ArtifactStore>) key.getType().getStoreClass();
145-
client.module( IndyStoresClientModule.class )
146-
.create( store, String.format( "Create store %s", key ), storeCls );
147+
String changelog = store.getMetadata( METADATA_CHANGELOG );
148+
if ( isBlank(changelog) )
149+
{
150+
changelog = String.format( "Create store %s", key );
151+
}
152+
client.module( IndyStoresClientModule.class ).create( store, changelog, storeCls );
147153
return store;
148154
}
149155
catch ( IndyClientException e )

0 commit comments

Comments
 (0)