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

Tag mass replace #6

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Tag mass replace #6

wants to merge 7 commits into from

Conversation

RT-nilPointer
Copy link

@RT-nilPointer RT-nilPointer commented Nov 19, 2020

Add a convenience function to do remove and add tags in one go, without needing to provide the cids of objects to remove the tag from.

This currently does not have a progressive implementation.

@codecov
Copy link

codecov bot commented Nov 19, 2020

Codecov Report

Merging #6 (a062f79) into master (651ff77) will decrease coverage by 3.39%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #6      +/-   ##
==========================================
- Coverage   63.43%   60.05%   -3.38%     
==========================================
  Files           6        6              
  Lines         473      458      -15     
==========================================
- Hits          300      275      -25     
  Misses        110      110              
- Partials       63       73      +10     
Impacted Files Coverage Δ
keys.go 75.72% <55.56%> (-5.61%) ⬇️
tag_counter.go 66.24% <61.37%> (-8.76%) ⬇️
progressive_counter.go 57.90% <100.00%> (-2.10%) ⬇️
progressive_tag_counter.go 73.92% <0.00%> (-4.65%) ⬇️
counter.go 53.18% <0.00%> (-3.76%) ⬇️
link_decoder.go 34.49% <0.00%> (-1.88%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 651ff77...a062f79. Read the comment docs.

@RT-nilPointer RT-nilPointer marked this pull request as ready for review November 19, 2020 03:49
@@ -135,6 +136,19 @@ func dataKeyToCid(s string) (cid.Cid, error) {
return cid.Decode(s[1 : len(s)-len(dataSuffixKey.String())])
}

func tagKeyToCid(k datastore.Key) (cid.Cid, error) {
s := k.String()
min := 4

Choose a reason for hiding this comment

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

would having min as a global variable be useful?

Copy link
Author

Choose a reason for hiding this comment

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

It could, but it's only used in this one function.

Copy link

@bonedaddy bonedaddy left a comment

Choose a reason for hiding this comment

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

looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants