Skip to content

Fix: calculate relative arcname for backupCase ZIP generation (fixes #403)#404

Open
tejassinghbhati wants to merge 1 commit intoEAPD-DRB:mainfrom
tejassinghbhati:fix/403-backup-case-absolute-path
Open

Fix: calculate relative arcname for backupCase ZIP generation (fixes #403)#404
tejassinghbhati wants to merge 1 commit intoEAPD-DRB:mainfrom
tejassinghbhati:fix/403-backup-case-absolute-path

Conversation

@tejassinghbhati
Copy link
Copy Markdown
Contributor

Linked issue

Existing related work reviewed

Overlap assessment

  • Classification: Bug Fix
  • Overlapping items: None
  • Why this is not duplicate/superseded: Corrects the internal ZIP extraction pathing behavior independently of any other backup endpoint concerns.

Why this PR should proceed

  • It solves an immediate user pain-point that guarantees Case Backups are generated with portable, correctly formatted directories instead of leaking the absolute directory chains of the host server filesystem.

Summary

  • What changed: Added arcname calculation utilizing os.path.relpath inside UploadRoute.py's backupCase() logic algorithm.
  • Why: To mandate that the .zip archive stores only the targeted case's relative structure (e.g. CaseName/genData.json) instead of defaulting to absolute backend host paths (e.g. e/MUIOGO/DataStorage/.../genData.json).

Validation

  • Tests added/updated (or not applicable)
  • Validation steps documented
  • Evidence attached (logs/screenshots/output as relevant)

Validation notes: Backup was visually validated on local UI. Unzipping the resulting archive directly outputs the clean caseData payload folder rather than the host's directory structure (Refer to the screenshot uploaded in Issue #403).

Documentation

  • Docs updated in this PR (or not applicable)
  • Any setup/workflow changes reflected in repo docs

Scope check

  • No unrelated refactors
  • Implemented from a feature branch
  • Change is deliverable without upstream OSeMOSYS/MUIO dependency
  • Base repo/branch is EAPD-DRB/MUIOGO:main (not upstream)

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.

[Bug] backupCase generates ZIP archives with deeply nested server system paths instead of relative case folders

1 participant