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

NEOS-1520 Add meter to anonymization service #2797

Merged
merged 18 commits into from
Oct 15, 2024

Conversation

alishakawaguchi
Copy link
Contributor

No description provided.

@alishakawaguchi alishakawaguchi added the Fast Follow Created by Linear-GitHub Sync label Oct 11, 2024
@alishakawaguchi alishakawaguchi self-assigned this Oct 11, 2024
Copy link

linear bot commented Oct 11, 2024

Copy link

vercel bot commented Oct 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
neosync-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 15, 2024 9:04pm

Copy link

github-actions bot commented Oct 12, 2024

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedOct 15, 2024, 9:03 PM

Copy link

codecov bot commented Oct 12, 2024

Codecov Report

Attention: Patch coverage is 26.27119% with 87 lines in your changes missing coverage. Please review.

Project coverage is 36.10%. Comparing base (2426bd0) to head (dc69fde).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...mt/v1alpha1/anonymization-service/anonymization.go 20.51% 51 Missing and 11 partials ⚠️
backend/internal/cmds/mgmt/serve/connect/cmd.go 0.00% 16 Missing ⚠️
...gmt/v1alpha1/anonymization-service/user-account.go 47.05% 5 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2797      +/-   ##
==========================================
- Coverage   36.16%   36.10%   -0.06%     
==========================================
  Files         293      294       +1     
  Lines       27854    27966     +112     
==========================================
+ Hits        10073    10097      +24     
- Misses      16432    16504      +72     
- Partials     1349     1365      +16     

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

Copy link
Member

@nickzelei nickzelei left a comment

Choose a reason for hiding this comment

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

looking great, left a few comments.

accountUuid, err := neosyncdb.ToUuid(accountId)
if err != nil {
return nil, err
}
Copy link
Member

Choose a reason for hiding this comment

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

prob wanna add a check here to see if the user is an API key.
Check the similar function in the job-service.

}

if !resp.Msg.IsValid {
return nil, fmt.Errorf("unable to anonymize due to account in invalid state. Reason: %q", *resp.Msg.Reason)
Copy link
Member

Choose a reason for hiding this comment

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

minor thing but let's return this as a nucleuserrors.NewBadRequest

}

if !resp.Msg.IsValid {
return nil, fmt.Errorf("unable to anonymize due to account in invalid state. Reason: %q", *resp.Msg.Reason)
Copy link
Member

Choose a reason for hiding this comment

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

sam here, let's return this as a bad request.

const (
inputMetricStr = "input_received"
outputMetricStr = "output_sent"
outputBatchCounterStr = "output_batch_sent"
Copy link
Member

Choose a reason for hiding this comment

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

doesnt look like we are using this

return nil, err
}
}

outputData, err := anonymizer.AnonymizeJSONObject(req.Msg.InputData)
if err != nil {
return nil, err
Copy link
Member

Choose a reason for hiding this comment

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

Hm, should we increment the output err counter here?

@alishakawaguchi alishakawaguchi merged commit d4a9b39 into main Oct 15, 2024
17 of 19 checks passed
@alishakawaguchi alishakawaguchi deleted the alisha/neos-1520-meter branch October 15, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fast Follow Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants