Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

chore: Replace QueuedCount -> CountByState with bitset parameter#64302

Merged
varungandhi-src merged 1 commit into
mainfrom
vg/simplify-count
Aug 7, 2024
Merged

chore: Replace QueuedCount -> CountByState with bitset parameter#64302
varungandhi-src merged 1 commit into
mainfrom
vg/simplify-count

Conversation

@varungandhi-src

Copy link
Copy Markdown
Contributor

Previously, the QueuedCount method was confusing because:

  1. By default, it actually returned the count for both the 'queued' and 'errored' states
    (despite the name just have 'Queued').
  2. There was an additional boolean flag for also returning entries in the 'processing' state,
    but reduced clarity at call-sites.

So I've changed the method to take a bitset instead, mirroring the just-added Exists API,
and renamed the method to a more generic 'CountByState'.

While this does make call-sites a bit more verbose,
I think the clarity win makes the change an overall positive one.

However, if there is strong opposition, I'm open to re-considering/closing this PR.

This PR is stacked on top of:

Test plan

Covered by existing tests.

At the moment, there is some breakage in one test, I think that's because
of the change in the base PR, I'll take a look into that if this PR is
deemed directionally correct.

@cla-bot cla-bot Bot added the cla-signed label Aug 6, 2024
@github-actions github-actions Bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Aug 6, 2024
@varungandhi-src varungandhi-src force-pushed the vg/simplify-count branch 2 times, most recently from c9dee0d to 3834b19 Compare August 6, 2024 14:05
Base automatically changed from vg/add-exists to main August 6, 2024 14:13
Previously, the QueuedCount method was confusing because:
1. By default, it actually returned the count for both the 'queued'
   and 'errored' states (despite the name just have 'Queued').
2. There was an additional boolean flag for also returning entries
   in the 'processing' state, but reduced clarity at call-sites.

So I've changed the method to take a bitset instead, mirroring the just-added
Exists API, and renamed the method to a more generic 'CountByState'.

While this does make call-sites a bit more verbose, I think the
clarity win makes the change an overall positive one.
@varungandhi-src varungandhi-src merged commit 930033c into main Aug 7, 2024
@varungandhi-src varungandhi-src deleted the vg/simplify-count branch August 7, 2024 08:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

2 participants