Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
pvillard31 committed Nov 25, 2024
1 parent 57b0ef0 commit 9af5323
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ public class BitBucketFlowRegistryClient extends AbstractGitFlowRegistryClient {
APP_PASSWORD,
OAUTH_TOKEN_PROVIDER);

static final String STORAGE_LOCATION_PREFIX = "[email protected]:";
static final String STORAGE_LOCATION_FORMAT = STORAGE_LOCATION_PREFIX + "%s/%s.git";

@Override
protected List<PropertyDescriptor> createPropertyDescriptors() {
return PROPERTY_DESCRIPTORS;
Expand All @@ -151,13 +154,12 @@ protected GitRepositoryClient createRepositoryClient(final FlowRegistryClientCon

@Override
public boolean isStorageLocationApplicable(FlowRegistryClientConfigurationContext context, String location) {
// TODO Auto-generated method stub
return false;
return location != null && location.startsWith(STORAGE_LOCATION_PREFIX);
}

@Override
protected String getStorageLocation(GitRepositoryClient repositoryClient) {
// TODO Auto-generated method stub
return null;
final BitBucketRepositoryClient gitLabRepositoryClient = (BitBucketRepositoryClient) repositoryClient;
return STORAGE_LOCATION_FORMAT.formatted(gitLabRepositoryClient.getWorkspace(), gitLabRepositoryClient.getRepoName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@ public boolean hasWritePermission() {
return canWrite;
}

/**
* @return the name of the workspace
*/
public String getWorkspace() {
return workspace;
}

/**
* @return the name of the repository
*/
public String getRepoName() {
return repoName;
}

@Override
public Set<String> getBranches() throws FlowRegistryException {
LOGGER.debug("Getting branches for repository [{}]", repoName);
Expand Down

0 comments on commit 9af5323

Please sign in to comment.