Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40138

SCMHead.getActions() must die

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      There is no way to signal that the persisted SCMHead has different actions from a SCMHead instance retrieved through traversal.

      Further, with the event API it may not be possible to reconstruct all the actions for a specific SCMHead from the event.

      The SCMHead interface was designed to be a key type class, not a value type class.

      It was a mistake to add an action API to it.

      As there are very few consumers it may be possible to revert the addition completely, otherwise it will be annotated @Restricted(DoNotUse.class) and the method turned into a no-op.

      As part of this change, ChangeRequestAction will also be removed, in favour of more composable metadata actions that will be made available through the SCMSource.fetchActions(...,listener) API rather than attached to the SCMHead, in this way consumers of the SCM API can access and persist the mutable information with the SCMHead being restored to its role as an immutable key with a strong deep equals contract.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/jenkins/scm/api/ChangeRequestSCMHead.java
            src/main/java/jenkins/scm/api/SCMHead.java
            src/main/java/jenkins/scm/api/actions/AvatarMetadataAction.java
            src/main/java/jenkins/scm/api/actions/ChangeRequestAction.java
            src/main/java/jenkins/scm/api/actions/ContributorMetadataAction.java
            src/main/java/jenkins/scm/api/actions/ObjectMetadataAction.java
            src/main/java/jenkins/scm/api/actions/TagAction.java
            src/main/java/jenkins/scm/api/actions/package-info.java
            src/main/java/jenkins/scm/api/metadata/AvatarMetadataAction.java
            src/main/java/jenkins/scm/api/metadata/ContributorMetadataAction.java
            src/main/java/jenkins/scm/api/metadata/ObjectMetadataAction.java
            src/main/java/jenkins/scm/api/metadata/package-info.java
            src/main/java/jenkins/scm/api/mixin/ChangeRequestSCMHead.java
            src/main/java/jenkins/scm/api/mixin/SCMHeadMixin.java
            src/main/java/jenkins/scm/api/mixin/TagSCMHead.java
            src/main/java/jenkins/scm/api/mixin/package-info.java
            src/main/java/jenkins/scm/api/package-info.java
            src/main/java/jenkins/scm/impl/ChangeRequestSCMHeadCategory.java
            src/main/java/jenkins/scm/impl/TagSCMHeadCategory.java
            src/main/java/jenkins/scm/impl/package-info.java
            src/test/java/jenkins/scm/api/SCMCategoryTest.java
            src/test/java/jenkins/scm/impl/ChangeRequestSCMHeadCategoryTest.java
            src/test/java/jenkins/scm/impl/TagSCMHeadCategoryTest.java
            src/test/java/jenkins/scm/impl/UncategorizedSCMHeadCategoryTest.java
            src/test/java/jenkins/scm/impl/mock/MockAvatarMetadataAction.java
            src/test/java/jenkins/scm/impl/mock/MockChangeRequestSCMHead.java
            src/test/java/jenkins/scm/impl/mock/MockMetadataAction.java
            src/test/java/jenkins/scm/impl/mock/MockSCM.java
            src/test/java/jenkins/scm/impl/mock/MockSCMHead.java
            src/test/java/jenkins/scm/impl/mock/MockSCMHeadEvent.java
            src/test/java/jenkins/scm/impl/mock/MockSCMNavigator.java
            src/test/java/jenkins/scm/impl/mock/MockSCMSource.java
            src/test/java/jenkins/scm/impl/mock/MockTagSCMHead.java
            http://jenkins-ci.org/commit/scm-api-plugin/d6bd43aad226cdc0f2b3060ba6205499c9b6ceda
            Log:
            [FIXED JENKINS-40138] Remove SCMHead.getAction(...)

            • Not actually removing, just making the methods stubs and annotating as @Restricted(DoNotUse) so that binary compatibility is retained
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/scm/api/ChangeRequestSCMHead.java src/main/java/jenkins/scm/api/SCMHead.java src/main/java/jenkins/scm/api/actions/AvatarMetadataAction.java src/main/java/jenkins/scm/api/actions/ChangeRequestAction.java src/main/java/jenkins/scm/api/actions/ContributorMetadataAction.java src/main/java/jenkins/scm/api/actions/ObjectMetadataAction.java src/main/java/jenkins/scm/api/actions/TagAction.java src/main/java/jenkins/scm/api/actions/package-info.java src/main/java/jenkins/scm/api/metadata/AvatarMetadataAction.java src/main/java/jenkins/scm/api/metadata/ContributorMetadataAction.java src/main/java/jenkins/scm/api/metadata/ObjectMetadataAction.java src/main/java/jenkins/scm/api/metadata/package-info.java src/main/java/jenkins/scm/api/mixin/ChangeRequestSCMHead.java src/main/java/jenkins/scm/api/mixin/SCMHeadMixin.java src/main/java/jenkins/scm/api/mixin/TagSCMHead.java src/main/java/jenkins/scm/api/mixin/package-info.java src/main/java/jenkins/scm/api/package-info.java src/main/java/jenkins/scm/impl/ChangeRequestSCMHeadCategory.java src/main/java/jenkins/scm/impl/TagSCMHeadCategory.java src/main/java/jenkins/scm/impl/package-info.java src/test/java/jenkins/scm/api/SCMCategoryTest.java src/test/java/jenkins/scm/impl/ChangeRequestSCMHeadCategoryTest.java src/test/java/jenkins/scm/impl/TagSCMHeadCategoryTest.java src/test/java/jenkins/scm/impl/UncategorizedSCMHeadCategoryTest.java src/test/java/jenkins/scm/impl/mock/MockAvatarMetadataAction.java src/test/java/jenkins/scm/impl/mock/MockChangeRequestSCMHead.java src/test/java/jenkins/scm/impl/mock/MockMetadataAction.java src/test/java/jenkins/scm/impl/mock/MockSCM.java src/test/java/jenkins/scm/impl/mock/MockSCMHead.java src/test/java/jenkins/scm/impl/mock/MockSCMHeadEvent.java src/test/java/jenkins/scm/impl/mock/MockSCMNavigator.java src/test/java/jenkins/scm/impl/mock/MockSCMSource.java src/test/java/jenkins/scm/impl/mock/MockTagSCMHead.java http://jenkins-ci.org/commit/scm-api-plugin/d6bd43aad226cdc0f2b3060ba6205499c9b6ceda Log: [FIXED JENKINS-40138] Remove SCMHead.getAction(...) Not actually removing, just making the methods stubs and annotating as @Restricted(DoNotUse) so that binary compatibility is retained
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/jenkins/branch/BranchNameContributor.java
            src/main/java/jenkins/branch/DescriptionColumn.java
            src/main/java/jenkins/branch/MetadataActionFolderIcon.java
            src/main/java/jenkins/branch/MultiBranchProject.java
            src/main/java/jenkins/branch/OrganizationFolder.java
            src/test/java/integration/BrandingTest.java
            src/test/java/integration/ScmApiTest.java
            src/test/java/jenkins/branch/BranchCategoryFilterTest.java
            src/test/java/jenkins/branch/RateLimitBranchPropertyTest.java
            http://jenkins-ci.org/commit/branch-api-plugin/8715ad7433cc28da95d928a7ee1ade8db1863358
            Log:
            JENKINS-40138 Pick up API changes

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/branch/BranchNameContributor.java src/main/java/jenkins/branch/DescriptionColumn.java src/main/java/jenkins/branch/MetadataActionFolderIcon.java src/main/java/jenkins/branch/MultiBranchProject.java src/main/java/jenkins/branch/OrganizationFolder.java src/test/java/integration/BrandingTest.java src/test/java/integration/ScmApiTest.java src/test/java/jenkins/branch/BranchCategoryFilterTest.java src/test/java/jenkins/branch/RateLimitBranchPropertyTest.java http://jenkins-ci.org/commit/branch-api-plugin/8715ad7433cc28da95d928a7ee1ade8db1863358 Log: JENKINS-40138 Pick up API changes
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            docs/implementation.adoc
            http://jenkins-ci.org/commit/scm-api-plugin/dd3479c901d9c08d9f9530ffb07196387c9cb0d1
            Log:
            JENKINS-40138 Update the documentation to reflect the API changes

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: docs/implementation.adoc http://jenkins-ci.org/commit/scm-api-plugin/dd3479c901d9c08d9f9530ffb07196387c9cb0d1 Log: JENKINS-40138 Update the documentation to reflect the API changes
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBranchFilter.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubOrgMetadataAction.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubPullRequestFilter.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubRepoMetadataAction.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestAction.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestGHEventSubscriber.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/PushGHEventSubscriber.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/94a1394323ed13b812bbcda499d435a19d6f105a
            Log:
            JENKINS-40138 Align with the SCM API contract

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBranchFilter.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubOrgMetadataAction.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubPullRequestFilter.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubRepoMetadataAction.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestAction.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestGHEventSubscriber.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java src/main/java/org/jenkinsci/plugins/github_branch_source/PushGHEventSubscriber.java http://jenkins-ci.org/commit/github-branch-source-plugin/94a1394323ed13b812bbcda499d435a19d6f105a Log: JENKINS-40138 Align with the SCM API contract

              People

              • Assignee:
                stephenconnolly Stephen Connolly
                Reporter:
                stephenconnolly Stephen Connolly
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: