-
Notifications
You must be signed in to change notification settings - Fork 19
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
Single command upgrading #72
Comments
We are going to try to upgrade all our client and OS modules at the same time using as much automation as possible. If the automation is smooth enough, we could even fork all the remaining third-party SS3 modules still out there and create an upgrade-to-4 pull request for them (fully automated). Right now, I have no idea how "automated" we can get (I may be dreaming), but it would be awesome if we could achieve that. Obviously our goal for this is "works with SS4" NOT "is optimised for SS4". I think it is a mistake the mix up the two. First we should make it "work" and then we can optimise it. Optimisation depends on what we are optimising it for (easy to read code, fast code, adjusted to changed best practice / circumstances / etc..., fully making use of the SS4 coolness, or whatever is most applicable) I have started some work here:
For the upgrade from 2 to 3 I used:
|
Thanks for sharing @sunnysideup! Our goal for core is a reduced upgrade burden, but since we have pretty high standards on the accuracy of the tools we provide, automated upgrades won't be feasible as part of this effort. So there's some room for additional/optional community-maintained tools - ideally complementing rather than duplicating the existing upgrader work of course :)
We're trying to do this with the
Wow, that's a pretty comprehensive list! We're already trying to do this through the upgrader command, everything with a |
Hi Ingo, Thank you for your notes. The inspect command is broken for me: #70 My list was up to 3.1 and not for 4.0. Once I do some more testing, I will write a few more notes here. |
As part of this, it would be great if the warnings from the inspect step were placed into a text file or something - upgrade-todo.txt or similar. As a developer you're going to need to refer to this after you close your CLI window. |
just wanted to share that I worked on my "multi module" tool a little - see: and for usage see: It still needs a lot of TLC, but I have great hopes ;-) |
I'm about to start working on this. I suggest splitting it in two:
One command to rule them allBasically, I'll have to go through each command and get a full listing of all the available flags. Some of them might not be relevant, so can probably be omitted. I don't think we can do this without writing our changes. Some steps require that a previous step had been completed before running. e.g.: Order of commandSome steps might be optional and won't prevent future steps from being run. (e.g. Upgrading web-root). Other steps will need to be successful before letting the next command run. Of the top of my head this seems like the best order.
I would exclude Providing nice output and feedbackManaging the output here could be interesting. Each command provides warnings, which should be sent to the STDERR. If I just concatenate the output of each command and spit it out at the user, the user will just have a big blurb of text at the end of the process sprinkled with warnings. If I can capture the warnings and display them all in a neat block at the end of the command, that probably would be better for the user. I might need to refactor the output of each command to make it easier to capture and more consistent. I might need to get each command to expose a ChangeDisplayer so I can see what has been done. To @sminnee point, it's probably a good idea to automatically save the output to a file. Obviously, there's nothing to stop the user to manually redirect the output to a file with Making recompose faster
This would speed up the process quite a bit, however you wouldn't get the recipe simplification logic and stricter version constraint. Testing this crazy thingI'll probably be testing this with a very vanilla project to begin with. However, I'll have to switch to a real world example to tease out edge cases. So I'll be implicitly upgrading that project along the way. I'll need something small enough that it doesn't take too much time to run the script, but complex enough that it throws some curve-balls at me. You may now suggest a project you want me to fix for you. Other points
|
I've already put some thought into redrafting the doc, althought it might be bigger than what @chillu had in mind. It's probably best to leave this until I'm done with the all-in-one command as repeatably bashing my head against the wall will increase my knowledge of each step. Reorganising the doc.I’m proposing we take the current Upgrading to SilverStripe 4 doc and convert to a multi page upgrade guide. Each step would become an individual page. The page would be designed to be read in a specific sequence and would follow more or less the same pattern. The broad purpose of this change would be to make it easier for developers to understand what they need to do when upgrading a site and divide the process up into smaller more understandable task. We still want developers to have a good understanding of what they are getting into and the amount of work that is required. Problems with the existing doc
What the standard Step/Page layout should look like
Each page should cover at most one upgrader command. Basically, the manual section explains the detail of what’s going to happens when you run the upgrader command so that you can debug the output afterwards. Table of content
|
I will focus on building a tiny tool to upgrade modules that will be complementary to the effort detailed above so I am stoked if this goes ahead. Thank you. |
@chillu On the point of renaming the commands, the Symfony console command class allows us to group command allows us to categories command with a This means when you look at the help for your command you get something like: We're adding new command at a furious rate right now, so it would make sense to start categorising them. |
Great write up, that really helps me as a PO! Sorry for taking so long to respond.
That's fine, as long as the upgrader clearly spells out that it's going to change the codebase as part of the process
I don't want to force people to change their webroot, or rename from
Only do this if it doesn't involve multi-hour refactoring. We can use colour and ascii headlines to highlight "sections" of output.
Let's stick to stdout, this is gold plating.
Good idea, but sounds like something we can put into docs for now. How often do you think people will run this command on an already updated composer.json?
I don't think that's worth a day of effort. How much would it be if you stub out the commands instead, and just test the "unit" of the all-in-one command? Basic stuff like checking it doesn't run a command if you've opted out of it, nothing fancy. |
I like single page upgrade guides because they become easily searchable through your browser. Talking to partners and developers, that's a real use case. Yes, it looks more scary (longer) than individual pages for steps, but there's no point hiding the complexity behind a bunch of links. Otherwise I agree with your "standard step/page layout", I'd just change that to a section on a single page instead. And we should recommend the automated way before explaining the manual way. How are you proposing we consolidate the I guess those guides serve a few different audiences:
Your doc restructure is pretty geared to "Devs going through a major upgrade". Do you think we can create one doc which serves these different use cases? Maybe we can do a step-by-step guide and link off to details on the individual steps as anchors on the same page? Proposed structure:
It might be worthwhile to move the full changelog at the bottom to a different document to make this page look a bit less scary? Also, I'm not sure where additional tips easily missed fits at the moment. It feels like some of those should be sections in the "Important API Changes", others should be in "Overview for Developers"? At the moment, we have so many "overviews" that there's no overview. |
It's not really asking the user that will take time. It's that if I need to apply changes to the code base later on, I'll need some mechanism to know if I need to operate in
Quite a bit actually. Most steps require a previous step to have completed successfully. So the execution will need to be halted on many occasion to give a chance to the user to fix stuff.
That's a good idea. I'll give that crack. |
Single page vs multi-pageI will strongly dissent with the single page idea:
We add a progress marker in he guide (e.g.: step 1 of 20), that should give the reader a good indication of where they are in the volume of work involved. AudienceI really saw this has a developer focus document, but I can see the value in having some section for other stakeholders. I would definitely would not to mix content author and decision maker doc with the developer doc. If I’m a content author who wants to learn more about the difference between SS3 and SS4, I’ll probably be pretty intimidated if I land on a massive document that talks about API changes, PHP version, running commands, etc. Guides vs change logsWe pretty much have the exact opposite view on this one. I would want to shift most of the content on the guide. 4.0.0.md and 4.1.0.md should just be a boring list of changes since the last release with little to no explanation about how to implement those changes. If there’s a specific minor version introduce a significant change that require some decent amount of work to upgrade, than that should be a designated step in the guide. It’s not all frowny faces and discontentThe API reference section is a great idea. I agree that additional tips easily missed should mostly go in the important API change section. |
Many command need to be applied to a specific path which may be mysite or mysite/code or their SS4 equivalent. addProjectFolders will append a project-path and code-path to the argument list pass to automated commands. silverstripe#72
You mean stuff like moving
No, separate feature ticket please.
How is this related to the single command use case? Sounds like enhancements to me. I think overall, if the add-namespace command isn't up to scratch to add namespaces to your project code, we should exclude it from the single command run for now. It's an optional step, presumably your project still works even if you don't apply a PSR-4 autoloader.
Yes, I think we should have it change the |
The problem is that devs can be both decision makers and upgrade implementors. Those are quite different use cases. A decision maker would want to scroll through easily digestible (technical) information quickly, in order to make a judgement call if they recommend an upgrade implementation to their boss/client in the first place. An implementor is more interested in the step-by-step. And then there's devs who are halfway through upgrading their codebase, but are stuck and need to search for a specific problem (e.g.
I'm OK with that. Just worried that as we release 4.2, 4.3 etc, we'll need to communicate those upgrade concerns (optional deprecated stuff, new features) in the individual changelogs again - it'd become too messy to tack them onto Overall, I'm still not sure what use case different pages serve that can't be served better in a single doc with anchors. I think we need another opinion - @unclecheese @flamerohr does either of you want to weigh in before we proceed? |
I've run a quick poll on Twitter for a related question: https://twitter.com/chillu/status/999393971817275392. The upgrade guide is a bit different again, but overall there's a clear preference for longer single page docs. |
I think SinglePage is good for a guide/readme - only if it's anchored and linked properly with proper section headings. MultiPage is a good mechanism for enforcing proper sections to be written out, something that can be done on a SinglePage. At least with SinglePage, even if the section is named incorrectly you can search on the page without needing to jump to a search engine. As a sidenote: I do agree with keeping change logs simple and keep information of implementation somewhere else, a simple changelog list helps the decision making without getting lost in the implementation details. |
I'm just outlining the TOC here. silverstripe/silverstripe-upgrader#72
Many command need to be applied to a specific path which may be mysite or mysite/code or their SS4 equivalent. addProjectFolders will append a project-path and code-path to the argument list pass to automated commands. silverstripe#72
@maxime-rainville , I have now created a really fragile working model of a module upgrader, that will hopefully work with your all-in-one upgrader: This file may give you a bit of an idea on how it works: |
The way I did the That might be a bit more relevant to #85. Let's maybe take that discussion there so we don't get things mixed up. |
sounds good. |
🚧 Original upgrading doc. I'm keeping it around just so I know what content hasn't been restructured. 🚧 Setting outline of new upgrading guide. I'm just outlining the TOC here. silverstripe/silverstripe-upgrader#72 🚧 Typo correction. 🚧 Move most of original content into new structure. 📝 Documenting how to recompose your dependencies. 📝 Finish documenting the reorganise command. 📝 Add a conlusion to upgrade 📝 Drafting environment upgrade doc Move environment upgrade doc out of change log and integrating it into the upgrading guide. 📝 Document how to namespace project 🚧 Working on step 4. 📝 Adding doc for the upgrade step. Finalise first draft of the upgrade guide. Remove typo Implementing feedback on the doc. Implementing upgrade guide feedback.wq Add refrence to upgrade guide into change log. Implement specific upgrade guide peer review suggestion. Wording tweaks. Remove reference to ACME and rewrite overview. The end of the upgrading guide tweaks ... I think.
🚧 Original upgrading doc. I'm keeping it around just so I know what content hasn't been restructured. 🚧 Setting outline of new upgrading guide. I'm just outlining the TOC here. silverstripe/silverstripe-upgrader#72 🚧 Typo correction. 🚧 Move most of original content into new structure. 📝 Documenting how to recompose your dependencies. 📝 Finish documenting the reorganise command. 📝 Add a conlusion to upgrade 📝 Drafting environment upgrade doc Move environment upgrade doc out of change log and integrating it into the upgrading guide. 📝 Document how to namespace project 🚧 Working on step 4. 📝 Adding doc for the upgrade step. Finalise first draft of the upgrade guide. Remove typo Implementing feedback on the doc. Implementing upgrade guide feedback.wq Add refrence to upgrade guide into change log. Implement specific upgrade guide peer review suggestion. Wording tweaks. Remove reference to ACME and rewrite overview. The end of the upgrading guide tweaks ... I think.
🚧 Original upgrading doc. I'm keeping it around just so I know what content hasn't been restructured. 🚧 Setting outline of new upgrading guide. I'm just outlining the TOC here. silverstripe/silverstripe-upgrader#72 🚧 Typo correction. 🚧 Move most of original content into new structure. 📝 Documenting how to recompose your dependencies. 📝 Finish documenting the reorganise command. 📝 Add a conlusion to upgrade 📝 Drafting environment upgrade doc Move environment upgrade doc out of change log and integrating it into the upgrading guide. 📝 Document how to namespace project 🚧 Working on step 4. 📝 Adding doc for the upgrade step. Finalise first draft of the upgrade guide. Remove typo Implementing feedback on the doc. Implementing upgrade guide feedback.wq Add refrence to upgrade guide into change log. Implement specific upgrade guide peer review suggestion. Wording tweaks. Remove reference to ACME and rewrite overview. The end of the upgrading guide tweaks ... I think.
Overview
While the upgrader is a very helpful, it interleaves manual instructions with individual automated commands. Ideally we can guide developers through semi-automated updates through a single command. This is aimed at increasing adoption, but also at making it easier to run a single tool to determine the "upgradeability" of a site. We need to get agencies and developers in a position where they feel somewhat confident quoting for upgrades, and getting a site "mostly running on 4.x" is a great way to achieve that.
Acceptance Criteria
--write
and--verbose
)Commands
Note: Order might need to be adjusted
Notes
--yes
optionSub task for the all in one command:
Pull Request
all
command #83The text was updated successfully, but these errors were encountered: