Purpose of this policy issue

The purpose of Drupal 8 beta releases is to provide a more stable version of Drupal 8 that can be used to build test sites and port contributed modules. To this end, we agreed to require that beta releases include (1) a stable data model and (2) stable critical APIs. From Dries' original announcement:

A stable data model means that developers should not need to perform data migrations between beta releases of Drupal 8 (except where necessary to resolve critical issues). The Drupal 8 data model includes database schemas, file-based configuration storage, and storage services like the Entity and State systems.

The following proposal is based on several previous discussions with various groups of people. I'm trying to get it all in one place in the issue queue so that we can discuss and document it.

What is the Drupal 8 data model?

(From our original notes when defining the scope of the beta release.) The data model for Drupal 8 includes:

  1. Database tables (hook_schema() implementations)
  2. Configuration data, including:
    • Simple configuration. The VALUES of configuration data can change in a stable data model, but the KEY NAMES and SCHEMATA should not.
    • Configuration entities.
    • Configuration schemata
    • Default configuration. Reiterating, the VALUES of configuration data can change in a stable data model, but the KEY NAMES and SCHEMATA should not.
  3. APIs that affect the data model: In general, in Drupal 8, it will be a best practice to use several different APIs for interacting with stored data, rather than querying the database directly. Key APIs that affect the data model might include:
    • Entity Field API. The unified Entity Field API underlies a significant portion of Drupal 8's data model, affecting both Configuration Entity data structures and automatically created database tables.
    • Configuration system. Affects the storage of configuration data.
    • Key/value and state system. Less critical, but also determines data storage.
    • Storage services defined by key core modules. Less critical, but affects the stability of the specific modules. E.g., the ban module currently defines its own database service, but probably should use K/V instead. Removing the DB service and replacing it with K/V storage would change the module's database schema and data model.
    • Database and schema APIs. The database and schema APIs themselves need to remain backwards-compatible with whatever was in beta 1.

Beta-to-beta upgrade path

  • In general, we allow data model changes where necessary to resolve critical issues.

  • We need to have some real-world testing of the update functionality between beta and the first release candidate. (Presently there is only abstract SimpleTest coverage, with no actual hook_update_N() implementations, and no reason for developers to test update.php in a real-world scenario.)

  • We should provide a "best-effort" upgrade path between beta releases. That is, we try to add update hooks for any data model changes as we would for a stable release, but we will not guarantee there are no upgrade path bugs and may choose to skip some updates if they would require too much overhead to support.

  • We may choose to become more rigorous as the beta phase goes on. For example, we might choose not to support a Beta 1 to Beta 2 upgrade path, but begin supporting one for (e.g.) Beta 2 to Beta 3.

  • Because of the overhead needed to add an upgrade path and test for data model changes, non-critical issues that require a data model change should generally have a beta deadline (so that we do not add unneeded technical debt between the beta and the release candidate). Any exceptions would be at maintainer discretion only.

Remaining tasks

  • We need feedback on the proposal above.
  • We should decide if we will also support beta-to-rc upgrade paths, or beta-to-release upgrade paths.
  • We need to decide what to do with certain configuration schemata issues (get more info from @Gábor Hojtsy).
  • We might want to take into consideration the impact of the schema change. For example, a simple addition of a database column that is automatically populated is not very disruptive. At the other end of the spectrum, an issue like #2183231: Make ContentEntityDatabaseStorage generate static database schemas for content entities might significantly impact a lot of modules and sites.

Comments

Gábor Hojtsy’s picture

The following issues are fixing missing items or shortcomings of the schema system and/or data structure. Most are not beta blockers. While most would not change data structure, it would be good to have a stand on whether the description of the data structure changing is considered change of the data structure. For SQL it would sure be because you cannot store data without describing the structure properly. For config, you can freely do it the other way around. Although schemas are not mandatory we are making a commitment to describe all our data structure in core. So would be good to have a stand on these vs. the beta:

These are all the major ones we know about but there may be smaller ones lurking.

effulgentsia’s picture

We might want to take into consideration the impact of the schema change. For example, a simple addition of a database column that is automatically populated is not very disruptive.

One concrete example: #2265847: [PP-0.5] Regression from D7: default titles of customized menu links aren't translated is currently a critical beta blocker postponed on #2256497: [meta] Menu Links - New Plan for the Homestretch, which is not currently prioritized as critical. If we get down to 0 other beta blockers and that latter issue still isn't in, we'll need to decide whether to implement #2265847: [PP-0.5] Regression from D7: default titles of customized menu links aren't translated by adding a 'default_title' column to the {menu_link} table prior to releasing the beta. My vote would be no, unless at that time we're 99% convinced that we're giving up on #2256497: [meta] Menu Links - New Plan for the Homestretch, because I don't see it as in any way disruptive to add that db column closer to RC.

PS: this is not the issue in which to discuss whether #2256497: [meta] Menu Links - New Plan for the Homestretch should be critical. I only bring #2265847: [PP-0.5] Regression from D7: default titles of customized menu links aren't translated up as an example of something that I think can go in after beta, if it needs to, without causing disruption, even though technically it's a schema change. There might be other examples too. In general, I think our "stable data model" criterion for beta is a good one, but it's ok for core maintainers to use their common sense in making exceptions.

effulgentsia’s picture

In general, we allow data model changes where necessary to resolve critical issues.

Does this imply that we do not allow it if it's only a major issue? I don't think it should imply that; rather, like in all other areas, I think core maintainers should be able to approve a major issue for a data model change if they believe the benefit of the issue outweighs the disruption of the change.

xjm’s picture

Does this imply that we do not allow it if it's only a major issue? I don't think it should imply that; rather, like in all other areas, I think core maintainers should be able to approve a major issue for a data model change if they believe the benefit of the issue outweighs the disruption of the change.

I think we can't really advertise a stable data model if we continue to change it for whatever, and we have been saying for a year that we need to narrow the scope of changes being made. Everything is of course always at maintainer discretion, but in terms of setting contributor expectations, we need to go back to the idea that changing the data model is something we do judiciously. So I would support "officially" restricting it to only criticals, or criticals and majors perhaps. Otherwise the beta isn't meaningful.

effulgentsia’s picture

we need to go back to the idea that changing the data model is something we do judiciously. So I would support "officially" restricting it to only criticals, or criticals and majors perhaps

Right. I agree it should be judicious. But I think Major issues approved by core maintainers would still qualify as judicious. So I'm concerned about the statement "we allow data model changes where necessary to resolve critical issues" being interpreted as "we allow data model changes only where necessary to resolve critical issues". Perhaps that's not a valid concern, since it's not what the sentence says :)

catch’s picture

The worst thing about the 18 months of Drupal 7 was trying to fix critical bugs that required an ugprade path, let's not kill ourselves again. So a looser approach for the first beta releases sounds very sensible.

For upgrade path testing,we could dump a snapshot database of a beta install, and test updating that to the latest code base (with a few basic assertions after the upgrade has completed), that ought to flush out complete site breakage - but we should only add that once we're planning to actually fix every upgrade issue that gets thrown up by that, not before.

Major bugs/tasks that affect schema probably have to be case by case. How major the issue is vs. how much of a schema change it is. Dropping/adding columns and indexes is a lot less disruptive than changing types/lengths etc. or updating values. Also whether not doing it means postponing to 8.1.x or 9.0.x.

However if possible we should try to triage the major issues prior to beta and get known schema changes tagged correctly - there could be very disruptive updates in there lurking (thinking particularly of postgresql/sqlite indexes etc. which would require an upgrade path or reinstall once we fix that).

There has to be an upgrade path from the final beta release to the first release candidate, whatever happens prior that seems 100% required.

If it turns out sites are desperate for a more stable upgrade path than we're managing to provide in core, then there's the option of opening major issues for changes that went in without an upgrade path, or reviving http://drupal.org/project/head2head or both.

webchick’s picture

Given we're already 3.5 years into the development of Drupal 8, I'm happy to explore ideas to remove barriers to core developers and help it get released sooner. Only worrying about the upgrade path during the final transition from beta > RC would be completely fine with me, personally. Beta-to-beta upgrades was not something we did in Drupal 7 and the two big sites that built while still in alpha/beta—Examiner and Drupal Gardens—were able to function fine without it. I consider it a "nice to have" for Drupal 8, one that we hope would result in more people building on D8 sooner, but that seems like a very big gamble against the mountain of data we have that shows that once we do require X-to-X upgrades, everything gets a lot trickier to solve.

Anonymous’s picture

yes, plus 1,000,000 to #6 and #7.

catch’s picture

One thing I'd add to the proposal. I've resisted so far putting either a dev tarball or the alpha releases on http://drupal.org/project/drupal.

Let's continue to not have those releases on the project page until we're making a decent effort to support the beta-beta upgrade path. Breaking sites between betas will annoy some people who get core via git, but it will almost certainly annoy a higher percentage of people who get core via a tarball.

webchick’s picture

Status: Active » Reviewed & tested by the community

+1.

Should we move this here? I haven't seen any huge opposition to anything being proposed yet.

xjm’s picture

Thanks everyone! Summarizing the additional feedback from the comments:

  • Our outstanding issues with schemata are mostly resolved or beta-blocking, with the exception of Migrate, which we should explicitly indicate in the beta1 release notes is an exception (i.e., Migrate is still in alpha).

  • In general, the upgrade path represents a big investment of core development resources, so we should be smart about not starting this too soon.

    For this, maybe we should explicitly state that beta 1 to beta 2 will not have a supported upgrade path, but will have a best-effort stable data model to reduce the burden on contrib module ports.

  • Being more explicit on allowed data model changes:
    • We will allow data model changes for critical issues when it's necessary.
    • We may allow data model changes for major issues, at maintainer discretion based on how disruptive the data model change is and what the impact of not allowing a data model change would be.
    • In most cases we will avoid data model changes for non-major issues.
  • We will begin providing tarballs of the betas on 3060 once we are providing a reasonably supported upgrade path, perhaps starting with beta 2.

Does that summary sound accurate to everyone? If so I'll incorporate it above and then add this to the handbook.

xjm’s picture

Forgot a couple points:

  • We will provide an upgrade path from the final beta to the first release candidate.
  • We will try to triage/tag major issues between now and (say) the second beta to identify what data model changes might be outstanding there.
catch’s picture

List looks good. I'd probably say 'beta 2 or 3'.

I'd also add we're not going to do anything special for service renames or similar which would require a container rebuild. Similarly anything like adding additional configuration dependencies which might involve updating active config. That can mean either mean (fixable but annoying) fatal errors after pull, or that the site is inconsistent with how it would be had there been a fresh install.

edit: that might already be covered under 'schema changes' since these are more minor, but longer list of 'things we will not fix' means less chance of issues getting opened maybe.

ianthomas_uk’s picture

A "best effort" upgrade path seems a poor compromise to me, if it means we're going to end up doing most of the work, but people still won't be able to actually use the upgrade path because a key issue or two is missing. Have we got any idea of how often a beta-beta upgrade path would end up being used?

The main advantage I see of a beta-beta upgrade path is to force us to test the current upgrade path and uncover any bugs sooner rather than later. But I don't think the sort of bugs we'd be likely to find would be difficult to fix closer to release.

xjm’s picture

I think all "best effort" means in this context is "we provide an upgrade path, but 'we break your code, not your data' doesn't have the rigidity it has for a stable release." That's my take, anyway.

coleman.sean.c’s picture

  • "Best effort" means that there are circumstances where we will knowingly commit a patch that could break someone's data. Rare circumstances that we will try to avoid, but it might happen.
  • "Best effort" implies a continuum to something that's binary: Either there's a commitment to a supported upgrade path, or there isn't.
  • As an expert employed to advise content creators who are making potentially expensive decisions, right now, I need to know when it's going to be safe to start entering data into a Drupal installation.
  • In the post quoted in the issue summary, Dries himself says that was beta1, which will occur when there are no critical issues in the queue.
  • This proposal is backing down from that very clear and highly publicized statement.

Instead, I need to wait for the 'final beta'? What does that mean, and when will that happen? What's the definition of 'beta 2'?

catch’s picture

In the post quoted in the issue summary, Dries himself says that was beta1, which will occur when there are no critical issues in the queue.

Please find that sentence in the post and quote it. Beta1 is when there are no 'critical API/data model changes', not when there are no critical issues at all - that's RC1. There's currently ~15 beta blockers and ~85 other critical issues in the queue.

We won't knowingly go into the beta with known critical data model changes left, that's why #2183231: Make ContentEntityDatabaseStorage generate static database schemas for content entities and similar issues are tagged as beta blocking.

However, once an upgrade path is properly supported, this means that those 85 critical issues (and the 100 or so more that will likely be opened and fixed before we get to RC1 that aren't even known about yet) have to do double if not quintuple the work in order to support it - write the upgrade path, write tests for the upgrade path, generate data sets that are realistic enough for the tests to be useful - sometimes for changes that would otherwise be a one or two line patch. Hence, prematurely announcing a beta/stable upgrade path has serious potential to delay the release as a whole, as well as the fixes for individual critical bugs.

This issue is trying to deal with the fact that there are two criteria for the beta:

1. You can reasonably expect to port a module and not have to deal with far-reaching API changes again - at least with 'critical APIs' that are required to build most modules.

2. You can very carefully start building sites and we won't go out of our way to break your data.

#1 is a lot easier to guarantee, and with much less consequences if something unexpected comes up than #2.

If Drupal.org supported it, I'd happily do gamma releases for the head2head upgrade path.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Going to go ahead and mark this fixed. We'll need to be very clear with the initial beta 1 release announcement what's happening.

catch’s picture

Issue tags: -revisit before beta
webchick’s picture

Er. Shouldn't Dries sign off on this before we mark it fixed? While I think it completely makes sense, it's nevertheless a pretty large departure from what was previously communicated out.

catch’s picture

@webchick I failed to mention this in my comment, but I marked it fixed while on the phone to Dries and alexpott. Which explains but does not excuse the very short comment...

xjm’s picture

a pretty large departure from what was previously communicated out.

Is it? Dries' post says:

This means that a data upgrade path from Drupal 7 is no longer a prerequisite for releasing Drupal 8.0-beta1. Instead, we will focus on what testers and contributed module authors most need from a Drupal 8 beta: (1) a stable data model and (2) stable critical APIs

And:

A stable data model means that developers should not need to perform data migrations between beta releases of Drupal 8 (except where necessary to resolve critical issues).

https://www.drupal.org/core/release-cycle#api-completion says:

A data migration path is generally not provided between beta releases.

And between ourselves we've been saying that it should be best-effort. Where is the departure?

webchick’s picture

catch: Oh, cool. Thanks. :)

xjm: That "best-effort" doesn't start until at least beta2 and possibly much later. Dries's post says it affects "between beta releases," with no qualifier.

And then there's this earlier post: http://buytaert.net/drupal-8-apis-are-freezing-but-not-frozen

"What can I expect from beta releases?
Beta 1 will still be the point at which we encourage any interested site builders to try out the beta and provide feedback on it, so it will include an upgrade path from Drupal 7 for testing."

So while we know that the later post was an "update" to that original one, both the big huge graphic and the text indicate in "freezing but not frozen" indicate that site builders should start using it at beta1. (IIRC Dries's Prague keynote said the same thing.)

So we may want to do another piece of communication about this decision, including when and how site builders who *do* want to build on D8 while it's still somewhat malleable (but don't want to or can't write their own upgrade paths) will know when the core team has introduced X-to-X upgrades. (Read the release notes? Watch for an announcement on Dries's blog? etc.)

catch’s picture

Yep this needs very clear explanation on the initial beta release notes.

I am not sure if it needs a specific post before there's a beta or not - maybe something in g.d.o/core pointing to this issue?

One thing worth pointing out, if you are developing a new site (or working on an upgrade from 6/7), beta is still a good point to start doing that in many cases.

It's a good idea if your workflow is to re-install your site after each major change. Every development project (that was not already launched) I've worked on in the past 4-5 years has had this workflow until the last possible moment. Usually anything between the first third and the first 4/5ths of the initial development there is no central database and you just install and/or install + migrate every so often. Custom code + default config entities might need updating occasionally - if you get hit by an API change.

What would not be a good idea would be a personal blog that takes less than a day to get set up then launches - however technically we also shouldn't be recommending that until all known security issues are fixed as well, which will likely be RC.

webchick’s picture

Yeah, g.d.o/core might work for now. Just anything to get it on the radar of more than 15 people. ;)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

catch’s picture

Status: Closed (fixed) » Active

Sorry I'm going to re-open this.

#2180389: Switch from item-based to time-based index throttling requires a small change to a static configuration file and schema.

For static configuration, changing the schema and adding/updating a value is an easy change to make, and I think we'll have to do that for performance and usability issues past beta.

I'd be more wary about changing config schema for configuration entities since those can be shipped by contrib/custom modules. Possibly a clarification that changes to static configuration are allowed is enough, but needs sorting out.

jhodgdon’s picture

The issue summary here is pretty clear about what the data model is: database schema and config schema, right?

It isn't clear about what the policy is for whether this data model can change at all after beta. It sort of implies you cannot change the data model at all, but apparently you can make some changes...

So this policy should clarify:

- Can you add things to the data model? This would include:
- Adding new database tables
- Adding new config entities
- Adding new database table fields
- Adding to config schema
- Adding new shipped config files
- Adding lines to existing shipped config files

- Can you make any changes to the existing data model, and if so, are there restrictions to why/when? [This would mean changing existing database table fields and config schema.]

- If you do make changes to the data model, what do you need to do (like make an upgrade path)?

catch’s picture

Issue tags: -revisit before release candidate +revisit before beta

So for critical issues, you can do any of those things at any time up until RC, or possibly after if there's absolutely no other way to fix. Once we support beta-to-beta upgrade paths, you can do any of those things if you also supply a hook_update_N().

For non-critical issues, I'd say the following is definitely OK:

- changing static configuration files/schema (there's no real benefit to them being locked down, and we're just going to have to change some)
- adding new static config files, config entities, or entire tables (within reason)
- adding columns to tables (within reason)
- adding indexes anywhere

(same rule with hook_update_N() once beta-to-beta updates are supported).

Any changes to configuration entities or content entities we'd have to be a lot more careful with. For critical issues we'll have to do it and provide upgrade path when that's necessary. Non-critical issues it'll probably have to be case by case.

What this doesn't cover is changes to things like lock/queue/cache schema - usually we only change those for critical issues anyway, but since the tables aren't part of the API at all the main issue is a safe upgrade path.

We also need to clarify this for minor vs. patch-level releases, most of these would probably need to be 'minor version target' because we want to avoid any potential upgrade headaches in 8.0.1 etc.

alexpott’s picture

#29 makes sense to me. But everything is with the caveat within reason - once we cut the beta we want do avoid https://socketwench.github.io/portingFlagToDrupal8/#/2/2 as much as possible - and definitely get really good at doing 8.x to 8.x change records.

catch’s picture