Skip to content

Commit 279f5d0

Browse files
ttanniscsteezDanielsamshuster
authored
Merge master into feature/dashboard (#408)
* Allow users to create JIRA tickets associated with a table (#389) * add jira connection * update location of report data issue * add some reducers * add to global state * fix saga/redux flow for the jira issues view * use redux to handle reporting a data issue : * fix build * add jira sdk to requirements.txt, run fix lint errors for js * add comment * add data quality icon * move constants into a separate file * add tests for reducer and api * add some more tests * add more tests, do some refactoring * still working on tests * fix unit tests that don't quite work * fix lint errors * add some python tests * add more tests for jira client * remove unused imports * remove unused import * fix lint errors * for some reason i have to add types? * re-fix tests * update comments * address some comments * respond to comments * respond to comments * remove jira project id requirement: * add base class for issue tracking * add resource for issue endpoint * interim commit while refactoring into more generic * do some refactor, add a generic base client * refactor name from jira -> issue * fix spec per changes in the api * respond to some pr comments, add some error handling if no jira component is enabled * update per pr comments * remove utils for trucation, use ellipsis * add custom exception class, make sure it returns config error on api call * fix tests, refactor * fix lint * hopefully fix build * css fix * try removing jira from requirements * update tests, add total count of remaining results to api call * add comment, see if this fixes the build * update tests * update build steps * try making the extras a string like in examples * try to follow example exactly * try without quotes * update tests, make method to generate url * try string again * try using jira as a string * remove references to extras and just install the package * mock urllib * update tests * add tests for rending extra issues * update text on issues view * fix some lint issues * respond to pr comments * update per pr comments * respond to pr comments * fix some lint errors * respond to comments, some lint fixes * fix more lint * respond to pr comments * remove todo * add definition of api calls in fe * hide issue integration by default * fix tests, increase test coverage a bit * update some text * update per some product feedback * update test * Apply suggestions from code review Co-Authored-By: Tamika Tannis <[email protected]> * update per pr comments Co-authored-by: Tamika Tannis <[email protected]> * Add documenation for JIRA feature (#395) * Add documenation for JIRA feature * update link * update docs a little bit * add some more clarification * remove whitespace * Search Filtering Support (#384) * Initial Filter React/Redux Modifications (#357) * Update configs and SearchFilter UI * Remove search syntax logic in SearchBar; Add RegEx validatation for SearchBar * Add filter state and ducks logic * Update filter UI; Code cleanup * Some python lint fixes * Code cleanup * Update request utils * Filter UX Improvements (#361) * SearchFilter UX improvements * Filter url updates; Modify no search results message * Support loading filters from pasted url * InputFilter apply changes on 'enter' * Simplify reducer logic + lint cleanup * Some cleanup based on comments * Fix build * Mypy fix * Mypy fix * Filter UI Improvements: Part 1 (#370) * Change 'Type' to 'Source' * Prevent SearchPanel width increase when InputFilter is present * Re-lower coverage while in development * Managed input autocomplete (#375) * Disabled autocomplete for some email input fields * Removed the hard coded font size for autocomplete * Improve user search experience (#376) * Fix a merge issue * Allow no search term; Persist filters on SearchPage * Lint fix * Add a TODO * Add support for configurable filter section help text (#377) * Add support for configurable filter section help text * Support on CheckboxFilterSection as well * Add default filterCategories for tables * Add default helpText * Update search flow (some more) (#383) * Add a Breadcrumb on HomePage that makes filters discoverable * Switch to using explicit clearing of search term; Revert to requiring term for SearchBar submit * Allow for html in InforButton text * WIP: Comment out some tests * Fix an edge case * Cleanup python logic; Add comments; Add tests; * Fix indentation error; Cleanup python tests; * Cleanup HomePage, Breadcrumb, InfoButton; Update tests * Connect SearchBar to router for executing special SearchPage logic * Cleanup SearchBar; Add tests; * Cleanup SearchPage; Add tests * Cleanup SearchFiilter components; Add tests; Increase jest threshold; * Fix build; Update FilterSection types * Cleanup config; Add tests; Update jest threshold; * Add another config test * Fix SearchFilter; Add filter action types; Code cleanup; Add tests; * Cleanup search reducer; Update/add tests; * Cleanup ducks + utils; Add tests; * Update application config documentation * Update endpoint to match search library change * Remove unused lines * Update input styles * rename filterconfig 'value' reference to 'categoryId' * Add new filter logic to support TagInfo case * Lint fix * Restructure filter components to leverage mapStateToProps; Update FilterType enums * Lint fix * Fix bad merge * Apply suggestions from code review Co-authored-by: Daniel <[email protected]> * Adds some responsiveness to table detail layouts (#391) * Improve granularity of logging search actions (#396) * WIP: One approach * Second approach * Fix a few errors; Add tests * Fix test * Code cleanup * Change value for when user selects inline result & searchAll is needed * Update SearchType enum * Use snake_case for consistency in backend until we have some auto-convert * Filter Fixes (#399) * Reset pageIndex to 0 on filter update * Allow CheckBoxItem to handle checked = undefined * Create TableHeaderBullets component (#397) * Create TableHeaderBullets component * Fix mocks * Update search_table endpoint (#400) * Update search_table endpoint * Update test docstring * Add reporter for JIRA Issue Creation (#401) * WIP test commit * Update reporter object * Testing user id * Another test * Update fix * Update jira logic. Move default configs * Add issue link; Add reported by in description * Update logic to transform filters then call _search_table (#402) * Update logic to transform filters then call _search_table * Update tests * Upgrade redux & react-redux (#373) * Update search results to include badges and display them (#398) * update search to include badges * fix test * slight change * remove mapping for badges * fix lint * remove badge as a search term since its not in the filters in ui * update test, remove unneeded import * Caste input to lowercase like we do for SearchBar (#404) * Issue 147/multi doc pathways (#381) * This adds "programmatic descriptions" into the frontend. Known issues: - is_editable property not respecected Added NonEditable Section Now no longer need to sort in index page. Uses the display title for title now. Added currently untested code in the api for programmatic display programmatic descriptions no longer needs to be returned by metadata service for backwards compatibility Tests added for the programmatic display component Caught a bug where display_title was not being set if configuration wasn't set. change source_id to source Make code more robust Rebasing with the upstream changes that have been made. adding documentation removing the comment in the config.py class Fixing upstream merge conflicts. Update docs/flask_config.md Co-Authored-By: jornh <[email protected]> Removing non editable section! readOnly is now an optional Property Added in a programmatic header and <hr> per design doc adding test for button rendering Adding in convertText function Changing SENTENCE_CASE -> Upper Upper. Need to confirm that this is ok, otherwise can create a new case Reverting SentenceCase Creating PascalCase Removing custom title Moving convert text to EditableSection. Applying by default * removing pascal case * fixing doc * Update amundsen_application/api/utils/metadata_utils.py Co-Authored-By: Tamika Tannis <[email protected]> * Update amundsen_application/api/utils/metadata_utils.py Co-Authored-By: Tamika Tannis <[email protected]> * cleaning up * Fixing unit test to have static method * changing to edit-button * Moving tests to test_metadata_utils * Fixing lint * updating the sample image Co-authored-by: Tamika Tannis <[email protected]> * Clean up some tests; Create constant for hardcoded text (#407) * Fix overflow for issue tracking feature (#406) * Fix overflow for issues from issue tracking feature * try using flex properties * use truncated class * add span Co-authored-by: christina stead <[email protected]> Co-authored-by: Daniel <[email protected]> Co-authored-by: samshuster <[email protected]>
1 parent b0cf4a9 commit 279f5d0

File tree

128 files changed

+5589
-1242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+5589
-1242
lines changed

amundsen_application/__init__.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import logging.config
55
import os
66

7-
from flask import Flask
7+
from flask import Flask, Blueprint
8+
from flask_restful import Api
89

910
from amundsen_application.api import init_routes
1011
from amundsen_application.api.v0 import blueprint
@@ -15,6 +16,8 @@
1516
from amundsen_application.api.metadata.v0 import metadata_blueprint
1617
from amundsen_application.api.preview.v0 import preview_blueprint
1718
from amundsen_application.api.search.v0 import search_blueprint
19+
from amundsen_application.api.issue.issue import IssueAPI, IssuesAPI
20+
1821

1922
app_wrapper_class = Flask
2023

@@ -53,6 +56,14 @@ def create_app(config_module_class: str, template_folder: str = None) -> Flask:
5356
logging.info('Using metadata service at {}'.format(app.config.get('METADATASERVICE_BASE')))
5457
logging.info('Using search service at {}'.format(app.config.get('SEARCHSERVICE_BASE')))
5558

59+
api_bp = Blueprint('api', __name__)
60+
api = Api(api_bp)
61+
62+
api.add_resource(IssuesAPI,
63+
'/api/issue/issues', endpoint='issues')
64+
api.add_resource(IssueAPI,
65+
'/api/issue/issue', endpoint='issue')
66+
5667
app.register_blueprint(blueprint)
5768
app.register_blueprint(announcements_blueprint)
5869
app.register_blueprint(log_blueprint)
@@ -61,6 +72,7 @@ def create_app(config_module_class: str, template_folder: str = None) -> Flask:
6172
app.register_blueprint(metadata_blueprint)
6273
app.register_blueprint(preview_blueprint)
6374
app.register_blueprint(search_blueprint)
75+
app.register_blueprint(api_bp)
6476
init_routes(app)
6577

6678
init_custom_routes = app.config.get('INIT_CUSTOM_ROUTES')
+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
from flask import current_app as app
2+
from flask import jsonify, make_response, Response
3+
from flask_restful import Resource, reqparse
4+
from http import HTTPStatus
5+
import logging
6+
7+
from amundsen_application.base.base_issue_tracker_client import BaseIssueTrackerClient
8+
from amundsen_application.proxy.issue_tracker_clients import get_issue_tracker_client
9+
from amundsen_application.proxy.issue_tracker_clients.issue_exceptions import IssueConfigurationException
10+
11+
LOGGER = logging.getLogger(__name__)
12+
13+
14+
class IssuesAPI(Resource):
15+
def __init__(self) -> None:
16+
self.reqparse = reqparse.RequestParser()
17+
self.client: BaseIssueTrackerClient
18+
19+
def get(self) -> Response:
20+
"""
21+
Given a table key, returns all tickets containing that key. Returns an empty array if none exist
22+
:return: List of tickets
23+
"""
24+
try:
25+
if not app.config['ISSUE_TRACKER_CLIENT_ENABLED']:
26+
message = 'Issue tracking is not enabled. Request was accepted but no issue will be returned.'
27+
logging.exception(message)
28+
return make_response(jsonify({'msg': message}), HTTPStatus.ACCEPTED)
29+
30+
self.client = get_issue_tracker_client()
31+
self.reqparse.add_argument('key', 'Request requires a key', location='args')
32+
args = self.reqparse.parse_args()
33+
response = self.client.get_issues(args['key'])
34+
return make_response(jsonify({'issues': response.serialize()}), HTTPStatus.OK)
35+
36+
except IssueConfigurationException as e:
37+
message = 'Encountered exception: ' + str(e)
38+
logging.exception(message)
39+
return make_response(jsonify({'msg': message}), HTTPStatus.NOT_IMPLEMENTED)
40+
except Exception as e:
41+
message = 'Encountered exception: ' + str(e)
42+
logging.exception(message)
43+
return make_response(jsonify({'msg': message}), HTTPStatus.INTERNAL_SERVER_ERROR)
44+
45+
46+
class IssueAPI(Resource):
47+
def __init__(self) -> None:
48+
self.reqparse = reqparse.RequestParser()
49+
self.client: BaseIssueTrackerClient
50+
super(IssueAPI, self).__init__()
51+
52+
def post(self) -> Response:
53+
try:
54+
if not app.config['ISSUE_TRACKER_CLIENT_ENABLED']:
55+
message = 'Issue tracking is not enabled. Request was accepted but no issue will be created.'
56+
logging.exception(message)
57+
return make_response(jsonify({'msg': message}), HTTPStatus.ACCEPTED)
58+
self.client = get_issue_tracker_client()
59+
60+
self.reqparse.add_argument('title', type=str, location='form')
61+
self.reqparse.add_argument('key', type=str, location='form')
62+
self.reqparse.add_argument('description', type=str, location='form')
63+
args = self.reqparse.parse_args()
64+
response = self.client.create_issue(description=args['description'],
65+
table_uri=args['key'],
66+
title=args['title'])
67+
return make_response(jsonify({'issue': response.serialize()}), HTTPStatus.OK)
68+
69+
except IssueConfigurationException as e:
70+
message = 'Encountered exception: ' + str(e)
71+
logging.exception(message)
72+
return make_response(jsonify({'msg': message}), HTTPStatus.NOT_IMPLEMENTED)
73+
except Exception as e:
74+
message = 'Encountered exception: ' + str(e)
75+
logging.exception(message)
76+
return make_response(jsonify({'msg': message}), HTTPStatus.INTERNAL_SERVER_ERROR)

0 commit comments

Comments
 (0)