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

Activedocs CRUD operations #145

Merged
merged 4 commits into from
May 22, 2019
Merged

Activedocs CRUD operations #145

merged 4 commits into from
May 22, 2019

Conversation

miguelsorianod
Copy link
Contributor

@miguelsorianod miguelsorianod commented May 21, 2019

Fixes #125

@miguelsorianod miguelsorianod changed the title Activedocs CRUD operations [WIP] Activedocs CRUD operations May 21, 2019
@miguelsorianod
Copy link
Contributor Author

Added ActiveDocs Entity

@miguelsorianod miguelsorianod force-pushed the activedocs-subcommand branch 3 times, most recently from 9aec7da to 421a261 Compare May 21, 2019 15:35
@miguelsorianod
Copy link
Contributor Author

I've updated the PR to add:

  • Implementation of create, delete and list
  • Unit tests
  • Integration tests

@miguelsorianod
Copy link
Contributor Author

The create command usage is:

USAGE
    3scale activedocs activedocs create <remote> <activedocs-name> <spec>

For the moment I've not implemented the 'apply' command because I've not found a suitable format for the command:

  • If we make a positional parameter it will mean is mandatory. However, when performing the update part of the apply that is optional, so it shouldn't be mandatory
  • if we make an optional parameter, it will mean is optional. However, when performing the create part of the apply that is mandatory, so it shouldn't be mandatory

@eguzki
Copy link
Member

eguzki commented May 21, 2019

I think apply can be useful. For instance to publish or hide it. And OAS content should be optional. When executing apply command and the toolbox has to create because it does not exist, then optional parameter should exist otherwise, command should fail.

@miguelsorianod miguelsorianod force-pushed the activedocs-subcommand branch 2 times, most recently from 77dd599 to a5449a8 Compare May 22, 2019 13:08
@miguelsorianod miguelsorianod changed the title [WIP] Activedocs CRUD operations Activedocs CRUD operations May 22, 2019
@miguelsorianod
Copy link
Contributor Author

Implemented apply and added integration tests.

I think this should be finished. @eguzki could you review it?

Thank you.

docs/activedocs.md Outdated Show resolved Hide resolved
docs/activedocs.md Show resolved Hide resolved
docs/activedocs.md Outdated Show resolved Hide resolved
docs/activedocs.md Outdated Show resolved Hide resolved
Toolbox will figure it out.
* Update to `published=true` activedocs by `--publish` flag.
* Update to `published=false` method by `--hide` flag.
* *The `--openapi-spec` flag is mandatory when the specified activedocs
Copy link
Member

Choose a reason for hiding this comment

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

it is not a flag, but optional parameter

docs/activedocs.md Outdated Show resolved Hide resolved
DESCRIPTION
List all defined ActiveDocs

OPTIONS FOR ACTIVEDOCS
Copy link
Member

Choose a reason for hiding this comment

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

It could be useful --service to list only activedocs for a certain service. But let's users demand first

include_context :random_name
include_context :resources
subject { ThreeScaleToolbox::CLI.run(command_line_str.split) }
let(:remote) do
Copy link
Member

Choose a reason for hiding this comment

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

let(:remote) { client_url } should work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@miguelsorianod
Copy link
Contributor Author

Applied requested changes

@miguelsorianod miguelsorianod merged commit 6f8cc14 into master May 22, 2019
@miguelsorianod miguelsorianod deleted the activedocs-subcommand branch May 22, 2019 16:57
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.

command to create/update/delete Activedocs
2 participants