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

11211 - Allow use of graph slugs for ES reindex by type #11212

Draft
wants to merge 8 commits into
base: dev/8.0.x
Choose a base branch
from

Conversation

bferguso
Copy link
Contributor

@bferguso bferguso commented Jul 19, 2024

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

Adds the ability to also use the graph slug to define which resources to reindex

Issues Solved

Closes #11211

Checklist

  • I targeted one of these branches:
    • dev/8.0.x (under development): features, bugfixes not covered below
    • dev/7.5.x (main support): regressions, crashing bugs, security issues, major bugs in new features
    • dev/6.2.x (extended support): major security issues, data loss issues
  • I added a changelog in arches/releases
  • I submitted a PR to arches-docs (if appropriate)
  • Unit tests pass locally with my changes
  • I added tests that prove my fix is effective or that my feature works
  • My test fails on the target branch

Accessibility Checklist

Developer Guide

Topic Changed Retested
Color contrast
Form fields
Headings
Links
Keyboard
Responsive Design
HTML validation
Screen reader

Ticket Background

Further comments

This allows the use of both graph UUID and graph slug to define the resource types to be reindexed.

Copy link
Member

@jacobtylerwalls jacobtylerwalls left a 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?

@@ -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))
Copy link
Member

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.

Copy link
Contributor Author

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.

Comment on lines 334 to 341
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
Copy link
Member

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.

arches/app/utils/index_database.py Outdated Show resolved Hide resolved
arches/app/utils/index_database.py Outdated Show resolved Hide resolved
releases/7.6.0.md Outdated Show resolved Hide resolved
@bferguso bferguso marked this pull request as draft July 19, 2024 18:16
@bferguso bferguso changed the base branch from dev/7.6.x to dev/8.0.x July 19, 2024 18:16
@bferguso bferguso force-pushed the brf/11211_allow_slug_for_es_reindex branch from ded33b2 to bb49837 Compare July 19, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow use of graph slug in ES reindex by resource type command
2 participants