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

CP-47356: Support backwards capability for Go SDK #5620

Merged
merged 10 commits into from
May 14, 2024

Conversation

duobei
Copy link
Contributor

@duobei duobei commented May 8, 2024

No description provided.

@xueqingz
Copy link

xueqingz commented May 8, 2024

From generated source files, for methods under session.go, it's not correct. eg.

func (class *Session) LoginWithPassword3(pwd string, version string) (retval SessionRef, err error) {
	method := "session.login_with_password"
	unameArg, err := serializeString(fmt.Sprintf("%s(%s)", method, "uname"), uname)
	if err != nil {
		return
	}
	pwdArg, err := serializeString(fmt.Sprintf("%s(%s)", method, "pwd"), pwd)
	if err != nil {
		return
	}
	versionArg, err := serializeString(fmt.Sprintf("%s(%s)", method, "version"), version)
	if err != nil {
		return
	}
	result, err := class.client.sendCall(method, unameArg, pwdArg, versionArg)
	if err != nil {
		return
	}
	retval, err = deserializeSessionRef(method+" -> ", result)
	if err != nil {
		return
	}
	class.ref = retval
	err = setSessionDetails(class)
	return
}

obviously missing parameter "uname" in functions. please check the generated JSON data.
same for other methods which doesn't have value "session_id" in function's parameters.

@duobei
Copy link
Contributor Author

duobei commented May 8, 2024

From generated source files, for methods under session.go, it's not correct. eg.

func (class *Session) LoginWithPassword3(pwd string, version string) (retval SessionRef, err error) {
	method := "session.login_with_password"
	unameArg, err := serializeString(fmt.Sprintf("%s(%s)", method, "uname"), uname)
	if err != nil {
		return
	}
	pwdArg, err := serializeString(fmt.Sprintf("%s(%s)", method, "pwd"), pwd)
	if err != nil {
		return
	}
	versionArg, err := serializeString(fmt.Sprintf("%s(%s)", method, "version"), version)
	if err != nil {
		return
	}
	result, err := class.client.sendCall(method, unameArg, pwdArg, versionArg)
	if err != nil {
		return
	}
	retval, err = deserializeSessionRef(method+" -> ", result)
	if err != nil {
		return
	}
	class.ref = retval
	err = setSessionDetails(class)
	return
}

obviously missing parameter "uname" in functions. please check the generated JSON data. same for other methods which doesn't have value "session_id" in function's parameters.

Yeah, there is a bug here. I'll fix soon.

--
Fixed

@duobei duobei requested a review from xueqingz May 8, 2024 13:52
… for usage of other modules

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
@duobei duobei force-pushed the private/fezhan/CP-47356 branch 2 times, most recently from f7f8cff to c2738c2 Compare May 10, 2024 08:11
@xueqingz
Copy link

When checking Golong lint , got 3 errors, could you please check why the method version for "VM.restart_device_models" is null?

root@3eea0d3e0e5d:/app/go/goSDK# golangci-lint run --config=/app/.golangci.yml
WARN The linter 'execinquery' is deprecated (since v1.58.0) due to: The repository of the linter has been archived by the owner.  
WARN The linter 'gomnd' is deprecated (since v1.58.0) due to: The linter has been renamed. Replaced by mnd. 
vm.go:264: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
//
vm.go:287: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
//
vm.go:314: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
//
3 issues:
* gci: 3

@duobei
Copy link
Contributor Author

duobei commented May 10, 2024

root@3eea0d3e0e5d:/app/go/goSDK# golangci-lint run --config=/app/.golangci.yml
WARN The linter 'execinquery' is deprecated (since v1.58.0) due to: The repository of the linter has been archived by the owner.  
WARN The linter 'gomnd' is deprecated (since v1.58.0) due to: The linter has been renamed. Replaced by mnd. 
vm.go:264: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
//
vm.go:287: File is not `gci`-ed with --skip-generated -s standard -s default (gci)
//
vm.go:314: File is not `gci`-ed with --skip-generated -s standard -s default (gci)

There is a bug hidden here. I'll fix it soon.

@xueqingz
Copy link

Golang lint checking pass.

root@3eea0d3e0e5d:/app/go/goSDK# golangci-lint run --config=/app/.golangci.yml
WARN The linter 'gomnd' is deprecated (since v1.58.0) due to: The linter has been renamed. Replaced by mnd. 
WARN The linter 'execinquery' is deprecated (since v1.58.0) due to: The repository of the linter has been archived by the owner.  
0 issues.

test with xs-samples go project, no special error found.

@minglumlu
Copy link
Member

Hi @duobei
Thanks. I only added a few more minor comments for the naming convention.

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
…unctions

Signed-off-by: xueqingz <xueqing.zhang@citrix.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
…h_enums`

Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
Signed-off-by: Luca Zhang <feiya.zhang@cloud.com>
@duobei duobei merged commit a41f264 into xapi-project:feature/go_sdk May 14, 2024
28 checks passed
Copy link

pytype_reporter extracted 50 problem reports from pytype output

.

You can check the results of the job here

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

3 participants