-
Notifications
You must be signed in to change notification settings - Fork 291
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
Do we need to include GBFS version? #15
Comments
How about in the common header info. |
@E1000s That's an interesting idea, though I'd be concerned about a system deciding to mix and match their feeds. This shouldn't be supported (i.e. you shouldn't be able to have a 1.0 |
I would also love to hear from people who have implemented GTFS consumers and publishers. The GTFS spec actually indicates that changes should be backward compatible. This is probably something we should shoot for and versioning should be saved for major breaking changes. The problem of course with breaking changes is that they're a pain for everyone (consumers and publishers), so they should really be avoided. |
The gbfs.json should maybe list a correspondence between a version number and the URL path of the specified version ( /v1, /v2, etc.). |
I agree we should aim for no breaking change. This does not mean we should not version the file so the consumer can know upfront what to expect. Proposition:
|
Shouldn't we simply link to other versions of the protocol from gbfs.json file? This would not allow for breaking changes in the gbfs.json, but in majority cases we will rather add fileds than remove, and would not require change of the link attribute. Also maintaining few versions inside gbfs.json file will be more elegant than having 2 or 3 link tags in the header. |
@cubbi Something like this?
Should we include the minor version or only major? If we include the minor version we force the consumer to do semver parsing when looking for the right version. If we don't the consumer does not know what to expect. What I like about the idea of adding a new |
@mdarveau Sorry for delay. Yes, I think this is the only way we can structure it without breaking v1, the other option would be to use version number as a key in "data". With your proposal, should this be allowed to use different versions of different files? e.g. use station_information in 1.0 format, and system_information in 2.0? |
@cubbi Yes, I would apply a versioning scheme per feed thus allowing station_information in 1.0 format, and system_information in 2.0. |
Way back in 2016 @jcn wrote:
GTFS has followed two different practices:
I recommend that GBFS accept amendments that break backwards compatibility only when absolutely necessary, and, if there are cases when that is necessary, then a versioning scheme would be essential. If feed consumers would find versioning useful for all spec changes, I'd recommend using whole digit version increments (v1, v2…) for non-backwards compatible changes, and numbers to the right of the decimal (v1.1, v1.2…) for backwards-compatible changes. Some questions:
|
Quick clarification on GTFS-realtime - changes to the .proto file for the Protocol Buffer format are backwards compatible, but we introduced a v2 to define semantic field requirements to the spec (previously the "required" indicator was specific to the Protocol Buffer implementation and didn't really reflect transit-specific logic). This allowed us to have valid v1 feeds in the wild, but tighten the requirements on future v2 feeds to improve data quality in a number of use cases. Details here if anyone is interested: I agree that backwards compatibility is important and breaking changes should only be introduced when absolutely necessary. As mentioned here: ...I think versioning is also helpful to consumers to indicate semantic differences in the feeds - in this case, when the keys in auto-discovery are standardized. This is similar in concept to what we did with GTFS-realtime v2.0. If we introduce versioning and it's something we're programmatically checking against, I'd suggest having two fields:
|
Thanks for the clarification on how GTFS-realtime versioning works! What do you and others think of this:
If there is support for such a change, then I will make a pull request for this, also including Since there are a lot of open proposals and pressing GBFS needs, it seems useful to establish versioning practice before making amendments to the GBFS. |
@antrim This documentation is what GitHub points to for versioning guidance - https://semver.org/. I'd propose we follow the general guidance listed there for
And for each change/release we can decide how the changes fit into the above categories. I fully acknowledge that there are various opinions on version naming and this is just one possible scheme. Alternate opinions or suggestions are welcome. |
In the semantic versioning parlance, my recommendation would be for the following:
My reasoning is that we are not building and releasing software where patch versions really make sense. I'm not really sure what the difference would be between a MINOR and PATCH update when talking about an API. A "bug fix" for an API sounds more like a clarification, which in reality is more like a MINOR bump (hopefully backwards compatible). 3 levels of versions is just too complicated for what we're trying to accomplish. So, implicitly (if not explicitly), we are at v1.0 right now. There are a number of updates to the API that are proposed in pull requests and discussion that I propose would bump us to v1.1. Future updates with additional fields/enhancements would bump the minor version for a while. I'm not actually sure what would bump the major version yet - possibly some deeper ties to other specs like MDS or possibly some of the larger micromobility changes that are being proposed. In addition, I would recommend that we require API versions to be consistent across an entire collection - i.e. an auto-discovery |
This generally makes sense to me. A related question is "when are we bumping version numbers?" If we bump the version on every pull request merge (more akin to the GTFS process where the latest master branch is always the latest release), then PATCH versioning could make sense for things like formatting and editorial changes (e.g., fixing spelling errors). Or, we just don't bump the version for those merges and forgo the PATCH version. Alternately, we could batch multiple PRs into a release at our discretion. This gives us more control over how things are versioned but has the downside of potentially taking longer to get new features into a new version of the spec. This process would be more akin to de jure standards.
I agree with this. A related question - should we specify if/how a producer should deploy multiple versions of the feed in the case when there are breaking changes? For REST APIs normally there are path designations for versioning (e.g., |
Based on what we heard at the NABSA GBFS Developers Workshop, here is a proposal for how to implement versioning for GBFS. Some of these proposals are a leap beyond group consensus, but I'm making a concrete proposal which can be revised in response to counter proposals. Why implement versioning?Backwards-compatibility breaking changes appear to be necessary for GBFS to evolve with industry needs. To support this evolution, coordination with MDS, and effective validation tools, we need to implement versioning. Approach to spec versioning
We propose to borrow MDS's definitions of breaking vs. non-breaking changes, quoted below.
Expectations for GBFS producers / requesting feeds in a specification version
|
I suggest changing the above to something like the following:
I'm not sure what X, Y, and Z should be (or if they should all be defined here), but I think the above gives a more complete picture of what a transition between versions would look like. The biggest breaking problem that I could see happening is a producer dropping support for the previous major GBFS version before consumers can adopt the new major version, which would effectively result in cutting off the feed for those apps.
I believe these are only needed for major (breaking) changes. |
We need to come to agreement around a versioning scheme to unblock backwards-compatibility breaking changes such as PR #147 ("Rotate bike_id on free_bike_status). Here's an updated concrete proposal for feedback. Approach to spec versioning
Expectations for GBFS producers / requesting feeds in a specification version
I'll draft a concrete PR that defines policies and practices, based on feedback (agreement, objections, alternatives) people post in this thread. |
Above looks good, although for:
...I'd make this a hard requirement and not a best practice. You can't provide a reliable service to end users as a consuming app if a producer can roll out breaking changes at any given time and stop supporting the previous major version. There needs to be some reliable graceful upgrade period that gives consumers time to adapt to the new major release. |
How will this impact the discovery endpoint? Also, would producer need to support URL with and without version to get the latest version and for backward compatibility ? For example, all of these would be valid:
|
Overall looks good. I would agree with @barbeau there should be a minimum amount of time that old version should be supported. Maybe 12 months is too long, producers can voice their opinion. I'd be ok with 6 months. I'm not sure we actually need to support minor version of the spec. What would be the benefits? At the end of the day, if there's a behaviour change that's asked of consumers to do, I would consider it a breaking change. If there's nothing asked of consumers, then no need to actually change the version. |
How often are breaking changes expected to happen? If the support window is 12 months long, and breaking changes are made quarterly, then producers will be supporting 4-5 versions concurrently. A situation like this would be very cumbersome and I don't think is tenable for producers. An alternative option would be to have a release process with a long term support (LTS) branch, similar to Django's release process. LTS branches have a long deprecation window and are expected to be maintained for a long amount of time (e.g. a year). Non-LTS branches have a shorter deprecation window. Producers would be expected to maintain the most recent LTS branch until it's replaced. |
@gcamp, @barbeau, and @evansiroky all gave a 👍 to the long-term support (LTS) branch idea. Is there other support? Dissent? This would prevent a GBFS application that hasn't been updated from losing access to GBFS data. I'd like to hear reactions to the following ideas:
|
Would this just be the master branch after the pull request for a proposal is merged, but before a new release is cut?
I think it's fine to set this expectation, but I wouldn't box-in the spec by making this a hard requirement. I could see a major release at some point having unexpected consequences, which could require another major release in short order. And then you couldn't release another for 12 months.
👍
I think this is fine, assuming there is only one active LTS release at a time. |
@gcamp In my mind, a point revision would be in place to either codify additions (but not breaking changes) to the spec, or to provide language clarity around an existing spec that might be necessary. For example, we've had some instances where, due to ambiguous language in the spec, some operators are publishing a field as a string, and some as an integer. From a consumer perspective, this is no known consistency anyway, so I wouldn't consider this a breaking change (i.e. the spec was broken anyway), so this point release would serve to clarify the original intent of that version of the spec - i.e. a bug fix to the spec itself.
I agree with this, and I'm wondering how minor versioning plays into this. I still see a benefit for clarifications, both for the LTS release and for the new major releases, so I'm hoping someone is able to better articulate how minor changes to the spec might be codified into the documentation. |
@jcn Good points. I think one way to handle this would be for minor versioning items to be "backported" to the LTS release as relevant. In other words, a producer would be responsible for the current LTS branch plus any future revisions to the spec that we consider backwards compatible with the LTS release. Examples:
A complicating factor to this design is how |
LTS doesn't necessarily mean "can't have bug fixes" though, right? Since any fixes backported to an LTS version should only serve to clarify bugs in the original spec, a consumer that was consuming a LTS v1.0 that switches to v1.1 shouldn't see any difference:
|
Correct, I agree. My main question is what the For example - let's say we have v1.0 LTS ( The |
@jcn you make good point with the minor version. I'm ok with it. |
@barbeau Can you clarify the |
@jcn Sure. The standing proposal for versioning is to add two new fields to each version of the spec, which would also be expressed within each producers feed:
Some examples of how these would change over time with each release:
The idea behind For example, in consuming code you can have:
Above it was proposed to have the major version number expressed within the URL path, like If the consensus is that |
I tried to synthesize everything here into a PR at #188. I didn't see broad support for I propose to close this issue in the next few days to move discussion to the PR, unless anyone objects. |
Closing this now with #188 passed! |
@mdarveau and @dsgermain raise up a good point in #9 about versioning. While we've said that we would version the spec in the repository via git tags, we did not actually ever decide where to indicate the GBFS version in the feed.
I can imagine two logical places for this:
I am leaning toward including it in gbfs.json but would like other people's thoughts.
The text was updated successfully, but these errors were encountered: