Skip to content

feat: init connection and blocks parser from WP - #2950

Open
petesfrench wants to merge 1 commit into
mainfrom
WP-CMS-DEMO
Open

petesfrench wants to merge 1 commit into
mainfrom
WP-CMS-DEMO

Conversation

@petesfrench

@petesfrench petesfrench commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Done

[List of work items including drive-bys]

QA

  • Open the DEMO
  • Alternatively, check out this feature branch
  • Run the site using the command dotrun
  • View the site locally in your web browser at: http://0.0.0.0:8002/
  • Run through the following QA steps
  • [List additional steps to QA the new features or prove the bug has been resolved]

Issue / Card

Fixes #

Screenshots

[if relevant, include a screenshot]

Copilot AI lite review requested due to automatic review settings September 15, 2026 08:19
@webteam-app

Copy link
Copy Markdown

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.65041% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.11%. Comparing base (e40ad84) to head (f2523b2).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
webapp/app.py 33.33% 14 Missing ⚠️
webapp/wordpress.py 96.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2950      +/-   ##
==========================================
+ Coverage   75.84%   77.11%   +1.27%     
==========================================
  Files          20       21       +1     
  Lines        2596     2845     +249     
==========================================
+ Hits         1969     2194     +225     
- Misses        627      651      +24     
Flag Coverage Δ
python 77.11% <90.65%> (+1.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved access-control, caching, and heading-content issues remain.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds a WordPress Gutenberg integration that fetches, parses, and renders hero content through a demo route.

Changes:

  • Maps Gutenberg blocks to the vf_hero schema.
  • Adds the WordPress demo route and template.
  • Adds tests, fixtures, and environment configuration.
File summaries
File Summary Findings
webapp/wordpress.py Gutenberg parsing, hero mapping, and API helpers Moderate (1 vote): preserve sanitized heading HTML. Nit (1 vote): align the signpost contract with behavior.
webapp/app.py WordPress hero demo endpoint Critical (3 votes): add preview access restrictions. Moderate (3 votes): prevent stale one-hour caching. Nit (1 vote): add route branch tests.
tests/test_wordpress.py Parser and API helper tests No final comments.
tests/fixtures/hero_content_raw_wp.html WordPress content fixture No final comments.
templates/wp-hero-demo.html Hero rendering template No final comments.
konf/site.yaml Demo WordPress secret configuration No final comments.
.env Local environment placeholders No final comments.
Review details

Suppressed comments (3)

webapp/app.py:239

  • The new endpoint has no app-level tests; tests/test_wordpress.py only exercises the helpers and never verifies the route's 503, 502, 404, or successful rendered-response branches. Add tests with patched credentials and session so regressions in this externally exposed integration are caught.
@app.route("/wp-hero-demo")
def wp_hero_demo():

webapp/wordpress.py:25

  • The module contract says only a second image with the signpost class becomes signpost_image, but _is_signpost below classifies the first or only matching image that way too (and test_signpost_image codifies that behavior). Update this description to match the implemented mapping, or enforce the second-image rule.
    * ``core/image``            -> ``image`` block (a second image with
                                   the ``signpost`` class becomes the
                                   ``signpost_image`` block)

webapp/wordpress.py:364

  • _text() removes all markup before assigning the heading values. vf_hero accepts HTML in title_text/subtitle_text (existing templates use elements such as <br> and <sup>), and Gutenberg headings can contain the same inline markup; for example, Take<br>control becomes Takecontrol. Preserve the heading's sanitized inner HTML instead of flattening it.
            level = block.attrs.get("level", 2)
            if level == 1 and not title_text:
                title_text = _text(block.inner_html)
            elif level == 2 and not subtitle_text:
                subtitle_text = _text(block.inner_html)
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread webapp/app.py
Comment on lines +225 to +227
# maps it to the vf_hero schema and renders it. Access to this preview route is
# intended to be restricted at the ingress (VPN IP allowlist), not in the app -
# see the commented nginx location block in konf/site.yaml.
Comment thread webapp/app.py
if not hero:
flask.abort(404, "No hero block found on the configured page.")

return flask.render_template("wp-hero-demo.html", hero=hero)
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.

3 participants