Skip to content

fix: look in target if draft name not found in anchor#10636

Merged
jennifer-richards merged 2 commits intoietf-tools:mainfrom
rjsparks:stay_on_target
Apr 13, 2026
Merged

fix: look in target if draft name not found in anchor#10636
jennifer-richards merged 2 commits intoietf-tools:mainfrom
rjsparks:stay_on_target

Conversation

@rjsparks
Copy link
Copy Markdown
Member

@rjsparks rjsparks commented Mar 31, 2026

Fixes #10634

@rjsparks
Copy link
Copy Markdown
Member Author

@larseggert you were here not to long ago - would appreciate your input.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.42%. Comparing base (68104b5) to head (4add1b3).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
ietf/utils/xmldraft.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10636      +/-   ##
==========================================
- Coverage   88.44%   88.42%   -0.02%     
==========================================
  Files         330      330              
  Lines       44365    44373       +8     
==========================================
+ Hits        39237    39239       +2     
- Misses       5128     5134       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread ietf/utils/xmldraft.py
target = ref.get("target")
if isinstance(target, str):
target = target.lower()
if target.startswith("https://datatracker.ietf.org/doc/"):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on this not changing is a bit ugly. Can we at least make https://datatracker.ietf.org/ and maybe doc tool-wide constants?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree and would be inclined to split out a helper like targetsDatatrackerDoc() (or some not terrible name. It could probably wait until we see a second use for it, though.

Copy link
Copy Markdown
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an improvement to me. Could perhaps be refactored, but I don't think it's essential.

Comment thread ietf/utils/xmldraft.py
target = ref.get("target")
if isinstance(target, str):
target = target.lower()
if target.startswith("https://datatracker.ietf.org/doc/"):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree and would be inclined to split out a helper like targetsDatatrackerDoc() (or some not terrible name. It could probably wait until we see a second use for it, though.

@rjsparks
Copy link
Copy Markdown
Member Author

rjsparks commented Apr 9, 2026

I guess we should bring this in and go for incremental improvement later - moving it out of draft.

@rjsparks rjsparks marked this pull request as ready for review April 9, 2026 22:13
@jennifer-richards jennifer-richards merged commit aa847b4 into ietf-tools:main Apr 13, 2026
9 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reference parser fails to find a reference to a draft

3 participants