#5 commands structure
Closed 5 years ago Opened 5 years ago by lenkaseg.

I took the functions from libpagure and tried to fit them into cranc commands.
I would need feedback on this :)

https://pastebin.com/P2EftNZM

With three slashes /// are marked places, where I'm not sure.


I have couple of suggestions

1) let's move this document into the cranc repo. We can create docs/ subfolder and put proposals and design documents there the same way we add code: create PR, discuss in comments and then merge.

2) the REST API's is usually defined by resource and action.

Thus the subcommand in the cli is also mapped to this structure,

it might be command <action> <resource> or command <resource> <action> but it should be consistent.

And to highlight this structure and the difference between usually resources are denoted by nouns and actions - by verbs.

For example, kubectl tool uses word describe for the info of the resource.

kubectl describe node
kubectl describe service

git uses show also a verb to denote action applied to a noun denoting the object.

So I suggest we keep this agreement and don't use words like info yet.

Once we implement the core structure(main resource/action combinations) we can add some shortcuts and additional exceptional commands for most common cases. But let's start from the standardized commands first.

3) there is a problem with comments in the proposal as comment might "belong" to issue and to pull-request

I suggest that we promote it to be a high-level resource of it's own, and issue-id or pr-id to be a parameter. Smth like

cranc comment create --issue-id 123 --message "text"
cranc comment create --pr-id 456 --message "text"

This way we will have unified interface to operate on comments for both issues and prs.

Metadata Update from @lenkaseg:
- Issue status updated to: Closed (was: Open)

5 years ago

I'm sorry that I don't understand the question you mentioned, so I can't give you some advice.
https://everythingreplica.com/product-category/replica-air-jordans/

Login to comment on this ticket.

Metadata