Skip to content

Commit

Permalink
fix: fcli ssc: The --attributes option on fcli ssc appversion *
Browse files Browse the repository at this point in the history
… and `fcli ssc attribute *` commands now supports setting multiple values for an attribute

ftest: Update SSCAppVersionSpec.groovy
  • Loading branch information
gendry-gh authored and rsenden committed Jan 31, 2024
1 parent a3eb6be commit bd3fd62
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import picocli.CommandLine.Option;

public class SSCAttributeUpdateMixin {
private static final String PARAM_LABEL = "[CATEGORY:]ATTR=VALUE[,VALUE...]";
private static final String PARAM_LABEL = "ATTR=VALUE";
public static abstract class AbstractSSCAppVersionAttributeUpdateMixin {
public abstract Map<String,String> getAttributes();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private static final ArrayNode getOptionSingleValue(SSCAttributeDefinitionHelper
}

private static ArrayNode getOptionValues(SSCAttributeDefinitionHelper helper, SSCAttributeDefinitionDescriptor descriptor, String value) {
return Stream.of(value.split(","))
return Stream.of(value.split("[\\[\\];]"))
.filter(StringUtils::isNotBlank)
.map(v->helper.getOptionGuid(descriptor.getGuid(), v))
.map(SSCAttributeUpdateBuilder::createAttrValueNode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,11 @@ fcli.ssc.artifact.upload.file = File to upload.
fcli.ssc.attribute.usage.header = Manage SSC application version attributes & definitions.
fcli.ssc.attribute.list.usage.header = List application version attributes.
fcli.ssc.attribute.update.usage.header = Update application version attributes.
fcli.ssc.attribute.update.option = Set values for one or more attributes. This option accepts a comma-separated list of attribute value assignments.
fcli.ssc.attribute.update.option = Example: ATTR1=[VAL1;VAL2],CATEGORY:ATTR2=VAL3 \
\nSet values for one or more attributes. This option accepts a comma-separated list of KEY=VALUE assignments. \
\nEach KEY accepts either the Attribute's GUID or its Name with the optional Category (InfoClassification or "BUSINESS:Data Classification" or "Data Classification") \
\nEach VALUE accepts a semicolon-separated list of Attribute's Values, encapsulated in brackets (optional for single value) \
fcli.ssc.attribute.get-definition.usage.header = Get attribute definition details.
fcli.ssc.attribute.list-definitions.usage.header = List attribute definitions.
fcli.ssc.attribute-definition.resolver.nameOrId = Attribute definition name or id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class SSCAppVersionSpec extends FcliBaseSpec {
}
}


/*
def "createWithCopy"() {
def args = "ssc appversion create --from=10060 --auto-required-attrs --issue-template=Prioritized\\ High\\ Risk\\ Issue\\ Template ${versionSupplier.version.appName}:copied --store=copied"
when:
Expand Down Expand Up @@ -140,8 +140,8 @@ class SSCAppVersionSpec extends FcliBaseSpec {
size()==3
it[1].contains("High 2")
}
}
}*/
//TODO add tests to verify copying of attributes once that is implemented
//the copy action in the UI using the /bulk endpoint sets a copyVersionAttributes flag which doesnt seem to do anything atm
//waiting for feedback from PM if that is supposed to be working, if not Alex plans to implement it client side
}
}

0 comments on commit bd3fd62

Please sign in to comment.