profile
viewpoint
Nick Cameron nrc @pingcap Christchurch, New Zealand https://www.ncameron.org Software engineer at PingCAP; @rust-lang core team.

nrc/derive-new 243

derive simple constructor functions for Rust structs

nrc/apr-intro 64

An alternate introdcution to the APR book

nrc/callgraph.rs 26

Callgraphs for Rust programs

nrc/find-work 23

find something Rusty to work on

GSam/rust-refactor 19

Rust refactoring project

nrc/box-error 3

A library for error handling using boxed errors

nrc/clyde 3

wip

nrc/cargo-edit 1

A utility for managing cargo dependencies from the command line.

nrc/chalk 1

A PROLOG-ish interpreter written in Rust, intended eventually for use in the compiler

push eventpingcap-incubator/tiup

Lonng

commit sha 05caa58b29535e2b654cb3d689ce56d25ef5a491

Verify signatures base on JSON raw message (#275) Signed-off-by: Lonng <heng@lonng.org>

view details

push time in 4 hours

delete branch pingcap-incubator/tiup

delete branch : raw-sig-verify

delete time in 4 hours

PR merged pingcap-incubator/tiup

Verify signatures base on JSON raw message

Signed-off-by: Lonng heng@lonng.org

<!-- Thank you for contributing to TiUP! Please read TiUP's CONTRIBUTING document BEFORE filing this PR. -->

What problem does this PR solve? <!--add issue link with summary if exists-->

Verify signatures base on JSON raw message to prevent verify failed from specification changing.

+39 -28

1 comment

3 changed files

lonng

pr closed time in 4 hours

push eventtikv/protobuf-build

Nick Cameron

commit sha 083d90d5218102a189f21c4a65d1e0496a3554eb

Handle repeated built-in types Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha 7f65cc22bbb3008b4dd8c4bf710406287ebbd6f3

Merge pull request #42 from nrc/colons Handle repeated built-in types

view details

push time in 4 hours

PR closed pingcap/kvproto

Add proto for CDC to support large txn status/WIP

This PR adds proto for CDC to support push resolved_ts according to large transaction's min_commit_ts.

+1342 -105

0 comment

3 changed files

MyonKeminta

pr closed time in 4 hours

PR merged tikv/protobuf-build

Handle repeated built-in types

This commit was missing from my previous PR. It adds some special casing for built-in types. (Needed to fix https://github.com/pingcap/kvproto/pull/622).

PTAL @BusyJay

+9 -2

0 comment

2 changed files

nrc

pr closed time in 4 hours

push eventpingcap-incubator/tiup

Lonng

commit sha 6bda4b88559ff76a383f63e7115add5dacca70b6

Add standalone/hidden field to index.json (#274) Signed-off-by: Lonng <heng@lonng.org>

view details

push time in 5 hours

delete branch pingcap-incubator/tiup

delete branch : component-fields

delete time in 5 hours

PR merged pingcap-incubator/tiup

Add standalone/hidden field to index.json

Signed-off-by: Lonng heng@lonng.org

<!-- Thank you for contributing to TiUP! Please read TiUP's CONTRIBUTING document BEFORE filing this PR. -->

What problem does this PR solve? <!--add issue link with summary if exists-->

Add standalone/hidden field to index.json

+15 -8

1 comment

2 changed files

lonng

pr closed time in 5 hours

Pull request review commentpingcap-incubator/tiup

Treat TiUP as a component when migrating

 func migrate(srcDir, dstDir string, rehash bool) error { 		} 	} +	// Tread TiUP as a component+	tiup := v0manifest.ComponentInfo{+		Name: "tiup",+		Desc: "Components manager for TiDB ecosystem",+	}+	tiupVersions := &v0manifest.VersionManifest{+		Description: tiup.Desc,+		Versions: []v0manifest.VersionInfo{+			{+				Version: v0manifest.Version(tiupver.NewTiUPVersion().SemVer()),+				Date:    time.Now().Format(time.RFC3339),+				Entry:   "tiup",+			},+		},+	}+	for _, goos := range []string{"linux", "darwin"} {+		for _, goarch := range []string{"amd64", "arm64"} {

I think we don't need arm/OS X

lonng

comment created time in 6 hours

Pull request review commentpingcap-incubator/tiup

Treat TiUP as a component when migrating

 func migrate(srcDir, dstDir string, rehash bool) error { 		} 	} +	// Tread TiUP as a component+	tiup := v0manifest.ComponentInfo{+		Name: "tiup",+		Desc: "Components manager for TiDB ecosystem",
		Desc: "Component manager for TiDB ecosystem",
lonng

comment created time in 6 hours

Pull request review commentpingcap-incubator/tiup

Treat TiUP as a component when migrating

 func migrate(srcDir, dstDir string, rehash bool) error { 		} 	} +	// Tread TiUP as a component
	// Treat TiUP as a component
lonng

comment created time in 6 hours

Pull request review commentpingcap-incubator/tiup

Fix mirror clone

 func cloneComponents(repo *V1Repository, 		compManifests[name] = newManifest 	} +	// Download TiUP binary+	for _, goos := range options.OSs {

We should probably share this code with the client code in v1repository, but we can refactor later.

lonng

comment created time in 9 hours

PR opened tikv/protobuf-build

Reviewers
Handle repeated built-in types

This commit was missing from my previous PR. It adds some special casing for built-in types. (Needed to fix https://github.com/pingcap/kvproto/pull/622).

PTAL @BusyJay

+9 -2

0 comment

2 changed files

pr created time in 9 hours

push eventnrc/protobuf-build

Nick Cameron

commit sha b559fb0f12cefd2d9396172dd729bb445973c264

Merge pull request #40 from nrc/colons Handle recursive types, which Prost wraps in a Box

view details

Nick Cameron

commit sha 4816a8a3a57f3e9db684a5155c3184236721a0f3

Merge branch 'master' into nested

view details

Nick Cameron

commit sha 8aca8e9de19fa92b6fa21298f7958ecb886ae3fc

Merge pull request #41 from nrc/nested Account for some edge cases inside repeated types.

view details

Nick Cameron

commit sha 083d90d5218102a189f21c4a65d1e0496a3554eb

Handle repeated built-in types Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 9 hours

push eventrust-lang/blog.rust-lang.org

Nick Cameron

commit sha 844988ea9975344e8b14d8029c5cc38da10d5763

Fix the date on the web retro post Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 10 hours

push eventrust-lang/blog.rust-lang.org

Nick Cameron

commit sha ca7f5c1d59d2118490b851166f60b7ed47b23fe5

Add website retrospective Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 10 hours

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

 func (lr *listResult) print() { }  func showComponentList(env *meta.Environment, onlyInstalled bool, refresh bool) (*listResult, error) {-	if refresh || env.Profile().Manifest() == nil {-		manifest, err := env.Repository().Manifest()-		if err != nil {-			return nil, err-		}-		err = env.Profile().SaveManifest(manifest)-		if err != nil {-			return nil, err-		}+	index, err := env.V1Repository().FetchIndexManifest()+	if err != nil {+		return nil, err 	}  	installed, err := env.Profile().InstalledComponents() 	if err != nil { 		return nil, err 	}-	manifest := env.Profile().Manifest()+ 	var cmpTable [][]string-	cmpTable = append(cmpTable, []string{"Name", "Installed", "Platforms", "Description"})+	cmpTable = append(cmpTable, []string{"Name", "Owner", "Installed", "Platforms", "Description"})  	localComponents := set.NewStringSet(installed...)-	for _, comp := range manifest.Components {-		if comp.Hide {-			continue-		}-		if onlyInstalled && !localComponents.Exist(comp.Name) {+	for name, comp := range index.Components {+		if onlyInstalled && !localComponents.Exist(name) { 			continue 		} 		installStatus := ""-		if localComponents.Exist(comp.Name) {-			versions, err := env.Profile().InstalledVersions(comp.Name)+		if localComponents.Exist(name) {

#267

lucklove

comment created time in a day

PR opened pingcap-incubator/tiup

Reviewers
Remove name field from component manifest

I think we should not have both name and id, it is confusing and has potential for errors where one is required but the other is used.

PTAL @lonng

+3 -8

0 comment

5 changed files

pr created time in a day

create barnchnrc/tiup

branch : name

created branch time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

 func (lr *listResult) print() { }  func showComponentList(env *meta.Environment, onlyInstalled bool, refresh bool) (*listResult, error) {-	if refresh || env.Profile().Manifest() == nil {-		manifest, err := env.Repository().Manifest()-		if err != nil {-			return nil, err-		}-		err = env.Profile().SaveManifest(manifest)-		if err != nil {-			return nil, err-		}+	index, err := env.V1Repository().FetchIndexManifest()+	if err != nil {+		return nil, err 	}  	installed, err := env.Profile().InstalledComponents() 	if err != nil { 		return nil, err 	}-	manifest := env.Profile().Manifest()+ 	var cmpTable [][]string-	cmpTable = append(cmpTable, []string{"Name", "Installed", "Platforms", "Description"})+	cmpTable = append(cmpTable, []string{"Name", "Owner", "Installed", "Platforms", "Description"})

This also has the advantage that tiup list would be very fast because it would only need the index manifest and installed versions.

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

 func (lr *listResult) print() { }  func showComponentList(env *meta.Environment, onlyInstalled bool, refresh bool) (*listResult, error) {-	if refresh || env.Profile().Manifest() == nil {-		manifest, err := env.Repository().Manifest()-		if err != nil {-			return nil, err-		}-		err = env.Profile().SaveManifest(manifest)-		if err != nil {-			return nil, err-		}+	index, err := env.V1Repository().FetchIndexManifest()+	if err != nil {+		return nil, err 	}  	installed, err := env.Profile().InstalledComponents() 	if err != nil { 		return nil, err 	}-	manifest := env.Profile().Manifest()+ 	var cmpTable [][]string-	cmpTable = append(cmpTable, []string{"Name", "Installed", "Platforms", "Description"})+	cmpTable = append(cmpTable, []string{"Name", "Owner", "Installed", "Platforms", "Description"})  	localComponents := set.NewStringSet(installed...)-	for _, comp := range manifest.Components {-		if comp.Hide {-			continue-		}-		if onlyInstalled && !localComponents.Exist(comp.Name) {+	for name, comp := range index.Components {+		if onlyInstalled && !localComponents.Exist(name) { 			continue 		} 		installStatus := ""-		if localComponents.Exist(comp.Name) {-			versions, err := env.Profile().InstalledVersions(comp.Name)+		if localComponents.Exist(name) {+			versions, err := env.Profile().InstalledVersions(name) 			if err != nil { 				return nil, err 			} 			installStatus = fmt.Sprintf("YES(%s)", strings.Join(versions, ",")) 		}-		sort.Strings(comp.Platforms)++		manifest, err := env.V1Repository().FetchComponentManifest(name)+		if err != nil {+			return nil, err+		}++		platforms := []string{}+		for p := range manifest.Platforms {+			platforms = append(platforms, p)+		}+ 		cmpTable = append(cmpTable, []string{-			comp.Name,+			name,+			comp.Owner, 			installStatus,-			strings.Join(comp.Platforms, ","),-			comp.Desc,+			strings.Join(platforms, ","),
			strings.Join(platforms, ", "),
lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

 func (lr *listResult) print() { }  func showComponentList(env *meta.Environment, onlyInstalled bool, refresh bool) (*listResult, error) {-	if refresh || env.Profile().Manifest() == nil {-		manifest, err := env.Repository().Manifest()-		if err != nil {-			return nil, err-		}-		err = env.Profile().SaveManifest(manifest)-		if err != nil {-			return nil, err-		}+	index, err := env.V1Repository().FetchIndexManifest()+	if err != nil {+		return nil, err 	}  	installed, err := env.Profile().InstalledComponents() 	if err != nil { 		return nil, err 	}-	manifest := env.Profile().Manifest()+ 	var cmpTable [][]string-	cmpTable = append(cmpTable, []string{"Name", "Installed", "Platforms", "Description"})+	cmpTable = append(cmpTable, []string{"Name", "Owner", "Installed", "Platforms", "Description"})  	localComponents := set.NewStringSet(installed...)-	for _, comp := range manifest.Components {-		if comp.Hide {-			continue-		}-		if onlyInstalled && !localComponents.Exist(comp.Name) {+	for name, comp := range index.Components {+		if onlyInstalled && !localComponents.Exist(name) { 			continue 		} 		installStatus := ""-		if localComponents.Exist(comp.Name) {-			versions, err := env.Profile().InstalledVersions(comp.Name)+		if localComponents.Exist(name) {+			versions, err := env.Profile().InstalledVersions(name) 			if err != nil { 				return nil, err 			} 			installStatus = fmt.Sprintf("YES(%s)", strings.Join(versions, ","))

I think rather than using YES(versions) we can just display the installed versions, it should be clearer.

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

 func (lr *listResult) print() { }  func showComponentList(env *meta.Environment, onlyInstalled bool, refresh bool) (*listResult, error) {-	if refresh || env.Profile().Manifest() == nil {-		manifest, err := env.Repository().Manifest()-		if err != nil {-			return nil, err-		}-		err = env.Profile().SaveManifest(manifest)-		if err != nil {-			return nil, err-		}+	index, err := env.V1Repository().FetchIndexManifest()+	if err != nil {+		return nil, err 	}  	installed, err := env.Profile().InstalledComponents() 	if err != nil { 		return nil, err 	}-	manifest := env.Profile().Manifest()+ 	var cmpTable [][]string-	cmpTable = append(cmpTable, []string{"Name", "Installed", "Platforms", "Description"})+	cmpTable = append(cmpTable, []string{"Name", "Owner", "Installed", "Platforms", "Description"})  	localComponents := set.NewStringSet(installed...)-	for _, comp := range manifest.Components {-		if comp.Hide {-			continue-		}-		if onlyInstalled && !localComponents.Exist(comp.Name) {+	for name, comp := range index.Components {+		if onlyInstalled && !localComponents.Exist(name) { 			continue 		} 		installStatus := ""-		if localComponents.Exist(comp.Name) {-			versions, err := env.Profile().InstalledVersions(comp.Name)+		if localComponents.Exist(name) {

The 'name' here is actually the id of the component, but after seeing this PR I think it is a mistake to have both name and id for components and we should remove name (I can do that if you agree, it doesn't have to be done in this PR).

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

 func (lr *listResult) print() { }  func showComponentList(env *meta.Environment, onlyInstalled bool, refresh bool) (*listResult, error) {-	if refresh || env.Profile().Manifest() == nil {-		manifest, err := env.Repository().Manifest()-		if err != nil {-			return nil, err-		}-		err = env.Profile().SaveManifest(manifest)-		if err != nil {-			return nil, err-		}+	index, err := env.V1Repository().FetchIndexManifest()+	if err != nil {+		return nil, err 	}  	installed, err := env.Profile().InstalledComponents() 	if err != nil { 		return nil, err 	}-	manifest := env.Profile().Manifest()+ 	var cmpTable [][]string-	cmpTable = append(cmpTable, []string{"Name", "Installed", "Platforms", "Description"})+	cmpTable = append(cmpTable, []string{"Name", "Owner", "Installed", "Platforms", "Description"})

I think it would be good for tiup list to give a very simple list of component names and tiup list --verbose to give this view. It is good info, but I think it might be overwhelming for new users.

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

 type Component struct {  // ComponentItem object type ComponentItem struct {+	Name      string `json:"name"`+	Desc      string `json:"description"`

Hmmm, true. I think this is OK for now, but long term maybe we can move them to snapshot.json.

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Support nightly

 func (r *V1Repository) selectVersion(id string, versions map[string]v1manifest.V 		var latest string 		var latestItem v1manifest.VersionItem 		for version, item := range versions {+			if v0manifest.Version(version).IsNightly() {

Good catch by the way, I did not think about this issue with nightlies.

july2993

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Support nightly

 func (v Version) IsEmpty() bool {  // IsNightly returns true if the version is nightly func (v Version) IsNightly() bool {-	return string(v) == version.NightlyVersion-+	return strings.Contains(string(v), "nightly")

A problem is that we must skip nightly versions when getting the latest version of a component, so we need to know which component versions are nightly and which aren't

july2993

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Support nightly

 func (r *V1Repository) selectVersion(id string, versions map[string]v1manifest.V 		var latest string 		var latestItem v1manifest.VersionItem 		for version, item := range versions {+			if v0manifest.Version(version).IsNightly() {

I think that we should add to manifests.md that a nightly version must contain the substring nightly. We could also check that in Component.IsValid

july2993

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Support nightly

 func (r *V1Repository) selectVersion(id string, versions map[string]v1manifest.V 		var latest string 		var latestItem v1manifest.VersionItem 		for version, item := range versions {+			if v0manifest.Version(version).IsNightly() {

Can we inline the 'is nightly' check here so we don't need to use v0manifest.Version?

july2993

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Support nightly

 func (r *V1Repository) UpdateComponents(specs []ComponentSpec) error { 			continue 		} -		if spec.Version == "nightly" && !manifest.HasNightly() {+		if spec.Nightly {+			spec.Version = manifest.Nightly+			// The v0 "nightly" is not versioned, force update as v0...+			// we will add daily ones like: "v3.0.0-nightly-yyyy-mm-dd"+			if spec.Version == "nightly" {+				spec.Force = true+			}+		}++		if v0manifest.Version(spec.Version).IsNightly() && !manifest.HasNightly(r.PlatformString()) {
		if spec.Nightly && !manifest.HasNightly(r.PlatformString()) {
july2993

comment created time in a day

pull request commentpingcap-incubator/tiup

Support nightly

I think maybe need to instal specified version as v1.2.2-nightly-yyyy-mm-dd, not just "nightly" ?

Ah, in that case I think we can add a nightly field to the component spec.

july2993

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Misc security fixes and tidying up for v1 manifests

 A key definition is:  ```json "KEYID": {-    "keyid_hash_algorithms": [

I added back in the line of the spec about sha256/sha512, but left keyid_hash_algorithms out.

nrc

comment created time in a day

push eventnrc/tiup

Nick Cameron

commit sha 73c8961e8baa58af66c9c7b6f7bcee5e4f02c121

Misc security fixes and tidying up for v1 manifests Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in a day

Pull request review commentpingcap-incubator/tiup

Misc security fixes and tidying up for v1 manifests

 A key definition is:  ```json "KEYID": {-    "keyid_hash_algorithms": [

I don't think we need keyid_hash_algorithms in any case because it is not role dependent. We currently only read the sha256 hash, but we can still have multiple hashes so support sha512 easily in the future.

nrc

comment created time in a day

push eventnrc/tiup

Allen Zhong

commit sha b2b0d4f598a485cf5e9bf862d0c1a9db89f5d0d7

*: add basic support of nightly versions (#261) * manifest: add nightly version to component * cmd/repo: add nightly flag * tools/migrate: include nightly versions * docs/manifest: fix typo & adjust sample * Update doc/design/manifest.md Co-authored-by: Lonng <heng@lonng.org> Co-authored-by: july2993 <july2993@gmail.com>

view details

Nick Cameron

commit sha 88b9f87b93a90a7ad90e4a26a1d0628777c70088

Misc security fixes and tidying up for v1 manifests Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in a day

Pull request review commentpingcap-incubator/tiup

Support nightly

 func (v Version) IsEmpty() bool {  // IsNightly returns true if the version is nightly func (v Version) IsNightly() bool {-	return string(v) == version.NightlyVersion-+	return strings.Contains(string(v), "nightly")

I think if we put nightly in the component spec, then we don't need to check the version to know (from the manifests, whether a version is nightly is external to the version identifier).

july2993

comment created time in a day

PR opened pingcap-incubator/tiup

Reviewers
Misc security fixes and tidying up for v1 manifests

This PR is a bit of a bag of different things I found while checking we were properly doing signature and hash verification. It includes:

  • Handling verification of expired root manifests by checking keys for expiry when they are used, not when loaded.
  • Make ReadJSON in Profile private to reduce the surface area of json decoding. I have checked that every place where we decode JSON verifies the result if necessary. I created a ReadMetaFile function to accomplish this, I think it is a good abstraction in any case.
  • Removed some mention of sha512 hashes which we do not support.
  • Removed the unused DownloadComponent from v1Repository
  • Removed an unnecessary reload of the root manifest in ensureManifests, this was a mistake from a previous PR (whoops).

PTAL @lucklove @july2993

+72 -80

0 comment

10 changed files

pr created time in a day

create barnchnrc/tiup

branch : check

created branch time in a day

Pull request review commentpingcap-incubator/tiup

Support nightly

 func (v Version) IsEmpty() bool {  // IsNightly returns true if the version is nightly func (v Version) IsNightly() bool {-	return string(v) == version.NightlyVersion-+	return strings.Contains(string(v), "nightly")

This is not true for v1 - although the nightly version should include nightly it doesn't have to.

july2993

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Support nightly

 func (env *Environment) UpdateComponents(specs []string, nightly, force bool) er 			component, v := ParseCompVersion(spec) 			v1specs = append(v1specs, repository.ComponentSpec{ID: component, Version: v.String(), Force: force}) 		}-		return env.v1Repo.UpdateComponents(v1specs)+		return env.v1Repo.UpdateComponents(v1specs, nightly)

I think nightly should be added to the component specs, not passed as another argument.

july2993

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

+package v1manifest++import (+	"github.com/pingcap-incubator/tiup/pkg/repository/v0manifest"+)++type (+	// Version represents a version string, like: v3.1.2+	Version = v0manifest.Version
	Version string

I like to keep the v0 and v1 manifest systems separate. However, I think it is also ok to just use a string for the version rather than create a type because we don't ensure any further invariants when we use the Version type.

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

 type Component struct {  // ComponentItem object type ComponentItem struct {+	Name      string `json:"name"`+	Desc      string `json:"description"`

I think it is better not to add these here since they can be changed when a component is updated and then we would need to touch index.json.

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

+package v1manifest++// ContainsVersion returns if the versions contain the specific version+func (manifest *Component) ContainsVersion(version Version) bool {

I think this can be removed - it is not used

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

+package v1manifest

I think this file can be removed

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

Refactor tiup list subcommand to use v1 repository

 func (lr *listResult) print() { }  func showComponentList(env *meta.Environment, onlyInstalled bool, refresh bool) (*listResult, error) {-	if refresh || env.Profile().Manifest() == nil {-		manifest, err := env.Repository().Manifest()-		if err != nil {-			return nil, err-		}-		err = env.Profile().SaveManifest(manifest)-		if err != nil {-			return nil, err-		}-	}--	installed, err := env.Profile().InstalledComponents()+	index, err := env.V1Repository().FetchIndexManifest()

I think it is better to use the local copy of the index rather than getting the latest version, that is very slow due to the network round trips. The user can either run update or we can add a flag to get the latest info.

lucklove

comment created time in a day

Pull request review commentpingcap-incubator/tiup

*: add basic support of nightly versions

 Where xxx is the id of the component, n is the version of the manifest, file is ``` "name": "Name of the Component", "description": "This is a component",+"nightly": "v0.2.0-nightly+20200525", "platforms": {     "x86_64-apple-darwin": {-        "0.0.1": {+        "v0.0.1": {             "yanked": false,-            "url": "/name-of_x86_64-apple-darwin_0.0.1.tar.gz",+            "url": "/name-of_x86_64-apple-darwin_v0.0.1.tar.gz",             "hashes": {                 "sha256": "141f740f53781d1ca54b8a50af22cbf74e44c21a998fa2a8a05aaac2c002886b",                 "sha512": "ef5beafa16041bcdd2937140afebd485296cd54f7348ecd5a4d035c09759608de467a7ac0eb58753d0242df873c305e8bffad2454aa48f44480f15efae1cacd0"             },             "length": 1001000499,             "dependencies": {-                "foo": "1.0.0",+                "foo": "v1.0.0",             },         },-        "0.2.0": { ... },+        "v0.2.0": { ... },     },     "aarch64-unknown-linux": { ... }, }, ```  The platform id should be one of the supported TiUp target triples. Version ids must be valid semver. Dependencies are a map from component id to a semver version string. +The "nightly" points to the version number of latest daily build, that version should be in the version list of all supported platforms. The version number of nightly build should (but not forced to) be in the following format:++```+vX.Y.Z-nightly+YYYYmmdd

This format is not valid semver (even ignoring the v prefix), I suggest using - instead of + (only a-Z, 0-9, -, and . are allowed)

AstroProfundis

comment created time in a day

issue commentpingcap-incubator/tiup

Manifest issues blocking GA release

Regarding beta testing, are we going to be able to ship this to some users a bit early (tomorrow?) to get it some real world testing? Or at least ask some PingCAP folk to take a look?

nrc

comment created time in 2 days

pull request commentpingcap-incubator/tiup

Check role is correct for keys and refactor key store

@july2993 comments addressed and rebased, please take another look (also I had a question in https://github.com/pingcap-incubator/tiup/pull/254#discussion_r429845034).

nrc

comment created time in 2 days

push eventnrc/tiup

Nick Cameron

commit sha afcad1f8cf9a400c94173ce3f341a355fc7eae89

Changes for rebasing Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 2 days

Pull request review commentpingcap-incubator/tiup

Check role is correct for keys and refactor key store

 type FsManifests struct { // NewManifests creates a new FsManifests with local store at root. // There must exists the trusted root.json. func NewManifests(profile *localdata.Profile) *FsManifests {-	return &FsManifests{profile: profile, cache: make(map[string]string)}+	return &FsManifests{profile: profile, keys: NewKeyStore(), cache: make(map[string]string)}

I think I've addressed this in the last commit, when creating a new FsManifests, we now do some initialisation by reading in the root manifest and adding its keys to the key store.

nrc

comment created time in 2 days

push eventnrc/tiup

Nick Cameron

commit sha 24d4e9447b609cbfa1288bfea5ed3038f13bf80d

Changes for rebasing Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 2 days

Pull request review commentpingcap-incubator/tiup

Check role is correct for keys and refactor key store

 func (r *V1Repository) selectVersion(id string, versions map[string]v1manifest.V 		for v := range versions { 			versionSlice = append(versionSlice, v) 		}-		sort.Strings(versionSlice)-		// TODO I think it is not actually correct semver order because versions can have a text suffix.-		version := versionSlice[len(versionSlice)-1]-		item := versions[version]-		return version, &item, nil++		var latest string+		var latestItem v1manifest.VersionItem+		for version, item := range versions {+			if latest == "" || semver.Compare("v"+version, "v"+latest) > 0 {

I don't understand, versions should come straight from the manifest and therefore not have the "v". Where is it added?

nrc

comment created time in 2 days

push eventnrc/tiup

Allen Zhong

commit sha a77db7e0ecab61120c069e1ed46ddd93cd69bef9

manifest: save private key with 0600 permission (#256)

view details

SIGSEGV

commit sha 17cceeda1043014b2b334bd38c3585a90b98d602

Add interface to support tiup-cluster (#253) Signed-off-by: lucklove <gnu.crazier@gmail.com> Co-authored-by: Lonng <heng@lonng.org>

view details

Lonng

commit sha 0c51e4269117b80a9a256b129e10c9e84c668bd7

Change the behavior of 'tiup uninstall --self' and keep user data (#259) Signed-off-by: Lonng <heng@lonng.org>

view details

july2993

commit sha f19c648802db9d043b664d6b62342b215fc5ba2d

Self update (#257)

view details

Nick Cameron

commit sha f2126892f8243814ace760a3bda253ea0ea086e7

Move key store code to its own file Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha eefd5b24568275a439c872203b94f81c5ba0a856

Refactor key store to support checking keys correspond to the right roles Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha d8f3a77186779adab66c47efada732dab1e45330

Move threshold from the component to the owner Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha 58d86c64b4f11d4f53782e66335acf18236d8d2c

Changes for rebasing Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 2 days

Pull request review commentpingcap-incubator/tiup

Check role is correct for keys and refactor key store

+// Copyright 2020 PingCAP, Inc.+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// See the License for the specific language governing permissions and+// limitations under the License.++package v1manifest++import (+	"fmt"++	"github.com/pingcap-incubator/tiup/pkg/repository/crypto"+	"github.com/pingcap/errors"+)++// KeyStore tracks roles, keys, etc. and verifies signatures against this metadata.+type KeyStore map[string]roleKeys++type roleKeys struct {+	threshold uint+	// key id -> public key+	keys map[string]crypto.PubKey+}++// NewKeyStore return a KeyStore+func NewKeyStore() *KeyStore {+	return &KeyStore{}+}++// AddKeys clears all keys for role, then adds all supplied keys and stores the threshold value.+func (s *KeyStore) AddKeys(role string, threshold uint, keys map[string]*KeyInfo) error {+	if threshold == 0 {+		return errors.Errorf("invalid threshold (0)")+	}++	(*s)[role] = roleKeys{threshold: threshold, keys: map[string]crypto.PubKey{}}++	for id, info := range keys {+		pub, err := info.publicKey()+		if err != nil {+			return err+		}+		(*s)[role].keys[id] = pub+	}++	return nil+}++func newSignatureError(fname string, err error) *SignatureError {+	return &SignatureError{+		fname: fname,+		err:   err,+	}+}++// IsSignatureError check if the err is SignatureError.+func IsSignatureError(err error) bool {+	_, ok := err.(*SignatureError)+	return ok+}++// SignatureError the signature of a file is incorrect.+type SignatureError struct {+	fname string+	err   error+}++func (s *SignatureError) Error() string {+	return fmt.Sprintf("invalid signature for file %s: %s", s.fname, s.err.Error())+}++// transitionRoot checks that signed is verified by signatures using newThreshold, and if so, updates the keys for the root+// role in the key store.+func (s *KeyStore) transitionRoot(signed []byte, newThreshold uint, signatures []Signature, newKeys map[string]*KeyInfo) error {+	oldKeys := (*s)[ManifestTypeRoot]++	err := s.AddKeys(ManifestTypeRoot, newThreshold, newKeys)+	if err != nil {+		return err+	}++	err = s.verifySignature(signed, ManifestTypeRoot, signatures, ManifestFilenameRoot)+	if err != nil {+		// Restore the old root keys.+		(*s)[ManifestTypeRoot] = oldKeys+		return err+	}++	return nil+}++// verifySignature verifies all supplied signatures are correct for signed. Also, that there are at least threshold signatures,+// and that they all belong to the correct role.+func (s *KeyStore) verifySignature(signed []byte, role string, signatures []Signature, filename string) error {+	if s == nil {+		return nil+	}++	// Check for duplicate signatures.+	has := make(map[string]struct{})+	for _, sig := range signatures {+		if _, ok := has[sig.KeyID]; ok {+			return errors.Errorf("signature section of %s contains duplicate signatures", filename)+		}+		has[sig.KeyID] = struct{}{}+	}++	keys, ok := (*s)[role]+	if !ok {+		return errors.Errorf("Unknown role %s", role)+	}++	var validSigs uint = 0+	for _, sig := range signatures {+		key, ok := keys.keys[sig.KeyID]+		if !ok {+			continue

I’ll change the comment. This is for handling root manifest old and new keys

nrc

comment created time in 2 days

issue openedpingcap-incubator/tiup

Manifest issues blocking GA release

This is an issue to track what is left to do before we launch. Please add stuff!

cc @lonng @AstroProfundis @july2993 @lucklove

  • [ ] Check we are doing all required validation of signatures and hashes
  • [ ] Manual test of all commands including in tiup-cluster (expand this item)
  • [ ] self-update
  • [ ] implement support for nightly versions
  • [ ] check forward compatibility (a 0.1.1 spec version should cause an error which informs the user to update)
  • [ ] ensure we can do the daily timestamp/snapshot updates and start a cron job to do it (or merge this with the nightly job)
  • [ ] ensure generating nightlies causes all manifests to update properly
  • [ ] get some beta testing!

If we can't get to the server side stuff, then we can check the expiry of timestamp/snapshot to a month instead of a day to give ourselves time to fix it and then use a shorter expiry

created time in 2 days

push eventnrc/r4cppp

Michael Bennett

commit sha d55491e9704ce8f887c597631085df5ac98b2076

Update README to remove dead link As of March 2020, Mozilla has decommissioned its IRC network, so the link to it is dead.

view details

Nick Cameron

commit sha 34185cbb7522669e0162c7dcfa9ef8b4a55d9494

Merge pull request #95 from MJJBennett/patch-1 Update README to remove dead link

view details

push time in 2 days

PR merged nrc/r4cppp

Update README to remove dead link

As of March 2020, Mozilla has decommissioned its IRC network (see the wiki), so the link to it is dead. It appears that the replacement is a Matrix server, although I cannot verify whether or not there is currently a Rust channel there.

(Great resource, by the way.)

+0 -2

0 comment

1 changed file

MJJBennett

pr closed time in 2 days

pull request commentpingcap-incubator/tiup

Check role is correct for keys and refactor key store

@july2993 rebased, PTAL

nrc

comment created time in 2 days

push eventnrc/tiup

july2993

commit sha f67f831ca55e42fa3019fb1b4ab5fec2a6651107

Make run components works for v1 (#252) * Make run components works for v1

view details

Nick Cameron

commit sha e56dbe1a972391ee3556b699624f01839ff97081

Move key store code to its own file Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha c1b6ca3d67cdc966426d6ab91019e9491caa0f61

Refactor key store to support checking keys correspond to the right roles Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha aadf30a4c0271e9929f5c3cdfbac679301a1504d

Move threshold from the component to the owner Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha 15c0062a4bb9cbeac7f2fdb36f35f3378be945a8

Changes for rebasing Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 2 days

Pull request review commentpingcap-incubator/tiup

Make run components works for v1

 func (r *V1Repository) FetchComponent(id string) (com *v1manifest.Component, err  	return r.updateComponentManifest(id) }++// BinaryPath return the binary path of the component.+// Support you have install the component, need to get entry from local manifest.+// Load the manifest locally only to get then Entry, do not force do something need access mirror.+func (r *V1Repository) BinaryPath(installPath string, componentID string, version v0manifest.Version) (string, error) {

But this won't work with an upgrade from v0 because there won't be an index manifest, etc? I think this will also fail for v1 manifests if we download a new component manifest, but not the component itself

july2993

comment created time in 2 days

Pull request review commentpingcap-incubator/tiup

Make run components works for v1

 func (r *V1Repository) updateComponentManifest(id string) (*v1manifest.Component 	return &component, nil } +// DownloadComponent downloads a component with specific version from repository+func (r *V1Repository) DownloadComponent(

If version is supplied in the component spec, then UpdateComponent will install that version.

july2993

comment created time in 2 days

PR opened pingcap-incubator/tiup

Reviewers
Check role is correct for keys and refactor key store

This also changes the manifest format, so we'll need to rebuild any old manifests.

PTAL @july2993

+364 -497

0 comment

13 changed files

pr created time in 2 days

create barnchnrc/tiup

branch : role

created branch time in 2 days

issue commentpingcap/tipb

rust ci fail on pr 171

I have published protobuf-build 0.11.2 which fixes this issue

hanfei1991

comment created time in 2 days

issue commentpingcap/kvproto

Cannot build rust when nested message contains repeated field

I have published protobuf-build 0.11.2

MyonKeminta

comment created time in 2 days

Pull request review commentpingcap-incubator/tiup

Make run components works for v1

 func (r *V1Repository) updateComponentManifest(id string) (*v1manifest.Component 	return &component, nil } +// DownloadComponent downloads a component with specific version from repository+func (r *V1Repository) DownloadComponent(

What does this function do differently to UpdateComponent?

july2993

comment created time in 2 days

Pull request review commentpingcap-incubator/tiup

Make run components works for v1

 func (r *V1Repository) FetchComponent(id string) (com *v1manifest.Component, err  	return r.updateComponentManifest(id) }++// BinaryPath return the binary path of the component.+// Support you have install the component, need to get entry from local manifest.+// Load the manifest locally only to get then Entry, do not force do something need access mirror.+func (r *V1Repository) BinaryPath(installPath string, componentID string, version v0manifest.Version) (string, error) {

Actually I think this information should be stored locally rather than reproduced from scratch. It is possible the manifest might change but not installed location, or vice-versa. I think Profile should keep this information and it should be independent of whether we use version 0 or 1 manifests.

july2993

comment created time in 2 days

Pull request review commentpingcap-incubator/tiup

Make run components works for v1

 func (r *V1Repository) FetchComponent(id string) (com *v1manifest.Component, err  	return r.updateComponentManifest(id) }++// BinaryPath return the binary path of the component.+// Support you have install the component, need to get entry from local manifest.+// Load the manifest locally only to get then Entry, do not force do something need access mirror.+func (r *V1Repository) BinaryPath(installPath string, componentID string, version v0manifest.Version) (string, error) {

Can we take a version string or something more generic than the v0 version?

july2993

comment created time in 2 days

Pull request review commentpingcap-incubator/tiup

Make run components works for v1

 func (env *Environment) SelfUpdate() error { 	return env.repo.DownloadTiup(env.LocalPath("bin")) } +func (env *Environment) downloadCompoentv1(component string, version v0manifest.Version, overwrite bool) error {

This function could be replaced by calling env.v1repo.UpdateComponents

july2993

comment created time in 2 days

Pull request review commentpingcap-incubator/tiup

Make run components works for v1

 func (env *Environment) SelfUpdate() error { 	return env.repo.DownloadTiup(env.LocalPath("bin")) } +func (env *Environment) downloadCompoentv1(component string, version v0manifest.Version, overwrite bool) error {
func (env *Environment) downloadComponentv1(component string, version v0manifest.Version, overwrite bool) error {
july2993

comment created time in 2 days

push eventnrc/tiup

Nick Cameron

commit sha 77c09a1f43a4938fed9968d91900d7918ecf295d

Handle no-expand tarballs with v1 manifests Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 3 days

PR opened pingcap-incubator/tiup

Handle no-expand tarballs with v1 manifests

Currently based on top of #249.

This PR handles tarballs which just need to be saved to disk rather than untared. The first commit factors out a distinct error type for when a manifest has expired. I don't actually use this code (I don't think we need to handle this case before the initial release) but I think it will be useful later and I'd already written it.

PTAL @AstroProfundis

+171 -119

0 comment

4 changed files

pr created time in 3 days

create barnchnrc/tiup

branch : expired

created branch time in 3 days

PR opened pingcap-incubator/tiup

Reviewers
manifest caching in local_manifests

Avoids repeated file reads by caching successful loads. We never clear the cache since we'll error out on an invalid or out of date manifest.

Probably don't want to land this until we fix the integration test which is commented out, since that is the way that this code will get tested.

PTAL @july2993

+120 -109

0 comment

2 changed files

pr created time in 3 days

push eventnrc/tiup

Nick Cameron

commit sha 3bf954980ac54d6c9a2f11f13582fd4c92a462f6

Implement caching in lcoal_manifests Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 3 days

create barnchnrc/tiup

branch : cache

created branch time in 3 days

push eventtikv/protobuf-build

Nick Cameron

commit sha 024a25c199aa64edc93b7a8895a5f7b888ffe929

Account for super in nested types Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha 4816a8a3a57f3e9db684a5155c3184236721a0f3

Merge branch 'master' into nested

view details

Nick Cameron

commit sha 8aca8e9de19fa92b6fa21298f7958ecb886ae3fc

Merge pull request #41 from nrc/nested Account for some edge cases inside repeated types.

view details

push time in 3 days

PR merged tikv/protobuf-build

Account for some edge cases inside repeated types.

Fixes https://github.com/pingcap/kvproto/issues/623.

We were producing invalid types such as event::super :: super :: kvrpcpb :: LockInfo.

I have confirmed that https://github.com/pingcap/kvproto/commit/e23c6bb183d4af51cceaf020957494d27b614294 builds with this PR.

PTAL @BusyJay

+23 -1

0 comment

1 changed file

nrc

pr closed time in 3 days

issue closedpingcap/kvproto

Cannot build rust when nested message contains repeated field

In this commit of my PR: https://github.com/pingcap/kvproto/pull/622/commits/e23c6bb183d4af51cceaf020957494d27b614294

And CI failed on building rust:

error[E0433]: failed to resolve: `super` in paths can only be used in start position
   --> /home/circleci/project/target/debug/build/kvproto-dc3c32c98dc79712/out/protos/wrapper_cdcpb.rs:385:65
    |
385 | #[inline] pub fn set_locks(&mut self, v: ::std::vec::Vec<event::super :: super :: kvrpcpb :: LockInfo>) { self.locks = v; }
    |                                                                 ^^^^^ `super` in paths can only be used in start position

error[E0433]: failed to resolve: `super` in paths can only be used in start position
   --> /home/circleci/project/target/debug/build/kvproto-dc3c32c98dc79712/out/protos/wrapper_cdcpb.rs:386:47
    |
386 | #[inline] pub fn get_locks(&self) -> &[event::super :: super :: kvrpcpb :: LockInfo] { &self.locks }
    |                                               ^^^^^ `super` in paths can only be used in start position

error[E0433]: failed to resolve: `super` in paths can only be used in start position
   --> /home/circleci/project/target/debug/build/kvproto-dc3c32c98dc79712/out/protos/wrapper_cdcpb.rs:387:70
    |
387 | #[inline] pub fn mut_locks(&mut self) -> &mut ::std::vec::Vec<event::super :: super :: kvrpcpb :: LockInfo> { &mut self.locks }
    |                                                                      ^^^^^ `super` in paths can only be used in start position

error[E0433]: failed to resolve: `super` in paths can only be used in start position
   --> /home/circleci/project/target/debug/build/kvproto-dc3c32c98dc79712/out/protos/wrapper_cdcpb.rs:388:66
    |
388 | #[inline] pub fn take_locks(&mut self) -> ::std::vec::Vec<event::super :: super :: kvrpcpb :: LockInfo> { ::std::mem::replace(&mut self.locks, ::std::vec::Vec::new()) }
    |                                                                  ^^^^^ `super` in paths can only be used in start position

error[E0412]: cannot find type `u64` in module `change_data_request`
   --> /home/circleci/project/target/debug/build/kvproto-dc3c32c98dc79712/out/protos/wrapper_cdcpb.rs:595:86
    |
595 | #[inline] pub fn set_txn_start_ts(&mut self, v: ::std::vec::Vec<change_data_request::u64>) { self.txn_start_ts = v; }
    |                                                                                      ^^^ not found in `change_data_request`
    |
help: possible candidates are found in other modules, you can import them into scope
    |
2   | use core::primitive::u64;
    |
2   | use std::primitive::u64;
    |

error[E0412]: cannot find type `u64` in module `change_data_request`
   --> /home/circleci/project/target/debug/build/kvproto-dc3c32c98dc79712/out/protos/wrapper_cdcpb.rs:596:68
    |
596 | #[inline] pub fn get_txn_start_ts(&self) -> &[change_data_request::u64] { &self.txn_start_ts }
    |                                                                    ^^^ not found in `change_data_request`
    |
help: possible candidates are found in other modules, you can import them into scope
    |
2   | use core::primitive::u64;
    |
2   | use std::primitive::u64;
    |

error[E0412]: cannot find type `u64` in module `change_data_request`
   --> /home/circleci/project/target/debug/build/kvproto-dc3c32c98dc79712/out/protos/wrapper_cdcpb.rs:597:91
    |
597 | #[inline] pub fn mut_txn_start_ts(&mut self) -> &mut ::std::vec::Vec<change_data_request::u64> { &mut self.txn_start_ts }
    |                                                                                           ^^^ not found in `change_data_request`
    |
help: possible candidates are found in other modules, you can import them into scope
    |
2   | use core::primitive::u64;
    |
2   | use std::primitive::u64;
    |

error[E0412]: cannot find type `u64` in module `change_data_request`
   --> /home/circleci/project/target/debug/build/kvproto-dc3c32c98dc79712/out/protos/wrapper_cdcpb.rs:598:87
    |
598 | #[inline] pub fn take_txn_start_ts(&mut self) -> ::std::vec::Vec<change_data_request::u64> { ::std::mem::replace(&mut self.txn_start_ts, ::std::vec::Vec::new()) }
    |                                                                                       ^^^ not found in `change_data_request`
    |
help: possible candidates are found in other modules, you can import them into scope
    |
2   | use core::primitive::u64;
    |
2   | use std::primitive::u64;
    |

error: aborting due to 8 previous errors

closed time in 3 days

MyonKeminta

push eventnrc/protobuf-build

Nick Cameron

commit sha b559fb0f12cefd2d9396172dd729bb445973c264

Merge pull request #40 from nrc/colons Handle recursive types, which Prost wraps in a Box

view details

Nick Cameron

commit sha 4816a8a3a57f3e9db684a5155c3184236721a0f3

Merge branch 'master' into nested

view details

push time in 3 days

Pull request review commentpingcap-incubator/tiup

Fix panic to close when enable v1 & platform format

 func (ms *FsManifests) LoadManifest(role ValidManifest) (bool, error) { }  // LoadComponentManifest implements LocalManifests.-func (ms *FsManifests) LoadComponentManifest(filename string) (*Component, error) {-	var role Component-	exists, err := ms.load(filename, &role)-	if !exists {-		return nil, nil+func (ms *FsManifests) LoadComponentManifest(index *Index, filename string) (*Component, error) {+	com := new(Component)

Could you continue to use load and move the call to ReadManifest into LoadManifest?

july2993

comment created time in 4 days

Pull request review commentpingcap-incubator/tiup

Fix panic to close when enable v1 & platform format

 func (manifest *Root) GetRootKeyStore() (ks crypto.KeyStore, err error) { 	return } +// GetComponentKeys the the threshold and keys for the specified component id.
// GetComponentKeys returns the threshold and keys for the specified component id.
july2993

comment created time in 4 days

Pull request review commentpingcap-incubator/tiup

Fix panic to close when enable v1 & platform format

 func ReadManifest(input io.Reader, role ValidManifest, root *Root) (*Manifest, e 		if err != nil { 			return nil, err 		}+	} else {+		return nil, errors.Errorf("unknow type: %s", role.Base().Ty)
		return nil, errors.Errorf("unknown type: %s", role.Base().Ty)
july2993

comment created time in 4 days

Pull request review commentpingcap-incubator/tiup

Fix panic to close when enable v1 & platform format

 func (env *Environment) Profile() *localdata.Profile { 	return env.profile } +// Close release resource of env.+func (env *Environment) Close() error {+	if os.Getenv(EnvNameV1) == "" {

I think this check should be env.repo != nil (once the repos are initialized we should no longer check the env vars in order to make them easy to override, e.g., in testing).

july2993

comment created time in 4 days

Pull request review commentpingcap-incubator/tiup

Fix panic to close when enable v1 & platform format

 func (r *V1Repository) checkTimestamp() (*v1manifest.FileHash, error) { 	return &hash, r.local.SaveManifest(manifest, v1manifest.ManifestFilenameTimestamp) } +func (r *V1Repository) fetchComponentManefest(index *v1manifest.Index, url string, com *v1manifest.Component, maxSize uint) (*v1manifest.Manifest, error) {
func (r *V1Repository) fetchComponentManifest(index *v1manifest.Index, url string, com *v1manifest.Component, maxSize uint) (*v1manifest.Manifest, error) {
july2993

comment created time in 4 days

push eventjuly2993/tiup

Lonng

commit sha 5096309bd65f0b596460a6ec595a776b26d43702

Implement the 'tiup doc error' subcommand (#246) Signed-off-by: Lonng <heng@lonng.org>

view details

Nick Cameron

commit sha bb7b1be3000f03aa7c90539e10794c564090b13e

Merge branch 'master' into test_com2

view details

push time in 4 days

push eventnrc/tiup

Nick Cameron

commit sha 0271bf39f0c8bcabfc72611de557de14648a0ade

Implement a test for UpdateComponents Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 4 days

PR opened pingcap-incubator/tiup

Reviewers
Implement a test for UpdateComponents

In order to do this test it required a little refactoring, but nothing very significant.

PTAL @july2993

+161 -22

0 comment

6 changed files

pr created time in 4 days

create barnchnrc/tiup

branch : test

created branch time in 4 days

Pull request review commenttikv/client-rust

raw: Implement `RawBatchScan`

 use crate::{ const CQ_COUNT: usize = 1; const CLIENT_PREFIX: &str = "tikv-client"; +#[macro_export]+macro_rules! group_by_range {

Yeah, I'm happy either way (thanks for trying @you06 !)

you06

comment created time in 4 days

issue commentpingcap/kvproto

Cannot build rust when nested message contains repeated field

This is fixed by https://github.com/tikv/protobuf-build/pull/41. I'll publish a new version of protobuf-build once it lands

MyonKeminta

comment created time in 4 days

PR opened tikv/protobuf-build

Reviewers
Account for some edge cases inside repeated types.

Fixes https://github.com/pingcap/kvproto/issues/623.

We were producing invalid types such as event::super :: super :: kvrpcpb :: LockInfo.

I have confirmed that https://github.com/pingcap/kvproto/commit/e23c6bb183d4af51cceaf020957494d27b614294 builds with this PR.

PTAL @BusyJay

+23 -1

0 comment

1 changed file

pr created time in 4 days

push eventnrc/protobuf-build

Nick Cameron

commit sha 024a25c199aa64edc93b7a8895a5f7b888ffe929

Account for super in nested types Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha 7fd0ee12442be03806f1764d709c13bd836280e4

Handle repeated built-in types Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

push time in 4 days

push eventtikv/protobuf-build

Nick Cameron

commit sha 0b0d66bfdf913cd59f03994b5e31882f92e0b194

Handle recursive types, which Prost wraps in a Box Signed-off-by: Nick Cameron <nrc@ncameron.org>

view details

Nick Cameron

commit sha b559fb0f12cefd2d9396172dd729bb445973c264

Merge pull request #40 from nrc/colons Handle recursive types, which Prost wraps in a Box

view details

push time in 5 days

PR merged tikv/protobuf-build

Handle recursive types, which Prost wraps in a Box

Fixes https://github.com/pingcap/tipb/issues/184

When a message is recursive, Prost uses Box<Foo> instead of just Foo for the recursive fields. Previously we were not handling these. This PR fixes that issue in two parts: first, when a type with parameters appears in expression context then it must use the turbofish style of angle brackets, e.g., Box::<Foo>::default(). Second, the type returned from get_* must be adjusted from, e.g., &Box<Foo> to the more idiomatic &Foo. This is not just a matter of style, because we have a reference to a static as our default reference type (which has type &'static Foo) without this change there is a type mismatch.

PTAL @BusyJay

+69 -15

4 comments

2 changed files

nrc

pr closed time in 5 days

issue closedpingcap/tipb

rust ci fail on pr 171

https://github.com/pingcap/tipb/pull/171 's rust ci always fail, I need help ~

closed time in 5 days

hanfei1991

create barnchnrc/protobuf-build

branch : nested

created branch time in 5 days

pull request commenttikv/protobuf-build

Handle recursive types, which Prost wraps in a Box

@hanfei1991 can you verify whether it fixes the issue?

I've pulled hanfei's branch and built with local protobuf-build and cargo build --no-default-features --features prost-codec and it builds successfully.

nrc

comment created time in 5 days

PR opened pingcap-incubator/tiup

Reviewers
Collect errors in UpdateComponents

Report error and continue with other updates, rather than stopping updates on first error. Based on #242

PTAL @july2993

+71 -53

0 comment

8 changed files

pr created time in 5 days

more