Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update group dependencies for new rfc model #6773

Merged
merged 10 commits into from
Dec 14, 2023

Conversation

jennifer-richards
Copy link
Member

This eliminates the attempts to get state.slug when state is None, which superficially fixes the error in ticket #6768.

PR is put up as a draft because I think more attention may be needed - some of the logic identifies RFCs by using the draft state. I think that should look at the type instead but I'm still sorting out what's meant to be going on.

Fixes #6768

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e211dc5) 88.80% compared to head (fdaa6d3) 88.81%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6773   +/-   ##
=======================================
  Coverage   88.80%   88.81%           
=======================================
  Files         285      285           
  Lines       40280    40287    +7     
=======================================
+ Hits        35771    35779    +8     
+ Misses       4509     4508    -1     

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

@@ -737,26 +737,35 @@ def dependencies(request, acronym, group_type=None):

references = Q(
Q(source__group=group) | Q(source__in=cl_docs),
source__type="draft",
source__type="draft", # does this need to be type__in=["draft", "rfc"]? Check for informative ref rfc->draft
Copy link
Member

Choose a reason for hiding this comment

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

I think likely not, but it might be a change from previous behavior without it.

Since this is only used for groups, we don't have to worry about rfcs that didn't come from drafts here.

The only use such data might have to the consumer of this function is knowing that some RFC inf-reffed this group's active draft. But that's a done deal, so the group won't really be motivated to do anything with the draft given this knowledge. So it's probably noise and shouldn't be on the graph in the first place.

Copy link
Member Author

Choose a reason for hiding this comment

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

I looked at a handful of cases comparing against the 11.16.0 release (i.e., for posterity, the release before the one with the "new" rfc modeling) and did not see any where nodes were missing. That included some selected specifically because they had a refinfo relationship pointing from an RFC to a group draft.

Also, I think the only way this could miss a relationship is if there was a relationship from an RFC to a group draft without there also having been a relationship from the draft that became the RFC to the group draft. Does that happen (aside from April 1 RFCs, which I feel pretty comfortable leaving off these plots except perhaps for amusement value)?

"expired": x.get_state("draft").slug == "expired",
"replaced": x.get_state("draft").slug == "repl",
"group": x.group.acronym if x.group.acronym != "none" else "",
"id": x.became_rfc().name if x.became_rfc() else x.name,
Copy link
Member

Choose a reason for hiding this comment

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

Check this on a busy group and if the time is noticeable, I think we can get the db to grab this with the primary query instead of n+1 -ing it here.

Copy link
Member

Choose a reason for hiding this comment

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

We might do that in a way the puts the conditional into the query as well, so that we don't see this pattern repeating.

Copy link
Member Author

@jennifer-richards jennifer-richards Dec 13, 2023

Choose a reason for hiding this comment

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

On the idr group (see below to gauge whether this is "busy", but it looks it to me), this brute force approach takes the request from 2-2.4 seconds up to 2.2-2.5 seconds on my dev machine. The code here is taking advantage of the caching in became_rfc(), so I believe it's at least only paying the N+1 penalty and not hammering the db any worse than that.

(edit to add: the faster time is what I get if I replace all the became_rfc() calls with simple references to name or remove them entirely in the nodes.rfc logic)

image

We're only admitting source__type="draft", so
no need to check it again in filter queries
@jennifer-richards jennifer-richards marked this pull request as ready for review December 14, 2023 15:27
@rjsparks rjsparks merged commit 6083205 into ietf-tools:main Dec 14, 2023
9 checks passed
@jennifer-richards jennifer-richards deleted the deps-json branch December 14, 2023 15:30
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2023
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.

Group dependencies view (deps.json) causes 500 error
2 participants