Skip to content

BP-1829: Refactor tools/backup.py - #492

Open
MarcoCunha-MOVAI wants to merge 3 commits into
mainfrom
feature/BP-1829-refactor-tools-backup-py
Open

MarcoCunha-MOVAI wants to merge 3 commits into
mainfrom
feature/BP-1829-refactor-tools-backup-py

Conversation

@MarcoCunha-MOVAI

@MarcoCunha-MOVAI MarcoCunha-MOVAI commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
  • BP-1829: Refactor tools/backup.py
    • Moved scope specific code to corresponding scopes
    • Created missing scopes
    • Moved ProjectSource to it's own file
    • Factored main import/export logic
    • Updated tests

@sonarqubecloud

Copy link
Copy Markdown

@MarcoCunha-MOVAI
MarcoCunha-MOVAI requested a review from a team October 20, 2026 19:34
Comment thread CHANGELOG.md Resolved
Comment thread dal/scopes/graphicscene.py Resolved
Comment thread dal/scopes/ports.py
@classmethod
def _update_metadata(cls, data: dict, file_path: str, source: ProjectSource) -> dict:
for name in data:
data = {"Ports": {name: data[name]}}

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.

Do not alter data in the same loop that iterates it. Keep data in a temporary dict and either return it or assign it after the loop.

Also, typhint returns dict but function does not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yikes, I've added a test and redid the export an import logic for ports

Comment thread dal/scopes/translation.py Resolved
Comment thread dal/scopes/translation.py Resolved
Comment thread dal/scopes/translation.py Resolved
Comment thread dal/tools/backup.py Resolved
Comment thread dal/tools/backup.py
try:
tool.run(objects)
report = tool.run(objects)
if args.action == "import" and report["failed"]:

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.

Just FYI there will be a similar report mechanism for export (already in PR).

@daniela-costa7

Copy link
Copy Markdown
Contributor

Forgot to bump movai-core-shared

This branch has not been deployed

No deployments
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