Content-Length: 448686 | pFad | http://github.com/nautobot/nautobot/pull/6752

0F GraphQL as a Git Data source provider. by djhoward12 · Pull Request #6752 · nautobot/nautobot · GitHub
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

GraphQL as a Git Data source provider. #6752

Merged
merged 23 commits into from
Jan 23, 2025

Conversation

djhoward12
Copy link
Contributor

@djhoward12 djhoward12 commented Jan 9, 2025

Closes #4702

What's Changed

Updated nautobot/extras/datasources/git.py to have the ability to pull in graphql queries stored in a git data source in the grapql_queries directory.

The update did require a change to the Graphql model in extras/models/models.py similar to other git data source providers.

The following fields were added.

    # A Graphql Query *may* be owned by another model, such as a GitRepository, or it may be un-owned
    owner_content_type = models.ForeignKey(
        to=ContentType,
        on_delete=models.CASCADE,
        limit_choices_to=FeatureQuery("grapql_query_owners"),
        default=None,
        null=True,
        blank=True,
        related_name="graphql_queries",
    )
    owner_object_id = models.UUIDField(default=None, null=True, blank=True)
    owner = GenericForeignKey(
        ct_field="owner_content_type",
        fk_field="owner_object_id",
    )

Screenshots

Screenshot 2025-01-09 at 4 20 55 PM

Screenshot 2025-01-09 at 4 21 41 PM

TODO

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Example App Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

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

Looks promising!

nautobot/docs/user-guide/feature-guides/git-data-source.md Outdated Show resolved Hide resolved
nautobot/docs/user-guide/feature-guides/git-data-source.md Outdated Show resolved Hide resolved
nautobot/docs/user-guide/feature-guides/git-data-source.md Outdated Show resolved Hide resolved
nautobot/extras/datasources/git.py Outdated Show resolved Hide resolved
nautobot/extras/datasources/git.py Outdated Show resolved Hide resolved
nautobot/extras/datasources/git.py Outdated Show resolved Hide resolved
nautobot/extras/tests/test_datasources.py Outdated Show resolved Hide resolved
nautobot/extras/datasources/git.py Outdated Show resolved Hide resolved
nautobot/extras/models/models.py Outdated Show resolved Hide resolved
nautobot/extras/models/models.py Show resolved Hide resolved
nautobot/extras/models/models.py Outdated Show resolved Hide resolved
Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

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

Nice work!

nautobot/extras/datasources/git.py Show resolved Hide resolved
nautobot/extras/datasources/git.py Outdated Show resolved Hide resolved
nautobot/extras/datasources/git.py Outdated Show resolved Hide resolved
nautobot/extras/datasources/git.py Outdated Show resolved Hide resolved
nautobot/extras/datasources/git.py Outdated Show resolved Hide resolved
changes/4702.added Outdated Show resolved Hide resolved
@glennmatthews glennmatthews merged commit ce92919 into nautobot:develop Jan 23, 2025
17 checks passed
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.

Graphql as a Git Data source provider
3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/nautobot/nautobot/pull/6752

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy