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
Safe versioning of .braids.json #66
Comments
A version flag in the braids file does seem reasonably sensible. How we handle previous versions basically comes down to how much time is spent to supporting the older versions. I believe the |
You're talking about a new versions of Braid migrating an old configuration. I filed this issue about the opposite scenario: an old version of Braid that sees a new configuration that it doesn't understand should raise an error and tell the user to upgrade rather than doing the wrong thing. Re the particular cases of new versions of Braid migrating old configurations:
Yes, that already works.
Based on this comment I thought you wanted to change the behavior without warning. It's a little late now, but if you're OK with making this an error, I'll go back and do that in #56.
That's precisely #65. |
Ahh - I see. Yes - not sure how we can gracefully handle forward compatibility for older braids. Other than as you suggest -adding the a version flag and starting with forward compatibility from now onwards. |
Another thought (outside the original scope of this issue but convenient to discuss here): Should we prompt the user before upgrading the configuration, just on the basis that other users on the project may then have to upgrade Braid, even if no incompatible behavior changes (such as converting full-history mirrors to squashed) are being made? Or do we assume that it's no problem for other users to upgrade Braid on demand (using I'm leaning against prompting. Is there any precedent we should consider among multi-user applications? (I know lots of single-user applications that assume the single user won't downgrade the application and thus upgrade data without prompting.) |
I don't have a strong opinion either way and see merits with both approaches. The The "auto upgrade" approach is probably less work for us to maintain (only have to emit a single form of output and we can transform config during load). However it makes it harder for users to control dependencies on versions. |
I agree that would be complicated and I don't want to do it now. We can still ask the user before upgrading the configuration. I've already started drafting the code for a Hopefully most users will keep Braid up to date and it won't be a big deal. If some users have more constraints on versioning, they may have to go to some trouble (e.g., manually installing multiple versions of Braid), but at least we are warning them about what they're getting into. Expanding this issue to cover both the check for a configuration that is too old (and |
.braids.json
so Braid can check if it's too old to process .braids.json
correctly
I have a more detailed design proposal. @realityforge, may I have your feedback before I proceed with implementation? This will be a considerable amount of work. I'm excited to get started on it while I'm on vacation. I'm not sure when or if I will finish, but even if I don't, the next person will have a plan they can follow if they like it. GoalsPrevent surprises and adequately support normal development processes while minimizing the additional maintenance cost of the version compatibility mechanism. I'd like to have Braid in good enough shape (on this issue as well as others) that I can confidently recommend it to teams whose use of Braid might outlive my availability to help them with it; I'm thinking of the team I worked with at my internship this past summer as an example. However, I don't want to spend extra work now and commit to extra future maintenance cost for non-essential features unless/until there's evidence of demand for them. Overview
History of configuration changes (for reference)
Test cases to write(Note: The single "breaking change" we have to work with right now is removal of full-history mirrors.)
|
Looks good to me. The only nitpick that jumped out at me is that the key should probably follow the same conventions as the rest of our keys. i.e. camelCase "configVersion" or maybe just "version". I would also tend to try to perform a graceful upgrade from our current config version to the versioning config version. You could just assume that a lack of version key means it is in current version config and that would cover 95% of the use case I would guess. Thanks for moving this forward. |
It doesn't look like we have any precedent for multi-word keys, but multi-word variables in the source code are lowercase with underscores, so I'll go with that.
I forgot to explain that part. I added a brief point to the overview above. In a bit more detail: So far, all of our configuration upgrades have been written in an idempotent way, so Braid has just tried all of them to upgrade a configuration file from any previous version. Keeping with that approach, post-redesign Braid will be able to upgrade any pre-redesign configuration file with |
@realityforge, can you help me figure out the right way to do this? It looks like the current content of the Might this be a good opportunity to transfer the Braid repository to a GitHub organization so you can have repository admin privileges and the URL will be stable if cristibalan needs to completely give up involvement? cristibalan can remain the only owner for now if he wants. The name I'll continue to work on the code while you sort this out. |
update". This is in preparation for supporting single-file mirrors, which will have a different data structure in place of the tree ID. - The check if the mirror is already up to date: I believe the change makes no difference because the only way to get here with switching == false and was_locked == true is if the old and new upstream revision are equal (it's not enough if they have equal content at the remote path). I'd like to clean up this code, but that becomes an invasive change that I don't want to block cristibalan#64 and cristibalan#66 on. - The label in conflict markup: This seems to make sense.
(DO NOT MERGE YET: needs the version table web page to be written.) Fixes cristibalan#66. Now that we have the infrastructure: - Report loss of support for full-history mirrors as a breaking change. Fixes cristibalan#56. - Correctly upgrade revision locks from Braid < 1.0.18. Fixes cristibalan#65.
Bump version to 1.1.0 according to the new policy that each configuration version corresponds to a different Braid minor version. (DO NOT MERGE YET: needs the version table web page to be written.) Fixes cristibalan#66. Now that we have the infrastructure: - Report loss of support for full-history mirrors as a breaking change. Fixes cristibalan#56. - Correctly upgrade revision locks from Braid < 1.0.18. Fixes cristibalan#65.
Bump version to 1.1.0 according to the new policy that each configuration version corresponds to a different Braid minor version. (DO NOT MERGE YET: needs the version table web page to be written.) Fixes cristibalan#66. Now that we have the infrastructure: - Report loss of support for full-history mirrors as a breaking change. Fixes cristibalan#56. - Correctly upgrade revision locks from Braid < 1.0.18. Fixes cristibalan#65.
Sorry for taking a while to get back to you - I have a 4-week year old that is taking up most of my time ;) Anyhoo - the way I have done this in the past was actually to fork this repo and regenerating the website on the fork from the GitHub website and then merging/PR-ing into the main repo the output. The other option I have tried is just manually patching the html. I assume those options would still work. We could also use jekyll directly but that seems like a smidge more work. HTH |
Congratulations! I researched the web site situation some more. It's currently in legacy Automatic Page Generator mode, but even without access to the settings of this repository, we can switch it to the new mode (in which GitHub automatically converts the Markdown to HTML and applies the theme invisibly to us) by going through GitHub's wizard on a fork and pushing the resulting content to the publishing source branch (currently gh-pages) of this repository. However, this would be a good opportunity to fix #67 by switching the source to the master branch so I can add my content there rather than to the gh-pages branch. I've emailed cristibalan to ask him to do that and also to inquire about transferring the repository to an organization. |
Bump version to 1.1.0 according to the new policy that each configuration version corresponds to a different Braid minor version. Fixes cristibalan#66. Now that we have the infrastructure: - Report loss of support for full-history mirrors as a breaking change. Fixes cristibalan#56. - Correctly upgrade revision locks from Braid < 1.0.18. Fixes cristibalan#65.
Each time a new version of Braid changes the
.braids.json
format in a way that older versions of Braid will process incorrectly (e.g., e6535aa), teams can get incorrect behavior unless they manually communicate and make sure that everyone who uses Braid upgrades it at the same time. We should add a version number to the configuration file and add a check to Braid that the version number is not newer than the version it understands.Then, ideally, we'd make a one-time change to the configuration file to block out all versions of Braid from before the version check was added. Unfortunately, if we just rename it, then old versions of Braid will behave as if no mirrors are defined; some commands will fail with "mirror does not exist", but
braid add
will happily create a new configuration file, which will just lead to more confusion. The only way to reliably cause old versions of Braid to fail is to deliberately make.braids.json
invalid JSON, but that's a pain for anyone who wants to process it with other tools. And if we wanted to block out versions of Braid from before the.braids.json
name was introduced, we'd have to create a.braids
file. This becomes ugly. Maybe the most reasonable thing is to forget about this and just tell teams to upgrade everyone to at least Braid 1.0.22, and then after that point, they will be notified when they need to upgrade.The text was updated successfully, but these errors were encountered: