fix: Use the doc name matched by fuzzy_find_documents when rendering#4862
fix: Use the doc name matched by fuzzy_find_documents when rendering#4862larseggert wants to merge 5 commits intoietf-tools:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4862 +/- ##
==========================================
- Coverage 88.47% 88.46% -0.01%
==========================================
Files 296 296
Lines 39795 39796 +1
==========================================
- Hits 35208 35206 -2
- Misses 4587 4590 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
@rjsparks you mentioned in Slack that this PS is wrong. I tried to do what you said before, i.e.,
But I guess I misunderstood? |
|
OBE, see #4897. |
|
I see I have some pending comments on this - failed a submit button somewhere along the way. I'll try to let them come through for completeness, but treat them as FYI only. |
|
|
||
| if found.matched_name.startswith('rfc') and name != found.matched_name: | ||
| return redirect('ietf.doc.views_doc.document_html', name=found.matched_name) | ||
| name = found.matched_name |
There was a problem hiding this comment.
This does nothing - name is never used after this assignment.
| @@ -810,7 +810,8 @@ def document_html(request, name, rev=None): | |||
| raise Http404("Multiple documents matched: %s" % name) | |||
|
|
|||
| if found.matched_name.startswith('rfc') and name != found.matched_name: | |||
There was a problem hiding this comment.
The problem you are working on is dealing with URLs like https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-07. And the issue is that the URL dispatcher is handing
[name, rev]: '['draft-ietf-oauth-v2', '1-07']'
To the view.
What's in the PR right now won't help since (beyond it being a no-op) the change is in the logic branch gated on finding something that starts with 'rfc'.
Your original commit was closer, and the property I was hoping to get out of the redirect isn't going to happen since the globbing is getting things so wrong to begin with.
I'll take the PR back to that commit, but we need to add tests to make sure that this isn't just pushing the general problem around and breaking other things.
There was a problem hiding this comment.
Our real problem is that we have
"rev": r"(?P<rev>[0-9]{1,2}(-[0-9]{2})?)",
in URL_REGEXPS so that we can match charter document versions that look like -00-01, which was a terrible thing to have let happen, and maybe we should refactor the URL parsers to match charters first with that rev pattern and everything else with just [0-9]{2}.
There was a problem hiding this comment.
For instance, this is 404ing, and it shouldn't:
https://datatracker.ietf.org/doc/html/draft-ietf-tsvwg-ieee-802-11
It should be showing RFC8325.
Your earlier fix causes it to show draft-ietf-tsvwg-ieee-802-11-11, so there's more to fix than just this name change.
Fixes #4855