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

Update version key in config file after version changes #1646

Merged
merged 1 commit into from
Jan 7, 2023

Conversation

jonakeys
Copy link
Contributor

@jonakeys jonakeys commented Dec 1, 2022

This PR fixes #1638
As mentioned in #1638 the reference states:

version
jrnl automatically updates this field to the version that it is running. There is no need to change this field manually.

jrnl now checks if the version in the config file differs from the current version, and if so, updates it. And I also added a BDD test for this functionality.

Side question: While working on this, I saw no BDD test for adding missing keys in the config. But for some reason the message 'Configuration updated to newest version at' prints when testing in 'poetry shell', but not while running in a test. Do BDD tests automatically fill in the config fields that aren't there yet?

Checklist

  • I have read the contributing doc.
  • I have included a link to the relevant issue number.
  • I have checked to ensure there aren't other open pull requests
    for the same issue.
  • I have written new tests for these changes, as needed.

@jonakeys
Copy link
Contributor Author

jonakeys commented Dec 2, 2022

In given_steps.py I found:

#Add jrnl version to file for 2.x journals
with open(config_dest, "a") as cf:
cf.write("version: {}".format(version))

So that's how the missing version-key gets added.

Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

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

Thank you! No notes, looks great.

@micahellison micahellison changed the title Update version key in config file Update version key in config file after version changes Jan 7, 2023
Copy link
Member

@wren wren left a comment

Choose a reason for hiding this comment

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

Looks great. Thank you!

@micahellison micahellison added the bug Something isn't working label Jan 7, 2023
@micahellison micahellison merged commit d943251 into jrnl-org:develop Jan 7, 2023
@jonakeys jonakeys deleted the issue1638 branch January 8, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jrnl does not update version key in config file
3 participants