-
Notifications
You must be signed in to change notification settings - Fork 263
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
Extend ObjectChange
change_context_detail
to 400 chars
#2602
Conversation
Adding @gsnider2195 as the original code contributor |
Confirms to fix nautobot/nautobot-app-circuit-maintenance#218 |
Can we also make this more robust in general so that we don't hit this same issue in the future if (heaven forbid) we somehow end up with a plugin with a 200-character viewname? It'd be good to ensure that we automatically truncate the change_context_detail to fit, e.g. here at least: https://github.com/nautobot/nautobot/blob/develop/nautobot/extras/signals.py#L83 |
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.
Come to think of it, we have a similar potential issue with object_repr
- it would be good to add a length check and automatic truncation here as well.
changes/2602.changed
Outdated
@@ -0,0 +1 @@ | |||
`ObjectChange.change_context_detail` extended from 100 to 200 chars |
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.
`ObjectChange.change_context_detail` extended from 100 to 200 chars | |
Increased size of `ObjectChange.change_context_detail` field from 100 to 200 chars. |
Ah - this is actually coming from https://github.com/nautobot/nautobot/blob/develop/nautobot/extras/jobs.py#L1243. Since Jobs can have a slug up to 320 characters in the worst case, we definitely need some truncation logic and/or to increase the limit to more than 200 chars. |
I agree on the idea. I would cover the |
@chadell can we move to a 320 size on the context to match that of a slug? |
We could move to 400 (to account for the application name). |
@chadell Moved to draft to indicate you're still updating the PR to make it visually distinct. Please select "Ready for review" once the PR has been updated. |
…to the object_repr attribute. Both, for the ObjectChange model
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.
Looks functionally solid to me. Can we define and use some constants in nautobot.extras.constants
for these two values so that we don't have to have hard-coded 200
and 400
in various places?
ObjectChange
change_context_detail
to 200 charsObjectChange
change_context_detail
to 400 chars
Closes: nautobot/nautobot-app-circuit-maintenance#218
What's Changed
change_context_detail
added in version 1.4.1 was limited to 100 charschange_context_detail
from 100 to 400 charsTODO