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

feat(common): add http argument parser #3300

Merged
merged 2 commits into from
May 24, 2024
Merged

feat(common): add http argument parser #3300

merged 2 commits into from
May 24, 2024

Conversation

sejust
Copy link
Collaborator

@sejust sejust commented Apr 1, 2024

Motivation

Parse http argument in common package.

Modifications

        var id Int
        var name String
        ParseArguments(r, id.ID().
                OnEmpty(func() error { return errors.New("not found id") }).
                OnError(func() error { return errors.New("parse id failed") }).
                OnValue(func() error { return nil }),
                name.Key("name"),
        )

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bugfix (non-breaking change which fixes an issue)
  • Documentation Update (if none of the other choices apply)
  • So on...

Verifying this change

  • Make sure that the change passes the testing checks.

This change is already covered by existing tests, such as (please describe tests).

Does this pull request potentially affect one of the following parts:

  • Master
  • MetaNode
  • DataNode
  • ObjectNode
  • AuthNode
  • LcNode
  • Blobstore
  • Client
  • Cli
  • SDK
  • Other Tools
  • Common Packages
  • Dependencies
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Review Expection

  • in-two-days
  • weeks
  • free-time
  • whenever

Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for cubefs-check ready!

Name Link
🔨 Latest commit 410a631
🔍 Latest deploy log https://app.netlify.com/sites/cubefs-check/deploys/664ffc122f64720008173178
😎 Deploy Preview https://deploy-preview-3300--cubefs-check.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Attention: Patch coverage is 27.18447% with 150 lines in your changes are missing coverage. Please review.

Project coverage is 40.56%. Comparing base (bdffd66) to head (34d3659).
Report is 55 commits behind head on master.

Current head 34d3659 differs from pull request most recent head 410a631

Please upload reports for the commit 410a631 to get more accurate results.

Files Patch % Lines
metanode/api_handler.go 2.66% 72 Missing and 1 partial ⚠️
datanode/server_handler.go 0.00% 69 Missing ⚠️
cmd/common/args.go 50.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3300      +/-   ##
==========================================
+ Coverage   40.49%   40.56%   +0.06%     
==========================================
  Files         603      606       +3     
  Lines      125057   124981      -76     
==========================================
+ Hits        50643    50694      +51     
+ Misses      70051    69922     -129     
- Partials     4363     4365       +2     

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

@sejust sejust force-pushed the slasher branch 3 times, most recently from e18a509 to 34d3659 Compare April 1, 2024 08:08
@sejust sejust requested review from NaturalSelect and removed request for NaturalSelect April 3, 2024 06:57
@sejust sejust force-pushed the slasher branch 2 times, most recently from 0de06e8 to 6e16b3f Compare April 12, 2024 08:55
@sejust sejust force-pushed the slasher branch 2 times, most recently from b1282d6 to b044416 Compare April 17, 2024 08:35
@sejust sejust force-pushed the slasher branch 3 times, most recently from b3b20d3 to 2ee8815 Compare April 26, 2024 01:54
Victor1319
Victor1319 previously approved these changes May 9, 2024
Copy link
Member

@Victor1319 Victor1319 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@leonrayang leonrayang left a comment

Choose a reason for hiding this comment

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

LGTM

. #22032837 of #22032813

Signed-off-by: slasher <shenjie1@oppo.com>
. #22032841 of #22032813

Signed-off-by: slasher <shenjie1@oppo.com>
@sejust sejust merged commit 59538d3 into cubefs:master May 24, 2024
13 checks passed
@sejust sejust deleted the slasher branch May 24, 2024 02:43
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.

None yet

4 participants