galaxyproject / galaxyproject/training-material

Galaxy training-material: GTN:004's PMID regex has a doubled slash, so the check has never fired

Open Beginner friendly
#7,092 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
367
Forks
1.1k
Avg merge
16h 27m
Merged PRs (30d)
49

Description

## Summary

`bin/lint.rb::check_pmids` matches:

```ruby
# https://www.ncbi.nlm.nih.gov/pubmed/24678044
find_matching_texts(contents,
%r{(\[[^\]]*\]\(https?://www.ncbi.nlm.nih.gov/pubmed//[0-9]*\))})
```

The pattern requires `pubmed//` — two slashes — while the documenting comment on the
line directly above shows the real URL shape with one. Real PubMed links never match,
so GTN:004 has never fired for a PMID link. Its companion `check_dois` is unaffected.

## Measurement

Across the **547** `tutorial.md` files reachable from the topic API
(689 discovered across all 35 topics; the rest are slides-only or renamed):

| | count |
|---|---|
| links the shipped regex matches | **0** |
| links `.../pubmed/` — the shape the comment documents | 47 |
| links on the modern host `pubmed.ncbi.nlm.nih.gov//` | 3 |
| tutorials with at least one missed link | 23 |

Most affected: `proteomics/protein-id-oms` (11), `proteomics/metaproteomics` (5), `proteomics/protein-id-sg-ps` (4), `proteomics/labelfree-vs-labelled` (3), `transcriptomics/rna-seq-genes-to-pathways` (3).

## Proposed fix

`check_pmids.patch` drops the duplicated slash, requires at least one digit, allows
the trailing slash PubMed itself emits, and additionally matches the modern
`pubmed.ncbi.nlm.nih.gov` host the check predates.

`test_check_pmids.rb` (16 assertions, all passing on ruby 4.0.6) pins the behaviour:
the shipped pattern misses all five real-world link forms; the proposed one matches
all five; and it ignores DOI links (handled by `check_dois`), the identifier-less
PubMed search page, non-PubMed NCBI links, bare URLs without link text, and existing
`{% cite %}` shortcodes. One assertion checks that capture group 1 is the whole
markdown link, since `ReviewDogEmitter` slices on `selected.begin(0)`/`end(0)`.

Contributor guide

Open the contributing guide

Research direction

Start in bin/lint.rb at check_pmids and compare its pattern with the documented PubMed URL. Then read test_check_pmids.rb and run its 16 assertions. Done means the check recognizes the documented and modern PubMed link forms while preserving the exclusions covered by the tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
testing-qa, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.