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

Version numbering for files #96

Open
tpitkanen opened this issue Nov 22, 2020 · 1 comment
Open

Version numbering for files #96

tpitkanen opened this issue Nov 22, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@tpitkanen
Copy link
Member

There should a way to save file compatibility information. Currently, there isn't a reliable way to tell which version of Potku was used to create/edit a request. This is problematic when there are backwards incompatible changes to file formats.

Types of files that are affected:

  • settings
  • presets
  • data

A simple solution would be to add a version field to files. It could use the date of the latest file format change for its value. The version field would then be checked whenever a file deserialized. If the version of the file doesn't match, the user can be warned about this with a proper message (e.g. f"'.profile' settings file version '{file_format}' is not compatible with '{self.FILE_FORMAT}'.").

@tpitkanen tpitkanen added the enhancement New feature or request label Nov 22, 2020
@jaakkojulin
Copy link
Member

Issue #46 is relevant here too. What I recommend is always saving the (hypothetical) version number of Potku for each file. When opening files (possibly in the future) it can be determined from the version number how to handle the file: version specific deserialization (good for small changes, difficult to maintain in the long term), falling back to defaults (when new features are added) or whether to warn or fail (compatibility is intentionally broken).

The files can of course have their own version numbering, but this becomes only relevant if the files are used outside Potku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants