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

Add branch parameter to generate intended config view #871

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

gsnider2195
Copy link
Contributor

@gsnider2195 gsnider2195 commented Jan 30, 2025

Closes: #828

This cannot be released until Nautobot v2.4.2 is released with nautobot/nautobot#6746

What's Changed

This PR implements the FR in #828 to add the branch parameter to the generate intended config UI. It also implements one of the UI enhancements requested in #862 Render the graphql data tab when the graphql query select2 changes.

Screen.Recording.2025-01-29.114118.mp4

To Do

  • Explanation of Change(s)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

@@ -47,7 +47,9 @@ curl -s -X GET \

The returned response will contain the rendered configuration for the specified device, the GraphQL data that was used, and if applicable, a diff of the most recent intended config that was generated by the **Intended Configuration** job. The web UI provides a simple form to interact with this REST API. You can access the web UI by clicking on "Generate Intended Config" in the "Tools" section of the Golden Config navigation menu.

For more advanced use cases, the REST API and web UI also accept a `graphql_query_id` parameter to specify a custom GraphQL query to use when rendering the configuration. If a `graphql_query_id` is not provided, the default query configured in the Device's Golden Config settings will be used.
For more advanced use cases, the REST API and web UI also accept an optional `graphql_query_id` parameter to specify a custom GraphQL query to use when rendering the configuration. If a `graphql_query_id` is not provided, the default query configured in the Device's Golden Config settings will be used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this whole docs section (Developing Intended Configuration Templates), could you please make a small change and flip the order? You start talking about the feature and how to use it via the API, but given we're in the "User Guide" let's start with the screenshot of the UI and what they can do there (what inputs they can provide, the 3 panels, what's shown there, noting the git pull as well etc.)

And then at the end provide the option of using the REST API endpoints (I'd even have that info under developer guide, but I don't see any of that in GC's docs so nevermind).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made these changes

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

…m:nautobot/nautobot-app-golden-config into u/gas-828-generate-intended-config-branch
if not filesystem_path.is_file():
msg = f"Jinja template {filesystem_path} not found in git repository {git_repository}"
msg = f"Jinja template {rendered_path} not found in git repository {git_repository}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change, should be easier for the user to understand.

Copy link
Contributor

@smk4664 smk4664 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I am unsure why there was so much introduced javascript code in the html file, but the code looks necessary.

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.

Add branch to generate-intended-config API
3 participants