stable

Clone or download

Read-only

Introduce logic for an XML representation of trackers

Historicaly we only generated XML for tracker in one place: tracker::exportXml() methods and related ones (formelement, reports, etc). With JiraImport, we started to generate XML out of an external source (Jira Core API) and the chosen path was to output XML more or less directly. As we are going to create tracker XML from a 3rd source (Jira Agile API) it's time to think about avoiding a duplication of code (and errors). Hence introducing a re-useable API that on top of the XML: XMLTracker and XMLxxxx that will come next. As there are tons of parameters, I choose not to go with dependency injection in constructor (fat constructor anti pattern) so it's the Builder pattern that was chosen. But in order to keep as much as possible of the immutability the "noSetters" provide, the `withXXX` methods returns a brand new instance of object: those are immutables. It might be possible that the manipulation of SimpleXmlElement can be made immutable too but that's not the scope of this refactoring so far. Part of story #19242 create Jira project with Agile configuration Change-Id: I42aef4f2e286623c39a63ff60469b48dd706e0bb

Modified Files

Name
A plugins/jira_import/include/JiraAgile/JiraAgileImporter.php +61 −0 Go to diff View file
M plugins/jira_import/include/Project/CreateProjectFromJira.php +7 −17 Go to diff View file
A plugins/jira_import/tests/unit/JiraAgile/JiraAgileImporterTest.php +97 −0 Go to diff View file
D plugins/jira_import/tests/unit/JiraAgile/JiraProjectBoardRetrieverTest.php +0 −61 Go to diff View file
M plugins/testmanagement/include/TestManagement/Step/Definition/Field/StepDefinition.php +7 −2 Go to diff View file
A plugins/testmanagement/include/TestManagement/Step/Definition/Field/XML/XMLStepDefinition.php +44 −0 Go to diff View file
A plugins/testmanagement/tests/unit/TestManagement/Step/Definition/Field/XML/XMLStepDefinitionTest.php +61 −0 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/FromJiraTrackerCreator.php +8 −11 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/Import/JiraXmlExporter.php +5 −4 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/Import/Structure/ContainersXMLCollection.php +1 −0 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/Import/Structure/ContainersXMLCollectionBuilder.php +10 −26 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/Import/Structure/FieldAndValueIDGenerator.php +2 −0 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/Import/Structure/FieldMappingCollection.php +2 −0 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/Import/Structure/JiraFieldAPIAllowedValueRepresentation.php +2 −0 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/Import/Structure/JiraFieldAPIRepresentation.php +2 −0 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/Import/Structure/JiraFieldRetriever.php +1 −0 Go to diff View file
M plugins/tracker/include/Tracker/Creation/JiraImporter/Import/Values/StatusValuesCollection.php +1 −1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/BurndownCalculator.php +1 −1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/ComputedFieldCalculator.php +1 −1 Go to diff View file
A plugins/tracker/include/Tracker/FormElement/Container/Column/XML/XMLColumn.php +35 −0 Go to diff View file
R plugins/jira_import/include/JiraAgile/JiraProjectBoardRetriever.php Go to diff View file
A plugins/tracker/include/Tracker/FormElement/Container/XML/XMLContainer.php +54 −0 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/FieldCalculator.php +1 −1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/IProvideArtifactChildrenForComputedCalculation.php +1 −1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement.php +80 −90 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElementFactory.php +5 −5 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Container.php +12 −11 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Container_Column.php +8 −1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Container_Fieldset.php +8 −1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_File.php +2 −1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_List.php +10 −9 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_List_Bind_Static.php +1 −1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Interface.php +7 −6 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_StaticField_LineBreak.php +5 −3 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_StaticField_Separator.php +5 −3 Go to diff View file
A plugins/tracker/include/Tracker/FormElement/XML/XMLFormElement.php +256 −0 Go to diff View file
A plugins/tracker/include/Tracker/FormElement/XML/XMLFormElementImpl.php +38 −0 Go to diff View file
M plugins/tracker/include/Tracker/Tracker.class.php +7 −33 Go to diff View file
R plugins/tracker/include/Tracker/Creation/JiraImporter/Import/Structure/IDGenerator.php Go to diff View file
A plugins/tracker/include/Tracker/XML/XMLTracker.php +219 −0 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Creation/JiraImporter/Import/Artifact/FieldChangeXMLExporterTest.php +1 −1 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Creation/JiraImporter/Import/Reports/XmlReportOpenIssuesExporterTest.php +1 −1 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Creation/JiraImporter/Import/Structure/ContainersXMLCollectionBuilderTest.php +0 −4 Go to diff View file
M plugins/tracker/tests/unit/Tracker/FormElement/BurndownCalculatorTest.php +3 −3 Go to diff View file
A plugins/tracker/tests/unit/Tracker/FormElement/Container/Fieldset/XML/XMLFieldsetTest.php +92 −0 Go to diff View file
M plugins/tracker/tests/unit/Tracker/FormElement/FieldCalculatorTest.php +6 −6 Go to diff View file
A plugins/tracker/tests/unit/Tracker/FormElement/XML/XMLFormElementImplTest.php +49 −0 Go to diff View file
M plugins/tracker/tests/unit/Tracker/XML/TrackerExportToXmlTest.php +4 −1 Go to diff View file
A plugins/tracker/tests/unit/Tracker/XML/XMLTrackerTest.php +220 −0 Go to diff View file