[Bug]: RSS feed reuses guids and ignores PATCHCALL_URL
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with internal/web/web.go and internal/check/check.go, where the issue identifies the guid, channel link, and early-return paths. Review open PR #13 before starting to avoid duplicating work. Done means each feed item has a unique app/version/advisory guid, the channel uses the configured public URL when available, saved alerts populate the feed despite Docker startup failures, and the existing web and check tests cover all three cases.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened?
Three small slips in the RSS feed at /feed.xml:
- When an app moves to another version that's still caught by the same advisory, the new item gets the same guid as the old one, so feed readers think they've seen it and drop it. The guid is app plus advisory, but an alert is per app, version and advisory
- The channel link is
http://plus whatever Host header the request came in with, not thePATCHCALL_URLyou set, so it's alwayshttp://even when you're on https, and it's whatever host the request happened to use - If Docker can't be listed when Patchcall starts, the feed's empty until Docker answers, even though the saved alerts are there
Steps to reproduce
- Set
PATCHCALL_URL=https://patchcall.example.com, then openhttp://localhost:<port>/feed.xml- the channel<link>ishttp://localhost:<port>/ - For the guid, have an app caught by an advisory, then move it to another version that's also affected - the second alert's
<guid>matches the first - For the empty start, stop Docker (or point Patchcall at a socket that isn't there), restart Patchcall, and open
/feed.xml
Version
1.0.0, and still there on main at 31c39ef
How are you running it?
Docker
Environment
Linux, Docker Engine
Relevant log output
None, nothing's logged for any of them.
Before submitting
- I have searched existing issues for duplicates
- I am running the latest version
- I agree to follow this project's Code of Conduct
Fix
- Guid:
internal/web/web.go:301usesit.App + " " + it.Hit.ID. Add the version, to match the alert key ininternal/check/check.go:263(app, version, advisory) - Link:
internal/web/web.go:193passes"http://"+r.Host+"/". Use the public URL (opts.PublicURL, which the alerts already use ininternal/check/report.go:97) when it's set, and only fall back to the Host header without it - Empty start:
Runininternal/check/check.go:112-116returns beforereport.Feed = c.state.Feed(line 151) when listing fails. Set the feed before that early return
A test for each in the existing web and check tests would be neat.
- Ngôn ngữ chính
- Go
- Star
- 3
- Fork
- 1
- Merge trung bình
- 1 giờ 11 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- 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 NotAFlightRisk/patchcall
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
NotAFlightRisk/patchcall#11 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NotAFlightRisk/patchcall
Issue tương tự
-
factory:subtask
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
OneBusAway/watchdog#470 ·
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 92/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: session
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
charmbracelet/crush#4484 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accepted good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 95/100