Skip to content

Branches plugin duplicates every dry-run entry once per configured branch #1026

Description

@tdabasinskas

In nop mode, the branches plugin reports each planned change N times, where N is the number of configured branches with a protection key.

sync() in lib/plugins/branches.js declares a single resArray outside the per-branch .map(), pushes each branch's NopCommands into it, and each callback returns that same array. Promise.all then yields N references to one array, and the final res.flat(2) inlines its full contents N times. A config with branches: [master, develop], both with protection changes, produces 8 NopCommands instead of 4 (each one twice).

Downstream, handleResults mostly masks this in check-run output because its duplicate filter compares only type/repo/plugin — but that same filter also throws away legitimately different rows with matching keys, so the dry-run report for a repo with two protected branches shows only the first branch's diff. One bug hiding another.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions