Repository: dmwm/wmcore
Issue: MSOutput: handle HIRelVal workflows as release validation workflows

**Impact of the bug**
ReqMgr2MS - MSOutput

**Describe the bug**
With the help of those annoying email notifications, I just noticed that RelVal workflows can be flagged as `HIRelVal` instead of simply `RelVal`, see batchor code:
https://github.com/CMSCompOps/WmAgentScripts/blob/master/Unified/batchor.py#L26-L28

That means we would be making output data placement for HI relvals as if they were standard workflows. Example workflow:
https://cmsweb.cern.ch/reqmgr2/fetch?rid=shundal_RVCMSSW_11_2_0_pre6QCD_Pt_80_120_13_HI_PU__200914_121449_4581

**How to reproduce it**
Inject a workflow with this key/value pair
```
"SubRequestType": "HIRelVal",
```

**Expected behavior**
We should identify such requests `SubRequestType:HIRelVal` as RelVals inside MSOutputTemplate. The rest will be taken care of by MSOutput.

**Additional context and error message**
MSOutputConsumer record:
```
2020-09-15 20:22:32,746:DEBUG:MSOutput: {u'Campaign': u'CMSSW_11_2_0_pre6__HIN_noPU2018-1600078293',
 u'CreationTime': 1600188791,
 u'IsRelVal': False,
 u'LastUpdate': 1600194152,
 u'OutputDatasets': [u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-112X_upgrade2018_realistic_HI_v3-v1/GEN-SIM',
                     u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-PU_112X_upgrade2018_realistic_HI_v3-v1/GEN-SIM-DIGI-RAW-HLTDEBUG',
                     u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-PU_112X_upgrade2018_realistic_HI_v3-v1/GEN-SIM-RECO',
                     u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-PU_112X_upgrade2018_realistic_HI_v3-v1/MINIAODSIM',
                     u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-PU_112X_upgrade2018_realistic_HI_v3-v1/DQMIO',
                     u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-SiStripCalZeroBias-PU_112X_upgrade2018_realistic_HI_v3-v1/ALCARECO',
                     u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-SiPixelCalZeroBias-PU_112X_upgrade2018_realistic_HI_v3-v1/ALCARECO'],
 u'OutputMap': [{u'Campaign': u'CMSSW_11_2_0_pre6__HIN_noPU2018-1600078293',
                 u'Copies': 0,
                 u'Dataset': u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-112X_upgrade2018_realistic_HI_v3-v1/GEN-SIM',
                 u'DatasetSize': 6147731691L,
                 u'DiskDestination': u'',
                 u'DiskRuleID': u'',
                 u'TapeDestination': u'T0_CH_CERN_MSS',
                 u'TapeRuleID': u''},
                {u'Campaign': u'CMSSW_11_2_0_pre6__HIN_noPU2018-1600078293',
                 u'Copies': 1,
                 u'Dataset': u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-PU_112X_upgrade2018_realistic_HI_v3-v1/GEN-SIM-DIGI-RAW-HLTDEBUG',
                 u'DatasetSize': 14998977440L,
                 u'DiskDestination': u'(tier=2|tier=1)&cms_type=real&rse_type=DISK',
                 u'DiskRuleID': u'',
                 u'TapeDestination': u'T0_CH_CERN_MSS',
                 u'TapeRuleID': u''},
                {u'Campaign': u'CMSSW_11_2_0_pre6__HIN_noPU2018-1600078293',
                 u'Copies': 0,
                 u'Dataset': u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-PU_112X_upgrade2018_realistic_HI_v3-v1/DQMIO',
                 u'DatasetSize': 83245384,
                 u'DiskDestination': u'',
                 u'DiskRuleID': u'',
                 u'TapeDestination': u'',
                 u'TapeRuleID': u''},
                {u'Campaign': u'CMSSW_11_2_0_pre6__HIN_noPU2018-1600078293',
                 u'Copies': 1,
                 u'Dataset': u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-SiPixelCalZeroBias-PU_112X_upgrade2018_realistic_HI_v3-v1/ALCARECO',
                 u'DatasetSize': 5293845,
                 u'DiskDestination': u'(tier=2|tier=1)&cms_type=real&rse_type=DISK',
                 u'DiskRuleID': u'',
                 u'TapeDestination': u'T0_CH_CERN_MSS',
                 u'TapeRuleID': u''},
                {u'Campaign': u'CMSSW_11_2_0_pre6__HIN_noPU2018-1600078293',
                 u'Copies': 1,
                 u'Dataset': u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-PU_112X_upgrade2018_realistic_HI_v3-v1/GEN-SIM-RECO',
                 u'DatasetSize': 6200231114L,
                 u'DiskDestination': u'(tier=2|tier=1)&cms_type=real&rse_type=DISK',
                 u'DiskRuleID': u'',
                 u'TapeDestination': u'T0_CH_CERN_MSS',
                 u'TapeRuleID': u''},
                {u'Campaign': u'CMSSW_11_2_0_pre6__HIN_noPU2018-1600078293',
                 u'Copies': 1,
                 u'Dataset': u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-SiStripCalZeroBias-PU_112X_upgrade2018_realistic_HI_v3-v1/ALCARECO',
                 u'DatasetSize': 41172109,
                 u'DiskDestination': u'(tier=2|tier=1)&cms_type=real&rse_type=DISK',
                 u'DiskRuleID': u'',
                 u'TapeDestination': u'T0_CH_CERN_MSS',
                 u'TapeRuleID': u''},
                {u'Campaign': u'CMSSW_11_2_0_pre6__HIN_noPU2018-1600078293',
                 u'Copies': 1,
                 u'Dataset': u'/RelValQCD_Pt_80_120_13_HI/CMSSW_11_2_0_pre6-PU_112X_upgrade2018_realistic_HI_v3-v1/MINIAODSIM',
                 u'DatasetSize': 136767384,
                 u'DiskDestination': u'(tier=2|tier=1)&cms_type=real&rse_type=DISK',
                 u'DiskRuleID': u'',
                 u'TapeDestination': u'T0_CH_CERN_MSS',
                 u'TapeRuleID': u''}],
 u'RequestName': u'shundal_RVCMSSW_11_2_0_pre6QCD_Pt_80_120_13_HI_PU__200914_121449_4581',
 u'RequestType': u'TaskChain',
 u'TransferStatus': u'done',
 u'_id': u'shundal_RVCMSSW_11_2_0_pre6QCD_Pt_80_120_13_HI_PU__200914_121449_4581'}
```

Changed files:
src/python/WMCore/MicroService/DataStructs/MSOutputTemplate.py

diff --git a/src/python/WMCore/MicroService/DataStructs/MSOutputTemplate.py b/src/python/WMCore/MicroService/DataStructs/MSOutputTemplate.py
index 2429eb630..47682a7c8 100644
--- a/src/python/WMCore/MicroService/DataStructs/MSOutputTemplate.py
+++ b/src/python/WMCore/MicroService/DataStructs/MSOutputTemplate.py
@@ -245,7 +245,7 @@ class MSOutputTemplate(dict):
         Evaluates whether it's a release validation request, if so, set the flag to True
         :param myDoc: the request dictionary
         """
-        if myDoc.get('SubRequestType') == 'RelVal':
+        if myDoc.get('SubRequestType') in ['RelVal', 'HIRelVal']:
             self.setKey('IsRelVal', True)
 
     def setTransferStatus(self, newStatus):