Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Allow Stash users to specify Size parameter of scm.ListOptions, by default only picks up first 25 paths in diff #89

@madappa-sharath

Description

@madappa-sharath

Rest API's of Stash are paginated and have a default page size of 25. As a result when the plugin fetches the diff via go-scm it only picks up the first 25 paths that were affected in the PR/commit. Diffs with greater than 25 paths affected isn't uncommon for a monorepo. stash.go#GetStashFilesChanged takes in a pagination parameter but plugin doesn't have a way to set the size option.

Add an environment variable to set the page size to a higher value.

References:

  1. API uses limit of 25 if unspecified.
    https://docs.atlassian.com/bitbucket-server/rest/4.0.0/bitbucket-rest.html#paging-params
  2. go-scm stash driver takes scm.ListOptions.Size as a parameter to set this limit
    https://github.com/drone/go-scm/blob/3edbe5560fdc172e093e6214196ee37ce516152d/scm/driver/stash/git.go#L114
  3. Plugin already supplies a empty parameter, this can be modified to set the configured size and probably default value greater than 25
    https://github.com/meltwater/drone-convert-pathschanged/blob/77a9eebf53d1ce7bba61cbe660f5ed189a70e69a/plugin/plugin.go#L169

Expected behavior

Applicable pipelines must be evaluated based on the entire changeset and not just the first page (Bitbucket sets the limit to 1000 when making api requests for its web gui)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions