neos-base-distribution icon indicating copy to clipboard operation
neos-base-distribution copied to clipboard

FEATURE: Do not install demo site and instead offer a choice

Open kitsunet opened this issue 5 years ago • 27 comments

This can be tested via:

composer create-project --repository '{"type":"vcs", "url":"[email protected]:kitsunet/neos-base-distribution.git"}' neos/neos-base-distribution neos-dev-dist-demo-installer dev-feature/demo-installer

followup: https://github.com/kitsunet/neos-base-distribution/pull/1 related: https://discuss.neos.io/t/rfc-post-create-project-tasks/5141

kitsunet avatar Oct 18 '19 16:10 kitsunet

looks good so far, wanted to test it locally, but when running composer create-project (with this PR checkout out ofc) composer starts to run into a endless loop with the message Something's changed, looking at all rules again (pass #305) (verbose output)

What ist the best way to test the changes locally @kitsunet?

gerhard-boden avatar Oct 18 '19 17:10 gerhard-boden

Tried it at home now on a completely different machine, same story (also for composer update). I think that https://github.com/neos/neos-base-distribution/commit/67a62e29e4051268b6e4a5509a3a91cea7a214ed might have something to do with it, although I can't see what's wrong.

gerhard-boden avatar Oct 18 '19 19:10 gerhard-boden

Okay here is a hack:

  1. Remove all packages except for neos/neos
  2. Run composer update
  3. Add all other packages

Now composer update will succeed. It looks like composer is running into a dependency check endless loop, never seen anything like this before.

This way was at least able to test this PR, but the general issue inside the base distribution has to be addressed. I would have opened an issue, but we don't do issues in the base distribution.

gerhard-boden avatar Oct 18 '19 19:10 gerhard-boden

Alright, removed a lot of superfluous stuff from this, actually trying it is rather hard. while working on it I was using a branch in this repo that I then asked for in create-project ( composer create-project neos/neos-base-distribution my-folder dev-mybranch ) . Now I probably could move this PR over to the original repo if you want and it makes testing easier.

kitsunet avatar Oct 18 '19 21:10 kitsunet

Now I probably could move this PR over to the original repo if you want and it makes testing easier.

Naw, I was able to test it in the end after some composer.json back and forth as mentioned above. Afterwards composer create-project within the folder would trigger the script. But the real troublemaker is that there is an issue in the master branch of the base distro (could you give composer create-project neos/neos-base-distribution . dev-master -vvv a try? Or should that never work because we have the dev distro for that?)

gerhard-boden avatar Oct 18 '19 21:10 gerhard-boden

I can install base-distribution dev-master just fine, but it takes quite a lot of memory and time. Probably composer resolving dependencies. Eventually it could install though.

kitsunet avatar Oct 19 '19 06:10 kitsunet

I can install base-distribution dev-master just fine, but it takes quite a lot of memory and time. Probably composer resolving dependencies. Eventually it could install though.

Thanks for checking, just tried it again:

Something's changed, looking at all rules again (pass #619)
Dependency resolution completed in 492.679 seconds
Analyzed 14727 packages to resolve dependencies
Analyzed 1402061 rules to resolve dependencies
Resolving dependencies through SAT
Looking at all rules.

I guess I wasn't patient enough on the train to wait 8 minutes for composer to just even start downloading packages 🙈

But at least it's working in general and this "issue" (if it is in one at some point), is definitely out of scope for this change. Just brought it up in here, because I noticed it while testing. 😊

gerhard-boden avatar Oct 19 '19 09:10 gerhard-boden

FYI this line allows to test this without messing with the composer-configuration:

composer create-project --repository '{"type":"vcs", "url":"[email protected]:kitsunet/neos-base-distribution.git"}' neos/neos-base-distribution neos-dev-dist-demo-installer dev-feature/demo-installer

mficzel avatar Oct 21 '19 11:10 mficzel

Interesting for me it installed jusut fine, apparently something changed with some dependency declaration? I can try to test for success, but not sure I get any info about that....

kitsunet avatar Oct 21 '19 11:10 kitsunet

@kitsunet https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Application.php#L194 returns 0 if all went fine and the composer application passes this trough. So this should be simple.

mficzel avatar Oct 21 '19 18:10 mficzel

I am suspecting that the neos-base-distribution has a dependency problem on master: I get Installing neos/flow (4.0.25): Loading from cache which is a bit oldish and also

Package typo3/neos-nodetypes is abandoned, you should avoid using it. Use neos/nodetypes instead.
Package typo3/kickstart is abandoned, you should avoid using it. Use neos/kickstarter instead.

The reason seems to be that dev-dist(master) requires (neos: @dev) which requires (flow: *).

How should the dependencies look on master?

mficzel avatar Oct 22 '19 09:10 mficzel

@kitsunet i think i understand the problem now. The solution here requires neos/demo without version constraint wich allows composer to make all sorts of decisions.

As solution i suggest to use the "extras" section of the composer manifest as source like this.

{
    "extra": {
        "neos": {
            "create-project-sitePackageOptions": [
                {
                    "composerName": "",
                    "versionConstraint": "",
                    "description": "empty Neos"
                },
                {
                    "composerName": "neos/demo", 
                    "versionConstraint": "@dev", 
                    "description": "start with the Neos Demo content"
                }
            ]
        }
    }
}

or more compact

{
    "extra": {
        "neos": {
            "create-project-sitePackageOptions": {
                "": "empty Neos",
                "neos/demo:@dev": "start with the Neos Demo content"
            }
        }
    }
}

As side effect this will also make the life of release managers easier as they can still adjust all constraints in the composer.json of the base-dist. Also it will be much more intuitive to add more flavors of neos like neos/skeleton or neos/headless to the base distribution.

mficzel avatar Oct 24 '19 06:10 mficzel

Mmm, yes, that could work, let me think about the syntax, because I have some more ideas in mind about this in the future...

kitsunet avatar Oct 24 '19 07:10 kitsunet

@kitsunet a way to make this even more useful and clean be to move the InstallSitePackage.php to Neos\Flow\Composer\InstallerScripts->PostCreateProjectCmd and use the path extra.neos.create-project-packageOptions from the main manifest for configuration. That way it would be available for the flow-base-distribution and even custom neos distributions.

Offcourse this would add a composer dependency to flow which we just added in https://github.com/neos/flow-development-collection/pull/1837 anyways.

mficzel avatar Nov 08 '19 07:11 mficzel

@kitsunet i played with moving the post create project command to the composer scripts in flow: https://github.com/neos/flow-development-collection/pull/1852 what do you think about this solution.

mficzel avatar Nov 21 '19 20:11 mficzel

@mficzel do still request changes or can we merge that feature?

davidspiola avatar Dec 01 '19 21:12 davidspiola

@davidspiola there is an alternate implementation based on flow that I mentioned above that would be a much more generic solution but is also in need of feedback

mficzel avatar Dec 01 '19 22:12 mficzel

I suggest to postpone this for now and aim to 5.2 for this feature

mficzel avatar Dec 01 '19 22:12 mficzel

So, what's the status on this one?

albe avatar Apr 01 '20 20:04 albe

It seems a bit unelegant to add a special class where all other composer magic is usually done in Neos\Flow\Composer\InstallerScripts .

I would really prefer a configurable solution via the Flow Composer Installer Scripts that can also be used for custom distributions like i sketched in https://github.com/neos/flow-development-collection/pull/1852 . That would reduce this pr to some lines in the composer.json of the neos-base-distribution.

However as the other or did not get any feedback and this is still an improvement we might consider to merge this as it is an intermediate improvement.

mficzel avatar Apr 02 '20 08:04 mficzel

FYI: I'll prepare a PR-PR with the suggested changes

bwaidelich avatar Apr 06 '20 08:04 bwaidelich

=> https://github.com/kitsunet/neos-base-distribution/pull/1

bwaidelich avatar Apr 06 '20 09:04 bwaidelich

Related discussion: https://discuss.neos.io/t/rfc-post-create-project-tasks/5141/14

bwaidelich avatar Sep 15 '20 08:09 bwaidelich

this would be a really valuable thing (especially for newcomers, then they wont get confused with uninstalling the demo site etc...)

i have another idea: how about that the Neos.Demo site is 'installed' in the DistributionPackages folder as one is likely to play around with it and this seems the right place. (maybe this could even work for custom git repos...).

mhsdesign avatar Dec 09 '21 15:12 mhsdesign

I would like to eventually remove the Language Configuration from Neos.Demo ... that way it could coexist with other site packages without problems. In which case it could still be installed by default without doing harm. We could even move it to the neos-dev-collection.

... plus cli-commands to add remove dimensions/dimensionvalues.

mficzel avatar Dec 09 '21 16:12 mficzel

as far as i know this is not solved. we only have a ./flow welcome command to setup neos but we want to hack into pre composer install logic ...

mhsdesign avatar May 30 '22 08:05 mhsdesign

I also think this is not solved yet fully but am not sure we should keep this pr open as we will probably end up with a different solution anyways?

mficzel avatar May 30 '22 08:05 mficzel