Skip to content

Refactor and consolidate CSV network importers #579

Description

@mrchrisadams

We currently have two kinds of CSV importers in our codebase for importing IP addresses for a provider - one was a external contribution a few years back.

The two importers

There is the new style CSVImporter importer that follows the ImporterProtocol, so the importing logic is shared with the other ones that import the protocol.

This is in apps.greenchcheck.importers.importers_csv.CSVImporter, and is used in our admin UI.

There is also the older ImporterCSV class that was created before, and contains its own network importer logic, and only supports IP4 imports.

This is in apps.greencheck.bulk_importers.ImporterCSV

This is used in our management command, import_from_csv.

What I think we should do

This is a bit confusing, and really we should only have one.

Really, we ought to be only using the newer version, and removing the ImporterCSV, so all our CSV importing uses the same code path, and we have consistent signatures for creating instances of the class.

If there are any helpful exceptions to raise and display to end users, this would be the time to make those changes too, probably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededimportersops / infraNot user facing, but aimed making the application more operable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions