Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/news/+hide-addons.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hid all add-ons managed by our package. @ericof
1 change: 1 addition & 0 deletions backend/news/+missing-upgrade.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added missing upgrade step from 20260620001 to 20260701001 and added upgrade tests. @ericof
1 change: 1 addition & 0 deletions backend/news/452.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bumped `plone.formblock` to `>=1.0.0a3`. @ericof
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"plone.volto",
"kitconcept.voltolighttheme>=8.0.0a30",
"collective.volto.formsupport==3.2.3",
"plone.formblock>=1.0.0a2",
"plone.formblock>=1.0.0a3",
"collective.honeypot",
"collective.person==1.0.0b6",
"pas.plugins.authomatic==2.0.0",
Expand Down
70 changes: 44 additions & 26 deletions backend/src/kitconcept/core/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,59 +12,77 @@


_PLONE_PACKAGES = [
"borg.localrole",
"CMFDefault",
"Products.CMFDefault",
"CMFDiffTool",
"CMFEditions",
"CMFPlone",
"Products.CMFPlone",
"Products.CMFPlone.migrations",
"CMFTopic",
"Products.CMFTopic",
"CMFUid",
"Products.CMFUid",
"DCWorkflow",
"Products.DCWorkflow",
"PasswordResetTool",
"Products.PasswordResetTool",
"PlonePAS",
"Products.PlonePAS",
"PloneLanguageTool",
"Products.PloneLanguageTool",
"MimetypesRegistry",
"Products.MimetypesRegistry",
"PortalTransforms",
"Products.PortalTransforms",
"CMFDiffTool",
"Products.CMFDiffTool",
"CMFEditions",
"Products.CMFEditions",
"Products.NuPlone",
"borg.localrole",
"PasswordResetTool",
"plone.app.caching",
"plone.app.dexterity",
"plone.app.discussion",
"plone.app.event",
"plone.app.intid",
"plone.app.iterate",
"plone.app.layout",
"plone.app.linkintegrity",
"plone.app.querystring",
"plone.app.registry",
"plone.app.multilingual",
"plone.app.referenceablebehavior",
"plone.app.registry",
"plone.app.relationfield",
"plone.app.theming",
"plone.app.users",
"plone.app.z3cform",
"plone.formwidget.recurrence",
"plone.keyring",
"plone.outputfilters",
"plone.portlet.static",
"plone.portlet.collection",
"plone.portlet.static",
"plone.protect",
"plone.resource",
"plonetheme.barceloneta",
"plone.restapi",
"plone.session",
"plone.volto",
"kitconcept.voltolighttheme",
"PloneLanguageTool",
"PlonePAS",
"plonetheme.barceloneta",
"PortalTransforms",
"Products.CMFDefault",
"Products.CMFDiffTool",
"Products.CMFEditions",
"Products.CMFPlacefulWorkflow",
"Products.CMFPlone.migrations",
"Products.CMFPlone",
"Products.CMFTopic",
"Products.CMFUid",
"Products.DCWorkflow",
"Products.MimetypesRegistry",
"Products.NuPlone",
"Products.PasswordResetTool",
"Products.PloneLanguageTool",
"Products.PlonePAS",
"Products.PortalTransforms",
]

_CORE_DEPENDENCIES = [
"collective.volto.formsupport",
"collective.contact_behaviors",
"collective.person",
"kitconcept.voltolighttheme",
"plone.formblock",
"plonegovbr.socialmedia",
"souper.plone",
"collective.volto.otp",
"pas.plugins.authomatic",
"pas.plugins.oidc",
"pas.plugins.keycloakgroups",
]

_PLONE_PROFILES = [
"Products.CMFDiffTool:CMFDiffTool",
"Products.CMFEditions:CMFEditions",
Expand Down Expand Up @@ -109,7 +127,7 @@
@implementer(INonInstallable)
class HiddenProfiles:
def getNonInstallableProducts(self):
return [PACKAGE_NAME, *_PLONE_PACKAGES]
return [PACKAGE_NAME, *_CORE_DEPENDENCIES, *_PLONE_PACKAGES]

def getNonInstallableProfiles(self):
"""Hide uninstall profile from site-creation and quickinstaller."""
Expand Down
1 change: 1 addition & 0 deletions backend/src/kitconcept/core/upgrades/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<include package=".v20260505001" />
<include package=".v20260619001" />
<include package=".v20260620001" />
<include package=".v20260701001" />

</configure>
Empty file.
17 changes: 17 additions & 0 deletions backend/src/kitconcept/core/upgrades/v20260701001/configure.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
>

<genericsetup:upgradeSteps
profile="kitconcept.core:base"
source="20260620001"
destination="20260701001"
>
<genericsetup:upgradeStep
title="Upgrade to version 20260701001"
handler="..utils.null_upgrade_step"
/>
</genericsetup:upgradeSteps>

</configure>
Empty file added backend/tests/setup/__init__.py
Empty file.
15 changes: 15 additions & 0 deletions backend/tests/setup/test_setup_addons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from plone import api

import pytest


class TestAddonsList:
@pytest.fixture(autouse=True)
def _setup(self, portal_class) -> None:
self.portal = portal_class

def test_addons_list_should_be_empty(self) -> None:
"""Test that the addons list should be empty."""
with api.env.adopt_roles(["Manager"]):
addons = api.addon.get_addons()
assert addons == [], "Expected no addons to be installed, but found some."
2 changes: 1 addition & 1 deletion backend/tests/setup/test_setup_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_dependencies_version(self, profile_last_version):

class TestSetupDependencies:
@pytest.fixture(autouse=True)
def _setup(self, portal_class):
def _setup(self, portal_class) -> None:
self.portal = portal_class
self.setup_tool: SetupTool = portal_class.portal_setup
self.types_tool: TypesTool = portal_class.portal_types
Expand Down
55 changes: 55 additions & 0 deletions backend/tests/setup/test_upgrades.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from kitconcept.core import PACKAGE_NAME
from Products.GenericSetup.tool import SetupTool

import pytest


@pytest.fixture(scope="module")
def base_profile_id() -> str:
"""Fixture to provide the profile ID for the package."""
return f"{PACKAGE_NAME}:base"


@pytest.fixture(scope="module")
def list_upgrades(base_profile_id):
"""Fixture to list available upgrades for the package."""
from Products.GenericSetup.upgrade import listUpgradeSteps

def _list_upgrades(setup_tool: SetupTool, source: str, dest: str) -> list:
return listUpgradeSteps(setup_tool, base_profile_id, source, dest)

return _list_upgrades


class TestUpgrades:
@pytest.fixture(autouse=True)
def _setup(self, portal_class, current_versions) -> None:
self.portal = portal_class
self.setup_tool: SetupTool = portal_class.portal_setup
self.version = current_versions.base

@pytest.mark.parametrize(
"src_version",
[
"20250523001",
"20250612001",
"20250902001",
"20250903001",
"20250915001",
"20250916001",
"20250917001",
"20251209001",
"20260122001",
"20260504001",
"20260505001",
"20260619001",
"20260620001",
],
)
def test_upgrade_to_latest(self, list_upgrades, src_version: str) -> None:
"""Test that the upgrade step to the latest version is available."""

upgrades = list_upgrades(self.setup_tool, src_version, self.version)
assert len(upgrades) > 0, (
f"No upgrade path found from {src_version} to {self.version}"
)
8 changes: 4 additions & 4 deletions backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading