-
Notifications
You must be signed in to change notification settings - Fork 2
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
Prepare Design lifecycle features for develop #131
Prepare Design lifecycle features for develop #131
Conversation
docs/user/design_lifecycle.md
Outdated
|
||
This feature allows to re run a design instance with different input data to update the implemented design with the new changes: additions and removals. | ||
|
||
It leverages a complete tracking of previous design implementation and a reduce function for the new design to understand the changes to be implemented and the objects to be decommissioned (leveraging the previous decommissioning feature for only a specific object). |
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.
We need to really consider the term reduce
. I think from a mathematical/computer science perspective the operation is more like a map
than a reduce
.
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.
yes, taking it into account
nautobot_design_builder/templates/nautobot_design_builder/designinstance_retrieve.html
Outdated
Show resolved
Hide resolved
nautobot_design_builder/templates/nautobot_design_builder/designinstance_retrieve.html
Outdated
Show resolved
Hide resolved
nautobot_design_builder/models.py
Outdated
description = models.CharField(max_length=255, blank=True, default="") | ||
docs = models.CharField(max_length=4096, blank=True, default="", editable=False) |
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.
If these two fields are in the design job class why do we need to also store them in the database?
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.
they are not. The only field persisted by the DesignJob (or Job) is the description. The version and docs are in the model, but not persisted in the DB.
nautobot_design_builder/models.py
Outdated
@@ -150,8 +151,6 @@ def get_by_natural_key(self, design_name, instance_name): | |||
|
|||
DESIGN_NAME_MAX_LENGTH = 100 |
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 know that this isn't a change in the current branch/PR but Nautobot core has standardized on a length of 255 for all char fields. Maybe we should as well.
nautobot_design_builder/signals.py
Outdated
default_data = {} | ||
if hasattr(instance.job_class.Meta, "description"): | ||
default_data["description"] = instance.job_class.Meta.description | ||
if hasattr(instance.job_class.Meta, "version"): | ||
default_data["version"] = instance.job_class.Meta.version | ||
if hasattr(instance.job_class.Meta, "docs"): | ||
default_data["docs"] = instance.job_class.Meta.docs |
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.
This is an additional comment based on my previous question about storing these values in the database. If we have them in the class why store them in the database? Which is authoritative? If the design class description is updated should the database get updated? Also, do we want to allow people to override the values via the UI?
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.
it makes sense. Moving it to properties
nautobot_design_builder/templates/nautobot_design_builder/design_list.html
Outdated
Show resolved
Hide resolved
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.
Just a few suggestions, otherwise it looks good.
Features/Fixes to be covered
Tidying up task for the end