-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update grapher configs in R2 when variable config changes #4096
Conversation
rakyi
commented
Oct 31, 2024
- Fix missing updates of configs in R2 after we update the configs in the DB on variable grapher config upsert/deletion in the API
- Update mdim view grapher configs on variable grapher config upsert/deletion
- Trigger baking if a published mdim config is created/updated
@sophiamersmann since you worked on the related code recently, could you take a look also? Feel free to ignore the mdim specifics. |
c98ee7e
to
f022baa
Compare
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-10-31 14:19:59 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't speak to the mdim specifics, but on a high level, this makes sense to me 👍🏻
If you wanted to, you could add a couple of db tests. This has saved me a few times while working on this stuff :) Up to you, though!
Thanks! I'll try adding a few tests. After one of the existing ones failed in CI, I now see we already have some, so will start there. |
74e53ae
to
85546ed
Compare
5beec5c
to
5f36cd8
Compare
85546ed
to
b142c8a
Compare
5f36cd8
to
740dc61
Compare
b142c8a
to
e3f6624
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some tiny notes but they are all optional - looks nice!
UPDATE chart_configs | ||
SET | ||
full = ?, | ||
updatedAt = ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpdatedAt should auto-update - I would remove the explicit update from here unless there is a good reason to do it manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied and tweaked existing code, and this is what we did there already. Checked just now and updatedAt
is not set to auto-update, and I'm not sure why. @sophiamersmann do you remember why we set it manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially switched to auto-update and then switched back to manual updates when Mojmir noticed that the updatedAt of the chart and the updatedAt of the config were out of sync for some charts. If it’s automatic updates then that can happen when you run a migration on one of the tables, for example. I don’t recall why Mojmir needed these to be the same, chart-diff maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, I vaguely remember that. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok cool, if there is a reason that that is fine. Could you just add a comment (can just quote the vague statement of Sophia even :) ) so that we don't accidentally delete this in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, added comments.
4c15136
to
8d720bb
Compare
* Fix missing updates of configs in R2 after we update the configs in the DB on variable grapher config upsert/deletion in the API * Update mdim view grapher configs on variable grapher config upsert/deletion * Trigger baking if a published mdim config is created/updated
8d720bb
to
2543b45
Compare