-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Currently we are adding this index_version as part of the calculated information for EACH entity document. This is totally unnecessary since this field is just the VERSION number and it doesn't reflect the actual deployment (the BUILD number) nor the actual data source (from entity-api).
search-api/src/hubmap_translator.py
Lines 779 to 783 in 8894027
| def add_calculated_fields(self, entity): | |
| logger.info("Start executing add_calculated_fields()") | |
| # Add index_version by parsing the VERSION file | |
| entity['index_version'] = self.index_version |
The portal-ui uses both this index_version and their portal translation generated mapper_version (which is more accurate). So supposedly they can just stop referencing this index_version in the portal-ui and we can remove it.
search-api/src/hubmap_translation/addl_index_transformations/portal/__init__.py
Lines 36 to 47 in 8894027
| def _get_version(): | |
| # Use the generated BUILD (under project root directory) version (git branch name:short commit hash) | |
| # as Elasticsearch mapper_metadata.version | |
| build_path = Path(__file__).absolute( | |
| ).parent.parent.parent.parent.parent / 'BUILD' | |
| if build_path.is_file(): | |
| # Use strip() to remove leading and trailing spaces, newlines, and tabs | |
| version = build_path.read_text().strip() | |
| logging.debug(f'Read "{version}" from {build_path}') | |
| return version | |
| logging.debug(f'Using place-holder version; No such file: {build_path}') | |
| return 'no-build-file' |
Metadata
Metadata
Assignees
Labels
Type
Projects
Status