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

Adding version to config file name closes #2731 #2734

Merged
merged 3 commits into from
Jul 15, 2015
Merged

Conversation

myleshorton
Copy link
Contributor

This just adds the Lantern version to the yaml config file name on disk. That prevents Lantern from ever reading config files from old versions, which I think is exactly what we want.

@myleshorton
Copy link
Contributor Author

Hey @aranhoide what do you think of this one?

@myleshorton
Copy link
Contributor Author

Or anyone else for that matter =).

@atavism atavism self-assigned this Jul 15, 2015
@@ -117,7 +117,7 @@ func doMain() error {

parseFlags()

cfg, err := config.Init()
cfg, err := config.Init(packageVersion)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to use version here instead of packageVersion -- packageVersion looks like it defaults to 9999.99.99, and that's to avoid auto-updating in development mode. version contains the current git revision so we'd get lantern-bae7606.yaml instead of lantern-9999.99.99.yaml which I think is more informative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I initially just made the change but then reverted it. In production they'll be the same values, but I think in development the tricky thing is that the commit will continually change, so if you're actually testing using that yaml file like we are for #2608 you might get screwed up if you're development pattern involves committing locally a lot, for example.

Does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hello @atavism!

packageVersion was initially intended for autoupdates only. If no VERSION is passed to the Makefile it will use the git revision and when compiled in development mode it will use 9999.99.99. I think the git revision would be more informative but I also think it would be harder to associate it with an actual release, as we'll always have to lookup the git revision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I agree @xiam. Also in production they're always the same regardless.

@aranhoide
Copy link
Contributor

LGTM

aranhoide added a commit that referenced this pull request Jul 15, 2015
Adding version to config file name closes #2731
@aranhoide aranhoide merged commit a89b41e into valencia Jul 15, 2015
@myleshorton
Copy link
Contributor Author

Thanks guys!

@myleshorton myleshorton deleted the issue2731 branch July 15, 2015 21:09
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.

4 participants