{"html_url": "https://github.com/simonw/datasette/issues/689#issuecomment-609469440", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/689", "id": 609469440, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTQ2OTQ0MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-05T19:28:59Z", "updated_at": "2020-04-05T19:28:59Z", "author_association": "OWNER", "body": "So I think the fix is to move the `\"select_templates\": select_templates` context setting bit to here instead:\r\n\r\nhttps://github.com/simonw/datasette/blob/e89b0ef2f9ae89eb3bde83b694f21452ea4858da/datasette/views/base.py#L75-L83\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 573583971, "label": "\"Templates considered\" comment broken in >=0.35"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/689#issuecomment-609469318", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/689", "id": 609469318, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTQ2OTMxOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-05T19:28:14Z", "updated_at": "2020-04-05T19:28:14Z", "author_association": "OWNER", "body": "Here's why: the `BaseView.render()` method is running `jinja_env.select_template()` now here:\r\n\r\nhttps://github.com/simonw/datasette/blob/e89b0ef2f9ae89eb3bde83b694f21452ea4858da/datasette/views/base.py#L75-L88\r\n\r\nWhich means this logic is always called with a template, not a list of strings:\r\n\r\nhttps://github.com/simonw/datasette/blob/e89b0ef2f9ae89eb3bde83b694f21452ea4858da/datasette/app.py#L555-L571", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 573583971, "label": "\"Templates considered\" comment broken in >=0.35"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/689#issuecomment-609468485", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/689", "id": 609468485, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTQ2ODQ4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-05T19:22:31Z", "updated_at": "2020-04-05T19:22:31Z", "author_association": "OWNER", "body": "```\r\n$ git bisect start master 0.34\r\nBisecting: 32 revisions left to test after this (roughly 5 steps)\r\n[dc80e779a2e708b2685fc641df99e6aae9ad6f97] Handle scope path if it is a string\r\n$ git bisect run python check_templates_considered.py\r\nrunning python check_templates_considered.py\r\nTraceback (most recent call last):\r\n...\r\nAssertionError\r\nBisecting: 15 revisions left to test after this (roughly 4 steps)\r\n[7c6a9c35299f251f9abfb03fd8e85143e4361709] Better tests for prepare_connection() plugin hook, refs #678\r\nrunning python check_templates_considered.py\r\nTraceback (most recent call last):\r\n...\r\nAssertionError\r\nBisecting: 7 revisions left to test after this (roughly 3 steps)\r\n[0091dfe3e5a3db94af8881038d3f1b8312bb857d] More reliable tie-break ordering for facet results\r\nrunning python check_templates_considered.py\r\nTraceback (most recent call last):\r\n...\r\nAssertionError\r\nBisecting: 3 revisions left to test after this (roughly 2 steps)\r\n[ce12244037b60ba0202c814871218c1dab38d729] Release notes for 0.35\r\nrunning python check_templates_considered.py\r\nTraceback (most recent call last):\r\n...\r\nAssertionError\r\nBisecting: 1 revision left to test after this (roughly 1 step)\r\n[70b915fb4bc214f9d064179f87671f8a378aa127] Datasette.render_template() method, closes #577\r\nrunning python check_templates_considered.py\r\nTraceback (most recent call last):\r\n...\r\nAssertionError\r\nBisecting: 0 revisions left to test after this (roughly 0 steps)\r\n[286ed286b68793532c2a38436a08343b45cfbc91] geojson-to-sqlite\r\nrunning python check_templates_considered.py\r\n70b915fb4bc214f9d064179f87671f8a378aa127 is the first bad commit\r\ncommit 70b915fb4bc214f9d064179f87671f8a378aa127\r\nAuthor: Simon Willison \r\nDate: Tue Feb 4 12:26:17 2020 -0800\r\n\r\n Datasette.render_template() method, closes #577\r\n \r\n Pull request #664.\r\n\r\n:040000 040000 def9e31252e056845609de36c66d4320dd0c47f8 da19b7f8c26d50a4c05e5a7f05220b968429725c M\tdatasette\r\nbisect run success\r\n```\r\nIt was 70b915fb4bc214f9d064179f87671f8a378aa127 - the same bad commit that caused #716!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 573583971, "label": "\"Templates considered\" comment broken in >=0.35"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/689#issuecomment-609468180", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/689", "id": 609468180, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTQ2ODE4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-05T19:20:33Z", "updated_at": "2020-04-05T19:20:33Z", "author_association": "OWNER", "body": "```\r\ngit bisect start master 0.34\r\ngit bisect run python check_templates_considered.py\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 573583971, "label": "\"Templates considered\" comment broken in >=0.35"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/689#issuecomment-609467876", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/689", "id": 609467876, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTQ2Nzg3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-05T19:18:36Z", "updated_at": "2020-04-05T19:18:36Z", "author_association": "OWNER", "body": "Just need the one checking script to run with bisect this time:\r\n\r\n`check_templates_considered.py`\r\n\r\n```python\r\nimport asyncio\r\nimport pathlib\r\nfrom datasette.app import Datasette\r\nimport httpx\r\n\r\n\r\nasync def run_check():\r\n ds = Datasette([])\r\n async with httpx.AsyncClient(app=ds.app()) as client:\r\n response = await client.get(\"http://localhost/\")\r\n assert 200 == response.status_code\r\n assert \"Templates considered\" in response.text\r\n\r\n\r\nif __name__ == \"__main__\":\r\n loop = asyncio.get_event_loop()\r\n loop.run_until_complete(run_check())\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 573583971, "label": "\"Templates considered\" comment broken in >=0.35"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/689#issuecomment-609467523", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/689", "id": 609467523, "node_id": "MDEyOklzc3VlQ29tbWVudDYwOTQ2NzUyMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-05T19:16:13Z", "updated_at": "2020-04-05T19:16:13Z", "author_association": "OWNER", "body": "I'm going to debug this using `git bisect run` - the same technique I used in #716 - https://github.com/simonw/datasette/issues/716#issuecomment-609453886", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 573583971, "label": "\"Templates considered\" comment broken in >=0.35"}, "performed_via_github_app": null}