-
Notifications
You must be signed in to change notification settings - Fork 12
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
Finalize before release #146
Conversation
Summary is now printed including field mappings, the argument was not necessary.
- Added default value to `CustomField.label`.
Custom importer is not necessary anymore as the default integer importer truncates to integer and adds an importer issue.
Added better documentation in the code to be used in docs.
- Renamed `DiffSummary` to `DiffSyncSummary`. - Added `NautobotModelSummary`, `NautobotModelsStats` and `SourceModelStats`. - Moved issues to appropriate `NautobotModelSummary`. - Fixed printing stats based on changes. - Moved first and second pass to separate `SourceModel` methods. - Added more detailed stats calculating.
- Replaced hard-coded summaries in `test_import.py` with stats stored in summaries. - Added `--build-fixtures` argument to `invoke unittest`. - Fixed order of arguments in `self.assertX()`, to pass expected as the first argument. - Replaced dynamic test cases by defined, e.g. `test_3_6()`.
docs/dev/generator.md
Outdated
@@ -46,11 +46,14 @@ This is achieved through `adapter.configure_model(content_type: ContentTypeStr)` | |||
- `identifiers`: A list of fields identifiable as unique references in the source data. | |||
- `default_reference`: A `RecordData` dictionary of default values to reference this model. This is useful when the source data does not provide a reference that is required in Nautobot. | |||
- `extend_content_type`: Define this when a source model extends another source model to merge into a single Nautobot model. | |||
- `forward_references`: Define to forward references to another content type. This is useful when the source data references a content type that is not directly related to the Nautobot content type. For example, a source data references a `dcim.location` content type, but the Nautobot content type is `dcim.locationtype`. | |||
- `disable_related_reference`: Define, to disable storing references to this content type from other content types. This is useful for e.g. `ObjectChange` model. | |||
- `pre_import`: Define a callable to be executed before importing the source data. Can be used to alter or cache the source data before importing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to document:
- the args that the callable should accept
- the fact that it actually gets called twice during the import process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
nautobot = "^2.1.2" | ||
nautobot = "^2.0.6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? Why 2.0.6 in particular?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted the change made by dependabot. 2.0.6
was there before as it was the latest 2.0
version without security issues AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for the revert was that there are more changes to be made to support 2.1.2
, and I didn't want to mix it here. Should I update it in a separate PR, or leave it for the release? WDYT @glennmatthews
Closes: NaN
What's Changed
DiffSummary
toDiffSyncSummary
.NautobotModelSummary
,NautobotModelsStats
andSourceModelStats
.NautobotModelSummary
.SourceModel
methods and added more detailed stats calculating.units
field importer.u_height
field to use default importer.CustomField.label
field is empty.CustomField.label
.add_issue()
instead oflogger.warning()
source_field.set_nautobot_value()
instead ofsetattr()
.print_field_mappings
argument.test_import.py
with stats stored in summaries.--build-fixtures
argument toinvoke unittest
to build fixtures.self.assertX()
, to pass expected as the first argument.test_3_6()
.