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

Swagger: fix inconsistencies (try #2) #5231

Merged
merged 1 commit into from
Feb 18, 2020

Conversation

edsantiago
Copy link
Member

As I've mentioned once or twice, hand-maintained swagger docs
are evil. This commit attempts to fix:

  • Inconsistent methods (swagger says POST but code signature
    says GET)

  • Inconsistent capitalization

  • Typos ("Mounter", "pood")

  • Completely wrong paths (/inspect vs /json)

  • Missing .Method() registrations

  • Missing /libpod in some /volumes paths

This is two hours' work, even with a script I have that
tries to cross-check everything.

Swagger docs should not be human-maintained.

Signed-off-by: Ed Santiago [email protected]

@mheon
Copy link
Member

mheon commented Feb 17, 2020

/approve
LGTM

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, mheon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 17, 2020
@mheon
Copy link
Member

mheon commented Feb 17, 2020

[+0026s] pkg/api/server/register_version.go:9:79: undeclared name: http (typecheck)

Looks like that file doesn't have a net/http import at the top

@edsantiago
Copy link
Member Author

Yep, just fixed & pushed that

@edsantiago edsantiago force-pushed the swagger_fixes branch 2 times, most recently from 3105972 to 70cf0ba Compare February 17, 2020 14:46
@rhatdan
Copy link
Member

rhatdan commented Feb 17, 2020

LGTM

@TomSweeneyRedHat
Copy link
Member

Nice touch ups throughout @edsantiago
LGTM assuming happy tests.

@rhatdan
Copy link
Member

rhatdan commented Feb 17, 2020

/lgtm
/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 17, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 17, 2020
@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #5093) made this pull request unmergeable. Please resolve the merge conflicts.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 17, 2020
@openshift-ci-robot openshift-ci-robot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 17, 2020
@@ -1023,7 +1023,7 @@ func (s *APIServer) RegisterContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/wait"), APIHandler(s.Context, libpod.WaitContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/exists libpod containerExists
// swagger:operation GET /libpod/containers/{name}/exists libpod containerExists
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a comment applying to /exists, not /wait ... can you re-check?

@baude
Copy link
Member

baude commented Feb 17, 2020

lgtm to except where noted.

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #5158) made this pull request unmergeable. Please resolve the merge conflicts.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2020
@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #5235) made this pull request unmergeable. Please resolve the merge conflicts.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2020
As I've mentioned once or twice, hand-maintained swagger docs
are evil. This commit attempts to fix:

  * Inconsistent methods (swagger says POST but code signature
    says GET)

  * Inconsistent capitalization

  * Typos ("Mounter", "pood")

  * Completely wrong paths (/inspect vs /json)

  * Missing .Method() registrations

  * Missing /libpod in some /volumes paths

  * Incorrect method declaration: /libpod/containers/.../kill
    was correct (POST) in swagger but wrong in the code itself
    (http.MethodGet). Correct the latter to MethodPost

This is two hours' work, even with a script I have that
tries to cross-check everything.

Swagger docs should not be human-maintained.

Signed-off-by: Ed Santiago <[email protected]>
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2020
@edsantiago
Copy link
Member Author

Two conflicty rebases today so far; any chance of an LGTM for this? Tests are green. TIA.

@mheon
Copy link
Member

mheon commented Feb 18, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 18, 2020
@mheon
Copy link
Member

mheon commented Feb 18, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 18, 2020
@openshift-merge-robot openshift-merge-robot merged commit 931eb1b into containers:master Feb 18, 2020
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants