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

Break up Ctx.VersionInWorkspace #688

Merged
merged 3 commits into from
Jul 20, 2017
Merged

Break up Ctx.VersionInWorkspace #688

merged 3 commits into from
Jul 20, 2017

Conversation

jmank88
Copy link
Collaborator

@jmank88 jmank88 commented May 31, 2017

#672

The VersionInWorkspace logic is coupled to Ctx as a method, although it only accesses Ctx.absoluteProjectRoot().
This change proposes dissolving VersionInWorkspace in favor of a new func with the interesting logic (gps.ProjectVersion) and exporting absoluteProjectRoot (currently named AbsForImport, but should coordinate with #682 ).

@sdboyer
Copy link
Member

sdboyer commented May 31, 2017

Let's wait until after #500 for this - there are significant changes pending in how this gets called.

@jmank88 jmank88 closed this Jun 2, 2017
@jmank88 jmank88 reopened this Jun 2, 2017
@jmank88 jmank88 closed this Jun 4, 2017
@jmank88 jmank88 reopened this Jun 4, 2017
@jmank88 jmank88 closed this Jun 5, 2017
@jmank88 jmank88 reopened this Jun 5, 2017
@jmank88
Copy link
Collaborator Author

jmank88 commented Jun 22, 2017

Rebased

@jmank88 jmank88 closed this Jun 22, 2017
@jmank88 jmank88 reopened this Jun 22, 2017
)

// ProjectVersion returns the current project version for an absolute path.
func ProjectVersion(path string) (Version, error) {
Copy link
Member

Choose a reason for hiding this comment

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

So I'm generally OK with having this logic in gps, except that I think we should avoid suggesting that this is getting versions for projects. There's a not-implausible future in which it's possible that we'd allow versions to be a property of metadata within the file tree itself (akin to Cargo.toml). In that case, it'd be up to the tool to impose these semantics.

Instead, let's use a weaker, more functionally-accurate name for the func: VCSVersion


// ProjectVersion returns the current project version for an absolute path.
func ProjectVersion(path string) (Version, error) {
repo, err := vcs.NewRepo("", path)
Copy link
Member

Choose a reason for hiding this comment

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

IIRC we have a gps-internal version of this call that uses our decorated types; as long as this is moving into gps, we should probably use that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Were you thinking of something in that wraps up or delegates to vcs.NewRepo behind the scenes? The only current dep/gps usage is this one.

@jmank88 jmank88 closed this Jun 27, 2017
@jmank88 jmank88 reopened this Jun 27, 2017
@jmank88
Copy link
Collaborator Author

jmank88 commented Jul 12, 2017

Bump

Copy link
Member

@sdboyer sdboyer left a comment

Choose a reason for hiding this comment

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

just little nits

)

// VSCVersion returns the current project version for an absolute path.
func VSCVersion(path string) (Version, error) {
Copy link
Member

Choose a reason for hiding this comment

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

s/VSC/VCS/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oops

rev: NewVersion("v0.8.0").Pair("645ef00459ed84a119197bfb8d8205042c6df63d"), // semver
checkout: true,
},
"github.com/Sirupsen/logrus": {
Copy link
Member

Choose a reason for hiding this comment

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

nit: with all the case sensitivity issues this is causing, let's go with the new one - sirupsen

@jmank88 jmank88 requested a review from carolynvs as a code owner July 19, 2017 02:33
@jmank88 jmank88 closed this Jul 19, 2017
@jmank88 jmank88 reopened this Jul 19, 2017
@sdboyer
Copy link
Member

sdboyer commented Jul 20, 2017

@jmank88 i'm ready to merge this, but before that let's use this as a guinea pig case for codeclimate - https://twitter.com/codeclimate/status/887756447437770753

i'm gonna push a dummy commit onto this PR so that they can sniff around with what's going on.

@jmank88 jmank88 closed this Jul 20, 2017
@jmank88 jmank88 reopened this Jul 20, 2017
@jmank88
Copy link
Collaborator Author

jmank88 commented Jul 20, 2017

Codeclimate appears to have run successfully, though it is still showing as in progress here.

@googlebot
Copy link
Collaborator

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@sdboyer
Copy link
Member

sdboyer commented Jul 20, 2017

OK, we're good to go. thanks! 🎉

@sdboyer sdboyer merged commit 6c5ebb9 into golang:master Jul 20, 2017
@sdboyer sdboyer added cla: yes and removed cla: no labels Jul 20, 2017
@jmank88 jmank88 deleted the version_in_workspace branch July 22, 2017 02:09
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.

3 participants