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

NXDRIVE-2844: Nuxeo Drive transfer failed after removing hardware (Sourcery refactored) #4047

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Jul 27, 2023

Pull Request #4046 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch, then run:

git fetch origin sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from acfa69a to b996ac5 Compare July 27, 2023 06:01
@sourcery-ai sourcery-ai bot requested a review from gitofanindya July 27, 2023 06:01
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Sourcery AI seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from b996ac5 to a44582d Compare July 27, 2023 06:03
@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Patch coverage: 11.11% and project coverage change: -0.02% ⚠️

Comparison is base (92bc486) 47.24% compared to head (1f01d64) 47.23%.

Additional details and impacted files
@@                                           Coverage Diff                                            @@
##           wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware    #4047      +/-   ##
========================================================================================================
- Coverage                                                                 47.24%   47.23%   -0.02%     
========================================================================================================
  Files                                                                        93       93              
  Lines                                                                     15645    15640       -5     
========================================================================================================
- Hits                                                                       7392     7388       -4     
+ Misses                                                                     8253     8252       -1     
Flag Coverage Δ
functional 37.80% <11.11%> (-0.02%) ⬇️
integration 1.98% <0.00%> (+<0.01%) ⬆️
unit 35.73% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
nxdrive/engine/processor.py 10.94% <11.11%> (-0.17%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from a44582d to 82b9edf Compare July 27, 2023 08:41
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 82b9edf to e5af8da Compare July 27, 2023 09:13
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from e5af8da to 8227b81 Compare July 27, 2023 11:07
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 8227b81 to 0994fac Compare July 27, 2023 13:32
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 0994fac to 9eefda1 Compare July 27, 2023 14:03
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 9eefda1 to c35a6bc Compare July 27, 2023 14:12
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from c35a6bc to 541f399 Compare July 27, 2023 14:26
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 541f399 to 10fec9d Compare July 27, 2023 14:30
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 10fec9d to d8bd02e Compare July 27, 2023 14:35
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from d8bd02e to 34d9d84 Compare July 27, 2023 15:01
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 34d9d84 to 18a0a9d Compare July 27, 2023 15:15
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 18a0a9d to 4b10b6d Compare July 27, 2023 15:19
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 4b10b6d to 725bf86 Compare July 27, 2023 15:50
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 725bf86 to 48ae1a9 Compare July 27, 2023 16:48
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from 48ae1a9 to d4bbbfd Compare July 28, 2023 05:58
@sourcery-ai sourcery-ai bot force-pushed the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch from d4bbbfd to 1f01d64 Compare July 28, 2023 05:59
state = self.dao.get_state_from_id(item.id)
if state:
if state := self.dao.get_state_from_id(item.id):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function Processor._get_next_doc_pair refactored with the following changes:

Comment on lines -463 to +462
self.dao.remove_filter(
doc_pair.remote_parent_path + "/" + doc_pair.remote_ref
)
self.dao.remove_filter(f"{doc_pair.remote_parent_path}/{doc_pair.remote_ref}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function Processor._execute refactored with the following changes:

Comment on lines -565 to +563
if WINDOWS:
path = doc_pair.local_path
else:
# The path retrieved from the database will have its starting slash trimmed, restore it
path = Path(f"/{doc_pair.local_path}")

path = doc_pair.local_path if WINDOWS else Path(f"/{doc_pair.local_path}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function Processor._synchronize_direct_transfer refactored with the following changes:

This removes the following comments ( why? ):

# The path retrieved from the database will have its starting slash trimmed, restore it

Comment on lines -618 to +611
# Update session then handle the status
session = self.dao.get_session(doc_pair.session)
if session:
if session := self.dao.get_session(doc_pair.session):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function Processor._direct_transfer_end refactored with the following changes:

This removes the following comments ( why? ):

# Update session then handle the status

Comment on lines -659 to +650
modified = self.dao.get_state_from_local(doc_pair.local_path)
if modified:
if modified := self.dao.get_state_from_local(doc_pair.local_path):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function Processor._synchronize_if_not_remotely_dirty refactored with the following changes:

Base automatically changed from wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware to master July 28, 2023 06:42
@sourcery-ai sourcery-ai bot closed this Jul 28, 2023
@sourcery-ai sourcery-ai bot deleted the sourcery/wip-NXDRIVE-2844-Nuxeo-Drive-transfer-failed-after-removing-hardware branch July 28, 2023 06:43
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