Skip to content

refactor sync and sync_one methods of accession - #532

Open
mike-kaimika wants to merge 2 commits into
release/5.3from
refactor-accession-sync
Open

refactor sync and sync_one methods of accession#532
mike-kaimika wants to merge 2 commits into
release/5.3from
refactor-accession-sync

Conversation

@mike-kaimika

Copy link
Copy Markdown
Collaborator

No description provided.

@mike-kaimika
mike-kaimika requested a review from joefutrelle June 30, 2026 01:38
@mike-kaimika mike-kaimika self-assigned this Jun 30, 2026
@mike-kaimika
mike-kaimika force-pushed the refactor-accession-sync branch from ad63501 to cd2d8c5 Compare June 30, 2026 01:41
@mike-kaimika
mike-kaimika changed the base branch from release/5.2 to release/5.3 August 25, 2026 19:53

@joefutrelle joefutrelle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like some renaming introduced collisions here, but I'm not sure. If so, the sync_bin endpoint could be affected.

Comment thread ifcbdb/dashboard/accession.py Outdated
def _find_ifcb_bin(self, pid):
for directory in self.dataset.directories.filter(kind=DataDirectory.RAW).order_by('priority'):
# skip and continue searching
if not os.path.exists(dd.path):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

undefined variable dd?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This was a typo and is now fixed

Comment thread ifcbdb/dashboard/accession.py Outdated

directory = ifcb.DataDirectory(directory.path)
try:
return directory[pid], directory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

line 19 swaps a DataDirectory (model instance) for an ifcb.DataDirectory which is a different type of object, and then passes that ifcb.DataDirectory back to code that expects the model instance. That seems like it wouldn't work.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. This led to a few places where a pair of (ifcb_bin, ifcb_directory) being used instead of (ifcb_bin, directory) which was needed. The ifcb_ prefix indicates a model from the pyifcb library and with out it the Django model. All of those inconsistencies have now been resolved and I was able to confirm both sync() and sync_one() are now working as expected

@mike-kaimika mike-kaimika added this to the 5.3 milestone Aug 27, 2026
@mike-kaimika
mike-kaimika force-pushed the refactor-accession-sync branch from cd2d8c5 to a80053c Compare August 28, 2026 16:26
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.

2 participants