Export publiccode.yml directly to a code repository
Maintainer thường phản hồi trong vòng 1 ngày
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
- 52/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github, gitlab, typescript
- Lĩnh vực
- frontend, internationalization, security, testing
Hướng nghiên cứu
Bắt đầu trong src/app/components/YamlPreview.tsx, sau đó so sánh src/app/exporters/ mới với src/app/importers/ và đọc gitlab-url-adapter.ts cùng is-valid-url.ts. Sử dụng gitlab-url-adapter.spec.ts làm mô hình kiểm thử. Được xem là hoàn thành khi đã xác thực rằng các liên kết GitHub và GitLab hỗ trợ các tệp mới và hiện có, GitLab self-hosted, hành vi đối với nội dung quá lớn, các bản dịch, và có phạm vi bao phủ unit test mà không cần thông tin xác thực hoặc backend.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
Derived from requirement RF-PCE-003
Scope
Today the only ways out of the editor are "copy to clipboard" and "download
publiccode.yml", both in YamlPreview. From there the user has to find their
repository, create or open the file, and paste. Close that gap: let the editor hand the
generated YAML straight to the code hosting platform.
The mechanism is deliberately link-based — the platform's own edit file page, prefilled
with the generated content — not an authenticated API call:
- GitHub:
/<owner>/<repo>/new/<branch>?filename=publiccode.yml&value=<content>for a
new file,/edit/<branch>/publiccode.ymlfor an existing one. - GitLab: the equivalent
/-/new/<branch>and/-/edit/<branch>/<path>routes.
The user stays in their own authenticated session on the platform, reviews the diff
there, and commits. Nothing is written on their behalf.
This choice is what keeps the requirement compatible with the app's architecture: the
editor is a static SPA with no back-end, so it has nowhere to keep an OAuth secret or a
token. A link-based export keeps it that way.
The import side already knows how to turn a platform web URL into something actionable
(gitlab-url-adapter.ts parses a GitLab web URL into an API URL). This is the same
translation in reverse, and the two should end up sharing their understanding of what a
repository URL looks like.
Affected areas
src/app/components/YamlPreview.tsx— the toolbar that currently holds copy /
upload / download; the new action belongs alongside them.- New
src/app/exporters/module, mirroring the existingsrc/app/importers/
structure (file.importer.ts,gitlab.importer.ts,standard.importer.ts), with one
exporter per supported platform. src/app/importers/gitlab-url-adapter.ts— the URL parsing to build on; consider
extracting the shared part rather than duplicating it.src/app/is-valid-url.ts— existing URL validation helper, to reuse instead of adding
a second one.src/i18n/locales/*.json— strings for the new action.
Non-functional constraints
- RNF-PCE-001 — Security (OWASP Top 10): the destination URL comes from the user, so
this is an open-redirect surface. Validate scheme and host against the supported
platforms before navigating, and never interpolate unescaped content into the URL.
Note also that prefilling via query string has a practical length limit, so the
behaviour when apubliccode.ymlexceeds it must be defined rather than silently
truncating. - RNF-PCE-004 — Standards and compliance: the editor must not acquire a dependency
on a third-party service without an open source implementation. Supporting GitLab
(self-hostable) alongside GitHub keeps a fully open source path available, and matters
for public administrations running their own instance.
Acceptance criteria
- From the preview panel the user can send the generated YAML to a repository's file
edit page, prefilled, on at least GitHub and GitLab - Self-hosted GitLab instances work, not only gitlab.com
- Both cases are handled: the file does not exist yet, and it already does
- The destination URL is validated before navigation; unsupported or malformed hosts
are refused with a clear message - Defined, non-silent behaviour when the content is too large to prefill by URL
- No credentials, tokens or back-end involved; the app remains a static SPA
- URL-building logic covered by unit tests, in the style of
gitlab-url-adapter.spec.ts - New strings translated in every supported locale
Related
- #647 — new locales; the strings added here need to land there too
- Ngôn ngữ chính
- TypeScript
- Star
- 33
- Fork
- 34
- Merge trung bình
- 10 giờ 50 phút
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của italia/publiccode-editor
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
italia/publiccode-editor#509 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
italia/publiccode-editor#702 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
italia/publiccode-editor#701 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 75/100
italia/publiccode-editor#691 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support to publiccode v0.8.0Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
italia/publiccode-editor#666 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của italia/publiccode-editor
Issue tương tự
-
prio:low scope:hud
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OliverRomhagen/vrigstad-joyride#953 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
review-followup
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
griffinwork40/agent-afk#5446 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
kacper-szewczyk/Ticknest#346 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
echarts geo: a GeoJSON URL that returns 200 with a body that is not JSON is fetched on each refreshĐang mởbug plugin/echarts/geo
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Yeachan-Heo/gajae-code#8230 ·
Maintainer thường phản hồi trong vòng 1 ngày