Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ private Group adjustTargetGroup( final RemoteRepository buildRepo, final Group s
+ buildRepo.getMetadata( NVR ) );

storeDataManager.storeArtifactStore( targetGroup, changeSummary, false, true, new EventMetadata() );
// Use repo service API to append the member of group instead of to override during target group update.
storeDataManager.addConstituentToGroup( targetGroup.getKey(), buildRepo.getKey() );
Copy link
Member

Choose a reason for hiding this comment

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

If we have the addConstituentToGroup, is the above storeArtifactStore still needed ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sswguo I just re-read this part, and yes, it seems the original logic is only focused on group update with a new member, so I annotated, and updated 8ad742a

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's what we discussed earlier, to replace that part with the specific endpoint.

}
catch ( IndyDataException e )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ Set<Group> affectedBy( Collection<StoreKey> keys )

Set<Group> filterAffectedGroups( Set<Group> affectedGroups );

void addConstituentToGroup( StoreKey key, StoreKey member );

class ContextualTask
{
private String threadName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,4 +681,7 @@ public boolean isExcludedGroup( Group group )
String filter = indyConfiguration.getAffectedGroupsExcludeFilter();
return isNotBlank( filter ) && group.getName().matches( filter );
}

@Override
public abstract void addConstituentToGroup( StoreKey key, StoreKey member );
}
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,9 @@ public void initByPkgMap()
keys.add( store.getKey() );
}
}

@Override
public void addConstituentToGroup( StoreKey key, StoreKey member )
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,8 @@ protected ArtifactStore putArtifactStoreInternal( StoreKey storeKey, ArtifactSto
return stores.put( storeKey, store );
}

@Override
public void addConstituentToGroup( StoreKey key, StoreKey member )
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import static java.util.Collections.emptyMap;
import static java.util.Collections.emptySet;
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.commonjava.indy.db.common.StoreUpdateAction.STORE;
import static org.commonjava.indy.model.core.ArtifactStore.METADATA_CHANGELOG;
import static org.commonjava.indy.model.core.StoreType.hosted;

Expand Down Expand Up @@ -492,4 +491,16 @@ protected void removeAffectedStore( StoreKey key )
logger.debug( "Do nothing here. Delegate to repository service for further operations." );
}

@Override
public void addConstituentToGroup( StoreKey key, StoreKey member )
{
try
{
client.module( IndyStoresClientModule.class ).addConstituentToGroup( key, member );
}
catch ( IndyClientException e )
{
logger.error( "Failed to add member {} into Group {}, due to: {}", member, key, e.getMessage() );
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

<!-- commonjava/redhat projects -->
<indyModelVersion>1.5</indyModelVersion>
<indyClientVersion>3.4.0</indyClientVersion>
<indyClientVersion>3.4.4-SNAPSHOT</indyClientVersion>
<atlasVersion>1.1.4</atlasVersion>
<galleyVersion>1.20</galleyVersion>
<weftVersion>1.24</weftVersion>
Expand Down
Loading