CCNetModifyingUsers <user> value change after CCNET 1.6 to 1.8 upgrade - ldap

After upgrading one of our build servers to the latest version of CCNET it stopped sending emails to modifiers group. We've using Mercurial for source control and version 2.3.2 is installed on the build server.
buildmasters group still gets emails but not modifiers:
<email mailport="25" includeDetails="true" useSSL="false">
<from>buildslave8#company.com</from>
<mailhost>###.###.##.###</mailhost>
<users>
<user name="Name" group="buildmasters" address="name#company.com"/>
</users>
<groups>
<group name="buildmasters">
<notifications>
<NotificationType>Always</NotificationType>
</notifications>
</group>
</groups>
<converters>
<regexConverter find="$" replace="#company.com" />
</converters>
<modifierNotificationTypes>
<NotificationType>Always</NotificationType>
</modifierNotificationTypes>
<subjectSettings>
<subject buildResult="Success" value="Build Status - SUCCESSFUL - ${CCNetProject} - ${CCNetLabel}" />
<subject buildResult="Fixed" value="Build Status - HAS BEEN FIXED - ${CCNetProject} - ${CCNetLabel}" />
<subject buildResult="StillBroken" value="Build Status - FAILED - ${CCNetProject}" />
<subject buildResult="Broken" value="Build Status - FAILED - ${CCNetProject}" />
<subject buildResult="Exception" value="Build Status - SERVER EXCEPTION - ${CCNetProject} - a serious error has occurred" />
</subjectSettings>
<attachments></attachments>
After digging through the build logs I noticed that <user> value under <CCNetModifyingUsers> has changed as follows:
From (CCNET 1.6):
<integrationProperties>
...
<CCNetModifyingUsers>
<user>flast</user>
<user>flast</user>
</CCNetModifyingUsers>
...
</integrationProperties>
To (CCNET 1.8):
<integrationProperties>
...
<CCNetModifyingUsers>
<user>First Last</user>
<user>First Last</user>
</CCNetModifyingUsers>
...
</integrationProperties>
Not sure how the <user> value under <CCNetModifyingUsers> gets populated or how to fix it.
UPDATE #1: I'm trying to see if changing the <converter> to ldapConverter will resolve my issues.
UPDATE #2: Still trying to mess with the ldapConverter:
<ldapConverter domainName="Name.corp" ldapLogOnUser="name" ldapLogOnPassword="pswd" />
This version throws and exception:
EmailPublisher exception: System.FormatException: The specified string is not in the form required for an e-mail address.
at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName)
at System.Net.Mail.MailAddressCollection.ParseValue(String addresses)
at ThoughtWorks.CruiseControl.Core.Publishers.EmailPublisher.GetMailMessage(String from, String to, String replyto, String subject, String messageText, String workingFolder, String[] attachments)
at ThoughtWorks.CruiseControl.Core.Publishers.EmailPublisher.SendMessage(String from, String to, String replyto, String subject, String message, String workingFolder)
While this:
<ldapConverter domainName="Name.corp" ldapLogOnUser="name" ldapLogOnPassword="pswd" ldapQueryField="userPrincipalName"/>
Successfully builds, but does not send emails out to the modifiers.
UPDATE #3:
I've put the following temporary fix in place:
<converters>
<regexConverter find="(?!^.?).(?!.{0}$).* " replace="" />
<regexConverter find="$" replace="#company.com" />
</converters>
It however does not cover the following cases:
people's Mercurial username does not match their email address' name
people who have a double (triple?) first or last names
UPDATE #4:
Will have to go through the source code to see if I can track down exactly what's causing the issues... might have to maintain a local build of it going forward.

I dealt with this in November of 2013. I had to install the CCNET source code and modify EmailLDAPConverter.cs. The Convert method creates a search filter using the SSAMAccountName Active Directory attribute. This would fail. I ended up filtering on the Active Directory "displayName" attribute.

Related

LabVIEW Parsing XML String without using tools

I am creating an information displaying mini-app for a device. The response I receive from the device when I send an HTTP Get request is literally as follows:
<?xml version="1.0" encoding="iso-8859-2"?>
<root xmlns="http://www.papouch.com/xml/th2e/act">
<sns id="1" type="1" status="0" unit="0" val="25.0" w-min="" w-max="" e-min-val=" -0.3" e-max-val=" 124.0" e-min-dte="01/01/2014 13:16:44" e-max-dte="05/14/2014 10:00:43" /><sns id="2" type="2" status="0" unit="3" val="56.4" w-min="" w-max="" e-min-val=" 0.1" e-max-val=" 100.0" e-min-dte="01/27/2014 08:39:14" e-max-dte="03/04/2014 11:02:40" /><sns id="3" type="3" status="0" unit="0" val="15.7" w-min="" w-max="" e-min-val=" -21.3" e-max-val=" 85.9" e-min-dte="01/27/2014 12:21:28" e-max-dte="03/04/2014 11:29:32" /><status frm="1" location="NONAME" time="01/02/2014 7:12:00" typesens="3" /></root>
There are 3 sns elements with incrementing ids, I need to read the val attribute of the sns element with the id 1.
I tried implementing the suggested way here:Get specific XML element attributes in Labview , and shown below is my implementation, but it does not work. I tested the XPath on http://xpather.com/ and it fetches the value I need just fine.
The XPath I am using is: //root/sns[#id="1"]/#val
The result I get when I run is just nothing, no Parsing errors, no any other errors, everything seems to be okay but the String indicator is always empty, String 2 displays the HTTP response fine.
I am using (and have to use) LabVIEW 2011 SP1.
The reason why the result is empty is the wrong input of Get Node Text Content.

RTI DDS creating own data types

I am working on a .Net example where I define my own data type using RTI Connext DDS.
Instead of creating the application from the beginning, I got help from the source code of the hello_world_xml_dynamic example in rti_workspace directory. I have made several changes to the USER_QOS_PROFILES.xml file to create my own data type and changes its name to MY_PROFILES.xml
But when I compile the application and run it from the command line, I get the following error:
DDS_DomainParticipantFactory_create_participant_from_config_w_paramsI:ERROR: Profile library 'MyParticipantLibrary::PublicationParticipant' not found
! Unable to create DDS domain participant
The line of code that catching the error:
if (this.participant == null)
{
this.participant = DDS.DomainParticipantFactory.get_instance().
create_participant_from_config(
"MyParticipantLibrary::PublicationParticipant");
if (this.participant == null)
{
Console.Error.WriteLine("! Unable to create DDS domain participant");
return;
}
}
this is the configuration file MY_PROFILES.xml :
<!--
RTI Data Distribution Service Deployment
-->
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/6.0.1/rti_dds_profiles.xsd">
<!-- Qos Library -->
<qos_library name="qosLibrary">
<qos_profile name="DefaultProfile">
</qos_profile>
</qos_library>
<!-- types -->
<types>
<struct name="FlightData">
<member name="Latitude" type="double"/>
<member name="Longitude" type="double"/>
<member name="Altitude" type="double"/>
</struct>
</types>
<!-- Domain Library -->
<domain_library name="MyDomainLibrary" >
<domain name="FlightDataDomain" domain_id="0">
<register_type name="FlightDataType"
type_ref="FlightData" />
<topic name="FlightDataTopic"
register_type_ref="FlightDataType">
<topic_qos name="FlightData_qos"
base_name="qosLibrary::DefaultProfile"/>
</topic>
</domain>
</domain_library>
<!-- Participant library -->
<domain_participant_library name="MyParticipantLibrary">
<domain_participant name="PublicationParticipant"
domain_ref="MyDomainLibrary::FlightDataDomain">
<publisher name="MyPublisher">
<data_writer name="FlightDataWriter"
topic_ref="FlightDataTopic"/>
</publisher>
</domain_participant>
<domain_participant name="SubscriptionParticipant"
domain_ref="MyDomainLibrary::FlightDataDomain">
<subscriber name="MySubscriber">
<data_reader name="FlightDataReader"
topic_ref="FlightDataTopic">
<datareader_qos name="FlightData_reader_qos"
base_name="qosLibrary::DefaultProfile"/>
</data_reader>
</subscriber>
</domain_participant>
</domain_participant_library>
</dds>
where am i making a mistake?
Your XML file looks correct. From the 'not found' error message, it seems that you may not have taken the right steps to instruct your application to load that profiles-file MY_PROFILES.xml to actually learn about your desired Participant. You can easily verify that this is the case by introducing an error in your XML file (for example by incorrectly renaming one tag) and rerun your application. If it does not complain about the syntax or schema of the XML, then your file did not get loaded and this hypothesis is correct.
If that turns out to be your problem indeed, then you have several options to fix that. They are listed in the User's Manual section 18.5 How to Load XML-Specified QoS Settings.

How to display error returned from custom REST API endpoint in a subsequent orchestration step?

Based on this question... the REST API endpoint is validating the external IDP email and is correclty returning an error back in the case the email is not valid.
return Content(HttpStatusCode.Conflict, new CustomResponseContent
{
Version = "1.0.0",
Status = (int)HttpStatusCode.Conflict,
UserMessage = message
});
Now I'd like to detect this error and use it in a subsequent OrchestrationStep like this:
<OrchestrationStep Order="3"
Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="REST-ValidateSignInEmail"
TechnicalProfileReferenceId="REST-ValidateSignInEmail" />
</ClaimsExchanges>
</OrchestrationStep>
<!-- Taken from here: https://medium.com/the-new-control-plane/creating-an-error-page-for-an-azure-ad-b2c-custom-policy-flow-fb2692a3b50f -->
<OrchestrationStep Order="4"
Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimEquals"
ExecuteActionsIf="true">
<Value>extension_Flag</Value>
<Value>False</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="SelfAssertedRegError"
TechnicalProfileReferenceId="SelfAsserted-RegError" />
</ClaimsExchanges>
</OrchestrationStep>
If step 3 returns a conflict, I'd like to show the error message in step 4 using the custom error page implemented as described here.
I see that step 4 executes based on extension_Flag.
Is there any way I could retrieve and store the result from REST-ValidateSignInEmail and use it in the flag for step 4?
Note: when the user journey finishes executing I see the following AADB2C error in the URL. It comes from the REST API endpoint error (409 - Conflict)...
https://mywebsite.azurewebsites.net/#error=server_error&error_description=AADB2C%3a+user%40gmail.com+is+not+valid.%0d%0aCorrelation+ID%7a+7777f77-7afd-7777-a777-7c77b7e77b7b%0d%0aTimestamp%7a+2019-11-09+14%3a40%3a57Z%0d%0a&state=7777c77a-77ad-414a-84df-3c131ed81ba7
The error_description message is what I'd like to pass to step 4.
I did this in a different way... instead of returning a Conflict [409] status, I changed the REST endpoint to return an OutputClaim like this:
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="extension_isEnabled"
PartnerClaimType="IsEnabled" DefaultValue="false"/>
<OutputClaim ClaimTypeReferenceId="errorMessage"
PartnerClaimType="ErrorMessage"/>
</OutputClaims>
This way I have a claim to check on step 4. Note that I also return an errorMessage from the endpoint. This error message will be later passed to SelfAsserted-RegError Technical Profile.
Depending on the validation done in the back-end, extension_isEnabled will get True or False.
On step 4 we check extension_isEnabled:
<OrchestrationStep Order="4"
Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimEquals"
ExecuteActionsIf="true">
<Value>extension_isEnabled</Value>
<Value>True</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="SelfAssertedRegError"
TechnicalProfileReferenceId="SelfAsserted-RegError" />
</ClaimsExchanges>
</OrchestrationStep>
Step 4 will only be executed when extension_isEnabled is false. If it is true we SkipThisOrchestrationStep and the SelfAsserted-RegError Technical Profile won't be called at all. The UserJourney flow continues as expected.

Tsung Issue with Dyn_Variable

I am very new to ERLANG and TSung, I never worked in this areas, but I am very much keen to know the fundamentals and do distributed load test for my web application. I am in half the way to complete, but I have a big hurdle and not able to moving forward , please read below tsung.xml file and advise me where & what I am missing?
**===> tsung.xml (this file perfectly working without any errors)**
*<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel = "debug" dumptraffic="true" version="1.0">
<clients>
<client host="localhost" weight ="1" maxusers="40000" cpu = "1" >
<ip value = '127.000.000.111'/>
</client>
</clients>
<servers>
<server host="127.000.000.112" port="80" type="tcp"></server>
</servers>
<load duration="1" unit="minute">
<arrivalphase phase="1" duration="1" unit="minute">
<users arrivalrate="10" unit="second"></users>
</arrivalphase>
</load>
<sessions>
<session name="mySession" probability="100" type="ts_http">
<transaction name="trx">
<request>
<dyn_variable name="myId" re="<myId>(\.*)\</myId>"/> <-- Trying with RegExp option, not getting the value myId
<!--dyn_variable name="myId" xpath="//response/myId" /--> <-- Trying with xpath option, not getting the value myId
<!--dyn_variable name="myId" jsonpath="response.myId" /--> <-- Trying with jsonpath option, not getting the value myId
<http url='http://127.000.000.112/Create_Rec' method='POST' version='1.1' content_type='text/xml'/>
</request>
<request subst="true">
<http url='http://999.000.000.999/Get_Rec/myId=%%_myId%%' method='GET' version='1.1' content_type='application/xml'/>
</request>
</transaction>
</session>
</sessions>
</tsung>*
When I run this url (it is web service call) "http://_127.000.000.112/Create_Rec" in the web browser, I get the following similar response from Server (in the back ground it creates the record in database and generates new id i.e. myId). When I run above tsung.xml, the first request working perfectly fine as I expected.
===> response (browser response)
<response id="SomeWebService">
<status>
<statusCode>1</statusCode>
<statusMsg>SomeMessage</statusMsg>
<statusTime>2013-06-20 02:52:25</statusTime>
</status>
<myId>298346728934734987</myId>
</response>
What I am looking here, I need to grab the myId from first request and pass into second request myId=%%_myId%%, but it is never working and myId always empty string. I am beyond of dyn_variable since two days, no clue and proper examples/documentation on it. Please suggest me, what I am missing.
You will have to set up the subst="true" in your request for substitution to work. So, your request should change to..
<request subst="true">
If still it doesn't work then I would suggest you to see the tsung.dump file and check the response which you are getting from server

Problem with struts 2 and json plugin

I'm using the json plugin that comes with struts 2 (json-lib-2.1.jar) and trying to follow the website to set it up.
Here's my struts.xml
<struts>
<package name="example" extends="json-default">
<action name="AjaxRetrieveUser" class="actions.view.RetrieveUser">
<result type="json"/>
</action>
</package>
</struts>
but I get this warning:
SEVERE: Unable to find parent packages json-default
Is there something else I'm supposed to do?
Edit:
I added this method to my RetrieveUser:
public Map<String,Object> getJsonModel()
{
return jsonModel;
}
And my struts.xml looks like this:
<struts>
<package name="example" extends="json-default">
<action name="AjaxRetrieveUser" class="actions.view.RetrieveUser">
<result type="json"/>
<param name="root">jsonModel</param>
</action>
</package>
</struts>
However, I don't think the response is going from the RetrieveUser class to the javascript. I'm using firebug and no request gets sent.
I believe that net.sf.json-lib is just a toolset you can use in your Java to build up JSON-ready objects, suitable to be returned by actions such as you describe.
Probably, you need to include struts-json-plugin - make sure its version matches your struts version.
I notice also that as written, your action will attempt to return RetrieveUser, serialized. Most implementations I've done/seen specify the root object to be returned, by adding
<param name="root">jsonUser</param>
Under the tag, and define this method in RetrieveUser
public Map<String, Object> getJsonUser()
[This is mentioned in the Sruts2 doc]. Hope that helps.
[edit] I use Map - you could also use the object structures provided by json-lib instead.
Re: Your edit. Probably need to see your calling javascript. And probably I will suggest that you make sure you have both a success and an error handler. Can you debug/log to show that the method is being called in java ? Do your logs show anything ? This is usually some sort of error....