Backend Migration & Model: Introduce versioning into agent_config table with paper_trail
MR: Introduce paper_trail to WorkspaceAgentConfig (!163572 - merged)
Description
After paper_trail is introduced into GitLab, we should introduce to agent_config
model. But on other application code, we still treat the agent_config as unversioned.
We plan to introduce some monkey-patching code into the agent_config model, and pls see this note for more details.
Please spend some time on paper_trail gem and understand how it works, so we have a solid foundation on what we rely on.
We will also need custom config for our table.
I also read through the entire paper_trail README, and I think we should also ensure we do the following custom non-default configuration and setup:
- Use a custom version class with a dedicated versions table per model. This definitely seems the way to go in a large monolith like GitLab, especially if we ever start using it for more tables. It also seems to avoid some issues with deleted item ID references which can occur if you only use a single
versions
table.- Use the JSON Serializer to store the object in a postgres jsonb column
Acceptance Criteria
-
write migration for paper_trail version table -
config paper_trail with agent_config model, we will need some custom configs -
add needed unit testings -
manual test make sure everything works as expected
Edited by zli