Skip to content

Conversation

@steveej
Copy link
Contributor

@steveej steveej commented Jan 10, 2019

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 10, 2019
@steveej steveej force-pushed the openapi-endpoint branch 2 times, most recently from c293c17 to d0c6e17 Compare January 10, 2019 19:00
@steveej steveej changed the title Rework path prefix handling and make an OpenAPI spec available [WIP] Rework path prefix handling and make an OpenAPI spec available Jan 10, 2019
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 10, 2019
@steveej steveej force-pushed the openapi-endpoint branch 3 times, most recently from c3f4232 to 65125cf Compare January 10, 2019 20:11
@steveej steveej changed the title [WIP] Rework path prefix handling and make an OpenAPI spec available Rework path prefix handling and make an OpenAPI spec available Jan 10, 2019
@steveej steveej changed the title Rework path prefix handling and make an OpenAPI spec available policy-engine: add OpenAPI spec and endpoint Jan 10, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 10, 2019
@steveej
Copy link
Contributor Author

steveej commented Jan 10, 2019

The OpenAPI spec is still missing the input arguments on the graph endpoint. Therefore putting this on hold.
/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 Jan 10, 2019
@steveej steveej force-pushed the openapi-endpoint branch 4 times, most recently from 19a04d0 to 04835bb Compare January 11, 2019 13:08
@steveej
Copy link
Contributor Author

steveej commented Jan 11, 2019

@lucab
All comments are addressed and the alternative way of mangling the paths sits in a commit on top. PTAL and let me know if there's anything left to fix before squashing.

@steveej
Copy link
Contributor Author

steveej commented Jan 11, 2019

@lucab

All the comments addressed in best-effort manner.

It could likely be optimized further but IMO that's not worth it for this code-path, as we're talking about the OpenAPI endpoint which I expect to have really low traffic.

@steveej
Copy link
Contributor Author

steveej commented Jan 11, 2019

/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 Jan 11, 2019
@lucab
Copy link
Contributor

lucab commented Jan 11, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 11, 2019
@steveej
Copy link
Contributor Author

steveej commented Jan 11, 2019

Looks like there were changes on quay.io causing the following issues with the manifest:

test net::quay_io::fetch_release_public_with_no_release_metadata_must_not_error ... FAILED
test net::quay_io::fetch_release_public_with_first_empty_tag_must_succeed ... FAILED
test net::quay_io::fetch_release_public_without_credentials_must_fail ... ok

failures:

---- net::quay_io::fetch_release_public_with_no_release_metadata_must_not_error stdout ----
thread 'net::quay_io::fetch_release_public_with_no_release_metadata_must_not_error' panicked at 'should not error on emtpy repo: ErrorMessage { msg: "unknown manifest_kind \'None\'" }', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- net::quay_io::fetch_release_public_with_first_empty_tag_must_succeed stdout ----
thread 'net::quay_io::fetch_release_public_with_first_empty_tag_must_succeed' panicked at 'fetch_releases failed: : ErrorMessage { msg: "unknown manifest_kind \'None\'" }', libcore/result.rs:1009:5


failures:
    net::quay_io::fetch_release_public_with_first_empty_tag_must_succeed
    net::quay_io::fetch_release_public_with_no_release_metadata_must_not_error

test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out

There's currently an incident on quay.io but I've yet to figure out if we're facing a backwards-compatibility issue or a temporary issue.

@steveej
Copy link
Contributor Author

steveej commented Jan 12, 2019

I tracked down the issue to a permanent quay.io change. I proposed a band-aid for dkregistry-rs with room for improvement.

This adds a new `/v1/openapi` route to the policy-engine, serving an
OpenAPI v3 specification which describes the service.

The specification is manually written as it seems overkill to have it
autogenerated as adding more endpoints to the policy-engine is not
anticipated.
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2019
@steveej steveej requested a review from lucab January 12, 2019 01:45
@steveej
Copy link
Contributor Author

steveej commented Jan 12, 2019

Rebased on master after #29 was merged which fixed the recent issue with quay.io.

@crawford or @lucab PTAL

@steveej
Copy link
Contributor Author

steveej commented Jan 12, 2019

[test]

@crawford
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: crawford, lucab, steveeJ

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [crawford,lucab,steveeJ]

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

@openshift-merge-robot openshift-merge-robot merged commit 908b72d into openshift:master Jan 12, 2019
@steveej steveej deleted the openapi-endpoint branch January 12, 2019 02:39
wking referenced this pull request in wking/cincinnati Nov 7, 2020
The metadata value is not a string, it is an object whose
sub-properties have string values:

  $ curl -sH Accept:application/json 'https://api.openshift.com/api/upgrades_info/v1/graph?channel=stable-4.6' | jq -S '.nodes[] | select(.version == "4.6.1")'
  {
    "metadata": {
      "description": "",
      "io.openshift.upgrades.graph.previous.remove_regex": "4\\.5\\.1[45]",
      "io.openshift.upgrades.graph.release.channels": "candidate-4.6,fast-4.6,stable-4.6",
      "io.openshift.upgrades.graph.release.manifestref": "sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9",
      "url": "https://access.redhat.com/errata/RHBA-2020:4196"
    },
    "payload": "quay.io/openshift-release-dev/ocp-release@sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9",
    "version": "4.6.1"
  }

In OpenAPI, that is represented by an additionalProperties object
declaring the type of the child values [1,2].

The previous string claim was from the original OpenAPI declaration in
d717acc (policy-engine: add OpenAPI content and route, 2019-01-10, #40).

[1]: https://github.com/OAI/OpenAPI-Specification/blame/3.0.2/versions/3.0.2.md#L2404-L2421
[2]: https://github.com/OAI/OpenAPI-Specification/blame/3.0.2/versions/3.0.2.md#L2305
LalatenduMohanty referenced this pull request in LalatenduMohanty/cincinnati Jan 20, 2021
The metadata value is not a string, it is an object whose
sub-properties have string values:

  $ curl -sH Accept:application/json 'https://api.openshift.com/api/upgrades_info/v1/graph?channel=stable-4.6' | jq -S '.nodes[] | select(.version == "4.6.1")'
  {
    "metadata": {
      "description": "",
      "io.openshift.upgrades.graph.previous.remove_regex": "4\\.5\\.1[45]",
      "io.openshift.upgrades.graph.release.channels": "candidate-4.6,fast-4.6,stable-4.6",
      "io.openshift.upgrades.graph.release.manifestref": "sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9",
      "url": "https://access.redhat.com/errata/RHBA-2020:4196"
    },
    "payload": "quay.io/openshift-release-dev/ocp-release@sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9",
    "version": "4.6.1"
  }

In OpenAPI, that is represented by an additionalProperties object
declaring the type of the child values [1,2].

The previous string claim was from the original OpenAPI declaration in
d717acc (policy-engine: add OpenAPI content and route, 2019-01-10, #40).

[1]: https://github.com/OAI/OpenAPI-Specification/blame/3.0.2/versions/3.0.2.md#L2404-L2421
[2]: https://github.com/OAI/OpenAPI-Specification/blame/3.0.2/versions/3.0.2.md#L2305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants