Skip to content

batches: acknowledge draft changesets when closing a Batch Change

Administrator requested to merge bo/ack-draft-changeset-on-close into main

Created by: BolajiOlajide

Description

When a batch change has one or more open changesets, we ask the user if they want to close them or not, but we don't trigger this behaviour for draft changesets.

Test plan

  • Create a batch change with multiple changesets
  • Ensure at least one of them is a published draft and the other is published and open
  • Closing the batch changes should prompt you about both open and draft changesets attached to the batch change

Below is a sample batch spec to use for testing.

name: another-bc
description: "All death metal^W^Wdrafts, all the time"

# "on" specifies on which repositories to execute the "steps".
on:
  # Example: find all repositories that contain a README.md file.
  - repository: github.com/sourcegraph-testing/zap

# "steps" are run in each repository. Each step is run in a Docker container
# with the repository as the working directory. Once complete, each
# repository's resulting diff is captured.
steps:
  # Example: append "Hello World" to every README.md
  - run: echo "Hello World" | tee -a $(find -name README.md)
    container: alpine:3

# "changesetTemplate" describes the changeset (e.g., GitHub pull request) that
# will be created for each repository.
changesetTemplate:
  title: Draft PR
  body: "This is a draft PR. Thrilling, yes?"

  branch: bo/drafts-bc-test

  commit:
    author:
      name: Bolaji Olajide
      email: [email protected]
    message: Append Hello World to all README.md files

  # Change published to true once you're ready to create changesets on the code host.
  published: draft

Screenshot

Screenshot 2022-03-11 at 05 55 07

Closes #22250

Merge request reports

Loading