Skip to content

Rename campaigns to batch changes

Created by: mrnugget

Context: RFC 320 Timeline: Name change timeline

Plan

Start with user-visible things (API, content, docs, URLs) and end with implementation "details" (Go package name, directory names, database table names).

Why? Avoids rebasing problems as long as possible and gets the critical must-be-done stuff done first.

TODOs

sourcegraph/sourcegraph

  • Deprecate old GraphQL entities (Campaign and CampaignSpec, CampaignsCodeHosts) and their queries & mutations. Add BatchChange and BatchSpec entities, mutations, queries. PR: https://github.com/sourcegraph/sourcegraph/pull/18734
    • In Go graphqlbackend package: rename GraphQL resolvers from CampaignsResolver to BatchChanges resolver
    • In Go enterprise/internal/campaigns/resolvers package: rename campaignsResolver to batchChangesResolver and same for BatchSpec.
  • Rename Go package campaigns to batchchanges PR: https://github.com/sourcegraph/sourcegraph/pull/18855
  • Change URL generation PR: https://github.com/sourcegraph/sourcegraph/pull/18859
  • WIP Rename Go types Campaign and CampaignSpec https://github.com/sourcegraph/sourcegraph/pull/18864
  • Use new GraphQL names in web code
  • Change web views to use "batch change" and "batch spec" wording
  • Change web views to use new src-cli commands
  • Change Batch changes to Batch Changes in web
  • Fix in-app docs links
  • Redirect /<org-or-username>/campaigns to /<org-or-username>/batch-changes
  • WIP @malomarrec Move doc/campaigns to doc/batch-changes PR https://github.com/sourcegraph/sourcegraph/pull/18854
    • Redirect docs.sourcegraph.com/campaigns to docs.sourcegraph.com/batch-changes (see `doc/_resources/assets/redirects)
    • Add redirect for the pages that have "campaigns" in their name: campaign_spec_yaml_reference
    • Move doc/dev/background-information/campaigns to doc/dev/background-information/batch-changes
    • Redirect docs.sourcegraph.com/dev/background-information/campaigns to docs.sourcegraph.com/dev/background-information/batch-changes (see `doc/_resources/assets/redirects)
    • Change the content
  • site config options: see here
    • campaigns.enabled
    • campaigns.restrictToAdmins
    • campaigns.readAccess.enabled (since it's deprecated anyway: remove?)
    • Wrapper function here
    • Usage here: here
    • Also, see these validators here
  • errors: ErrCampaignsDisabled etc. in the resolvers: see this file
    • we need to wrap those and return the Campaigns version when a campaigns mutation was used and a batchchange version when not
    • UPDATE: @mrnugget and @eseliger discussed this and didn't think this was worth it, since the only place where these errors could show up is in the src-cli where campaign commands have been deprecated anyway.
  • Licensing PR: https://github.com/sourcegraph/sourcegraph/pull/18983
  • Rename database table and foreign keys
    • UserCredentials "domain" is currently "campaigns"
  • Add changelog entry
  • Regenerate docs for src-cli in doc/cli/references #18799 (closed)
  • Rebase and update usagestats PR https://github.com/sourcegraph/sourcegraph/pull/18604
  • Rebase and update analytics PR https://github.com/sourcegraph/analytics/pull/109

sourcegraph/src-cli

Misc