-
Notifications
You must be signed in to change notification settings - Fork 129
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
Draft versioning spec for discussion #16
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"latest":"0.0.7", | ||
"supported": [ | ||
"0.0.7" | ||
], | ||
"deprecated": [ | ||
"0.0.6" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
# Python deployment on python.microbit.org | ||
|
||
This spec outlines how python.microbit.org will become the primary web-hosted editor for Micropython micro:bit programming, deprecating what is at microbit.co.uk. | ||
|
||
It also includes a mechanism to make the same editor available to users offline, so that they can have a familiar environment when working without an internet connection. | ||
|
||
## Versioning | ||
|
||
In order to balance the requirements of stability required by teachers and people producing printed materials and books, with a desire to ensure the latest features are available to advanced/curious users the following mechanisms will be in place: | ||
|
||
From the top level version, it is highly desirable (I’d like to say mandatory?) that the top level version deterministically identify the precise version of the underlying components that will run on the micro:bit (in reality, this means the MicroPython version/build which should itself point to a DAL version and then an mbed one from there) | ||
|
||
Not only could this enable direct viewing of dependent source (including the underlying C/C++), it could offer in some editors a list of known bugs in that version, and url links to the version that fixed it. | ||
|
||
### Semantic versioning | ||
|
||
The editor will use semantic versioning (http://semver.org/). In addition to breaking API changes, the following things will be considered ‘MAJOR’ changes | ||
1) Addition of significant features if they interact with the existing deployed features | ||
2) Things that would change screenshots of the editor that are published online or in books. | ||
|
||
Additional buttons on a toolbar are fine, but removing or renaming existing buttons should be considered a breaking change. | ||
|
||
Anything that could stop a script that previously worked from working must be considered a breaking change. In the case of MicroPython this means that things increasing memory consumption or reducing the flash available for a users’ script are likely breaking changes. | ||
|
||
{<< what other things should constitute a breaking change, and should we allow certain kinds of breaking change inside a version of the editor? IE can we support more than one MicroPython version for a particular deployed version of the front-end?>>}} | ||
|
||
It may be desirable to agree a high water mark in memory and growing beyond this is considered a breaking change. It would then be necessary to police memory growth but people do already do this I think. This would allow small increases in memory usage to be possible without a breaking change. | ||
|
||
### URL versioning scheme | ||
|
||
For each published major version, the deployed editor will live at | ||
|
||
`python.microbit.org/v<major version>/editor.html` | ||
|
||
Because the use of semantic versioning ensures that things will not break for the user when upgrading minor versions, there will not be fine-grained control over which minor version a user gets. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any reason not to allow /v2.1/ access? Minor change can still include ui additions or new minor functionality, so I am assuming some people might want to stick to minor versions too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think such fine grained versioning just complicates matters in a "please don't make me think" sort of a way for the end user. As a teacher, I might be using version 2 of the editor with my resources and we, as well behaved developers, guarantee non-breakage between the different minor versions as specified by Jonny's criteria above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Users could still use the simpler /v2/ versioning and not worry about it, while anybody with the knowledge to know the difference between /v2.2/ and /v2.3/ could still access each one. As long as /v2/ serves the latest minor without changing the URL, I really cannot really see any disadvantage in making minor versions available. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Upon reflection, I think you're right. :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with Carlos. v2 needs to be the "don't make me think" version, and resources should always use that form of URL and 'share' should always create that form of URL. The minor versioned ones should be available but 'under the hood' - does that work for you both? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Don't quite agree with that last part. Let's say version 2.9 is the latest, if a user goes to /v2/ it should internally resolve and serve version 2.9, but the URL stays as /v2/, it doesn't redirect to /v2.9/. |
||
|
||
For example visiting `python.microbit.org/v2/` will serve version `2.<latest minor>` | ||
|
||
### Versions in URLs | ||
|
||
When a script is published or shared, it must be published including the major version of the editor (and therefore the MicroPython stack) that it was created with so that anyone following the link will be taken back to the version the script was created with. | ||
|
||
If a user visits python.microbit.org/latest/ and is working on the editor there, the URL published should still be versioned, such as python.microbit.org/v1/. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a user visits There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that However, I disagree that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Carlos, can I check I understand your comments here: You think As long as the embedded data in the hex file and the 'share' and 'publish' buttons in the first case will point to python.microbit.org/v2 then that's all good. If not, I think we risk breaking things under people's feet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, and just to clarify, from my point of view we would have: visit http://python.microbit.org --> get the current 'stable' version (the academic year stable version) and the URL bar reads 'python.microbit.org' |
||
|
||
See “workflows” for discussion of how the user will be notified about newer versions | ||
|
||
|
||
### Versioning in hex files | ||
|
||
When the user is provided a hex file, the full semantic editor version must also be embedded into the hex file at a known location so that when unpacking the hex, any version of the editor can offer to load the version that the script was created in. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see a reason to do this. Specially if we keep a 1 to 1 mapping of micropython and editor versions we could resolve this internally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with @carlosperate on this point. Also, I believe such changes would require the input of @dpgeorge. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed this is something that maybe needs to be discussed in the proper microbit micropython repository as well, as at the moment even adding the micropython version to a known hex location is not as simple as it might seem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think if we have 1:1 mapping of MicroPython version to editor version that does work BUT, what happens if we start to do things like PXT packages where we have in-editor assembly of modules - this isn't out of the question and I think means we could do with a way to say "this editor version created this hex file". Also, it means that third parties (say Mu, MS) won't have to go and look up the MicroPython version that maps to an editor version in order to redirect a user correctly. (IE if I drop a hex file from PythonEditor into PXT, PXT should be able to redirect me to the correct location!) One way to do this would be to maintain a mapping of MP version to editor version (can be many:1) in the 'latest' version, so if you open a hex in /latest?mpversion=ABC it can redirect you to the right editor version? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We would have to pack these in the internal filesystem, so either the filesystem files has been added by the user and we just read these (and maybe display them as well if they are python files?), or they are modules packed by the editor, so they would be under our control and should have pythonic versioning, which in essence is just plain data that can be parsed by the editor.
If a third party editor encounters a micropython hex, they should only have to send it to the main python editor without any further processing. It would then be the main python editor responsibility to figure out the MicroPython version and redirect/load the correct editor version. |
||
|
||
The hex file must also contain some editor unique identity, so that any hex can be related to the appropriate editor, perhaps automatically (e.g. MP signature at known location).This could be part of the version number? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the goal of this one to be able to differenciate between micropython, pxt, touch develop, etc hex files? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is my concern too. Also, how should we handle hex files generated by uflash, Mu and non-official languages / runtimes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, that's important if it breaks backwards compat but it's also really nicetohave as a feature. We can use UICR for this, we have some unused registers there and I'd like to make DAPLink UICR and editor version aware so we can do things like only updating the flash that contains the script file not the whole hex when drag/dropping. |
||
|
||
See “workflows” for discussion of how the user will be notified about the fact they are heading to an older version. | ||
|
||
(This kind of thing can enable the ability to show a user the exact version of the source code that was used to generate their hex file, including MicroPython code) | ||
|
||
## Release cadence | ||
|
||
Because we must commit to maintaining and fixing versions that are deployed on python.microbit.org it is desirable to make a small number of major release. | ||
|
||
We propose an annual cadence for major releases, with an RC released early in the year so that a stable release can be made in July after the school year ends. This gives teachers time to become familiar with it before the school year start. The previous year’s version will remain available after this but will no longer be redirected to via python.microbit.org/latest or python.microbit.org/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like this at all. While I understand the need for stability, it means development is constrained to a glacial pace of release. Furthermore, it'll encourage others to just update to the latest version and host it themselves. Why not make the cadence three times a year to reflect the cadence of the school year: Christmas holidays, Easter and Summer holidays. I want to stress that the wider Python community won't follow these cadences (herding cats etc...). This will be a major source of pain for me personally as people tap my shoulder asking where / when their contribution / fix will land. Once a year also means all the effort and rush for a stable release happens over the summer when people want to go on holiday. My biggest concern is the King Canute argument - you may say you're going to do X, Y and Z (and I may agree with you on such points) but if the wider community doesn't agree they'll just find ways around them and/or fork, thus making it hard to coordinate efforts. I.e. the tide will come in no matter what you say. Welcome to my world! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I talked to some teachers about Mu, one of the things that was mentioned is that one of them liked the fact that the same version could be installed in all computers and stick with it for the rest of the year. In the same session, some of the teachers I was talking with were apprehensive to even consider PXT at all because they had already lessons planned with the original blocks editor.
If the front page at I do agree that the way this "release procedure" is described here kind of puts all the effort (which we should remember is coming from a community of volunteers) into a specific time of the year, and as much as we all love working on this project, life happens and there are other priorities. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @carlosperate totally get all this. Hmm... I like the difference between I think we should try to offer choice. There will be teachers who want stability, some who want to keep up to date and developers who want cutting edge. If at all possible we should be able to support all three and ensure each group knows where to find the version they need. This reminds me of the pioneer, settler, citizen distinction between users. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whole point of this scheme and work is to offer choice ;) By having a 'beta' or 'rc' always running we get the advanced teachers helping us test the latest stuff, too. I'm really convinced by the fact we need a stable, annual main experience. Nicholas, as a book editor, don't you also want this? One of the common reasons we have for this is printed resources, etc! |
||
|
||
For the first stable release (Ideally made in July 2017) there should be only a 6-month lifetime to allow a greater number of changes while the project is growing. | ||
|
||
## Unstable Versions | ||
|
||
There should be a mechanism to deploy versions of the editor that are not yet considered stable. These will not be widely exposed to the majority of visitors to the site, but will be published for enthusiasts, developers and other interested parties to help test the editor. | ||
|
||
It should be very hard for a naive user to wind up using a beta by accident. (Think, about:config warning in Firefox, etc) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be fine for anyone to get to any version of the editor so long as they know what version of the editor it is they're using and understand the caveats involved. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think those statements are compatible :) I think we need to allow ourselves to kill versions that were either
Otherwise things might get a bit hectic! |
||
|
||
### Beta | ||
|
||
There should, at times, be a beta branch that gives access to features not in the main deployed editor but that are likely to be in the next RC. | ||
|
||
We should find ways to display visually as well as with a dialogue, the status of beta. Crucially, the fact that users should expect a greater number of things that are broken | ||
|
||
Links to beta versions for which semantically-versioned final releases, RC versions or newer betas exist should redirect automatically to newest of the possible options. The user should be told this has happened and have the option of going back (see workflows below) | ||
|
||
As the beta is expected to be buggier than the RC or stable versions, we should warn teachers not to plan lessons around the beta versions unless absolutely necessary | ||
|
||
### RC | ||
|
||
Before a release is made, a RC branch should be used and deployed that allows users to see what the next version of the editor will contain. During the RC period, bugs will be fixed and the editor stabilised, but there should be no breaking changes (as dictated by a Semver process). | ||
|
||
### Experimental Branches | ||
|
||
Features in the these branches might go away, change, or break. We need to warn users very clearly and make sure teachers don’t base their lessons off things in these. | ||
|
||
We should find ways to display visually as well as with a dialogue, the status of beta. | ||
|
||
### Link sharing for unstable versions (beta, RC) | ||
|
||
If a version is ‘unstable’ a user should not be able to share a link to that version without first confirming they understand the meaning of that. This could be done like the GitHub “delete repository” dialogue. If a user clicks ‘share’ in an unstable editor deployment their options should be | ||
|
||
((Go to the stable editor and share from there))((Enter “temporary share” in the box below to create a link to the current beta)) | ||
|
||
### Link sharing for experimental versions | ||
|
||
Users should not be able to create links directly that share to an experimental version, because those versions may go away (say, python.microbit.org/doomed_feature/1/ might only exist one week). | ||
|
||
However, the publish feature for these branches should generate a URL that can be modified by an advanced user to link to an experimental version. This is a deliberate step to discourage use of the experimental editors for day-to-day work | ||
|
||
### retiring feature branches | ||
|
||
An unstable beta/RC branch, once retired, should redirect to the latest equivalent branch, or if it can be determined by the version of the branch, the stable version that this version became | ||
|
||
Experimental branches can and will be destroyed with reckless abandon. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of the above feels over-complicated. Why not just three versions a la Debian (it's beautifully simple): stable - what you get when you visit That's it. For something from dev to get to testing it must meet various criteria such as unit tests, integration tests, evidence of a code review from not-the-developer and evidence of feedback from some sort of user test. Once in test, things are tested and bugs are fixed but the fundamental behaviour of new features mustn't change. If people want to do anything more complex they probably have the technical chops to clone the repos and play around without having to bother us. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason not to have 3 versions a-la Debian is because Debian has a built-in package (and therefore composition) system. I can be on latest and then install XYZ if I want it. We don't have that same kind of configuration/composition here, so if we want to test a feature, really it needs a branch. I'm trying to describe something a bit like git-flow here. We have 3 primary versions And then we have feature branches, which may or may not get merged into beta. For example, I'd like to start with Blockly on a 'blocks' feature branch at the next deployment. |
||
## Stable feature versions (’named versions’) | ||
|
||
As well as versioned deployments we could also support named versions for providing special versions of the editor for specific events, features or configurations. Examples of this might be ‘blocks’, ‘tvseriesname’ or similar. | ||
|
||
Not every build will be the same as every other, and it should be possible to turn on/off features without forking the codebase using a config file. | ||
|
||
A named deployment could also enable pre-rolled, version specific frozen modules pre-imported. This would help for hardware specific or branded activities that require simple and fast engagement times. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, this will require changes in upstream MicroPython and @dpgeorge's involvement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, this is a long way up the road I think :) |
||
|
||
### Storing the config for each deployment | ||
|
||
The config for any deployment should be stored alongside that deployment so that it can be queried by other versions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you imagine being in the config that other versions would want to query it. Sounds complicated. Give me a compelling use case. ;-) |
||
|
||
### Locations for named versions: | ||
|
||
These versions will live at `python.microbit.org/<name>/v<version>` | ||
|
||
The top level link at `<branchname>` will redirect to the latest version, and the `<version>` redirects will work exactly as in the spec above. | ||
|
||
## Workflows for telling people about newer versions. | ||
|
||
When a user arrives at any version of the editor, the editor will check for the existence of a version manifest. If found the editor can decide what information to present to the user. | ||
|
||
If the editor is not the latest version AND the user has not already been redirected from a newer version (For example with ?redirect-from= maybe) then they will be prompted to move to the newest version. The text of the users’s script should be preserved as they user moves to the new version. | ||
In arriving at the newer version, the user should be told that they have arrived from an older version, and a means by which they can return to the version that the originally come to (presumably the version that the script they were loading was created in, or at least last published from) in case things don’t work | ||
|
||
* Ideally, we should maintain a growing list of API breakages in newer versions of the editor as they happen so that we can scan code and warn users if it uses an API that has changed. | ||
* In the case that there is a simulator and simulating the code on the new version determines errors, the user can be prompted more obviously than described above to update their code or go back | ||
|
||
If the editor is not the latest version but the user *has* been redirected from an older version, two possible reasons for this are: | ||
|
||
* The user has dropped a hex file from an older version of the editor than they had loaded, and chosen to be redirected | ||
* The user has already moved versions once to a newer version, found fault with that and asked to come back | ||
|
||
In these cases, it seems desirable not to prompt the user to move forward. | ||
|
||
{<<I’m up for discussing these workflows, I don’t really want dialogues in front of people, but I also don’t want to move versions under their feet. >>}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This all feels overly complicated. All this redirection is likely to be, a) ignored, b) confusing c) over engineered for little actual usefulness (see a and b). I know some really awesome UX people - let me pick their brains, they have a bunch of patterns an tricks we may be able to re-use. In any case, my feeling is ^^^ is too complicated and I believe we can probably find a better solution. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestions welcome, but honestly, those are things that have come out of thinking through the detail of this with PXT and teachers and the MBF :) |
||
|
||
## Versions manifest JSON | ||
|
||
This specification relies on a version of the editor being able to know that it is no longer the ‘latest’ version and know the location of newer versions. This could be done by including a versions manifest that lives one level up from the editor.html. This manifest should contain: | ||
|
||
* The current stable version: `”stable” : “2.1”` | ||
* A list of all supported versions `”supported”: [ “1.3”, “2.1” ]` | ||
* A list of deprecated versions (not sure this is necessary?) | ||
|
||
{<< This seems very MVP, might be better to instead have every version listed and a status for each one? >>} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this idea of every version of the editor including the single source of truth. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, the idea was actually that the manifest was a level up from the versions, so not included in them, as to do it in them we'd have to update every version at every release of another version which is suboptimal. But maybe we're crossed wires? |
||
|
||
### Unstable versions | ||
For any unstable branch of the editor, the version manifest will contain a full URL to a complete and stable version of the editor, | ||
|
||
… | ||
“stable”: “http://python.microbit.org/“, | ||
… | ||
|
||
{<< Should I use JSON schema for this bit?>>} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure any of this is useful. |
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should assign a micropython version to each editor version. This way is simpler and avoids any inadvertent or obscure incompatibilities. Most obvious example is that API changes will cause block changes. We could could define somethin that works it all out, but it just feels like unnecessary overhead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, when you say "assign a micropython version to each editor version" you mean each minor version. So, for example, if the only update is a new micropython runtime and we're curently on version 2.1, then we're releasing version 2.2 where the only update is a non-breaking update to the micropython runtime.
I think this is a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly what you said, I should have been more clear about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense, though raises the question of whether we'd like to make older editor (even minor) versions explicitly available (eg for memory increase scenarios).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, specially based on the conversation a couple of lines below, we just offer access to all versions, including minor.