Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

push-md: e2e suite only exercises the unscoped source, not the built (scoped) zip

Đang mở
#70 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
68/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
bash, docker, git, github-actions, php
Lĩnh vực
build-system, ci-cd, testing

Hướng nghiên cứu

Bắt đầu với bin/build-plugins.sh, bin/run-push-md-playground.sh, bin/inspect-push-md-zip.sh và workflow push-md-e2e.yml hiện có để theo dõi cách flow hiện tại với source được mount được build và chạy. Thêm một đường dẫn Playground mới để cài đặt dist/plugins/push-md.zip, sau đó chạy flow clone, chỉnh sửa Markdown, commit và push hiện có. Hoàn tất khi artifact trong phạm vi được load đúng chức năng, push thành công mà không có lỗi fatal hoặc bad line length character, và đường dẫn artifact chạy trong CI.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

The push-md e2e suite never functionally imports the built (scoped) plugin zip — it mounts the unscoped source tree directly. This is the testing gap that let the scoping regression in #68 (fixed by #69) ship in v0.6.6 / v0.6.7 uncaught: clone worked, but the first Markdown import/push fataled on the scoped build, and no automated test loaded the scoped artifact.

Details

bin/run-push-md-playground.sh boots Playground against the live source, not the release artifact:

--mount="$ROOT_DIR:/workspace"
--mount="$ROOT_DIR/vendor:/wordpress/wp-content/vendor"
--mount="$ROOT_DIR/components:/wordpress/wp-content/components"
--mount="$ROOT_DIR/plugins/push-md:/wordpress/wp-content/plugins/push-md"

So the e2e flow runs with:

  • the unscoped namespaces (Nette\…, League\…, …), where inline qualified references resolve fine, and
  • the dev bootstrap / composer autoloader, not the generated/scoped php-toolkit/vendor/composer/* classmap.

bin/build-plugins.sh produces the scoped dist/plugins/push-md.zip, but it's only checked structurally by bin/inspect-push-md-zip.sh (file presence + content greps). Nothing ever loads the scoped classes through their autoloader and pushes Markdown, so a scoping bug that fatals at class-load time passes every gate.

Proposed follow-up

Add an e2e path that exercises the built zip:

  1. bash bin/build-plugins.sh to produce dist/plugins/push-md.zip.
  2. Install that zip on a fresh Playground site (a blueprint step that installs the artifact, rather than mounting source).
  3. Run the existing import/push flow: git clone …/wp-json/git/v1/md.git, edit a post/*.md, commit, git push.
  4. Assert success (no bad line length character: <br, no PHP fatal in the receive-pack response).

Wire this into CI (e.g. push-md-e2e.yml) so every change that touches the scoper, prune list, or bundle layout is validated against the shipped artifact.

Notes
  • #69 already adds a cheap static canary in inspect-push-md-zip.sh (rejects in-class trait use of a scoped name missing a leading backslash). This issue is about the functional gate that a static grep can't cover.
  • Keep the unscoped-source e2e too (fast inner loop); the scoped-zip run is the release-artifact gate.

Follow-up to #69 / #68.

Ngôn ngữ chính
PHP
Star
22
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Automattic/php-toolkit

Tất cả issue của Automattic/php-toolkit

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.