Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

feature: define api types for seed pattern #1270

Merged

Conversation

wangforthinker
Copy link
Contributor

Signed-off-by: allen.wq [email protected]

Ⅰ. Describe what this PR did

define some api types for seed mode.

Ⅱ. Does this pull request fix one issue?

NONE.

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

none.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Copy link
Member

@lowzj lowzj left a comment

Choose a reason for hiding this comment

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

The codes in apis/types will be generated automatically by the robot, it's better not to submit these codes in pr.


ignore this, it's hard to separate them.

basic:
$ref: "#/definitions/PeerInfo"
description: "Basic node info"
extra:
Copy link
Member

Choose a reason for hiding this comment

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

I think the extra property is a map struct not a pre-defined object, thus we can add some customized properties without changing the api in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

apis/swagger.yml Outdated
@@ -1362,6 +1394,93 @@ definitions:
format: "int64"
description: "The length of the file dfget requests to download in bytes."

NetworkInfoFetchRequest:
type: "object"
description: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add description here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

apis/swagger.yml Outdated

Extra:
type: "object"
description: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add description here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

apis/swagger.yml Outdated

TaskFetchInfo:
type: "object"
description: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add description here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

apis/swagger.yml Outdated

Node:
type: "object"
description: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add description here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

apis/swagger.yml Outdated
This attribute represents the length of resource, dfdaemon or dfget catches and calculates
this parameter from the headers of request URL. If fileLength is vaild, the supernode need
not get the length of resource by accessing the rawURL.
format: "int64"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the indent here is incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

apis/swagger.yml Outdated
IP:
type: "string"
description: "IP address which peer client carries"
format: "string"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use ipv4 or ipv6 for the format here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

items:
$ref: "#/definitions/Node"

HeartBeatRequest:
Copy link
Contributor

Choose a reason for hiding this comment

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

This struct is newly declared here, while where to use it in the API endpoint?
I think where to use it is missing in the API defining side.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@lowzj
Copy link
Member

lowzj commented Apr 8, 2020

apis/types/task_register_request.go:110:28: "specfic" is a misspelling of "specific"
apis/swagger.yml:799:34: "specfic" is a misspelling of "specific"
apis/types/task_register_request.go:110:28: "specfic" is a misspelling of "specific"
apis/types/task_register_request.go:110:28: "specfic" is a misspelling of "specific"
./apis/types/task_register_request.go:110:28: "specfic" is a misspelling of "specific"
apis/swagger.yml:799:34: "specfic" is a misspelling of "specific"
./apis/swagger.yml:799:34: "specfic" is a misspelling of "specific"

please resolve these spell errors

@wangforthinker wangforthinker force-pushed the feat/define-some-api-types-prepare-pr branch 2 times, most recently from a8f34df to ffd954f Compare April 9, 2020 02:31
@codecov-io
Copy link

codecov-io commented Apr 9, 2020

Codecov Report

Merging #1270 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1270   +/-   ##
=======================================
  Coverage   48.51%   48.51%           
=======================================
  Files         121      121           
  Lines        7788     7788           
=======================================
  Hits         3778     3778           
  Misses       3698     3698           
  Partials      312      312           
Impacted Files Coverage Δ
dfget/types/register_request.go 0.00% <ø> (ø)

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 9a4e7b0...1d160be. Read the comment docs.


// Extra extra
// swagger:model Extra
type Extra struct {
Copy link
Member

Choose a reason for hiding this comment

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

This file is not generated by go-swagger with the current api definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Signed-off-by: allen.wq <[email protected]>
@wangforthinker wangforthinker force-pushed the feat/define-some-api-types-prepare-pr branch from ffd954f to 1d160be Compare April 9, 2020 02:48
@lowzj lowzj changed the title define some api types. feature: define api types for seed pattern Apr 9, 2020
Copy link
Member

@lowzj lowzj left a comment

Choose a reason for hiding this comment

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

LGTM

@lowzj lowzj merged commit 05b2f8e into dragonflyoss:master Apr 9, 2020
@@ -648,6 +648,47 @@ paths:
500:
$ref: "#/responses/500ErrorResponse"

/peer/heartbeat:
get:
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not think this is a "GET" request. Maybe POST is better. @wangforthinker

@wangforthinker wangforthinker deleted the feat/define-some-api-types-prepare-pr branch April 23, 2020 03:18
sungjunyoung pushed a commit to sungjunyoung/Dragonfly that referenced this pull request May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants