Skip to content

Commit

Permalink
feat: sync kcl api and bump package path and go version (#128)
Browse files Browse the repository at this point in the history
* chore: bump CI go version to 1.19+

* chore: bump kusionstack to kcl-lang

* chore: sync kcl api latest

* fix: dep parser windows unit test cases.
  • Loading branch information
Peefy committed Aug 2, 2023
1 parent dcff71b commit 96e2e7c
Show file tree
Hide file tree
Showing 11 changed files with 458 additions and 336 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main_darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.19

# Parallel tests
- run: go test ./...
2 changes: 1 addition & 1 deletion .github/workflows/main_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.19

# Parallel tests
- run: go test -v -coverprofile=profile.cov ./...
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/main_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.10'
go-version: 1.19

# Parallel tests
- run: go test ./...
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COPY . .

RUN GOOS=linux GOARCH=amd64 go build ./cmds/kcl-go

FROM kusionstack/kclvm
FROM kcllang/kcl

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PROJECT_NAME = kcl-go

PWD:=$(shell pwd)

BUILD_IMAGE:=kusionstack/kclvm-builder
BUILD_IMAGE:=kcllang/kcl

# export DOCKER_DEFAULT_PLATFORM=linux/amd64
# or
Expand Down
3 changes: 0 additions & 3 deletions pkg/kcl/opt.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ func (p *Option) Merge(opts ...Option) *Option {
if opt.SortKeys {
p.SortKeys = opt.SortKeys
}
if opt.IncludeSchemaTypePath {
p.IncludeSchemaTypePath = opt.IncludeSchemaTypePath
}
if opt.ExternalPkgs != nil {
p.ExternalPkgs = append(p.ExternalPkgs, opt.ExternalPkgs...)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/spec/gpyrpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ default:
protoc --go_out=plugins=grpc:. gpyrpc.proto

cp ./kcl-lang.io/kcl-go/pkg/spec/gpyrpc/gpyrpc.pb.go gpyrpc.pb.go
-rm -rf ./kusionstack.io
-rm -rf ./kcl-lang.io
750 changes: 435 additions & 315 deletions pkg/spec/gpyrpc/gpyrpc.pb.go

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions pkg/spec/gpyrpc/gpyrpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,11 @@ message ExecProgram_Args {

// yaml/json: sort keys
bool sort_keys = 12;
// include schema type path in JSON/YAML result
bool include_schema_type_path = 13;

// -E --external : external packages path
repeated CmdExternalPkgSpec external_pkgs = 14;
repeated CmdExternalPkgSpec external_pkgs = 13;
}

message ExecProgram_Result {
string json_result = 1;
string yaml_result = 2;
Expand Down Expand Up @@ -283,7 +282,7 @@ message KeyValuePair {
}

// ----------------------------------------------------------------------------
// JSON Schema Lit
// KCL Type Structure
// ----------------------------------------------------------------------------

message KclType {
Expand All @@ -302,6 +301,11 @@ message KclType {
int32 line = 10;

repeated Decorator decorators = 11; // schema decorators

string filename = 12; // `filename` represents the absolute path of the file name where the attribute is located.
string pkg_path = 13; // `pkg_path` represents the path name of the package where the attribute is located.
string description = 14; // `description` represents the document of the attribute.
map<string, Example> examples = 15; // A map object to hold examples, the key is the example name.
}

message Decorator {
Expand All @@ -310,6 +314,12 @@ message Decorator {
map<string, string> keywords = 3;
}

message Example {
string summary = 1; // Short description for the example.
string description = 2; // Long description for the example.
google.protobuf.Any value = 3; // Embedded literal example.
}

// ----------------------------------------------------------------------------
// END
// ----------------------------------------------------------------------------
4 changes: 2 additions & 2 deletions pkg/tools/list/dep_parser_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import (
)

func TestInvalidFilePath(t *testing.T) {
_, err := newImportDepParser("./testdata/complicate/", DepOptions{Files: []string{"appops/projectA/invalid.k"}, UpStreams: []string{}})
assert.EqualError(t, err, "invalid file path: CreateFile testdata/complicate/appops/projectA/invalid.k: The system cannot find the file specified.", "err not match")
_, err := newImportDepParser(".\\testdata\\complicate\\", DepOptions{Files: []string{"appops\\projectA\\invalid.k"}, UpStreams: []string{}})
assert.EqualError(t, err, "invalid file path: stat appops\\projectA\\invalid.k: invalid argument", "err not match")
}
2 changes: 1 addition & 1 deletion testdata/app0/main.k
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import .sub as sub
import app0.sub as sub

main1=3

Expand Down

0 comments on commit 96e2e7c

Please sign in to comment.