Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Add new registry update command #604

Merged
merged 1 commit into from
Jun 12, 2018
Merged

Conversation

shomron
Copy link
Collaborator

@shomron shomron commented Jun 11, 2018

Part of #237.

Currently supports GitHub repositories only. Helm / Fs support to be added in subsequent PR.

Outstanding issues

  • Helm repository support
  • Filesystem repository support
  • Update to specific version, rather than latest matching
  • Tests for TransactionWriter
  • Correct update behavior for GitHub repositories lacking a GitVersion section in app.yaml
  • Ensure correct consumption of registry caches as part of GitHub registry.yaml cache paths inconsistent #603
  • Followup PR for package update

Signed-off-by: Oren Shomron shomron@gmail.com

@shomron shomron requested a review from bryanl June 11, 2018 19:21
@shomron shomron changed the title Add new registry update command. Add new registry update command Jun 11, 2018
@shomron
Copy link
Collaborator Author

shomron commented Jun 11, 2018

I'd love some scrutiny around error messages, wrapping semantics.

@coveralls
Copy link

coveralls commented Jun 11, 2018

Pull Request Test Coverage Report for Build 975

  • 132 of 327 (40.37%) changed or added relevant lines in 9 files are covered.
  • 3 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.7%) to 69.147%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/component/component.go 0 1 0.0%
pkg/app/schema.go 8 10 80.0%
pkg/registry/fs.go 0 3 0.0%
pkg/registry/helm.go 0 3 0.0%
pkg/app/base_app.go 18 26 69.23%
pkg/clicmd/registry_update.go 9 37 24.32%
pkg/registry/github.go 26 90 28.89%
pkg/actions/registry_update.go 67 153 43.79%
Files with Coverage Reduction New Missed Lines %
pkg/component/component.go 1 35.79%
pkg/util/strings/rand.go 2 84.62%
Totals Coverage Status
Change from base Build 973: -0.7%
Covered Lines: 9841
Relevant Lines: 14232

💛 - Coveralls

@bryanl
Copy link
Member

bryanl commented Jun 11, 2018

@shomron

Can you update to a previous SHA1?

$ ks registry update incubator --version=ac9c25c4823037d6e86b0219a3a49b0b7d57ab57 -v             
DEBUG setting log verbosity                         verbosity-level=1
DEBUG loading application configuration from /private/tmp/mule4
DEBUG Updating registries: [incubator]

DEBUG updating registry incubator
DEBUG [github.Update] trying to update registry ksonnet/parts@master
DEBUG [github.Update] current version: 40285d8a14f1ac5787e405e1023cf0c07f6aa28c
DEBUG github: fetching SHA1 for ksonnet/parts@master
DEBUG [fetchRemoteSpec] fetching ksonnet/parts/incubator/registry.yaml@40285d8a14f1ac5787e405e1023cf0c07f6aa28c
DEBUG github: fetching contents for ksonnet/parts/incubator/registry.yaml@40285d8a14f1ac5787e405e1023cf0c07f6aa28c
DEBUG [update] registry incubator version unchanged: 40285d8a14f1ac5787e405e1023cf0c07f6aa28c

Copy link
Member

@bryanl bryanl left a comment

Choose a reason for hiding this comment

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

In general, this look fine. I've added a question about upgrading to previous versions.

}
} else {
log.Debugf("[update] registry %v version unchanged: %v", rs.Name, newVersion)
// TODO where does helm store its versions?
Copy link
Member

Choose a reason for hiding this comment

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

No where yet! Wanted to see what this change did first.


package mocks

//go:generate mockery -dir .. -output . -name=App
Copy link
Member

Choose a reason for hiding this comment

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

I like this pattern.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks!

@bryanl
Copy link
Member

bryanl commented Jun 11, 2018

AS for logging, we should start using logrus in a better fashion.

Instead of doing logrus.Debug("[github.Update]: whatever"), why aren't we doing logrus.WithField("action", "github.Update").Debug("whatever"). This would be helpful if you are using ksonnet as part of an automated pipeline because logs would be generated in JSON format and you could actually search for logs with action=github.Update.

@shomron
Copy link
Collaborator Author

shomron commented Jun 11, 2018

Can you update to a previous SHA1?

Not quite yet :) It's in the outstanding issues list above.

Part of ksonnet#237.

Signed-off-by: Oren Shomron <shomron@gmail.com>
@shomron shomron merged commit 9480ef0 into ksonnet:master Jun 12, 2018
shomron added a commit to shomron/ksonnet that referenced this pull request Jun 19, 2018
…ing forward on branches.

Additional work:

* Rework ks set update -> ks registry set
* Registries are no longer versioned
* Deprecation of GitVersion in configuration files

Issues:

Rework logic from ksonnet#604.
Closes ksonnet#234.

Signed-off-by: Oren Shomron <shomron@gmail.com>
shomron added a commit to shomron/ksonnet that referenced this pull request Jun 19, 2018
…ing forward on branches.

Additional work:

* Rework ks set update -> ks registry set
* Registries are no longer versioned
* Deprecation of GitVersion in configuration files

Issues:

Rework logic from ksonnet#604.
Closes ksonnet#234.

Signed-off-by: Oren Shomron <shomron@gmail.com>
shomron added a commit to shomron/ksonnet that referenced this pull request Jun 19, 2018
…ing forward on branches

Additional work:

* Rework ks set update -> ks registry set
* Registries are no longer versioned
* Deprecation of GitVersion in configuration files

Issues:

Rework logic from ksonnet#604.
Closes ksonnet#234.

Signed-off-by: Oren Shomron <shomron@gmail.com>
shomron added a commit to shomron/ksonnet that referenced this pull request Jun 19, 2018
…ing forward on branches

Additional work:

* Rework ks set update -> ks registry set
* Registries are no longer versioned
* Deprecation of GitVersion in configuration files

Issues:

Rework logic from ksonnet#604.
Part of ksonnet#237.

Signed-off-by: Oren Shomron <shomron@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants