Skip to content
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

Config with default template #162

Merged
merged 15 commits into from
Mar 22, 2023

Conversation

gforcada
Copy link
Member

No description provided.

@mister-roboto
Copy link

@gforcada thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@gforcada gforcada requested a review from jensens March 17, 2023 15:19
@gforcada
Copy link
Member Author

@jenkins-plone-org please run jobs

Copy link
Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

But there are three failing tests in all four PR jobs.
Initial guess: the zpretty changes break something, but it is easy to blindly point there because that is the biggest change.

Fix a few test failures due to empty html attributes.
mauritsvanrees added a commit to plone/plone.restapi that referenced this pull request Mar 21, 2023
See plone/plone.app.z3cform#162

Instead of

```
<input id="__ac_password" name="__ac_password"
```

we get:

```
<input class="form-control password-widget required password-field" id="__ac_password" name="__ac_password" type="password" />
```
mauritsvanrees added a commit to plone/plone.restapi that referenced this pull request Mar 22, 2023
See plone/plone.app.z3cform#162

Instead of

```
<input id="__ac_password" name="__ac_password"
```

we get:

```
<input class="form-control password-widget required password-field" id="__ac_password" name="__ac_password" type="password" />
```
@mauritsvanrees
Copy link
Member

LGTM.

But there are three failing tests in all four PR jobs. Initial guess: the zpretty changes break something, but it is easy to blindly point there because that is the biggest change.

Indeed zpretty is responsible for two of the three test failures.
@ale-rt

For example a template had this:

title="" lang="" disabled="" readonly=""

zpretty turned it into this:

disabled
lang=""
readonly
title=""

And this gives errors. These tests failed:

$ bin/test -s plone.app.contenttypes -m test_behaviors_collection
...
Failure in test test_collection_in_edit_form (plone.app.contenttypes.tests.test_behaviors_collection.CollectionBehaviorFunctionalTest.test_collection_in_edit_form)
Traceback (most recent call last):
  File "/Users/maurits/.pyenv/versions/3.11.1/lib/python3.11/unittest/case.py", line 57, in testPartExecutor
    yield
  File "/Users/maurits/.pyenv/versions/3.11.1/lib/python3.11/unittest/case.py", line 623, in run
    self._callTestMethod(testMethod)
  File "/Users/maurits/.pyenv/versions/3.11.1/lib/python3.11/unittest/case.py", line 579, in _callTestMethod
    if method() is not None:
  File "/Users/maurits/shared-eggs/cp311/plone.app.contenttypes-3.0.1-py3.11.egg/plone/app/contenttypes/tests/test_behaviors_collection.py", line 103, in test_collection_in_edit_form
    self.assertEqual(from_control.value, [])
  File "/Users/maurits/.pyenv/versions/3.11.1/lib/python3.11/unittest/case.py", line 873, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/Users/maurits/.pyenv/versions/3.11.1/lib/python3.11/unittest/case.py", line 1079, in assertListEqual
    self.assertSequenceEqual(list1, list2, msg, seq_type=list)
  File "/Users/maurits/.pyenv/versions/3.11.1/lib/python3.11/unittest/case.py", line 1061, in assertSequenceEqual
    self.fail(msg)
  File "/Users/maurits/.pyenv/versions/3.11.1/lib/python3.11/unittest/case.py", line 703, in fail
    raise self.failureException(msg)
AssertionError: Lists differ: ['CreationDate'] != []

First list contains 1 additional elements.
First extra element 0:
'CreationDate'

- ['CreationDate']
+ []

$ bin/test -s plone.app.relationfield -t schemaeditor.txt
...
File "/Users/maurits/shared-eggs/cp311/plone.app.relationfield-3.0.1-py3.11.egg/plone/app/relationfield/tests/../schemaeditor.txt", line 64, in schemaeditor.txt
Failed example:
    browser.getControl(name='form.widgets.portal_type:list').value
Expected:
    ['Event', 'Folder']
Got:
    ['Event']
----------------------------------------------------------------------
File "/Users/maurits/shared-eggs/cp311/plone.app.relationfield-3.0.1-py3.11.egg/plone/app/relationfield/tests/../schemaeditor.txt", line 97, in schemaeditor.txt
Failed example:
    sorted(my_field.source.query.get('portal_type'))
Expected:
    ['Event', 'Folder']
Got:
    ['Event']
----------------------------------------------------------------------
File "/Users/maurits/shared-eggs/cp311/plone.app.relationfield-3.0.1-py3.11.egg/plone/app/relationfield/tests/../schemaeditor.txt", line 145, in schemaeditor.txt
Failed example:
    browser.getControl(name='form.widgets.portal_type:list').value
Expected:
    ['Event', 'Folder']
Got:
    ['Event']
----------------------------------------------------------------------
File "/Users/maurits/shared-eggs/cp311/plone.app.relationfield-3.0.1-py3.11.egg/plone/app/relationfield/tests/../schemaeditor.txt", line 178, in schemaeditor.txt
Failed example:
    sorted(my_field.value_type.source.query.get('portal_type'))
Expected:
    ['Event', 'Folder']
Got:
    ['Event']

Fixed with commit bbca022.
I simply removed the empty attributes, because they were replaced by tal anyway.

Same for multiple and checked, and maybe others.

There is one other test failure. Technically zpretty introduced this one as well, but here it is simply a slightly different attribute output order, and a test in plone.restapi was too strict. Fixed here to work with the old and new code:
plone/plone.restapi#1603

davisagli pushed a commit to plone/plone.restapi that referenced this pull request Mar 22, 2023
See plone/plone.app.z3cform#162

Instead of

```
<input id="__ac_password" name="__ac_password"
```

we get:

```
<input class="form-control password-widget required password-field" id="__ac_password" name="__ac_password" type="password" />
```
mister-roboto pushed a commit to plone/buildout.coredev that referenced this pull request Mar 22, 2023
Branch: refs/heads/master
Date: 2023-03-21T17:57:55-07:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.restapi@acca00e

Fixed tests in combination with newer plone.app.z3cform. (#1603)

See plone/plone.app.z3cform#162

Instead of

```
&lt;input id="__ac_password" name="__ac_password"
```

we get:

```
&lt;input class="form-control password-widget required password-field" id="__ac_password" name="__ac_password" type="password" /&gt;
```

Files changed:
A news/162.internal
M src/plone/restapi/tests/test_functional_auth.py
@mauritsvanrees
Copy link
Member

Strange, the gh-actions tests install plone.app.theming 5.0.2 that I released yesterday but is not in https://dist.plone.org/release/6.0-dev/constraints.txt: that has 5.0.0. Version 5.0.2 gives a configuration conflict due to the permission that we moved.
I see see the same locally with tox -e test.

We may need some extra tox options. Okay, this option works locally:

constrain_package_deps = true

See tox changelog. 4.4.0 introduced the option, setting it by default to true. 4.4.1 changed the default to false, to match what previous tox versions did. In our case we want it true.
Let's test it in this PR, and then we can consider it for plone.meta.

@mauritsvanrees
Copy link
Member

That worked. :-)
Now Jenkins:

@jenkins-plone-org please run jobs

mauritsvanrees added a commit to plone/meta that referenced this pull request Mar 22, 2023
@mauritsvanrees mauritsvanrees merged commit c25c803 into master Mar 22, 2023
@mauritsvanrees mauritsvanrees deleted the config-with-default-template-b58883d3 branch March 22, 2023 13:35
mister-roboto pushed a commit to plone/buildout.coredev that referenced this pull request Mar 22, 2023
Branch: refs/heads/master
Date: 2023-03-17T16:10:32+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@a288ae3

Configuring with plone/meta

Files changed:
A .editorconfig
A .meta.toml
A .pre-commit-config.yaml
A news/243ca9ec.internal
A tox.ini
M pyproject.toml
M setup.cfg
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:10:44+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@c4bbfa7

chore: pyupgrade

Files changed:
M plone/app/z3cform/widget.py
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:10:44+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@4376d97

fix: isort is configured in pyproject.toml now

Files changed:
D .isort.cfg
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:10:44+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@8395f06

chore: isort

Files changed:
M plone/app/z3cform/converters.py
M plone/app/z3cform/interfaces.py
M plone/app/z3cform/tests/test_widgets.py
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:10:44+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@192d3bf

chore: black

Files changed:
M plone/app/z3cform/converters.py
M plone/app/z3cform/tests/test_widget.py
M plone/app/z3cform/tests/test_widgets.py
M plone/app/z3cform/widget.py
M plone/app/z3cform/wysiwyg/widget.py
M setup.py
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:10:44+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@39bf540

chore: zpretty ZCML

Files changed:
M plone/app/z3cform/configure.zcml
M plone/app/z3cform/overrides.zcml
M plone/app/z3cform/profiles.zcml
M plone/app/z3cform/tests/testing.zcml
M plone/app/z3cform/widget.zcml
M plone/app/z3cform/wysiwyg/configure.zcml
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:11:22+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@491553a

chore: zpretty PT

Files changed:
M plone/app/z3cform/profiles/default/browserlayer.xml
M plone/app/z3cform/profiles/default/metadata.xml
M plone/app/z3cform/templates/ajaxselect_display.pt
M plone/app/z3cform/templates/checkbox_input.pt
M plone/app/z3cform/templates/contentprovider-widget.pt
M plone/app/z3cform/templates/error.pt
M plone/app/z3cform/templates/file_input.pt
M plone/app/z3cform/templates/form.pt
M plone/app/z3cform/templates/image_input.pt
M plone/app/z3cform/templates/layout.pt
M plone/app/z3cform/templates/link_input.pt
M plone/app/z3cform/templates/macros.pt
M plone/app/z3cform/templates/multi_input.pt
M plone/app/z3cform/templates/object_input.pt
M plone/app/z3cform/templates/orderedselect_input.pt
M plone/app/z3cform/templates/password_input.pt
M plone/app/z3cform/templates/radio_input.pt
M plone/app/z3cform/templates/radio_input_single.pt
M plone/app/z3cform/templates/relateditems_display.pt
M plone/app/z3cform/templates/select_input.pt
M plone/app/z3cform/templates/singlecheckbox.pt
M plone/app/z3cform/templates/singlecheckboxbool_display.pt
M plone/app/z3cform/templates/singlecheckboxbool_hidden.pt
M plone/app/z3cform/templates/singlecheckboxbool_input.pt
M plone/app/z3cform/templates/submit_input.pt
M plone/app/z3cform/templates/text_input.pt
M plone/app/z3cform/templates/textarea_input.pt
M plone/app/z3cform/templates/textfield_widget_input.pt
M plone/app/z3cform/templates/textlines_input.pt
M plone/app/z3cform/templates/widget.pt
M plone/app/z3cform/wysiwyg/wysiwyg_display.pt
M plone/app/z3cform/wysiwyg/wysiwyg_input.pt
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:11:23+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@5dc642a

feat: flake8

Files changed:
M plone/app/z3cform/interfaces.py
M plone/app/z3cform/tests/test_widgets.py
M plone/app/z3cform/widget.py
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:11:23+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@5cbe979

feat: configure codespell

Files changed:
M pyproject.toml
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:11:23+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@c2c4f92

feat: codespell

Files changed:
M CHANGES.rst
M plone/app/z3cform/converters.py
M plone/app/z3cform/tests/test_utils.py
M plone/app/z3cform/tests/test_widget.py
M plone/app/z3cform/tests/test_widgets.py
M plone/app/z3cform/utils.py
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:11:24+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@41037d6

fix(tox): adjust extras name

Files changed:
M tox.ini
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:11:24+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@741d414

feat: declare dependencies

Files changed:
M setup.py
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-17T16:18:17+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: plone/plone.app.z3cform@a3cdc61

fix: adapt tests to zptlint

Files changed:
M plone/app/z3cform/tests/test_widgets.py
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-22T00:45:55+01:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.app.z3cform@bbca022

Fixed templates with not working multiple/disabled/readonly.

Fix a few test failures due to empty html attributes.

Files changed:
M plone/app/z3cform/templates/checkbox_input.pt
M plone/app/z3cform/templates/orderedselect_input.pt
M plone/app/z3cform/templates/password_input.pt
M plone/app/z3cform/templates/radio_input_single.pt
M plone/app/z3cform/templates/select_input.pt
M plone/app/z3cform/templates/singlecheckboxbool_input.pt
M plone/app/z3cform/templates/text_input.pt
M plone/app/z3cform/templates/textarea_input.pt
M plone/app/z3cform/templates/textlines_input.pt
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-22T13:08:11+01:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.app.z3cform@3bddf0c

Fix tox: use constrain_package_deps=true.

Available since tox 4.4.0.
See plone/plone.app.z3cform#162 (comment)

Files changed:
M tox.ini
Repository: plone.app.z3cform

Branch: refs/heads/master
Date: 2023-03-22T14:35:06+01:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.app.z3cform@c25c803

Merge pull request #162 from plone/config-with-default-template-b58883d3

Config with default template

Files changed:
A .editorconfig
A .meta.toml
A .pre-commit-config.yaml
A news/243ca9ec.internal
A tox.ini
M CHANGES.rst
M plone/app/z3cform/configure.zcml
M plone/app/z3cform/converters.py
M plone/app/z3cform/interfaces.py
M plone/app/z3cform/overrides.zcml
M plone/app/z3cform/profiles.zcml
M plone/app/z3cform/profiles/default/browserlayer.xml
M plone/app/z3cform/profiles/default/metadata.xml
M plone/app/z3cform/templates/ajaxselect_display.pt
M plone/app/z3cform/templates/checkbox_input.pt
M plone/app/z3cform/templates/contentprovider-widget.pt
M plone/app/z3cform/templates/error.pt
M plone/app/z3cform/templates/file_input.pt
M plone/app/z3cform/templates/form.pt
M plone/app/z3cform/templates/image_input.pt
M plone/app/z3cform/templates/layout.pt
M plone/app/z3cform/templates/link_input.pt
M plone/app/z3cform/templates/macros.pt
M plone/app/z3cform/templates/multi_input.pt
M plone/app/z3cform/templates/object_input.pt
M plone/app/z3cform/templates/orderedselect_input.pt
M plone/app/z3cform/templates/password_input.pt
M plone/app/z3cform/templates/radio_input.pt
M plone/app/z3cform/templates/radio_input_single.pt
M plone/app/z3cform/templates/relateditems_display.pt
M plone/app/z3cform/templates/select_input.pt
M plone/app/z3cform/templates/singlecheckbox.pt
M plone/app/z3cform/templates/singlecheckboxbool_display.pt
M plone/app/z3cform/templates/singlecheckboxbool_hidden.pt
M plone/app/z3cform/templates/singlecheckboxbool_input.pt
M plone/app/z3cform/templates/submit_input.pt
M plone/app/z3cform/templates/text_input.pt
M plone/app/z3cform/templates/textarea_input.pt
M plone/app/z3cform/templates/textfield_widget_input.pt
M plone/app/z3cform/templates/textlines_input.pt
M plone/app/z3cform/templates/widget.pt
M plone/app/z3cform/tests/test_utils.py
M plone/app/z3cform/tests/test_widget.py
M plone/app/z3cform/tests/test_widgets.py
M plone/app/z3cform/tests/testing.zcml
M plone/app/z3cform/utils.py
M plone/app/z3cform/widget.py
M plone/app/z3cform/widget.zcml
M plone/app/z3cform/wysiwyg/configure.zcml
M plone/app/z3cform/wysiwyg/widget.py
M plone/app/z3cform/wysiwyg/wysiwyg_display.pt
M plone/app/z3cform/wysiwyg/wysiwyg_input.pt
M pyproject.toml
M setup.cfg
M setup.py
D .isort.cfg
@petschki
Copy link
Member

petschki commented Oct 17, 2024

Just got the same problems in an addon. I've created an issue: malthe/chameleon#429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants