Interface VcsPullRequestDao

    • Method Detail

      • findByRepositoryAndKey

        @Nullable
        @Nullable MutableVcsPullRequest findByRepositoryAndKey​(long repositoryId,
                                                               @NotNull
                                                               @NotNull String pullRequestKey)
        Search pull request by pull request key (unique on repository level) and target repository id
        Parameters:
        repositoryId - target repository id
        pullRequestKey - repository-specific pull request key
        Returns:
        pull request or null if not found
      • findByRepository

        @NotNull
        @NotNull List<MutableVcsPullRequest> findByRepository​(long repositoryId,
                                                              boolean isOpen)
        Search pull requests by target repository and status.
        Parameters:
        repositoryId - target repository id
        isOpen - status
        Returns:
        list of pull requests
      • closePullRequestsClosedInRepository

        @NotNull
        @NotNull PartialList<MutableVcsPullRequest> closePullRequestsClosedInRepository​(long targetRepositoryId,
                                                                                        @NotNull
                                                                                        @NotNull Set<String> openPrKeys)
        Synchronize status of PRs in DB and in remote repository. Returns a PartialList of updated pull requests.

        If the returned list is incomplete, this method should be called again.

        Parameters:
        targetRepositoryId - id of a remote repository
        openPrKeys - keys of pull requests which have open state in remote repository
        Returns:
        list of modified pull request entities
      • findByStatus

        @NotNull
        @NotNull List<MutableVcsPullRequest> findByStatus​(boolean isOpen,
                                                          long startFromId,
                                                          int limit)
        Search pull requests by status.
        Parameters:
        isOpen - status
        startFromId - entity id to start query from
        limit - maximum amount of values to be returned
        Returns:
        list of pull requests sorted by id
      • removeOrphanedPullRequests

        int removeOrphanedPullRequests()
        Remove pull requests which are neither linked to any repository nor to any plan branch.
        Returns:
        number of removed records