initial setup for a metadata field on the updates table, #67
Merged
Conversation
…or storing arbitrary info useful for debugging and auditing
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new metadata field to the updates table to facilitate debugging and auditing by linking analyses and calculation dates. Key changes include:
- Adding a nullable metadata TEXT column to the updates table.
- Updating the Update model to include a Metadata field.
- Adding a Metadata field to the Usage struct and using it during update creation.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| migrations/000017_updates_metadata.up.sql | Creates a metadata column in the updates table for debugging. |
| migrations/000017_updates_metadata.down.sql | Removes the metadata column added in the up migration. |
| internal/model/update.go | Adds a pointer Metadata field to the Update struct. |
| internal/controllers/usages.go | Introduces a Metadata field in Usage and passes it to updates. |
ianmcorvidae
commented
May 29, 2025
| ResourceName string `json:"resource_name"` | ||
| UsageValue float64 `json:"usage_value"` | ||
| UpdateType string `json:"update_type"` | ||
| Metadata string `json:"metadata"` |
Collaborator
Author
There was a problem hiding this comment.
Minor question for someone who's worked more with this code is if this should be any other type or what. I guess this should mean that we insert blank strings rather than nulls, which is probably fine but maybe someone has a different thought there. Haven't worked to integrate with anything yet either, of course.
Collaborator
Author
|
I'm hoping this is correct enough, so I'm going to go ahead and merge it. Reviews definitely still welcome 😅 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
intended to be used for storing arbitrary info useful for debugging and auditing -- in particular, for keeping track of what analyses correspond to what updates, and what dates are being used for the calculations, for the sake of double-counting avoidance