diff options
author | ddunne | 2010-08-27 20:13:38 +0000 |
---|---|---|
committer | ddunne | 2010-08-27 20:13:38 +0000 |
commit | 6748fb47afbc3e4d13fd0ab588bfed7295b9a21d (patch) | |
tree | 9690143087a3de841d8f6d11dafcd604af95df2b | |
parent | 2693dee42ace102c46ab8efa57f30f7fdbf6da67 (diff) | |
download | org.eclipse.osee-6748fb47afbc3e4d13fd0ab588bfed7295b9a21d.tar.gz org.eclipse.osee-6748fb47afbc3e4d13fd0ab588bfed7295b9a21d.tar.xz org.eclipse.osee-6748fb47afbc3e4d13fd0ab588bfed7295b9a21d.zip |
added checks for working branches not in commit state when commit occurred
-rw-r--r-- | plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java | 89 |
1 files changed, 63 insertions, 26 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java index a136f2cb6d5..d9da9fe139a 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java @@ -43,6 +43,7 @@ import org.eclipse.osee.ats.internal.AtsPlugin; import org.eclipse.osee.ats.task.TaskEditor;
import org.eclipse.osee.ats.task.TaskEditorSimpleProvider;
import org.eclipse.osee.ats.util.AtsArtifactTypes;
+import org.eclipse.osee.ats.util.AtsBranchManager;
import org.eclipse.osee.ats.util.AtsRelationTypes;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.util.StateManager;
@@ -51,6 +52,8 @@ import org.eclipse.osee.ats.util.widgets.XCurrentStateDam; import org.eclipse.osee.ats.util.widgets.XStateDam;
import org.eclipse.osee.ats.world.WorldXNavigateItemAction;
import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.core.enums.BranchArchivedState;
+import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.BranchDoesNotExist;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
@@ -191,24 +194,25 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction { artifacts.addAll(artifactsTemp);
}
count += artifacts.size();
- testArtifactIds(artifacts);
- testAtsAttributeValues(artifacts);
- testAtsActionsHaveTeamWorkflow(artifacts);
- testAtsWorkflowsHaveAction(artifacts);
- testAtsWorkflowsHaveZeroOrOneVersion(artifacts);
- testTasksHaveParentWorkflow(artifacts);
- testReviewsHaveParentWorkflowOrActionableItems(artifacts);
- testReviewsHaveValidDefectAndRoleXml(artifacts);
- testTeamWorkflows(artifacts);
- testTeamDefinitions(artifacts);
- testVersionArtifacts(artifacts);
- testStateMachineAssignees(artifacts);
- testAtsLogs(artifacts);
- testActionableItemToTeamDefinition(artifacts);
- testTeamDefinitionHasWorkflow(artifacts);
- for (IAtsHealthCheck atsHealthCheck : AtsHealthCheck.getAtsHealthCheckItems()) {
- atsHealthCheck.validateAtsDatabase(artifacts, testNameToResultsMap);
- }
+ // testArtifactIds(artifacts);
+ // testAtsAttributeValues(artifacts);
+ // testAtsActionsHaveTeamWorkflow(artifacts);
+ // testAtsWorkflowsHaveAction(artifacts);
+ // testAtsWorkflowsHaveZeroOrOneVersion(artifacts);
+ // testTasksHaveParentWorkflow(artifacts);
+ // testReviewsHaveParentWorkflowOrActionableItems(artifacts);
+ // testReviewsHaveValidDefectAndRoleXml(artifacts);
+ // testTeamWorkflows(artifacts);
+ testAtsBranchManager(artifacts);
+ // testTeamDefinitions(artifacts);
+ // testVersionArtifacts(artifacts);
+ // testStateMachineAssignees(artifacts);
+ // testAtsLogs(artifacts);
+ // testActionableItemToTeamDefinition(artifacts);
+ // testTeamDefinitionHasWorkflow(artifacts);
+ // for (IAtsHealthCheck atsHealthCheck : AtsHealthCheck.getAtsHealthCheckItems()) {
+ // atsHealthCheck.validateAtsDatabase(artifacts, testNameToResultsMap);
+ // }
if (monitor != null) {
monitor.worked(1);
}
@@ -241,7 +245,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction { // Check that duplicate Legacy PCR IDs team arts do not exist with different parent actions
if (artifact instanceof TeamWorkFlowArtifact) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) artifact;
- String legacyPcrId = artifact.getSoleAttributeValueAsString(AtsAttributeTypes.LegacyPcrId, null); + String legacyPcrId = artifact.getSoleAttributeValueAsString(AtsAttributeTypes.LegacyPcrId, null);
if (legacyPcrId != null) {
if (legacyPcrIdToParentHrid.containsKey(legacyPcrId)) {
if (!legacyPcrIdToParentHrid.get(legacyPcrId).equals(
@@ -268,7 +272,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction { VersionArtifact verArt = (VersionArtifact) artifact;
try {
String parentBranchGuid =
- verArt.getSoleAttributeValueAsString(AtsAttributeTypes.BaselineBranchGuid, null); + verArt.getSoleAttributeValueAsString(AtsAttributeTypes.BaselineBranchGuid, null);
if (parentBranchGuid != null) {
validateBranchGuid(verArt, parentBranchGuid);
}
@@ -287,7 +291,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction { TeamDefinitionArtifact teamDef = (TeamDefinitionArtifact) art;
try {
String parentBranchGuid =
- teamDef.getSoleAttributeValueAsString(AtsAttributeTypes.BaselineBranchGuid, null); + teamDef.getSoleAttributeValueAsString(AtsAttributeTypes.BaselineBranchGuid, null);
if (parentBranchGuid != null) {
validateBranchGuid(teamDef, parentBranchGuid);
}
@@ -322,6 +326,39 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction { }
}
+ private void testAtsBranchManager(Collection<Artifact> artifacts) {
+ for (Artifact art : artifacts) {
+ if (art instanceof TeamWorkFlowArtifact) {
+ TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) art;
+ AtsBranchManager mgr = teamArt.getBranchMgr();
+ try {
+ Collection<Branch> branchesCommittedTo = mgr.getBranchesCommittedTo();
+ Branch workingBranch = mgr.getWorkingBranch();
+ if (workingBranch != null && branchesCommittedTo.size() > 0 && workingBranch.getBranchState() != BranchState.COMMITTED) {
+ testNameToResultsMap.put(
+ "testAtsBranchManagerA",
+ "Error: TeamWorkflow " + XResultData.getHyperlink(teamArt) + " has committed branches but working branch [" + workingBranch.getGuid() + "] != COMMITTED");
+ }
+ if (workingBranch != null && workingBranch.getBranchState() == BranchState.COMMITTED && workingBranch.getArchiveState() == BranchArchivedState.UNARCHIVED) {
+ String fixStr = "";
+ if (teamArt.isCompleted()) {
+ fixStr = " - Fix: Workflow Completed, Branch can be Archived";
+ } else {
+ fixStr = " - Workflow not completed, verify manually";
+ }
+ testNameToResultsMap.put(
+ "testAtsBranchManagerB",
+ "Error: TeamWorkflow " + XResultData.getHyperlink(teamArt) + " has committed working branch [" + workingBranch.getGuid() + "] but not archived" + fixStr);
+ }
+ } catch (Exception ex) {
+ testNameToResultsMap.put(
+ "testAtsBranchManager",
+ teamArt.getArtifactTypeName() + " " + XResultData.getHyperlink(teamArt) + " exception: " + ex.getLocalizedMessage());
+ }
+ }
+ }
+ }
+
private void validateBranchGuid(Artifact artifact, String parentBranchGuid) {
try {
Branch branch = BranchManager.getBranchByGuid(parentBranchGuid);
@@ -453,11 +490,11 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction { String.format(
"Error: Artifact: " + XResultData.getHyperlink(artifact) + " Type [%s] AttrType [%s] Max [%d] Actual [%d] Values [%s] ",
artifact.getArtifactTypeName(), attrType.getName(), attrType.getMaxOccurrences(), count,
- artifact.getAttributesToString(attrType)); + artifact.getAttributesToString(attrType));
Map<String, Attribute<?>> valuesAttrMap = new HashMap<String, Attribute<?>>();
int latestGamma = 0;
String fixInfo = " - FIX AVAILABLE";
- for (Attribute<?> attr : artifact.getAttributes(attrType)) { + for (Attribute<?> attr : artifact.getAttributes(attrType)) {
if (attr.getGammaId() > latestGamma) {
latestGamma = attr.getGammaId();
}
@@ -469,7 +506,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction { if (latestGamma != 0) {
result += fixInfo;
if (fixAttributeValues) {
- for (Attribute<?> attr : artifact.getAttributes(attrType)) { + for (Attribute<?> attr : artifact.getAttributes(attrType)) {
if (attr.getGammaId() != latestGamma) {
attr.delete();
}
@@ -637,12 +674,12 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction { if (artifact instanceof ReviewSMArtifact) {
ReviewSMArtifact reviewArtifact = (ReviewSMArtifact) artifact;
try {
- if (reviewArtifact.getAttributes(AtsAttributeTypes.ReviewDefect).size() > 0 && reviewArtifact.getDefectManager().getDefectItems().isEmpty()) { + if (reviewArtifact.getAttributes(AtsAttributeTypes.ReviewDefect).size() > 0 && reviewArtifact.getDefectManager().getDefectItems().isEmpty()) {
testNameToResultsMap.put(
"testReviewsHaveValidDefectAndRoleXml",
"Error: Review " + XResultData.getHyperlink(reviewArtifact) + " has defect attribute, but no defects (xml parsing error).");
}
- if (reviewArtifact.getAttributes(AtsAttributeTypes.Role).size() > 0 && reviewArtifact.getUserRoleManager().getUserRoles().isEmpty()) { + if (reviewArtifact.getAttributes(AtsAttributeTypes.Role).size() > 0 && reviewArtifact.getUserRoleManager().getUserRoles().isEmpty()) {
testNameToResultsMap.put(
"testReviewsHaveValidDefectAndRoleXml",
"Error: Review " + XResultData.getHyperlink(reviewArtifact) + " has role attribute, but no roles (xml parsing error).");
|