Skip to content

Commit

Permalink
[fc] Repository: plone.recipe.zope2instance
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2021-04-08T08:04:16+02:00
Author: Jürgen Gmach (jugmac00) <juergen.gmach@googlemail.com>
Commit: plone/plone.recipe.zope2instance@21a6cc6

enable both weekly and manual builds for gh actions

this fixes #169

Files changed:
A news/169.feature.rst
M .github/workflows/testing.yml
Repository: plone.recipe.zope2instance

Branch: refs/heads/master
Date: 2021-04-08T08:13:43+02:00
Author: Jürgen Gmach (jugmac00) <juergen.gmach@googlemail.com>
Commit: plone/plone.recipe.zope2instance@8caf0f6

fix yaml syntax

Files changed:
M .github/workflows/testing.yml
Repository: plone.recipe.zope2instance

Branch: refs/heads/master
Date: 2021-04-08T09:15:29+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.recipe.zope2instance@28bc539

Merge pull request #170 from plone/improve-ci

enable both weekly and manual builds for gh actions

Files changed:
A news/169.feature.rst
M .github/workflows/testing.yml
  • Loading branch information
jensens committed Apr 8, 2021
1 parent 716a125 commit b4abe65
Showing 1 changed file with 42 additions and 16 deletions.
58 changes: 42 additions & 16 deletions last_commit.txt
@@ -1,25 +1,51 @@
Repository: plone.restapi
Repository: plone.recipe.zope2instance


Branch: refs/heads/master
Date: 2021-04-07T13:40:56+02:00
Author: Tiberiu Ichim (tiberiuichim) <tiberiuichim@users.noreply.github.com>
Commit: https://github.com/plone/plone.restapi/commit/92a68e31f10407e0c773304ac587cdb9aae8ca84
Date: 2021-04-08T08:04:16+02:00
Author: Jürgen Gmach (jugmac00) <juergen.gmach@googlemail.com>
Commit: https://github.com/plone/plone.recipe.zope2instance/commit/21a6cc66b1ba6d3e3d0a7dd3f98a92e4355b6517

Fix search in VHM with PhysicalRoot (#1105)
enable both weekly and manual builds for gh actions

* WIP

* Fix search when using VHM RootPhysicalPath

* Run black

* Add news entry
this fixes #169

Files changed:
A news/1105.bugfix
M src/plone/restapi/search/handler.py
M src/plone/restapi/tests/test_search.py
A news/169.feature.rst
M .github/workflows/testing.yml

b'diff --git a/news/1105.bugfix b/news/1105.bugfix\nnew file mode 100644\nindex 000000000..af101f2fb\n--- /dev/null\n+++ b/news/1105.bugfix\n@@ -0,0 +1,3 @@\n+Fix ``@search`` endpoint with use_site_search_settings flag, for VHM PhysicalRoot\n+scenarios\n+@tiberiuichim\ndiff --git a/src/plone/restapi/search/handler.py b/src/plone/restapi/search/handler.py\nindex f07b16c6d..1251acab8 100644\n--- a/src/plone/restapi/search/handler.py\n+++ b/src/plone/restapi/search/handler.py\n@@ -127,6 +127,13 @@ def filter_query(self, query):\n if "path" not in query:\n query["path"] = {"query": getNavigationRoot(self.context)}\n \n+ vhm_physical_path = self.request.get("VirtualRootPhysicalPath")\n+ # if vhm trick is applied, we should present a stripped path, as it will be\n+ # processed again in _constrain_query_by_path\n+ if vhm_physical_path:\n+ bits = query["path"]["query"].split("/")[len(vhm_physical_path) :]\n+ query["path"]["query"] = "/".join(bits) or "/"\n+\n default_sort_on = search_settings.sort_on\n \n if "sort_on" not in query:\ndiff --git a/src/plone/restapi/tests/test_search.py b/src/plone/restapi/tests/test_search.py\nindex b83a88ca6..d06cad447 100644\n--- a/src/plone/restapi/tests/test_search.py\n+++ b/src/plone/restapi/tests/test_search.py\n@@ -732,6 +732,66 @@ def test_search_use_site_search_settings_with_navigation_root(self):\n noLongerProvides(self.folder, INavigationRoot)\n transaction.commit()\n \n+ @unittest.skipIf(not PLONE5, "No ISearchSchema in Plone 4")\n+ def test_search_use_site_search_settings_with_navigation_root_and_vhm(self):\n+\n+ if "virtual_hosting" not in self.app.objectIds():\n+ # If ZopeLite was imported, we have no default virtual\n+ # host monster\n+ from Products.SiteAccess.VirtualHostMonster import (\n+ manage_addVirtualHostMonster,\n+ )\n+\n+ manage_addVirtualHostMonster(self.app, "virtual_hosting")\n+ alsoProvides(self.folder, INavigationRoot)\n+ transaction.commit()\n+\n+ vhm_url = "%s/VirtualHostBase/http/plone.org/plone/VirtualHostRoot/%s" % (\n+ self.app.absolute_url(),\n+ "/folder/@search",\n+ )\n+ response = self.api_session.get(\n+ vhm_url, params={"use_site_search_settings": 1, "path": "/folder"}\n+ ).json()\n+ titles = [u"Some Folder", u"Lorem Ipsum", u"Other Document"]\n+ self.assertEqual([item["title"] for item in response["items"]], titles)\n+\n+ noLongerProvides(self.folder, INavigationRoot)\n+ transaction.commit()\n+\n+ @unittest.skipIf(not PLONE5, "No ISearchSchema in Plone 4")\n+ def test_search_use_site_search_settings_with_vhm(self):\n+\n+ if "virtual_hosting" not in self.app.objectIds():\n+ # If ZopeLite was imported, we have no default virtual\n+ # host monster\n+ from Products.SiteAccess.VirtualHostMonster import (\n+ manage_addVirtualHostMonster,\n+ )\n+\n+ manage_addVirtualHostMonster(self.app, "virtual_hosting")\n+ transaction.commit()\n+\n+ vhm_url = "%s/VirtualHostBase/http/plone.org/plone/VirtualHostRoot/%s" % (\n+ self.app.absolute_url(),\n+ "/@search",\n+ )\n+ response = self.api_session.get(\n+ vhm_url, params={"use_site_search_settings": 1, "path": "/"}\n+ ).json()\n+ titles = [\n+ "Some Folder",\n+ "Lorem Ipsum",\n+ "Other Document",\n+ "Another Folder",\n+ "Document in second folder",\n+ "Doc outside folder",\n+ ]\n+ self.assertEqual([item["title"] for item in response["items"]], titles)\n+\n+ noLongerProvides(self.folder, INavigationRoot)\n+ transaction.commit()\n+\n \n class TestSearchATFunctional(unittest.TestCase):\n layer = PLONE_RESTAPI_AT_FUNCTIONAL_TESTING\n'
b"diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml\nindex 67bc50c..e279ac4 100644\n--- a/.github/workflows/testing.yml\n+++ b/.github/workflows/testing.yml\n@@ -1,6 +1,10 @@\n name: Test\n \n on: [push]\n+ schedule:\n+ - cron: '0 12 * * 0' # run once a week on Sunday\n+ # Allows you to run this workflow manually from the Actions tab\n+ workflow_dispatch:\n \n jobs:\n build:\ndiff --git a/news/169.feature.rst b/news/169.feature.rst\nnew file mode 100644\nindex 0000000..1e8d410\n--- /dev/null\n+++ b/news/169.feature.rst\n@@ -0,0 +1 @@\n+Enable both weekly and manual builds for GitHub Actions [jugmac00]\n\\ No newline at end of file\n"

Repository: plone.recipe.zope2instance


Branch: refs/heads/master
Date: 2021-04-08T08:13:43+02:00
Author: Jürgen Gmach (jugmac00) <juergen.gmach@googlemail.com>
Commit: https://github.com/plone/plone.recipe.zope2instance/commit/8caf0f6fe527b5b1c7bda8304afd0e04210098e3

fix yaml syntax

Files changed:
M .github/workflows/testing.yml

b'diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml\nindex e279ac4..1564004 100644\n--- a/.github/workflows/testing.yml\n+++ b/.github/workflows/testing.yml\n@@ -1,8 +1,11 @@\n name: Test\n \n-on: [push]\n+on:\n+ push:\n+\n schedule:\n- - cron: \'0 12 * * 0\' # run once a week on Sunday\n+ - cron: "0 12 * * 0" # run once a week on Sunday\n+\n # Allows you to run this workflow manually from the Actions tab\n workflow_dispatch:\n \n'

Repository: plone.recipe.zope2instance


Branch: refs/heads/master
Date: 2021-04-08T09:15:29+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: https://github.com/plone/plone.recipe.zope2instance/commit/28bc53987a3294e4a0111794a717ca635d2478e4

Merge pull request #170 from plone/improve-ci

enable both weekly and manual builds for gh actions

Files changed:
A news/169.feature.rst
M .github/workflows/testing.yml

b'diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml\nindex 67bc50c..1564004 100644\n--- a/.github/workflows/testing.yml\n+++ b/.github/workflows/testing.yml\n@@ -1,6 +1,13 @@\n name: Test\n \n-on: [push]\n+on:\n+ push:\n+\n+ schedule:\n+ - cron: "0 12 * * 0" # run once a week on Sunday\n+\n+ # Allows you to run this workflow manually from the Actions tab\n+ workflow_dispatch:\n \n jobs:\n build:\ndiff --git a/news/169.feature.rst b/news/169.feature.rst\nnew file mode 100644\nindex 0000000..1e8d410\n--- /dev/null\n+++ b/news/169.feature.rst\n@@ -0,0 +1 @@\n+Enable both weekly and manual builds for GitHub Actions [jugmac00]\n\\ No newline at end of file\n'

0 comments on commit b4abe65

Please sign in to comment.