Skip to content

Commit

Permalink
Added fix for casing while storing runs
Browse files Browse the repository at this point in the history
Signed-off-by: Aashir Siddiqui <aashir_sidiki@hotmail.com>
  • Loading branch information
aashir21 committed Nov 28, 2024
1 parent dc245d5 commit 352eda2
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,28 @@ private boolean storeRun(String runName, SubmitRunRequest runRequest) throws Dyn
} else {
otherRunProperties.put(runPropertyPrefix + ".group", UUID.randomUUID().toString());
}
otherRunProperties.put(runPropertyPrefix + ".requestor", requestor.toLowerCase());

//Putting this in as a feature flag, checking if CPS property is set
//If set to true then it will allow it to have mixed characters, for e.g,
// Galasadelivery@ibm.com. Else it would set everything to lowercase by default

boolean isMixedCaseRequestorAllowed = false;
try {
String propValue ;
propValue = cps.getProperty("runs.requestor", "is.mixed.case");
if ("true".equals(propValue)) {
isMixedCaseRequestorAllowed = true;
}
} catch(ConfigurationPropertyStoreException ex){
// swallow the exception.
}
String storedRequestor;
if (isMixedCaseRequestorAllowed) {
storedRequestor = requestor ;
} else {
storedRequestor = requestor.toLowerCase();
}
otherRunProperties.put(runPropertyPrefix + ".requestor", storedRequestor);

if (sharedEnvironmentPhase != null) {
otherRunProperties.put(runPropertyPrefix + ".shared.environment", "true");
Expand Down

0 comments on commit 352eda2

Please sign in to comment.