KBEC-00146 - Continuous Integration property storage and management

Article ID:360032831152
1 minute readKnowledge base

Summary

During Continuous Integration sentry runs, ElectricSentry stores triggers and when they were last modified in the ElectricSentry schedule in the Electric Cloud project.

Sentry plugin

The Sentry plugin examines the schedules in each project for the schedule property "Enabled for ElectricSentry".

ElectricSentry enabled schedules have a propertySheet called ec_customEditorData. This property sheet has values stored by the Source Control Monitor (SCM) specific plugin.

If you are using the file trigger SCM for example, the shortcut path to the Trigger File Name would be:

/myProject/schedules/fileTriggerSchedule/ec_customEditorData/TriggerFileName

Each SCM plugin has plugin specific properties in ec_customEditorData. Look over the property values for the ones of use in your use case.

Deprecated SentryMonitor Schedule (Prior to Commander version 3.6)

XML Example - finding the time of the last attempted snapshot

The time of the last attempted snapshot is stored as a property in the "Electric Cloud" project.

The path to the property:

ectool getProperties --path "/projects/Electric Cloud/schedules/SentryMonitor/<triggerProjectName>/<triggerScheduleName>"

An example property sheet response:

<response requestId="1"> <propertySheet> <propertySheetId>174892</propertySheetId> <createTime>2010-02-02T20:10:00.171Z</createTime> <lastModifiedBy>project: EA Electric Cloud</lastModifiedBy> <modifyTime>2010-02-02T20:10:00.171Z</modifyTime> <owner>project: EA Electric Cloud</owner> <property> <propertyId>270886</propertyId> <propertyName>LastAttemptedSnapshot</propertyName> <createTime>2010-02-02T20:10:00.171Z</createTime> <expandable>1</expandable> <lastModifiedBy>project: EA Electric Cloud</lastModifiedBy> <modifyTime>2010-02-02T20:10:00.171Z</modifyTime> <owner>project: EA Electric Cloud</owner> <value>29425</value> </property> </propertySheet> </response>

In the XML, look for LastAttemptedSnapshot

  1. <value> - the value that caused the trigger

  2. <modifyTime> - the time of the trigger

Javascript Example pre plugin - finding the time of the last attempted snapshot

echo "$[/javascript function findLastAttempted() { var settings = projects["Electric Cloud"].schedules["SentryMonitor"]["ElectricSentrySettings"]; if (typeof(settings) == "undefined") return ""; var project = settings[myJob.projectName]; if (typeof(project) == "undefined") return ""; var schedule = project[myJob.scheduleName]; if (typeof(schedule) == "undefined") return ""; return schedule["LastAttemptedSnapshot"]; } findLastAttempted();]"