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

Fix: Swagger UI for indexer is a stub (#5051, #5228) #5160

Merged

Conversation

nadove-ucsc
Copy link
Contributor

@nadove-ucsc nadove-ucsc commented Apr 26, 2023

Connected issues: #5051 #5228

Checklist

Author

  • PR is a draft
  • Target branch is develop
  • Name of PR branch matches issues/<GitHub handle of author>/<issue#>-<slug>
  • PR title references all connected issues
  • PR title matches1 that of a connected issue or comment in PR explains why they're different
  • For each connected issue, there is at least one commit whose title references that issue
  • PR is connected to all connected issues via ZenHub
  • PR description links to connected issues
  • Added partial label to PR or this PR completely resolves all connected issues

1 when the issue title describes a problem, the corresponding PR
title is Fix: followed by the issue title

Author (reindex, API changes)

  • Added r tag to commit title or this PR does not require reindexing
  • Added reindex label to PR or this PR does not require reindexing
  • Added a (compatible changes) or A (incompatible ones) tag to commit title or this PR does not modify the Azul service API
  • Added API label to connected issues or this PR does not modify the Azul service API

Author (chains)

  • This PR is blocked by previous PR in the chain or this PR is not chained to another PR
  • Added base label to the blocking PR or this PR is not chained to another PR
  • Added chained label to this PR or this PR is not chained to another PR

Author (upgrading)

  • Documented upgrading of deployments in UPGRADING.rst or this PR does not require upgrading
  • Added u tag to commit title or this PR does not require upgrading
  • Added upgrade label to PR or this PR does not require upgrading

Author (operator tasks)

  • Added checklist items for additional operator tasks or this PR does not require additional tasks

Author (hotfixes)

  • Added F tag to main commit title or this PR does not include permanent fix for a temporary hotfix
  • Reverted the temporary hotfixes for any connected issues or the prod branch has no temporary hotfixes for any connected issues

Author (before every review)

  • Rebased PR branch on develop, squashed old fixups
  • Ran make requirements_update or this PR does not touch requirements*.txt, common.mk, Makefile and Dockerfile
  • Added R tag to commit title or this PR does not touch requirements*.txt
  • Added reqs label to PR or this PR does not touch requirements*.txt
  • make integration_test passes in personal deployment or this PR does not touch functionality that could break the IT

Peer reviewer (after requesting changes)

Uncheck the Author (before every review) checklists.

Peer reviewer (after approval)

  • PR is not a draft
  • Ticket is in Review requested column
  • Requested review from primary reviewer
  • Assigned PR to primary reviewer

Primary reviewer (after requesting changes)

Uncheck the before every review checklists. Update the N reviews label.

Primary reviewer (after approval)

  • Actually approved the PR
  • Labeled connected issues as demo or no demo
  • Commented on connected issues about demo expectations or all connected issues are labeled no demo
  • Decided if PR can be labeled no sandbox
  • PR title is appropriate as title of merge commit
  • N reviews label is accurate
  • Moved ticket to Approved column
  • Assigned PR to current operator

Operator (before pushing merge the commit)

  • Checked reindex label and r commit title tag
  • Checked that demo expectations are clear or all connected issues are labeled no demo
  • Squashed PR branch and rebased onto develop
  • Sanity-checked history
  • Pushed PR branch to GitHub
  • Pushed PR branch to GitLab dev and added sandbox label or PR is labeled no sandbox
  • Pushed PR branch to GitLab anvildev or PR is labeled no sandbox
  • Build passes in sandbox deployment or PR is labeled no sandbox
  • Build passes in anvilbox deployment or PR is labeled no sandbox
  • Reviewed build logs for anomalies in sandbox deployment or PR is labeled no sandbox
  • Reviewed build logs for anomalies in anvilbox deployment or PR is labeled no sandbox
  • Deleted unreferenced indices in sandbox or this PR does not remove catalogs or otherwise causes unreferenced indices
  • Deleted unreferenced indices in anvilbox or this PR does not remove catalogs or otherwise causes unreferenced indices
  • Started reindex in sandbox or this PR does not require reindexing sandbox
  • Started reindex in anvilbox or this PR does not require reindexing sandbox
  • Checked for failures in sandbox or this PR does not require reindexing sandbox
  • Checked for failures in anvilbox or this PR does not require reindexing sandbox
  • Added PR reference to merge commit title
  • Collected commit title tags in merge commit title
  • Moved connected issues to Merged column in ZenHub
  • Pushed merge commit to GitHub

Operator (after pushing the merge commit)

  • Shortened the PR chain or this PR is not labeled base
  • Pushed merge commit to GitLab dev or PR is labeled no sandbox
  • Pushed merge commit to GitLab anvildev or PR is labeled no sandbox
  • Build passes on GitLab dev1
  • Reviewed build logs for anomalies on GitLab dev1
  • Build passes on GitLab anvildev1
  • Reviewed build logs for anomalies on GitLab anvildev1
  • Deleted PR branch from GitHub
  • Deleted PR branch from GitLab dev
  • Deleted PR branch from GitLab anvildev

1 When pushing the merge commit is skipped due to the PR being
labelled no sandbox, the next build triggered by a PR whose merge commit is
pushed determines this checklist item.

Operator (reindex)

  • Deleted unreferenced indices in dev or this PR does not remove catalogs or otherwise causes unreferenced indices
  • Deleted unreferenced indices in anvildev or this PR does not remove catalogs or otherwise causes unreferenced indices
  • Started reindex in dev or this PR does not require reindexing
  • Started reindex in anvildev or this PR does not require reindexing
  • Checked for and triaged indexing failures in dev or this PR does not require reindexing
  • Checked for and triaged indexing failures in anvildev or this PR does not require reindexing
  • Emptied fail queues in dev deployment or this PR does not require reindexing
  • Emptied fail queues in anvildev deployment or this PR does not require reindexing

Operator

  • Unassigned PR

Shorthand for review comments

  • L line is too long
  • W line wrapping is wrong
  • Q bad quotes
  • F other formatting problem

@github-actions github-actions bot added the orange [process] Done by the Azul team label Apr 26, 2023
@coveralls
Copy link

coveralls commented Apr 26, 2023

Coverage Status

Coverage: 84.402% (+0.03%) from 84.373% when pulling 874f464 on issues/nadove-ucsc/5051-swagger-ui-indexer-stub into 75a01ee on develop.

@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #5160 (34f3f65) into develop (75a01ee) will increase coverage by 0.13%.
The diff coverage is 100.00%.

❗ Current head 34f3f65 differs from pull request most recent head 874f464. Consider uploading reports for the commit 874f464 to get more accurate results

@@             Coverage Diff             @@
##           develop    #5160      +/-   ##
===========================================
+ Coverage    84.35%   84.49%   +0.13%     
===========================================
  Files          148      150       +2     
  Lines        18278    18449     +171     
===========================================
+ Hits         15418    15588     +170     
- Misses        2860     2861       +1     
Impacted Files Coverage Δ
lambdas/indexer/app.py 95.11% <100.00%> (-0.04%) ⬇️
src/azul/openapi/params.py 100.00% <100.00%> (ø)
src/azul/openapi/spec.py 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

@nadove-ucsc nadove-ucsc force-pushed the issues/nadove-ucsc/5051-swagger-ui-indexer-stub branch 2 times, most recently from f37ad27 to 8e2f848 Compare April 26, 2023 00:56
@nadove-ucsc
Copy link
Contributor Author

New spec is visible here

achave11-ucsc
achave11-ucsc previously approved these changes Apr 27, 2023
Copy link
Member

@achave11-ucsc achave11-ucsc left a comment

Choose a reason for hiding this comment

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

Nicely done!

@achave11-ucsc achave11-ucsc removed their assignment Apr 27, 2023
@nadove-ucsc nadove-ucsc force-pushed the issues/nadove-ucsc/5051-swagger-ui-indexer-stub branch from 74117a4 to b8ff22d Compare April 27, 2023 01:27
achave11-ucsc
achave11-ucsc previously approved these changes Apr 27, 2023
@achave11-ucsc achave11-ucsc marked this pull request as ready for review April 27, 2023 02:32


@attr.s(auto_attribs=True, frozen=True, kw_only=True)
class AuxSpec:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class AuxSpec:
class CommonEndpointSpecs:

return {
'method_spec': {

'summary': 'Describe current version of the Azul service',
Copy link
Member

Choose a reason for hiding this comment

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

or indexer

return {
'method_spec': {

'summary': 'Return OpenAPI specifications for this service',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'summary': 'Return OpenAPI specifications for this service',
'summary': 'Return OpenAPI specifications for this REST API',

Please check if there are more of these cases, where documentation isn't general enough or needs to be parameterized.

'tags': ['Auxiliary']
}

def full_health(self) -> JSON:
Copy link
Member

Choose a reason for hiding this comment

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

Many of these can be properties.

def basic_health():
return app.health_controller.basic_health()


@app.route('/health/cached', methods=['GET'], cors=True)
@app.route('/health/cached', methods=['GET'], cors=True, **aux_spec.cached_health())
Copy link
Member

Choose a reason for hiding this comment

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

L here and in several other places.

@@ -103,14 +110,17 @@ def static_resource(file):
return app.swagger_resource(file)


@app.route('/openapi', methods=['GET'], cors=True)
aux_spec = AuxSpec(app_name='indexer')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
aux_spec = AuxSpec(app_name='indexer')
common_specs = AuxSpec(app_name='indexer')

'description': 'Contents of the notification',
'required': True,
**json_content(schema.object(
match=schema.object(
Copy link
Member

Choose a reason for hiding this comment

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

I believe this conflicts with PR #5059 for #5000.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct. I'll avoid requesting concurrent reviews for these PRs to avoid conflicts.

@@ -151,7 +161,43 @@ def update_health_cache(_event: chalice.app.CloudWatchEvent):
app.health_controller.update_cache()


@app.route('/{catalog}/{action}', methods=['POST'])
@app.route('/{catalog}/{action}', methods=['POST'], method_spec={
Copy link
Member

Choose a reason for hiding this comment

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

This should mention the HMAC header and briefly explain how to compute it.

@hannes-ucsc hannes-ucsc removed their assignment Apr 27, 2023
@hannes-ucsc hannes-ucsc added the 1 review [process] Lead requested changes once label Apr 27, 2023
@nadove-ucsc nadove-ucsc force-pushed the issues/nadove-ucsc/5051-swagger-ui-indexer-stub branch from b8ff22d to 0a01a03 Compare May 2, 2023 03:46
@nadove-ucsc nadove-ucsc changed the base branch from develop to issues/noah-aviel-dove/5000-index-supp-files-anvil May 2, 2023 03:46
@nadove-ucsc nadove-ucsc added the chained [process] PR needs to based of develop before merging label May 2, 2023
@nadove-ucsc nadove-ucsc force-pushed the issues/nadove-ucsc/5051-swagger-ui-indexer-stub branch from 0a01a03 to d94c936 Compare May 2, 2023 04:05
@hannes-ucsc hannes-ucsc removed their assignment May 23, 2023
@achave11-ucsc achave11-ucsc force-pushed the issues/nadove-ucsc/5051-swagger-ui-indexer-stub branch from 3db488f to ffabb56 Compare May 23, 2023 23:08
@achave11-ucsc achave11-ucsc added the sandbox [process] Resolution is being verified in sandbox deployment label May 23, 2023
@achave11-ucsc achave11-ucsc removed their assignment May 23, 2023
@achave11-ucsc achave11-ucsc removed the sandbox [process] Resolution is being verified in sandbox deployment label May 23, 2023
@achave11-ucsc
Copy link
Member

PR failed sandbox and anvilbox pipelines.

@nadove-ucsc
Copy link
Contributor Author

Due to my changes, generate_openapi_document script patches either the service or the indexer endpoint depending on which module (service or indexer) it is targeting. However, AzulChaliceApp always uses the service endpoint when constructing base_url, so when the script patches the indexer endpoint, it allows the unpatched service endpoint to slip through. I believe the solution is to modify the base_url property so that ServiceApp and IndexerApp can each use their correct respective endpoint.

@nadove-ucsc nadove-ucsc force-pushed the issues/nadove-ucsc/5051-swagger-ui-indexer-stub branch 3 times, most recently from d55cf96 to 59b9011 Compare May 25, 2023 06:44
@nadove-ucsc nadove-ucsc force-pushed the issues/nadove-ucsc/5051-swagger-ui-indexer-stub branch from 59b9011 to 52f1a38 Compare May 26, 2023 02:38
@nadove-ucsc nadove-ucsc requested a review from hannes-ucsc May 26, 2023 03:05
@hannes-ucsc hannes-ucsc added 4+ reviews [process] Lead requested changes four times or more and removed 3 reviews [process] Lead requested changes thrice labels May 26, 2023
@achave11-ucsc achave11-ucsc force-pushed the issues/nadove-ucsc/5051-swagger-ui-indexer-stub branch from 52f1a38 to 874f464 Compare May 26, 2023 17:25
@achave11-ucsc achave11-ucsc added the sandbox [process] Resolution is being verified in sandbox deployment label May 26, 2023
@achave11-ucsc achave11-ucsc merged commit 61f6e0d into develop May 26, 2023
@achave11-ucsc achave11-ucsc deleted the issues/nadove-ucsc/5051-swagger-ui-indexer-stub branch May 27, 2023 00:38
@achave11-ucsc achave11-ucsc removed their assignment May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4+ reviews [process] Lead requested changes four times or more orange [process] Done by the Azul team sandbox [process] Resolution is being verified in sandbox deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants