From: Cliff W. <cl...@lr...> - 2003-07-26 19:02:45
|
For those interested, I'd like to propose the following and open up the floor for comments. If anyone is interested in this subject, please speak up! Automated Schema Updates for Slash ---------------------------------- While the current system for updating the Slash schema isn't all that complex, it is a bit tedious, and as the number of Slash sites to maintain increases, this tedium can then become an updating nightmare. Currently, all updates must be done by hand, for each site: this includes core updates, core plugin updates, core theme updates, third party plugin updates and third party theme updates. Rigth now, most of the core changes are tracked in slash/sql/mysql/updates (since MySQL is the only backend really being supported, at the moment). This is good, but what happens when site administrators have to worry about updates for third party add-ons? And for multiple Slash sites? What is proposed is a community effort to design and implement an automated tool that can determine, parse, and apply any changes that need to be made to a Slash backend to bring it current with the updates in database schema and data storage methods employed by Slash, to reduce the hassle and the problems that occur with Slash software updates. To simplify this problem, I have broken the issue up into 4 phases, including a "prep" phase: 0. Prep I. Determining Current Schema Characteristics II. Parsing Schema Changes III. Applying Schema Changes IV. Updating Data V. Schema Verification Now, to discuss the issues surrounding each phase: 0. Prep This is basically the "housekeeping" step that needs to be done to the codebase. There are two major concerns: converting the current upgrades file into something that is both human and machine readable. The second is providing a system where third-party themes and plugins can specify their own updates, as a working system will need to consider those changes as well. This tool might also assist developers in keeping their changes aligned with changes in Slash (by providing warnings and errors when their changes fall out of date and conflict with the core), especially if the developer is following Slash development from CVS. (For the sake of argument, "third-party" is used to define anything not included with core Slash, and the determination of what is, and is not "core" is left up to the Slash Development Team). Much of the work has been done, since the upgrades file is heavily commented (including notations of the updates for T_ and R_ release flags, and plugins specific updates). If we can standardize on such notations, we can parse them out. I. Determining Current Schema Characteristics Before updating a schema, it must be analyzed for validity. The analysis doesn't necessarily have to be expensive, but checks bypassed here, may be necessary (and more expensive to implement) if put off to a later phase (most likely to the verification phase). Analysis here could be as simple as a variable (one for the core code, and a variable each for every third party plugin AND theme). Or it could be as complex, involving a thorough (and processor intensive) analysis of the current schema for validity. Regardless of the implementation, we must be able to provide some kind of starting point for the update tool to work from. II. Parsing Schema Changes From said starting point, a list of changes needs to be constructed from the given update data, from the core and from third party addons. III. Applying Schema Changes Changes are then applied to the site, with core changes being applied first and third-party changes applied last. IV. Updating Data In the event that schema changes from one version to the next, involve updating data in some manner, than these changes need to be done in this stage. V. Schema Verification The entire schema may then need to be verified. It might be wise to take the existing schema (both core and third party) and compare it to what's currently live and note the differences. Note, that in the event of a multi-version update, the tool will run the phases in the following order (say from version x, thru y, to z): Start Vx -> Vy Vy -> Vz Fin I -> II -> III -> IV -> III -> IV -> V Such a tool, once developed to handle a single site, automatically. Can then be applied to update Slash clusters, via "glue"-methods like shell scripts or Perl, cutting down on the laber necessary to prepare a Slash site for a software update, and minimizing the chance of human error in the update process. Now I don't have a complete answer to this entire problem, so this is where the community gets involved. If you are interested in working on this problem, I'd be very interested in hearing your thoughts. If enough like minded individuals are interested in putting their heads together, maybe we can come up with a workable solution that everyone can use. I'm looking forward to reading the thoughts from this list. - Cliff |
From: Brian A. <br...@ta...> - 2003-07-29 19:09:25
|
When I looked at this, I wanted to make a patch tool. My tool works off a data file that looks like this: <updates> <patch> <id>2322</id> <comment>Sample Comment</comment> <author>Brian</author> <sql>SELECT now()</sql> </patch> <patch> <id>2322</id> <comment>Sample Comment</comment> <author>Brian</author> <sql>SELECT now()</sql> <sql>ALTER MORE CRAP</sql> </patch> The thing is that is that each plugin should have its own XML update file that can be used, which is something that mine does not do yet. For what it is worth, the livejournal code base uses a really cool tool to diff schema and then apply patches. -Brian -- _______________________________________________________ Brian "Krow" Aker, br...@ta... Seattle, Washington http://krow.net/ http://askbrian.org/ _______________________________________________________ You can't grep a dead tree. |
From: shane <sh...@lo...> - 2003-07-29 22:59:53
|
On Saturday 26 July 2003 15:02, Cliff Wood wrote: > For those interested, I'd like to propose the following and open > up the floor for comments. If anyone is interested in this > subject, please speak up! > > > Automated Schema Updates for Slash > ---------------------------------- > > While the current system for updating the Slash schema isn't all that > complex, it is a bit tedious, and as the number of Slash sites to > maintain increases, this tedium can then become an updating > nightmare. Currently, all updates must be done by hand, for each > site: this includes core updates, core plugin updates, core theme > updates, third party plugin updates and third party theme updates. > Rigth now, most of the core changes are tracked in > slash/sql/mysql/updates (since MySQL is the only backend really > being supported, at the moment). This is good, but what happens when > site administrators have to worry about updates for third party > add-ons? And for multiple Slash sites? Yes, tedious is one of the words I've referred to it as. It's not bad when you have one, or two sites. But get 5 or more and... ugh. A lot of the work, for me, is the templates. If a site has highly customized looknfeel, the works exponential to make sure everything in the templates is updated to match the stock slashcode theme's templates. Now, IMHO, this will be lessened if/when the standard slashcode them uses CSS. Cosmetic changes? Change the stylesheet, and no need to change a lof of the templates. (Ok, I'm getting OT here) > What is proposed is a community effort to design and implement an > automated tool that can determine, parse, and apply any changes that > need to be made to a Slash backend to bring it current with the > updates in database schema and data storage methods employed by > Slash, to reduce the hassle and the problems that occur with Slash > software updates. Wasn't someone from OSDN working on such a beast a few months ago? > To simplify this problem, I have broken the issue up into 4 phases, > including a "prep" phase: > > 0. Prep > > I. Determining Current Schema Characteristics > > II. Parsing Schema Changes > > III. Applying Schema Changes > > IV. Updating Data > > V. Schema Verification > > Now, to discuss the issues surrounding each phase: > > 0. Prep > > This is basically the "housekeeping" step that needs to be done to > the codebase. There are two major concerns: converting the current > upgrades file into something that is both human and machine readable. > The second is providing a system where third-party themes and > plugins can specify their own updates, as a working system will need > to consider those changes as well. This tool might also assist > developers in keeping their changes aligned with changes in Slash > (by providing warnings and errors when their changes fall out of > date and conflict with the core), especially if the developer is > following Slash development from CVS. (For the sake of argument, > "third-party" is used to define anything not included with core > Slash, and the determination of what is, and is not "core" is left > up to the Slash Development Team). > > Much of the work has been done, since the upgrades file is heavily > commented (including notations of the updates for T_ and R_ release > flags, and plugins specific updates). If we can standardize on such > notations, we can parse them out. How about expanding the THEME, PLUGIN, and site_info table to hold version #'s? Or version tags? or something. But that would give an upgrade-tool app/script something to key off of. It might also simplify support - in that when you ask someone what version of Slash, or some plugin, they are running, and they go 'oh, uh, i installed that last year, I don't know'. > I. Determining Current Schema Characteristics > > Before updating a schema, it must be analyzed for validity. The > analysis doesn't necessarily have to be expensive, but checks > bypassed here, may be necessary (and more expensive to > implement) if put off to a later phase (most likely to the > verification phase). > > Analysis here could be as simple as a variable (one for the core > code, and a variable each for every third party plugin AND theme). > Or it could be as complex, involving a thorough (and processor > intensive) analysis of the current schema for validity. > > Regardless of the implementation, we must be able to provide some > kind of starting point for the update tool to work from. > > > II. Parsing Schema Changes > > From said starting point, a list of changes needs to be constructed > from the given update data, from the core and from third party > addons. Ya know, I recall a few weeks ago seeing someone on, I think, freshmeat, that someone wrote - that would go through a mysql db and come up with a diff for that schema. That might be worth looking into. > III. Applying Schema Changes > > Changes are then applied to the site, with core changes being applied > first and third-party changes applied last. How would you handle relevance, or dependance? Especially with foreign keys? > IV. Updating Data > > In the event that schema changes from one version to the next, > involve updating data in some manner, than these changes need to be > done in this stage. > > > V. Schema Verification > > The entire schema may then need to be verified. It might be wise to > take the existing schema (both core and third party) and compare it > to what's currently live and note the differences. > > > Note, that in the event of a multi-version update, the tool will run > the phases in the following order (say from version x, thru y, to z): > > Start Vx -> Vy Vy -> Vz Fin > I -> II -> III -> IV -> III -> IV -> V > > Such a tool, once developed to handle a single site, automatically. > Can then be applied to update Slash clusters, via "glue"-methods > like shell scripts or Perl, cutting down on the laber necessary to > prepare a Slash site for a software update, and minimizing the > chance of human error in the update > process. Oh bless the Lord wouldn't such a tool be sweet to have. > Now I don't have a complete answer to this entire problem, so this > is where the community gets involved. If you are interested in > working on this problem, I'd be very interested in hearing your > thoughts. If enough like minded individuals are interested in > putting their heads together, maybe we can come up with a workable > solution that everyone can use. I can devote a list serve to the cause, if needed. Shane |
From: Clifton W. <cl...@sl...> - 2003-07-30 04:02:28
|
On Tuesday 29 July 2003 18:55, shane wrote: > Wasn't someone from OSDN working on such a beast a few months ago? I think that was Brian, who now works for MySQL, and I don't think OSDN is willing to pick this task up at this time. > How about expanding the THEME, PLUGIN, and site_info table to > hold version #'s? Or version tags? or something. > > But that would give an upgrade-tool app/script something to key > off of. > > It might also simplify support - in that when you ask someone what > version of Slash, or some plugin, they are running, and they go > 'oh, uh, i installed that last year, I don't know'. I'd rather not put the versions in the files. I'd prefer to have them in the database, however this is not a hard and fast rule. If someone can come up with a better system that uses files than I'm interested. > Oh bless the Lord wouldn't such a tool be sweet to have. Yes, and hence my attempts at drumming up some support for it. =) > I can devote a list serve to the cause, if needed. Well, we're good here for a bit, but I might take you up on that. - Cliff |
From: Brian A. <br...@ta...> - 2003-07-30 04:54:45
|
On Tue, 2003-07-29 at 21:02, Clifton Wood wrote: > On Tuesday 29 July 2003 18:55, shane wrote: > > Wasn't someone from OSDN working on such a beast a few months ago? > I think that was Brian, who now works for MySQL, and I don't think > OSDN is willing to pick this task up at this time. Yep, that was me, and I have the basics of such a tool that I am willing to share with someone (the tool). My version of Slash is a fork, but this tool should be able to work for both. A more general sql diff tool might be of interest for MySQL, but it would need to be written in C. > I'd rather not put the versions in the files. I'd prefer to have them > in the database, however this is not a hard and fast rule. If > someone can come up with a better system that uses > files than I'm interested. Personally I think that plugins and the core do need versions, but that these should work like the perl ones and be more for "minimum" support. > > Oh bless the Lord wouldn't such a tool be sweet to have. > Yes, and hence my attempts at drumming up some support > for it. =) Good, needs to be done :) -Brian -- |
From: Clifton W. <cl...@sl...> - 2003-07-30 18:40:57
|
On Wednesday 30 July 2003 06:10, shane wrote: > No no no. The THEME and PLUGIN file would need to have a new line > that'd take someting like > > VERSION = blah > > But it'd be stored in the db. OIC! That's an idea, definitely. - Cliff |
From: Peter W. <pe...@op...> - 2003-07-30 19:24:53
|
Brian Aker wrote: > When I looked at this, I wanted to make a patch tool. > My tool works off a data file that looks like this: > <updates> > <patch> > <id>2322</id> > <comment>Sample Comment</comment> > <author>Brian</author> > <sql>SELECT now()</sql> > </patch> > <patch> > <id>2322</id> > <comment>Sample Comment</comment> > <author>Brian</author> > <sql>SELECT now()</sql> > <sql>ALTER MORE CRAP</sql> > </patch> I think that a tool like this would certainly make life easier when you run several slash sites ( hell even if you just run one ). We at Openflows are interested in a tool like this, so we'll help out to make sure that one gets developed. We've developed and host a number of slash sites using various cvs versions, as well as 2.2.6. Krow's XML syntax (above) for the upgrades file makes a lot of sense, at least to me. Is anyone thinking about a tool to help upgrading templates as well? Because it can be a lot of work. I'll now go back to upgrading yet another Slash site. :P |
From: Brian A. <br...@ta...> - 2003-07-30 19:44:47
|
On Wed, 2003-07-30 at 12:24, Peter Winnberg wrote: > I think that a tool like this would certainly make life easier when you > run several slash sites ( hell even if you just run one ). I am attaching the current version of it. No promises about its state at all. I had a feature in it to allow someone to take a text like file and insert the entry from it parsed, but personally I am going to pull it since I had no interest in it. > Is anyone thinking about a tool to help upgrading templates as well? > Because it can be a lot of work. Used the template-tool -U bit? -Brian -- _______________________________________________________ Brian "Krow" Aker, br...@ta... Seattle, Washington http://krow.net/ http://askbrian.org/ _______________________________________________________ You can't grep a dead tree. |
From: Peter W. <pe...@op...> - 2003-07-30 20:27:57
|
Brian Aker wrote: > Used the template-tool -U bit? Yes, I did a quick test ( I've not had time to check the code yet to see what it actually does ). It updates the templates to the latest version of the templates that are installed, right? But what if I do a default slash site using the slashcode theme .. does a lot of changes to the templates .. I launch the site .. and a couple of months later I decide that I want to upgrade to a newer version of slash cvs. I install the new version of slash cvs .. if I run template-tool -U now .. doesn't I end up with the default slashcode template again ( even if it's the latest version of the slashcode templates )?. peter |
From: Brian A. <br...@ta...> - 2003-07-30 20:38:30
|
On Wed, 2003-07-30 at 13:27, Peter Winnberg wrote: > Yes, I did a quick test ( I've not had time to check the code yet to see > what it actually does ). It updates the templates to the latest version > of the templates that are installed, right? Right > But what if I do a default slash site using the slashcode theme .. does > a lot of changes to the templates .. I launch the site .. and a couple > of months later I decide that I want to upgrade to a newer version of You need to create your own theme, and have it inherit the slashcode theme. Then, just insert your custom templates into that theme. They will override the slashcode templates for upgrades. -Brian -- _______________________________________________________ Brian "Krow" Aker, br...@ta... Seattle, Washington http://krow.net/ http://askbrian.org/ _______________________________________________________ You can't grep a dead tree. |
From: Alessio B. <al...@al...> - 2003-08-06 12:12:47
|
On Wed, 2003-07-30 at 23:27, Peter Winnberg wrote: > But what if I do a default slash site using the slashcode theme .. does > a lot of changes to the templates .. I launch the site .. and a couple > of months later I decide that I want to upgrade to a newer version of > slash cvs. I install the new version of slash cvs .. if I run > template-tool -U now .. doesn't I end up with the default slashcode > template again ( even if it's the latest version of the slashcode > templates )?. My solution is to use CVS with standard templates in a "vendor branch" and local updates on the main branch. -- Alessio Bragadini <al...@al...> APL Financial Services (Overseas) Ltd |