Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

migrations: Add column author_user_id to critical_and_site_config#45618

Closed
indradhanush wants to merge 3 commits into
mainfrom
ig/site-config-author
Closed

migrations: Add column author_user_id to critical_and_site_config#45618
indradhanush wants to merge 3 commits into
mainfrom
ig/site-config-author

Conversation

@indradhanush

@indradhanush indradhanush commented Dec 13, 2022

Copy link
Copy Markdown
Contributor

We recently had an incident where a site config was changed but didn't know who / why this was made.

Adding an author_user_id to the table will help with auditing.

We needed this feature as part of #40377 anyway.

Test plan

  1. Tested locally with both sg migration up and sg migration downto.
  2. Tested that sg start works
  3. Builds should pass.

@cla-bot cla-bot Bot added the cla-signed label Dec 13, 2022
@indradhanush indradhanush requested a review from a team December 13, 2022 12:22

@sashaostrikov sashaostrikov 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.

LGTM!

indradhanush and others added 2 commits December 13, 2022 18:24
…itical_and_site_config/down.sql

Co-authored-by: Alex Ostrikov <alex.ostrikov@sourcegraph.com>

@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.

Why add this column without the code that populates it? I'm a bit unclear on how we're going to use the column

@indradhanush

Copy link
Copy Markdown
Contributor Author

Why add this column without the code that populates it? I'm a bit unclear on how we're going to use the column

I wanted to get this out and follow up with the PR that would use this column. The settings table already has a author_user_id column so it felt natural to add one by the same name here as well.

@@ -0,0 +1,3 @@

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.

Suggested change

😁

@mrnugget

Copy link
Copy Markdown
Contributor

I wanted to get this out and follow up with the PR that would use this column.

I get the need to keep changes small, but this is a ~25 line change that doesn't do anything, it only adds a dead column. I'm scared that once we start using it it turns out it needs to be non-nullable, or something like that, and then we need to redo the migration again.

@indradhanush

Copy link
Copy Markdown
Contributor Author

I get the need to keep changes small, but this is a ~25 line change that doesn't do anything, it only adds a dead column. I'm scared that once we start using it it turns out it needs to be non-nullable, or something like that, and then we need to redo the migration again.

I forgot to reply to this. 😓

Makes sense. I'll close this PR for now and come back to it if I have some downtime between bigger issues.

@unknwon

unknwon commented Dec 21, 2022

Copy link
Copy Markdown
Contributor

Just to express interests that there was a use case for this column in a recent MI debugging, I wanted to find out was it the customer admin or us made a mistake in one of the site config update.

@indradhanush

Copy link
Copy Markdown
Contributor Author

Just to express interests that there was a use case for this column in a recent MI debugging, I wanted to find out was it the customer admin or us made a mistake in one of the site config update.

Thank you for the data point. I think its important to have that in place and hopefully can come back to make use of the migration soon this year.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants