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

Multi-Device Collapsing Config Diff #825

Open
rifen opened this issue Oct 25, 2024 · 11 comments
Open

Multi-Device Collapsing Config Diff #825

rifen opened this issue Oct 25, 2024 · 11 comments

Comments

@rifen
Copy link

rifen commented Oct 25, 2024

Environment

  • Nautobot version: all
  • nautobot-golden-config version: all

I'd like to be able to select a certain amount of devices and see all of their config diffs and if they all have the same diff then they would combine or not. It could be shown in Config Plans as a button with a popup of all the devices in the plan and/or Configuration Overview I could select the devices (probably a bulk action) and get a collapsing diff view of them all.

I want to deploy a bunch of configs to a lot of devices and I want to check what is going on with all the devices. Selecting each device 1 by 1 is not scalable and adds a lot of engineer time.

Figmaed (Figma'd?) a quick example:
image

@itdependsnetworks
Copy link
Contributor

Yea, certainly agreed, this was on our original design spec, but did not make MVP (along with many other features). Another relevant one was the ability to understand when the changes are the same, e.g. if there was a hash value associated with the change and ideally a filter, to filter out one hash value at a time.

@rifen
Copy link
Author

rifen commented Oct 25, 2024

A good example of that: https://aeolun.github.io/react-diff-viewer-continued/ though not working in React in this case :)

@itdependsnetworks
Copy link
Contributor

hmm, that just looks like a diff viewer, which we already have in bootstrap: https://demo.nautobot.com/plugins/golden-config/golden-config/d200ff18-ef93-449b-b75e-301e948aaf50/compliance/

not sure what you are suggesting we are comparing?

@rifen
Copy link
Author

rifen commented Oct 25, 2024

not sure what you are suggesting we are comparing?

I thought by "filter" you meant only show the changes needed. In that diff viewer it had "Expand" showing only the diffed parts to the user. It seems that isn't what you were getting at.

@rifen
Copy link
Author

rifen commented Oct 29, 2024

Hey @itdependsnetworks and @jeffkala,

I'd like to contribute this feature, my company has allocated me time to do so 🙂 . I have plenty of Python Experience and I am willing to learn more Django (Outside interacting with the ORM via writing Jobs). I have some JavaScript experience but very little, which I believe is a small requirement in this.

My plans for this feature would go something like this:

  1. Add a new button "Compare" to the Configuration Overview view at the top + a "Compare" button via the Config Plans screen.
  2. The button would direct you to a view utilizing the selected devices in Configuration Overview (if possible) or Config Plan
  3. The new view would use Collapsible Panels and diff2html side-by-side comparison for each device to start. (Combining devices could come in a later but separate feature depending on the complexity.)
  4. Here is a touchy part - from my perspective I believe engineers would want each comparison to be of the Running Config and the Intended Config. Today the comparison is between the backup and the intended. When users press the Compare button, I don't see a complete issue with going out and getting the running config for each device, utilizing the URL the same as they were navigating to Devices > Configuration. There would be noticeable overhead of course because of the amount of devices potentially. Maybe it could be a setting - where users could set "Backup" or "Running" in Golden Config settings to point to which they want to look at for comparisons. I could enqueue the Backup job for the devices specifically, would be the same I think 🤔 probably same amount of waiting.

I can dedicate most of my time to this contribution and hopefully future contributions. If there is anything I didn't touch on in this feature, any changes or any extra tips let me know. If your comfortable assigning me this Issue now or waiting until I have an MVP/PR, that's fine too.


Additional ideas while going through GC code:

  • Could add a form view where you just select all devices and get all of their diffs. Would be in the menu as "Configuration Comparison"
  • Could just be added to the Execute dropdown button as "Compare"

@itdependsnetworks
Copy link
Contributor

I think it makes sense to create a PR for each of the following steps

  1. Redirect you to a view when you select devices, then click the "Deploy" Button and this would have the collapsible panels
  2. The panel headers should include a hash value of what will change, so one can understand if this is the same change
  3. Add in a comparison view for Missing and Remediation, that would simply show what the current intended is in place
  4. Add in the ability to have diff view (It's not clear to us yet if we want to proceed with this, as it may cause confusion, but certainly not off of the table)

For your initial 4, this is not something we would do in the near or even medium term future. The idea is to have a control of what you have approved, and this breaks the principle of least astonishment in that it was approved as one configuration and pushed yet another configuration.

@rifen
Copy link
Author

rifen commented Oct 31, 2024

To align with your step 1 and limit scope:

On the 'Config Plans' view specifically, we redirect 'Deploy Selected' button to a new page. This page would have collapsible panels view of running vs. intended configurations (or missing vs. extra?) for each selected device.

Workflow would be:

  1. Generate intended config
  2. Create config plans
  3. Press "Deploy Selected" after selecting plans
  4. Redirect to page with Comparison Panels for Devices plans selected
  5. Press "Deploy"

The "Deploy" job button on the Config Plan page would be removed to lower confusion and granting 1 streamlined workflow to deploy plans.


Edits:

  • Use of new page and no modals.
  • Removed Workflow 2

@itdependsnetworks
Copy link
Contributor

Instead of modal, I was just thinking it's own page, I could be convinced otherwise, but given the amount of data on it, I think we will need all of the real estate.

I am not understanding what workflow 2 would provide?

@rifen
Copy link
Author

rifen commented Oct 31, 2024

Agreed on the full page.

Well the deploy button was already in the Config Plan page 🤷 so I figured there was a reason. Could just remove it and have the "Merge Selected" button that then takes you to the next page. That consolidates ways you can merge. Makes it 1 streamlined flow.

@rifen
Copy link
Author

rifen commented Nov 5, 2024

Updated previous comment: #825 (comment) for clarity with discussions.

@itdependsnetworks
Copy link
Contributor

I think that works, I think you can leave it as Deployed Selected, I don't think anyone will be confused that there is a confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants