Repository navigation
feat: newcomers found no way in from the flat issues list - #182
Conversation
Three pinned issues now refresh every hour: help wanted, community pull requests and roadmap status. scripts/dashboards.py finds each one by the marker in its body and rewrites it.
foothillsdigital
left a comment
There was a problem hiding this comment.
The boards read well, and the 14 tests pass (counted with -v). One thing has to change before this runs every hour with issues: write.
Anyone can take over a dashboard. existing() takes the first open issue whose body starts with the marker, and GET /repos/.../issues lists the newest first. So if a stranger opens an issue whose body starts with <!-- parsec-dashboard:roadmap -->, the next run writes the roadmap into their issue, and the pinned #181 goes stale. I checked it by stubbing gh with two open issues, the stranger's newer #200 and the owner's #181:
{'roadmap': 200}
The fix is a line in existing(): accept an issue only if a maintainer opened it, for example i.get("author_association") in MAINTAINER_ROLES, or i["user"]["login"] in CORE_TEAM plus github-actions[bot] if the job ever creates one. Add a test that a newer issue from someone else with the same marker is ignored.
Not blocking, but worth a look while you're in there:
- The claim regex matches more than claims.
"I would like to know why this fails"and"the claim in the README is wrong"both match, so a question would mark an issue as taken. Requiring a verb afteri'd like to/i would like to(work|take|try|help|pick|fix) and dropping the bareclaimwould cut most of that. CORE_TEAMonly lists you, so my PRs (and any other maintainer's) will show up on the community board, and a maintainer's "I'll take this" counts as a community claim. If that's what you want, fine. Otherwise useauthorAssociationthere too, the waybucketalready does.
existing() took the newest open issue carrying a marker, so a stranger's issue with the roadmap marker would have been written to instead of the pinned one. Only issues a maintainer or this workflow opened count now. Also: a question like "I would like to know why" no longer reads as a claim, and maintainers other than the core team are left off the community boards, judged by authorAssociation as bucket() already did.
|
Good catch, thank you. That one would have been easy to miss for a long time.
18 tests pass, and a dry run against the live repo still finds #179, #180 and #181. |
* fix(dashboards): anyone could take over a dashboard issue publish() mapped each marker to the first open issue whose body starts with <!-- conn3x-dashboard:<marker> -->. GitHub lists issues newest first and anyone can open one, so an issue a stranger opened with the help-wanted marker would get the next hourly write, from a job with issues: write, while the pinned #383 went stale. They'd control the title and labels of an issue the project keeps updating. Only an issue a maintainer opened, or github-actions[bot], which is who publish() creates missing boards as, now counts. The lookup is its own function, existing_boards(), so it can be tested. From the same review: - CLAIM matched questions: "I would like to know why", "the claim in the README", "I'd love to see this". "I'd like to" and "I'd love to" now need a verb of taking the work, and the bare "claim" is gone. - Other maintainers counted as community: claim(), outside() and bucket() now use maintainer(), with authorAssociation asked for in the help-wanted and PR queries. Found in review of Parsec's copy of this script (parsec-html/parsec#182). Signed-off-by: James Conway <148910373+jamesconwaydev@users.noreply.github.com> * test(dashboards): the takeover tests sat below unittest.main() and never ran in CI CI runs python3 scripts/dashboards_test.py, so unittest.main() ran and exited before Boards and Outside were defined: 14 tests ran, not 18 (Foothills' review on #1250). Move both classes above it. Signed-off-by: James Conway <148910373+jamesconwaydev@users.noreply.github.com> --------- Signed-off-by: James Conway <148910373+jamesconwaydev@users.noreply.github.com>
Fixes #145.
Problem. Someone new opens the issues page and gets a flat list of 40-odd issues. The six marked good first issue or help wanted are mixed in with milestone tracking issues, and nothing says which are already taken or where each milestone stands.
Change.
scripts/dashboards.pybuilds three dashboards and writes each into the open issue whose body starts with<!-- parsec-dashboard:NAME -->:good first issueandhelp wantedissue, free or taken. An issue counts as taken when it's assigned, has an open linked pull request, or someone outside the core team has said they're on it.jamesconwaydevand the bots, sorted into waiting on us, waiting on the author, failing CI, needs a rebase and drafts, longest wait first..github/workflows/dashboards.ymlruns it at 23 minutes past each hour, and on demand. The job getsissues: writeand nothing else, and checks out without persisting credentials.@nameor#12in one never notifies anyone or cross-links from every snapshot. Bodies shrink their tables to stay under GitHub's 65,536-character limit.The three issues are created, pinned and filled already, from a local run against this repository.
Tests.
scripts/dashboards_test.py, no network:Escaping: fails if a handle or issue number in a title stays bare.Buckets: fails if a maintainer reply doesn't hand the turn to the author, an author reply doesn't hand it back, an outsider's comment counts as ours, or draft, rebase and CI stop taking precedence in that order.Claims: fails if an assignee, a linked pull request or a "I'd like to work on this" comment doesn't mark an issue taken, or a core-team comment does.HelpBoard: fails if an issue with both labels shows up twice, the free count is wrong, or a 400-issue body goes over the limit.Roadmap: fails if a dashboard issue is counted in its milestone, an assignee goes missing, the "more" link is wrong, or closed milestones aren't listed last.python3 -m unittest dashboards_testpasses (14 tests), andactionlintandzizmorreport nothing on the workflow.