diff --git a/model/ap_application.csv b/model/ap_application.csv deleted file mode 100644 index ed907a9..0000000 --- a/model/ap_application.csv +++ /dev/null @@ -1,6 +0,0 @@ -_type;ctlg;;;;;;;;; -_key;_field;;;;;;;;; -table:ap_application;_field;type;format;index;generic;aggregat;key;acceptance;alias;description -;apappid;pk;vchar(256);N;;;;;; -;apid;int;vchar(256);I;;;;;; -;appid;int;vchar(256);I;;;;;; diff --git a/model/ap_applications.csv b/model/ap_applications.csv new file mode 100644 index 0000000..ce2c9db --- /dev/null +++ b/model/ap_applications.csv @@ -0,0 +1,6 @@ +_type;ddl;;;;;;;;; +_key;_field;;;;;;;;; +table:ap_applications;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +;apappid;pk;vchar(256);N;;;;;; +;apid;int;vchar(256);I;;;;;; +;appid;int;vchar(256);I;;;;;; diff --git a/model/ap_component.csv b/model/ap_components.csv similarity index 51% rename from model/ap_component.csv rename to model/ap_components.csv index 84fdf69..9f97a4c 100644 --- a/model/ap_component.csv +++ b/model/ap_components.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:ap_component;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:ap_components;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;apcomid;pk;int;N;;;;;; ;apid;int;int;I;;;;;; ;coid;int;int;I;;;;;; diff --git a/model/ap_project.csv b/model/ap_projects.csv similarity index 60% rename from model/ap_project.csv rename to model/ap_projects.csv index f6ff5e4..cebb75e 100644 --- a/model/ap_project.csv +++ b/model/ap_projects.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:ap_project;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:ap_projects;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;pjid;pk;int;N;;;;;; ;apid;int;int;I;;;;;; ;project;str;vchar(256);I;;;;;; diff --git a/model/ap_usecases.csv b/model/ap_usecases.csv new file mode 100644 index 0000000..64e3704 --- /dev/null +++ b/model/ap_usecases.csv @@ -0,0 +1,7 @@ +_type;ddl;;;;;;;;; +_key;_field;;;;;;;;; +table:ap_usecases;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +;apuseid;pk;int;N;;;;;; +;apid;int;int;I;;;;;; +;usid;int;int;I;;;;;; +;usecase;str;vchar(256);N;;;;;; diff --git a/model/ap_variants.csv b/model/ap_variants.csv new file mode 100644 index 0000000..81656ce --- /dev/null +++ b/model/ap_variants.csv @@ -0,0 +1,7 @@ +_type;ddl;;;;;;;;; +_key;_field;;;;;;;;; +table:ap_variants;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +;apvarid;pk;int;N;;;;;; +;apid;int;int;I;;;;;; +;vaid;int;int;I;;;;;; +;variannt;str;vchar(256);N;;;;;; diff --git a/model/application.py b/model/application.py index 1de0ceb..838f518 100644 --- a/model/application.py +++ b/model/application.py @@ -24,23 +24,9 @@ DEFAULT_SYNC = M.SYNC_FULL_GIT2DB TABLE_NAME = B.SUBJECT_APP """ system-name for this entity """ FIELD_ID = "apid" -FIELD_NAME = D.FIELD_NAME -FIELD_DESCRIPTION = B.SUBJECT_DESCRIPTION -FIELD_REFERENCE = B.SUBJECT_REFERENCE -FIELD_PROJECT = B.SUBJECT_PROJECT -LIST_FIELDS = [FIELD_ID, FIELD_NAME, FIELD_DESCRIPTION, FIELD_REFERENCE, FIELD_PROJECT] -""" list of object-attributes """ -LIST_NODES = [B.NODE_ATTRIBUTES] - -SUB_COMPS = B.SUBJECT_COMPS -SUB_APPS = B.SUBJECT_APPS -SUB_RELS = B.SUBJECT_RELS -SUB_USECASE = B.SUBJECT_USECASES -LIST_SUBTABLES = [SUB_APPS, SUB_COMPS, SUB_RELS, SUB_USECASE] -PREFIX_SUBTABLE = "ap" FILE_EXTENSION = D.DFILE_TYPE_YML -UNIQUE_FIELDS = [FIELD_NAME] +UNIQUE_FIELDS = [D.FIELD_NAME] """ unique business field as human identifer """ IDENTIFYER_FIELDS = [FIELD_ID] """ unique technical field as technical identifer """ @@ -201,7 +187,7 @@ class Application(model.entity.Entity): LIST_FIELDS = [FIELD_ID, D.FIELD_NAME, B.SUBJECT_DESCRIPTION, B.SUBJECT_REFERENCE, B.SUBJECT_PROJECT] """ list of object-attributes """ LIST_NODES = [B.NODE_ATTRIBUTES] - LIST_SUBTABLES = [B.SUBJECT_APPS, B.SUBJECT_COMPS, B.SUBJECT_RELS, B.SUBJECT_USECASES] + LIST_SUBTABLES = [B.SUBJECT_APPS, B.SUBJECT_COMPS, B.SUBJECT_USECASES, B.SUBJECT_VARIANTS] PREFIX_SUBTABLE = "ap" def read_unique_names(self, job, project, application, gran, args): diff --git a/model/artifact.py b/model/artifact.py new file mode 100644 index 0000000..731ec61 --- /dev/null +++ b/model/artifact.py @@ -0,0 +1,46 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------------------------------------------- +# Author : Ulrich Carmesin +# Source : gitea.ucarmesin.de +# --------------------------------------------------------------------------------------------------------- +import basic.toolHandling +import tools.data_const as D +import basic.constants as B +import model.entity +import tools.config_tool + +FIELD_ID = "arid" +LIST_FIELDS = [FIELD_ID, D.FIELD_NAME, B.SUBJECT_DESCRIPTION, B.SUBJECT_REFERENCE, + B.SUBJECT_PROJECT, B.SUBJECT_COMP, B.SUBJECT_TESTCASE] +""" list of object-attributes """ +LIST_NODES = [B.NODE_ATTRIBUTES] + +LIST_SUBTABLES = [] + + +class Artifact(model.entity.Entity): + FIELD_ID = "arid" + LIST_FIELDS = [FIELD_ID, D.FIELD_NAME, B.SUBJECT_DESCRIPTION, B.SUBJECT_REFERENCE, + B.SUBJECT_PROJECT, B.SUBJECT_COMP, B.SUBJECT_TESTCASE] + """ list of object-attributes """ + LIST_NODES = [B.NODE_ATTRIBUTES] + + LIST_SUBTABLES = [] + name = "" + description = "" + release = "" + testsuites = {} + steps = [] + + + def read_entity(self, job, name): + """ + reads the entity from the file-system + :param job: + :param name: + :return: + """ + config = {} + return self.setAttributes(job, config, name, self.LIST_FIELDS, self.LIST_NODES, self.LIST_SUBTABLES) + diff --git a/model/co_artifact.csv b/model/co_artifacts.csv similarity index 67% rename from model/co_artifact.csv rename to model/co_artifacts.csv index e425fdd..a0eeed7 100644 --- a/model/co_artifact.csv +++ b/model/co_artifacts.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:co_artifact;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:co_artifacts;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;coartid;pk;int;N;;;;;; ;coid;int;integer;I;;;T:1;;; ;stid;int;integer;I;;;T:2;;; diff --git a/model/co_steps.csv b/model/co_steps.csv new file mode 100644 index 0000000..dbdb5b0 --- /dev/null +++ b/model/co_steps.csv @@ -0,0 +1,11 @@ +_type;ddl;;;;;;;;; +_key;_field;;;;;;;;; +table:co_steps;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +;costpid;pk;int;N;;;;;; +;coid;int;integer;I;;;T:1;;; +;vaid;int;integer;I;;;T:2;;; +;stid;int;integer;I;;;T:2;;; +;step;str;vchar(256);I;;;;;; +;variant;str;vchar(256);I;;;;;; +;description;string;vchar(256);N;;;;;; + diff --git a/model/co_table.csv b/model/co_tables.csv similarity index 68% rename from model/co_table.csv rename to model/co_tables.csv index c6db209..af3d7f7 100644 --- a/model/co_table.csv +++ b/model/co_tables.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:co_table;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:co_tables;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;codtbid;pk;int;N;;;;;; ;coid;int;integer;I;;;T:1;;; ;dtid;int;integer;I;;;T:2;;; diff --git a/model/en_component.csv b/model/en_components.csv similarity index 77% rename from model/en_component.csv rename to model/en_components.csv index 45e04a3..ad606f0 100644 --- a/model/en_component.csv +++ b/model/en_components.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:en_component;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:en_components;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;encomid;pk;int;N;;;;;; ;enid;int;vchar(256);I;;;;;; ;component;str;vchar(256);I;;;;;; diff --git a/model/en_project.csv b/model/en_project.csv deleted file mode 100644 index 8ddd26d..0000000 --- a/model/en_project.csv +++ /dev/null @@ -1,6 +0,0 @@ -_type;ctlg;;;;;;;;; -_key;_field;;;;;;;;; -table:en_project;_field;type;format;index;generic;aggregat;key;acceptance;alias;description -;enproid;pk;int;N;;;;;; -;enid;int;vchar(256);I;;;;;; -;project;str;vchar(256);I;;;;;; diff --git a/model/en_projects.csv b/model/en_projects.csv new file mode 100644 index 0000000..b45c19f --- /dev/null +++ b/model/en_projects.csv @@ -0,0 +1,6 @@ +_type;ddl;;;;;;;;; +_key;_field;;;;;;;;; +table:en_projects;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +;enproid;pk;int;N;;;;;; +;enid;int;vchar(256);I;;;;;; +;project;str;vchar(256);I;;;;;; diff --git a/model/factory.py b/model/factory.py index 9df0247..5582906 100644 --- a/model/factory.py +++ b/model/factory.py @@ -7,7 +7,7 @@ def get_entity_object(job, name, args): if name in [B.SUBJECT_STEPS, B.SUBJECT_STEP]: entity = getStep(job) - elif name in [B.SUBJECT_STORIES, B.SUBJECT_STORY]: + elif name in [B.SUBJECT_STORIES, B.SUBJECT_STORY, "storys"]: entity = getStory(job) elif name in [B.SUBJECT_VARIANTS, B.SUBJECT_VARIANT]: entity = getVariant(job) @@ -21,24 +21,38 @@ def get_entity_object(job, name, args): entity = getApplication(job) elif name in [B.SUBJECT_COMPS, B.SUBJECT_COMP]: entity = getComponent(job) + elif name in [B.SUBJECT_ARTIFACTS, B.SUBJECT_ARTIFACT]: + entity = getEnvironment(job) elif name in [B.SUBJECT_TESTCASES, B.SUBJECT_TESTCASE]: entity = getTestcase(job) - elif name in [B.SUBJECT_TESTSUITES]: + elif name in [B.SUBJECT_TESTSUITES, B.SUBJECT_TESTSUITE]: entity = getTestsuite(job) elif name in [B.SUBJECT_TESTPLANS, B.SUBJECT_TESTPLAN]: entity = getTestplan(job) elif name in [B.SUBJECT_USERS, B.SUBJECT_USER]: entity = getUser(job) + elif name in [B.SUBJECT_REL, B.SUBJECT_RELS]: + entity = getRelease(job) + elif name in [B.SUBJECT_ENVIRONMENT, B.SUBJECT_ENVIRONMENTS]: + entity = getEnvironment(job) else: return None entity.setAttributes(job, args, name, entity.getFieldList(), entity.getNodeList(), entity.getSubtableList()) #testserver = basic.Testserver.getInstance(job) return entity -def getEnvironment(job=None): +def getRelease(job=None, name=""): + import model.release + return model.release.Release(job) + +def getEnvironment(job=None, name=""): import model.environment return model.environment.Environment(job) +def getArtifact(job=None, name=""): + import model.artifact + return model.artifact.Artifact(job) + def getApplication(job=None, args={}, name=""): import model.application return model.application.Application(job) diff --git a/model/release.py b/model/release.py index 2617f05..29b35d0 100644 --- a/model/release.py +++ b/model/release.py @@ -27,7 +27,8 @@ class Release(model.entity.Entity): B.NODE_ATTRIBUTES] """ list of object-attributes """ LIST_NODES = [B.NODE_ATTRIBUTES] - LIST_SUBTABLES = [] + LIST_SUBTABLES = [B.SUBJECT_APPS, B.SUBJECT_STORIES] + PREFIX_SUBTABLE = "rl" rlid = 0 name = "" diff --git a/model/rl_applications.csv b/model/rl_applications.csv new file mode 100644 index 0000000..f2e00fd --- /dev/null +++ b/model/rl_applications.csv @@ -0,0 +1,6 @@ +_type;ddl;;;;;;;;; +_key;_field;;;;;;;;; +table:rl_applications;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +;rlappid;pk;vchar(256);N;;;;;; +;rlid;int;vchar(256);I;;;;;; +;appid;int;vchar(256);I;;;;;; diff --git a/model/co_step.csv b/model/rl_stories.csv similarity index 52% rename from model/co_step.csv rename to model/rl_stories.csv index 003db12..d05433c 100644 --- a/model/co_step.csv +++ b/model/rl_stories.csv @@ -1,8 +1,8 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:co_step;_field;type;format;index;generic;aggregat;key;acceptance;alias;description -;costpid;pk;int;N;;;;;; -;coid;int;integer;I;;;T:1;;; +table:rl_stories;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +;rlstrid;pk;integer;N;;;T:1;;; +;rlid;int;integer;I;;;T:1;;; ;stid;int;integer;I;;;T:2;;; ;story;str;vchar(256);I;;;;;; ;description;string;vchar(256);N;;;;;; diff --git a/model/st_releases.csv b/model/st_releases.csv new file mode 100644 index 0000000..f7222b1 --- /dev/null +++ b/model/st_releases.csv @@ -0,0 +1,8 @@ +_type;ddl;;;;;;;;; +_key;_field;;;;;;;;; +table:st_releases;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +;strelid;pk;integer;N;;;;;; +;stid;int;integer;I;;;T:1;;; +;rlid;int;integer;I;;;T:2;;; +;description;string;vchar(256);N;;;;;; +;reference;str;vchar(256);N;;;;;; diff --git a/model/story.py b/model/story.py index 145b7aa..f849588 100644 --- a/model/story.py +++ b/model/story.py @@ -27,6 +27,7 @@ class Story(model.entity.Entity): """ list of object-attributes """ LIST_NODES = [] LIST_SUBTABLES = [B.SUBJECT_RELS] + PREFIX_SUBTABLE = "st" stid = 0 story = "" diff --git a/model/table.py b/model/table.py index 3bcc93c..fb886c5 100644 --- a/model/table.py +++ b/model/table.py @@ -135,6 +135,7 @@ class Table(model.entity.Entity): :param context: :return: """ + config = {} if "context" in args: if args["context"] == "component": ddl = tools.config_tool.getConfig(job, D.DDL_FILENAME, self.component.name, name, ttype=D.CSV_SPECTYPE_DDL) @@ -142,11 +143,10 @@ class Table(model.entity.Entity): ddl = tools.config_tool.getConfig(job, D.DDL_FILENAME, args["context"], name, ttype=D.CSV_SPECTYPE_DDL) elif args["context"] == B.ATTR_INST_TESTSERVER: ddl = tools.config_tool.getConfig(job, D.DDL_FILENAME, B.ATTR_INST_TESTSERVER, name, ttype=D.CSV_SPECTYPE_DDL) - config = {} - if "_name" in ddl: - config[ddl["_name"]] = ddl - else: - config = ddl + if "_name" in ddl: + config[ddl["_name"]] = ddl + else: + config = ddl return self.setAttributes(job, config, name, self.LIST_FIELDS, self.LIST_NODES, self.LIST_SUBTABLES) def select_entity(self, job, name): diff --git a/model/tc_step.csv b/model/tc_steps.csv similarity index 62% rename from model/tc_step.csv rename to model/tc_steps.csv index 745fc68..d7a5ac0 100644 --- a/model/tc_step.csv +++ b/model/tc_steps.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:tc_step;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:tc_steps;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;tcstpid;pk;integer;N;;;;;; ;tcid;int;integer;I;;;T:1;;; ;spid;int;integer;I;;;T:2;;; diff --git a/model/tc_story.csv b/model/tc_stories.csv similarity index 68% rename from model/tc_story.csv rename to model/tc_stories.csv index cd2aae8..110e166 100644 --- a/model/tc_story.csv +++ b/model/tc_stories.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:tc_story;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:tc_stories;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;tcstrid;pk;integer;N;;;T:1;;; ;tcid;int;integer;I;;;T:1;;; ;stid;int;integer;I;;;T:2;;; diff --git a/model/tc_table.csv b/model/tc_tables.csv similarity index 58% rename from model/tc_table.csv rename to model/tc_tables.csv index 645fce5..eb79ff8 100644 --- a/model/tc_table.csv +++ b/model/tc_tables.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:tc_table;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:tc_tables;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;tcdtbid;pk;integer;N;;;;;; ;tcid;int;integer;I;;;T:1;;; ;dtid;int;integer;I;;;T:2;;; diff --git a/model/tp_testsuite.csv b/model/tp_testsuites.csv similarity index 61% rename from model/tp_testsuite.csv rename to model/tp_testsuites.csv index 6ab80aa..10bc19a 100644 --- a/model/tp_testsuite.csv +++ b/model/tp_testsuites.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:tp_testsuite;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:tp_testsuites;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;tptsuid;pk;integer;N;;;;;; ;tpid;int;integer;I;;;T:1;;; ;tsid;int;integer;I;;;T:2;;; diff --git a/model/tr_artifact.csv b/model/tr_artifacts.csv similarity index 65% rename from model/tr_artifact.csv rename to model/tr_artifacts.csv index b4776a1..9cacf14 100644 --- a/model/tr_artifact.csv +++ b/model/tr_artifacts.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:tr_artifact;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:tr_artifacts;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;trartid;pk;integer;N;;;;;; ;trid;int;integer;I;;;T:1;;; ;arid;int;integer;I;;;T:2;;; diff --git a/model/ts_testcase.csv b/model/ts_testcases.csv similarity index 61% rename from model/ts_testcase.csv rename to model/ts_testcases.csv index 2d575a4..8217c9d 100644 --- a/model/ts_testcase.csv +++ b/model/ts_testcases.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:ts_testcase;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:ts_testcases;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;tstcsid;pk;integer;N;;;;;; ;tsid;int;integer;I;;;T:1;;; ;tcid;int;integer;I;;;T:2;;; diff --git a/model/ts_usecase.csv b/model/ts_usecases.csv similarity index 61% rename from model/ts_usecase.csv rename to model/ts_usecases.csv index b5b65f4..a750dac 100644 --- a/model/ts_usecase.csv +++ b/model/ts_usecases.csv @@ -1,6 +1,6 @@ -_type;ctlg;;;;;;;;; +_type;ddl;;;;;;;;; _key;_field;;;;;;;;; -table:ts_usecase;_field;type;format;index;generic;aggregat;key;acceptance;alias;description +table:ts_usecases;_field;type;format;index;generic;aggregat;key;acceptance;alias;description ;tsucsid;pk;integer;N;;;;;; ;tsid;int;integer;I;;;T:1;;; ;ucid;int;integer;I;;;T:2;;; diff --git a/model/variant.py b/model/variant.py index 8803e60..8d2eb42 100644 --- a/model/variant.py +++ b/model/variant.py @@ -26,10 +26,10 @@ IDENTIFYER_FIELDS = [FIELD_ID] class Variant(model.entity.Entity): FIELD_ID = "vrid" - LIST_FIELDS = [FIELD_ID, D.FIELD_NAME, B.SUBJECT_DESCRIPTION, B.SUBJECT_REFERENCE, B.SUBJECT_PROJECT] + LIST_FIELDS = [FIELD_ID, D.FIELD_NAME, B.SUBJECT_DESCRIPTION, B.SUBJECT_REFERENCE, B.SUBJECT_PROJECT, B.SUBJECT_COMP] """ list of object-attributes """ LIST_NODES = [B.NODE_ATTRIBUTES] - LIST_SUBTABLES = [B.SUBJECT_COMPS] + LIST_SUBTABLES = [] """ list of object-attributes """ name = "" description = ""