-
Notifications
You must be signed in to change notification settings - Fork 147
11211 - Allow use of graph slugs for ES reindex by type #11212
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
base: dev/8.0.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement, but will need some adjusting for v8. Since the 7.6 code submission deadline was Monday, should we just proceed by retargeting 8?
arches/app/utils/index_database.py
Outdated
@@ -327,30 +327,41 @@ def index_resources_by_type( | |||
|
|||
for resource_type in resource_types: | |||
start = datetime.now() | |||
try: | |||
uuid.UUID(str(resource_type)) | |||
graph = models.GraphModel.objects.get(graphid=str(resource_type)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part will have to change because slugs are no longer unique in v8 -- they are shared across graph versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a functioning v8 setup here so I'll just put this PR on hold for now until I have the time to get one up and running to sort this out.
arches/app/utils/index_database.py
Outdated
try: | ||
graph = models.GraphModel.objects.get(slug=str(resource_type)) | ||
except: | ||
logger.warning( | ||
"Unable to resolve resource type %s. Please confirm it is a valid graph ID or slug." | ||
% resource_type | ||
) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to have the log & continue only under one failure path? A UUID not in the db will still hard-crash.
ded33b2
to
bb49837
Compare
Types of changes
Description of Change
Adds the ability to also use the graph slug to define which resources to reindex
Issues Solved
Closes #11211
Checklist
Accessibility Checklist
Developer Guide
Ticket Background
Further comments
This allows the use of both graph UUID and graph slug to define the resource types to be reindexed.