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

Removing ./pkg/repo #316

Closed
wants to merge 27 commits into from
Closed

Removing ./pkg/repo #316

wants to merge 27 commits into from

Conversation

arschles
Copy link
Member

@arschles arschles commented Jul 20, 2018

This is a follow-up to #291 that removes the ./pkg/repo package and replaces calls to it with the new ./pkg/module functionality that #291 added. #314 requires this.

Requires #291 before merging this. Requires #291. Check out more details on why this is opened against #291 at #290 (comment)

This is part of #290

The only addition on top of #291 is 244014e. Refer to #291 for all other changes

This removes code that is no longer used and depends on the ./pkg/repo package
if err != nil {
return err
}
ret, err := ref.Read()
Copy link
Member

Choose a reason for hiding this comment

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

Do you check the err somewhere?

func (s *ModuleSuite) TestNewGoGetFetcher() {
r := s.Require()
fs := s.fs
fetcher, err := NewGoGetFetcher(fs, repoURI, version)
Copy link
Member

Choose a reason for hiding this comment

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

NewGoGetFetcher func has only one arg.

// we need to use an OS filesystem because fetch executes vgo on the command line, which
// always writes to the filesystem
fs := afero.NewOsFs()
fetcher, err := NewGoGetFetcher(fs, repoURI, version)
Copy link
Member

Choose a reason for hiding this comment

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

NewGoGetFetcher func has only one arg.

// TODO: return a ref for cleaning up the goPathRoot
return nil, err
}
sourcePath := filepath.Join(goPathRoot, "src", goPathRoot)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be sourcePath := filepath.Join(goPathRoot, "src") ?

goGetFetcher, ok := fetcher.(*goGetFetcher)
r.True(ok)
r.Equal(repoURI, goGetFetcher.repoURI)
r.Equal(version, goGetFetcher.version)
Copy link
Member

Choose a reason for hiding this comment

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

fields repoURI and version do not exists

Copy link
Contributor

@marwan-at-work marwan-at-work left a comment

Choose a reason for hiding this comment

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

lgtm after pull 291 is updated plus @marpio's comments.


// save it
if err := s.Save(context.Background(), module, version, modBytes, zipFile, infoBytes); err != nil {
if err := s.Save(
context.Background(),
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd put a contextWithTimeout if there's no context being passed from above.


func (s *ModuleSuite) TestNewGoGetFetcher() {
r := s.Require()
fs := s.fs
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to assign a new variable here, just use s.fs once below.

_, err = e.Append(eventlog.Event{
Module: modName,
Version: version,
Time: time.Now(),
Copy link
Member

Choose a reason for hiding this comment

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

Should we use UTC?

@ghost ghost added on hold Issues and pull requests that shouldn't be closed yet, but shouldn't be worked on yet either blocked This issue or pull request requires one or more other issues or pull requests before completion. and removed on hold Issues and pull requests that shouldn't be closed yet, but shouldn't be worked on yet either labels Jul 25, 2018
@arschles
Copy link
Member Author

I'm closing this because I'm going to do #314 and this in one pass

That's all tracked by #335

@arschles arschles closed this Jul 26, 2018
@arschles arschles deleted the rm-pkg-repo branch July 26, 2018 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue or pull request requires one or more other issues or pull requests before completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants