Skip to content

Changeset list ordering

Created by: eseliger

Allow users to order the list of changesets

Tasks involved:

  • https://github.com/sourcegraph/sourcegraph/issues/15781 adds a text box and is a hard requirement for this ticket.
  • Define by which attributes changesets can be ordered
  • Extend the campaigns.Store to allow ordering changesets
  • Extend the GraphQL API to allow ordering of changesets (see below)
  • Extend the changeset resolvers to allow ordering
    • Migrate the "after" cursor to use some cursor value that allows to have deterministic ordering (ie createdAt:id, where we use it like WHERE created_at < args.createdAt, ..other ideas..)
  • Add a syntax for ordering to the search box, parse it on the client, send it to the API
  • optional: Add a UI that adds common orderings to the search box with one click
    • This would then require design work

Quick idea for API:

enum ChangesetOrder {
  CREATED_AT_ASC
  CREATED_AT_DESC
  // ...other popular things
}

type Campaign implements Node {
  // ... other fields
  changesets(order: ChangesetOrder): ChangesetConnection!
}