stable

Clone or download

Read-only

REST representations of tracker are immutables

The tracker plugin only uses immutable representations for all its REST endpoints. The tracker plugin is the first plugin to be converted in reason of its central role. As the immutability of a class infects all the other classes that compose it, it's not easy to convert a part of the API and not end up converting the tracker plugin. Also, it shows it is doable everywhere since the tracker plugin comes with a lot of baggage that does not make the conversion straightforward: big class hierarchy with child class updating parent properties, local caches everywhere, no clean separation between the infrastructure and logic layers… Part of request #15111: REST representations should not be mutable Change-Id: I8ab00ab8728548576e8f0e8e4060065583282641

Modified Files

Name
M plugins/agiledashboard/include/AgileDashboard/REST/v1/BacklogItemParentReference.class.php +1 βˆ’2 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/REST/v1/BacklogItemRepresentation.php +3 βˆ’6 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/REST/v1/CardRepresentation.class.php +2 βˆ’8 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/REST/v1/Kanban/KanbanItemsResource.php +2 βˆ’3 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/REST/v1/Kanban/KanbanRepresentation.php +2 βˆ’3 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/REST/v1/MilestoneParentReference.class.php +1 βˆ’2 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/REST/v1/MilestoneRepresentation.class.php +6 βˆ’11 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/REST/v1/PlanningRepresentation.class.php +3 βˆ’5 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/REST/v2/BacklogItemRepresentation.php +3 βˆ’6 Go to diff View file
M plugins/agiledashboard/include/AgileDashboard/REST/v2/BacklogRepresentation.php +1 βˆ’2 Go to diff View file
M plugins/crosstracker/include/CrossTracker/REST/v1/CrossTrackerArtifactReportRepresentation.php +4 βˆ’8 Go to diff View file
M plugins/crosstracker/include/CrossTracker/REST/v1/CrossTrackerReportRepresentation.php +3 βˆ’5 Go to diff View file
M plugins/docman/include/REST/v1/ItemRepresentationBuilder.php +2 βˆ’3 Go to diff View file
M plugins/docman/tests/unit/REST/v1/Permissions/DocmanItemPermissionsForGroupsBuilderTest.php +1 βˆ’1 Go to diff View file
M plugins/docman/tests/unit/REST/v1/Service/DocmanServicePermissionsForGroupsBuilderTest.php +2 βˆ’2 Go to diff View file
M plugins/frs/include/FRS/REST/v1/FileRepresentation.php +1 βˆ’2 Go to diff View file
M plugins/frs/include/FRS/REST/v1/PackageRepresentation.php +1 βˆ’2 Go to diff View file
M plugins/frs/include/FRS/REST/v1/ReleaseRepresentation.php +2 βˆ’3 Go to diff View file
M plugins/frs/include/FRS/REST/v1/UploadedLinkRepresentation.php +2 βˆ’3 Go to diff View file
M plugins/frs/tests/unit/FRS/REST/v1/PackageRepresentationBuilderTest.php +2 βˆ’2 Go to diff View file
M plugins/frs/tests/unit/FRS/REST/v1/ReleasePermissionsForGroupsBuilderTest.php +2 βˆ’2 Go to diff View file
M plugins/frs/tests/unit/FRS/REST/v1/ServiceRepresentationBuilderTest.php +5 βˆ’5 Go to diff View file
M plugins/git/include/Git/RepositoryList/ListPresenterBuilder.php +2 βˆ’5 Go to diff View file
M plugins/git/include/Git/Webhook/PushPayload.php +2 βˆ’3 Go to diff View file
M plugins/git/include/REST/v1/GitCommitRepresentation.php +3 βˆ’3 Go to diff View file
M plugins/git/tests/unit/Git/Webhook/WebhookRequestSenderTest.php +2 βˆ’1 Go to diff View file
M plugins/project_ownership/include/REST/ProjectOwnershipRepresentation.php +2 βˆ’3 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/GitRepositoryReference.php +2 βˆ’3 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PaginatedCommentsRepresentationsBuilder.php +2 βˆ’3 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PaginatedTimelineRepresentationBuilder.php +3 βˆ’6 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestInlineCommentRepresentationBuilder.php +2 βˆ’3 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestsResource.php +2 βˆ’4 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/Reviewer/ReviewerChangeTimelineEventRepresentation.php +1 βˆ’4 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/Reviewer/ReviewersRepresentation.php +1 βˆ’2 Go to diff View file
M plugins/pullrequest/include/PullRequest/Reviewer/Autocompleter/ReviewerAutocompleterController.php +1 βˆ’2 Go to diff View file
M plugins/svn/include/REST/v1/NotificationsBuilder.php +2 βˆ’3 Go to diff View file
M plugins/svn/include/REST/v1/RepositoryRepresentation.php +2 βˆ’3 Go to diff View file
M plugins/taskboard/include/REST/v1/CardRepresentationBuilder.php +1 βˆ’1 Go to diff View file
M plugins/testmanagement/include/RealTime/RealTimeMessageSender.php +7 βˆ’13 Go to diff View file
M plugins/testmanagement/include/TestManagement/IndexPresenter.class.php +1 βˆ’2 Go to diff View file
M plugins/testmanagement/include/TestManagement/REST/v1/AssignedToRepresentationBuilder.php +2 βˆ’5 Go to diff View file
M plugins/testmanagement/include/TestManagement/REST/v1/CampaignCreator.class.php +1 βˆ’4 Go to diff View file
M plugins/testmanagement/include/TestManagement/REST/v1/DefinitionRepresentation.php +2 βˆ’4 Go to diff View file
M plugins/testmanagement/include/TestManagement/REST/v1/ExecutionCreator.class.php +1 βˆ’4 Go to diff View file
M plugins/testmanagement/include/TestManagement/REST/v1/ExecutionRepresentationBuilder.php +4 βˆ’4 Go to diff View file
M plugins/testmanagement/include/TestManagement/REST/v1/ExecutionStatusUpdater.php +1 βˆ’4 Go to diff View file
M plugins/testmanagement/tests/unit/TestManagement/CampaignCreatorTest.php +3 βˆ’3 Go to diff View file
M plugins/testplan/include/REST/v1/BacklogItemRepresentation.php +1 βˆ’2 Go to diff View file
M plugins/testplan/tests/unit/REST/v1/BacklogItemRepresentationTest.php +12 βˆ’3 Go to diff View file
M plugins/timetracking/include/Timetracking/REST/v1/TimetrackingOverviewRepresentationsBuilder.php +2 βˆ’4 Go to diff View file
M plugins/timetracking/include/Timetracking/REST/v1/TimetrackingReportRepresentation.php +4 βˆ’6 Go to diff View file
M plugins/timetracking/include/Timetracking/REST/v1/TimetrackingRepresentation.php +1 βˆ’5 Go to diff View file
M plugins/timetracking/include/Timetracking/REST/v1/TimetrackingTrackerReportRepresentation.php +3 βˆ’4 Go to diff View file
M plugins/timetracking/tests/unit/Time/TimetrackingOverviewRepresentationsBuilderTest.php +1 βˆ’0 Go to diff View file
M plugins/tracker/include/REST/Artifact/ArtifactCreator.class.php +2 βˆ’4 Go to diff View file
M plugins/tracker/include/REST/Artifact/ArtifactReference.class.php +12 βˆ’5 Go to diff View file
M plugins/tracker/include/REST/Artifact/ArtifactRepresentation.class.php +68 βˆ’31 Go to diff View file
M plugins/tracker/include/REST/Artifact/ArtifactRepresentationBuilder.php +5 βˆ’18 Go to diff View file
M plugins/tracker/include/REST/Artifact/ChangesetCommentRepresentation.class.php +17 βˆ’5 Go to diff View file
M plugins/tracker/include/REST/Artifact/ChangesetRepresentation.class.php +7 βˆ’10 Go to diff View file
M plugins/tracker/include/REST/Artifact/FileDataRepresentation.class.php +5 βˆ’4 Go to diff View file
M plugins/tracker/include/REST/Artifact/FileInfoRepresentation.class.php +5 βˆ’4 Go to diff View file
M plugins/tracker/include/REST/Artifact/MyArtifactsRepresentation.php +29 βˆ’9 Go to diff View file
M plugins/tracker/include/REST/Artifact/ParentArtifactReference.php +14 βˆ’3 Go to diff View file
M plugins/tracker/include/REST/Artifact/UsersArtifactsResourceController.php +2 βˆ’2 Go to diff View file
M plugins/tracker/include/REST/CompleteTrackerRepresentation.class.php +29 βˆ’7 Go to diff View file
M plugins/tracker/include/REST/ContainerFieldsetInArtifactContextRepresentation.php +17 βˆ’5 Go to diff View file
M plugins/tracker/include/REST/FieldDateRepresentation.class.php +21 βˆ’5 Go to diff View file
M plugins/tracker/include/REST/FieldOpenListRepresentation.class.php +21 βˆ’5 Go to diff View file
M plugins/tracker/include/REST/FormElement/FieldFileRepresentation.php +21 βˆ’5 Go to diff View file
M plugins/tracker/include/REST/FormElement/PermissionsForGroupsBuilder.php +1 βˆ’3 Go to diff View file
M plugins/tracker/include/REST/FormElement/PermissionsForGroupsRepresentation.php +4 βˆ’1 Go to diff View file
M plugins/tracker/include/REST/FormElementRepresentation.class.php +35 βˆ’10 Go to diff View file
M plugins/tracker/include/REST/FormElementRepresentationsBuilder.php +5 βˆ’15 Go to diff View file
M plugins/tracker/include/REST/MinimalFieldRepresentation.php +5 βˆ’2 Go to diff View file
M plugins/tracker/include/REST/MinimalTrackerRepresentation.php +20 βˆ’10 Go to diff View file
M plugins/tracker/include/REST/ReportRepresentation.class.php +5 βˆ’2 Go to diff View file
M plugins/tracker/include/REST/Tracker/PermissionsRepresentation.php +4 βˆ’1 Go to diff View file
M plugins/tracker/include/REST/Tracker/PermissionsRepresentationBuilder.php +1 βˆ’4 Go to diff View file
M plugins/tracker/include/REST/TrackerReference.class.php +18 βˆ’8 Go to diff View file
M plugins/tracker/include/REST/TrackerRepresentation.php +3 βˆ’0 Go to diff View file
M plugins/tracker/include/REST/TrackerRestBuilder.class.php +3 βˆ’12 Go to diff View file
M plugins/tracker/include/REST/WorkflowRepresentation.class.php +5 βˆ’2 Go to diff View file
M plugins/tracker/include/REST/WorkflowRulesRepresentation.class.php +5 βˆ’2 Go to diff View file
M plugins/tracker/include/REST/WorkflowTransitionPOSTRepresentation.class.php +7 βˆ’4 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactFilesResource.class.php +1 βˆ’3 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactLinkRepresentation.php +29 βˆ’14 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactPatchDryRunFieldsResponseRepresentation.php +6 βˆ’6 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactPatchDryRunResponseRepresentation.php +6 βˆ’4 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactPatchRepresentation.php +4 βˆ’1 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactPatchResponseRepresentation.php +18 βˆ’6 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactTemporaryFilesResource.class.php +2 βˆ’5 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactsResource.class.php +7 βˆ’10 Go to diff View file
M plugins/tracker/include/REST/v1/CreatedFileRepresentation.php +4 βˆ’1 Go to diff View file
M plugins/tracker/include/REST/v1/FileCreator.php +1 βˆ’2 Go to diff View file
M plugins/tracker/include/REST/v1/FilePOSTRepresentation.php +3 βˆ’0 Go to diff View file
M plugins/tracker/include/REST/v1/ProjectTrackersResource.class.php +1 βˆ’2 Go to diff View file
M plugins/tracker/include/REST/v1/ReportsResource.class.php +2 βˆ’4 Go to diff View file
M plugins/tracker/include/REST/v1/TrackerFieldRepresentations/TrackerFieldPatchRepresentation.php +4 βˆ’1 Go to diff View file
M plugins/tracker/include/REST/v1/TrackerFieldsResource.php +1 βˆ’4 Go to diff View file
M plugins/tracker/include/REST/v1/TrackersResource.class.php +3 βˆ’8 Go to diff View file
M plugins/tracker/include/REST/v1/Workflow/PostActionsPUTRepresentation.php +4 βˆ’1 Go to diff View file
M plugins/tracker/include/REST/v1/Workflow/TransitionPOSTHandler.php +2 βˆ’4 Go to diff View file
M plugins/tracker/include/REST/v1/Workflow/TransitionRepresentation.php +4 βˆ’1 Go to diff View file
M plugins/tracker/include/REST/v1/Workflow/WorkflowTransitionPATCHRepresentation.php +4 βˆ’1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Tracker_Artifact.class.php +2 βˆ’0 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Tracker_Artifact_ChangesetValue_ArtifactLink.class.php +1 βˆ’2 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Field/File/Upload/FileToDownload.php +3 βˆ’0 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Field/File/Upload/FileToUpload.php +3 βˆ’0 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement.class.php +11 βˆ’0 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Container.class.php +1 βˆ’1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Container_Fieldset.class.php +7 βˆ’2 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_List_Bind_Users.class.php +2 βˆ’5 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_List_Bind_UsersValue.class.php +2 βˆ’8 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_Priority.class.php +3 βˆ’0 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_StaticField.class.php +2 βˆ’7 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_StaticField_LineBreak.class.php +2 βˆ’1 Go to diff View file
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_StaticField_Separator.class.php +2 βˆ’0 Go to diff View file
M plugins/tracker/include/Tracker/NullTracker.class.php +7 βˆ’0 Go to diff View file
M plugins/tracker/include/Tracker/Tracker.class.php +7 βˆ’0 Go to diff View file
M plugins/tracker/include/Tracker/Tracker_FileInfo.class.php +2 βˆ’6 Go to diff View file
M plugins/tracker/include/Tracker/Webhook/ArtifactPayload.php +2 βˆ’3 Go to diff View file
M plugins/tracker/tests/unit/REST/Artifact/ArtifactRepresentationBuilderTest.php +30 βˆ’12 Go to diff View file
M plugins/tracker/tests/unit/REST/FormElement/PermissionsForGroupsBuilderTest.php +8 βˆ’8 Go to diff View file
M plugins/tracker/tests/unit/REST/FormElementRepresentationsBuilderTest.php +3 βˆ’0 Go to diff View file
M plugins/tracker/tests/unit/REST/Tracker/PermissionsRepresentationBuilderTest.php +10 βˆ’10 Go to diff View file
M plugins/tracker/tests/unit/REST/v1/Workflow/TransitionPOSTHandlerTest.php +1 βˆ’2 Go to diff View file
M src/common/Project/Group.class.php +19 βˆ’4 Go to diff View file
M src/common/Project/Project.class.php +3 βˆ’0 Go to diff View file
M src/common/Project/ProjectUGroup.php +4 βˆ’2 Go to diff View file
M src/common/Project/REST/MinimalProjectRepresentation.php +4 βˆ’1 Go to diff View file
M src/common/Project/REST/ProjectReference.class.php +5 βˆ’2 Go to diff View file
M src/common/Project/REST/ProjectRepresentation.class.php +16 βˆ’6 Go to diff View file
M src/common/Project/REST/UserGroupRepresentation.php +8 βˆ’5 Go to diff View file
M src/common/Project/REST/v1/ProjectResource.class.php +1 βˆ’4 Go to diff View file
M src/common/Project/REST/v1/UserGroupResource.class.php +3 βˆ’10 Go to diff View file
M src/common/Project/UGroupManager.class.php +1 βˆ’1 Go to diff View file
M src/common/REST/v1/PlanningRepresentationBase.class.php +7 βˆ’2 Go to diff View file
M src/common/User/REST/MinimalUserRepresentation.class.php +53 βˆ’26 Go to diff View file
M src/common/User/REST/UserRepresentation.class.php +20 βˆ’9 Go to diff View file
M src/common/User/REST/v1/UserHistoryEntryRepresentation.php +2 βˆ’3 Go to diff View file
M src/common/User/REST/v1/UserResource.php +4 βˆ’5 Go to diff View file
M src/common/include/TemplateSingleton.class.php +9 βˆ’5 Go to diff View file
M tests/unit/common/Project/ProjectXMLExporterTest.php +4 βˆ’4 Go to diff View file
M tests/unit/common/Project/ProjectXMLExporterWithSynchronizedUGroupsTest.php +4 βˆ’4 Go to diff View file