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

WIP: Refine type for ClosestUploads #62528

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

varungandhi-src
Copy link
Contributor

There is an invariant in the implementation for closest uploads which
is not documented in the function signature. This makes it hard to reason
about which uploads can be returned. This attempts to document that
invariant using types rather than just a comment.

Unfortunately, the OrderedMap type here doesn't expose an API
which allows arbitrary indexing, making it hard to use as a drop-in replacement.

We should probably introduce a collections.MonotonicOrderedMap for that.

Test plan

Existing tests should pass.

The upload filtering code previously did a check whether:
- The commit corresponding to the upload actually existing on gitserver
- The path of interest had an associated SCIP document in that upload.

However, the second code path incorrectly only handled the case when
the first operation was a no-op. In case some uploads were filtered
out due to the path existing (or not) in the wrong upload, and the
final result could still have uploads for which the commit no longer
existed on gitserver.
@cla-bot cla-bot bot added the cla-signed label May 8, 2024
@github-actions github-actions bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels May 8, 2024
Base automatically changed from vg/fix-candidates-bug to main May 8, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant