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

Fix extras FKs and related names #3262

Merged
merged 53 commits into from
Feb 27, 2023
Merged

Fix extras FKs and related names #3262

merged 53 commits into from
Feb 27, 2023

Conversation

timizuoebideri1
Copy link
Contributor

Closes: #3067

What's Changed

  • Fix all related names

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 Plugin Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

@timizuoebideri1 timizuoebideri1 changed the base branch from develop to next February 8, 2023 20:41
nautobot/core/testing/api.py Outdated Show resolved Hide resolved
nautobot/extras/models/models.py Outdated Show resolved Hide resolved
@timizuoebideri1 timizuoebideri1 marked this pull request as ready for review February 9, 2023 20:10
Copy link
Contributor

@jathanism jathanism left a comment

Choose a reason for hiding this comment

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

This is beautiful and I love it. I only have a simple question and one comment about a FIXME. But this is good to go IMO.

nautobot/core/testing/api.py Show resolved Hide resolved
nautobot/extras/models/tags.py Outdated Show resolved Hide resolved
nautobot/docs/installation/upgrading-from-nautobot-v1.md Outdated Show resolved Hide resolved
nautobot/docs/installation/upgrading-from-nautobot-v1.md Outdated Show resolved Hide resolved
nautobot/docs/installation/upgrading-from-nautobot-v1.md Outdated Show resolved Hide resolved
nautobot/extras/models/jobs.py Outdated Show resolved Hide resolved
nautobot/extras/migrations/0063_rename_model_fields.py Outdated Show resolved Hide resolved
# Conflicts:
#	nautobot/docs/installation/upgrading-from-nautobot-v1.md
#	nautobot/extras/api/serializers.py
#	nautobot/extras/jobs.py
#	nautobot/extras/models/jobs.py
#	nautobot/extras/tests/test_api.py
#	nautobot/extras/tests/test_customfields.py
#	nautobot/extras/tests/test_views.py
#	nautobot/extras/views.py
# Conflicts:
#	nautobot/extras/api/serializers.py
#	nautobot/extras/tests/test_customfields.py
nautobot/extras/api/views.py Outdated Show resolved Hide resolved
nautobot/extras/jobs.py Outdated Show resolved Hide resolved
nautobot/extras/tests/test_api.py Outdated Show resolved Hide resolved
nautobot/extras/utils.py Outdated Show resolved Hide resolved
timizuoebideri1 and others added 6 commits February 24, 2023 01:43
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
# Conflicts:
#	nautobot/docs/installation/upgrading-from-nautobot-v1.md
#	nautobot/extras/filters/__init__.py
#	nautobot/extras/tests/test_filters.py
@glennmatthews
Copy link
Contributor

  File "/home/runner/work/nautobot/nautobot/nautobot/extras/tests/test_filters.py", line 442, in setUpTestData
    CustomFieldChoice.objects.create(field=fields[num], value=f"Custom Field Choice {num}")

Probably needs to be changed to custom_field=fields[num].

nautobot/docs/installation/upgrading-from-nautobot-v1.md Outdated Show resolved Hide resolved
nautobot/docs/installation/upgrading-from-nautobot-v1.md Outdated Show resolved Hide resolved
nautobot/docs/installation/upgrading-from-nautobot-v1.md Outdated Show resolved Hide resolved
@@ -918,7 +918,7 @@ def validate(self, data):
class JobInputSerializer(serializers.Serializer):
data = serializers.JSONField(required=False, default=dict)
commit = serializers.BooleanField(required=False, default=None)
schedule = NestedScheduledJobSerializer(required=False)
scheduled_job = NestedScheduledJobSerializer(required=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change probably needs to be documented somewhere in the upgrading guide (it's not a model serializer per se so it doesn't fit in the current tables, though).

This will also need to be updated in nautobot/docs/additional-features/job-scheduling-and-approvals.md and probably nautobot/docs/additional-features/jobs.md as well.

It seems like a similar change to the _schedule fields in JobMultiPartInputSerializer should also be made and reflected in nautobot.extras.api.views._run_job?

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI I'm going to revert this particular change and the associated changes to _run_job and the tests in #3368. This is because this isn't actually a nested ScheduledJob object reference, but rather just a set of parameters to the run_job function that we represent in a fashion "similar to" a ScheduledJob.

nautobot/extras/datasources/git.py Outdated Show resolved Hide resolved
Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
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.

One remaining comment, otherwise good to go. :-)

nautobot/extras/datasources/git.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.

If tests pass, :shipit:!

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.

FK, Related Name Cleanup: extras App
3 participants