Skip to content

campaigns: restore pre-3.20 instance compatibility#370

Merged
LawnGnome merged 1 commit into
mainfrom
aharvey/check-auto-author
Nov 5, 2020
Merged

campaigns: restore pre-3.20 instance compatibility#370
LawnGnome merged 1 commit into
mainfrom
aharvey/check-auto-author

Conversation

@LawnGnome

Copy link
Copy Markdown
Contributor

The author name and e-mail fields were always sent, but the schema Sourcegraph 3.19 uses to validate changeset specs don't include these fields. Since we're doing version detection for feature flags (quirks) now anyway, let's use that to not set the author name and e-mail if they're not explicitly provided when talking to a 3.19 instance.

If the user provides an author name and/or e-mail and sends a changeset spec to a pre-3.20 instance, the request will fail, but since those are 3.20 features that's OK.

The author name and e-mail fields were always sent, but the schema
Sourcegraph 3.19 uses to validate changeset specs don't include these
fields. Since we're doing version detection for feature flags (quirks)
now anyway, let's use that to not set the author name and e-mail if
they're not explicitly provided when talking to a 3.19 instance.

If the user provides an author name and/or e-mail and sends a changeset
spec to a pre-3.20 instance, the request will fail, but since those are
3.20 features that's OK.

@chrispine chrispine left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @LawnGnome

@LawnGnome LawnGnome merged commit 7f82fde into main Nov 5, 2020
@LawnGnome LawnGnome deleted the aharvey/check-auto-author branch November 5, 2020 20:08

@mrnugget mrnugget left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! Nice little struct :)

scjohns pushed a commit that referenced this pull request Apr 24, 2023
The author name and e-mail fields were always sent, but the schema
Sourcegraph 3.19 uses to validate changeset specs don't include these
fields. Since we're doing version detection for feature flags (quirks)
now anyway, let's use that to not set the author name and e-mail if
they're not explicitly provided when talking to a 3.19 instance.

If the user provides an author name and/or e-mail and sends a changeset
spec to a pre-3.20 instance, the request will fail, but since those are
3.20 features that's OK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants