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

Make export/import process simpler for CLI #101

Open
gerrod3 opened this issue Jan 28, 2021 · 8 comments
Open

Make export/import process simpler for CLI #101

gerrod3 opened this issue Jan 28, 2021 · 8 comments
Assignees
Labels
feature request New feature request (template-set) prio-list driving Pulp's Kanban searches

Comments

@gerrod3
Copy link
Contributor

gerrod3 commented Jan 28, 2021

Users should be able to export the repositories they want in one command and shouldn't need to know the difference between 'export' and 'exporter'. I propose we remove the 'export' commands and re-brand them under 'exporter'. Exporter should get two new subcommands: 'export' and 'history'.

The 'history' command would get three subcommands from the original 'export' command: 'list', 'show', and 'delete'. Export objects are basically history records of previous exports and thus would fit nicely under this context. If a user doesn't specify a subcommand when using 'history' the default behaviour should be 'list' so they can see all the export objects aka the history.

The new 'export' sub command will take over the original export's 'run' command. This command will have extra functionality to allow for the creation of an exporter so the whole process can be done in one command.

Examples:

with Exporter named foo:

$pulp exporter pulp export --name foo [export options]
Started export task. Task href: ...

with no Exporter:

$pulp exporter pulp export --base-path tmp/exports/ --repository file_repo file --repository rpm_repo rpm [export options]
Would you like to save these configurations? [y/n]
$y
Please give a name to the exporter config options:
$bar
Config options saved in exporter object bar
Started export task. Task href: ...

If the user would specify 'no' on saving the config options, the command would give the created exporter a default name. The other commands under 'exporter' should have their help descriptions updated to reflect the exporter's role as a config object.

A similar process should be applied to the 'importer' commands so that the experience is consistent.

@mdellweg
Copy link
Member

I like the fact that the "exporter" can "export" and the result is an "export". This is like the "repository" can "sync" and the result is a "repository version".

@gerrod3
Copy link
Contributor Author

gerrod3 commented Jan 28, 2021

So is that a +1 or -1 for the design? Using your example the repository version commands are under the repository command and I'm proposing we do a similar thing and place the export commands under the exporter ones.

I like the fact that the "exporter" can "export" and the result is an "export".

I don't like this. I think the wording is confusing when you use "export" to mean a verb and noun which is why I want to change the wording within the commands.

@daviddavis
Copy link
Contributor

FWIW, I've always used the noun when working on the API due to the RESTful architecture (ie users create/read/update/delete exports). I have no objection to using the verb in the CLI but I think hiding exports will be difficult (and perhaps even unwise).

@daviddavis daviddavis added the feature request New feature request (template-set) label Jan 28, 2021
@mdellweg
Copy link
Member

OK what about the "exporter" has a command "run" and the result is an "export"?
Whether we want to list and view and delete exports as a subcommand group of exporter is probably another question.

And yes, that was a +1...

@dkliban
Copy link
Member

dkliban commented Nov 21, 2022

How about the following commands?

Create an exporter:

pulp exporter pulp create --name foo

Create an export:

pulp exporter pulp run --name foo

List exports:

pulp exporter pulp exports list --name foo

Delete an export:

pulp exporter pulp exports destroy --href <export href>

@mdellweg
Copy link
Member

I still kind of dislike the pulp exporter pulp part, but i think i need to live with it for the time being. The rest looks good. Would the importer commands look similar?

@dkliban
Copy link
Member

dkliban commented Nov 22, 2022

Yes, the importer commands would follow the same pattern.

@ggainey
Copy link
Contributor

ggainey commented Jan 24, 2023

We have a new export/er type, FilesystemExporter/FilesystemExport. I tried to capture the above discussion, and roll in the implications of "we have another type", into a doc here : https://hackmd.io/@ggainey/import-export-cli

I'm proposing to close #619 and address it along with changing/cleaning up the CLI interaction w/ import/export under this issue.

Feel free to comment here or on the linked doc with suggestions.

@ggainey ggainey self-assigned this Jan 25, 2023
@pulpbot pulpbot moved this from Free to take to In Progress in RH Pulp Kanban board Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request (template-set) prio-list driving Pulp's Kanban searches
Projects
No open projects
Status: In Progress
Development

No branches or pull requests

5 participants