Skip to content
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

Merged
merged 29 commits into from
Apr 15, 2024

Conversation

chadell
Copy link
Contributor

@chadell chadell commented Apr 4, 2024

Features/Fixes to be covered

  • New Menu for Design Builder (instead of Jobs): Design Library 3d94ba2
  • Add support for a Design to bring a docs reference explaining the design 645ff07
  • The Owner of a Design should use the Contacts from Nautobot 2.x 2e76123
  • Update the name of Design Instance to Design Deployment 6086198
  • Add in the design table the last time the design job was synchronized 06550d9
  • Add support in UI for a design version (without versioning feature yet) d2b3f84
  • Update the button to trigger the design 681a122
  • Update the details tab of a design aligned with core "data provenance" -> Won't do as it will come naturally from Core when available
  • Design Instance should be implemented more than the owner 2e76123
  • The Last Implemented changed to Last Updated ee9d7b2
  • Update Live State to something else 4630a25
  • Remove Journals view and integrate as a tab from a Design Instance 34224f9
  • Change the Name of the decommissioning job category fdcf825
  • Add a description of every design job 45aef4f
  • Clean up tag when the design instance is deleted 37245d6
  • Allow the design to be disabled in the table (job disable functionality exposed) 1777b06
  • Handle a Job removal when there is a reference in the Design Object, how to handle it e93470e
  • Take into consideration breaking changes in the command 6ab7440
  • Fix job input data taken from last implementation ab967a1
  • Change defaults for version (0.0.0) and description: blank 645ff07

Tidying up task for the end

@chadell chadell marked this pull request as ready for review April 10, 2024 14:17
@chadell chadell requested review from abates and mzbroch as code owners April 10, 2024 14:17

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).
Copy link
Contributor

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.

Copy link
Contributor Author

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

Comment on lines 110 to 111
description = models.CharField(max_length=255, blank=True, default="")
docs = models.CharField(max_length=4096, blank=True, default="", editable=False)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@@ -150,8 +151,6 @@ def get_by_natural_key(self, design_name, instance_name):

DESIGN_NAME_MAX_LENGTH = 100
Copy link
Contributor

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.

Comment on lines 70 to 76
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
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@abates abates left a 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.

@chadell chadell merged commit 8127eda into feature_delices Apr 15, 2024
15 checks passed
@abates abates deleted the feature_delices_prepare-for-develop branch April 15, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants