profile
viewpoint

Pull request review commentgomods/athens

add warning logs for situations where files are missing from a packag…

 func (p *protocol) Latest(ctx context.Context, mod string) (*storage.RevInfo, er 	return lr, nil } -func (p *protocol) Info(ctx context.Context, mod, ver string) ([]byte, error) {+func (p *protocol) Info(ctx context.Context, mod, ver string, lggr log.Entry) ([]byte, error) { 	const op errors.Op = "protocol.Info" 	ctx, span := observ.StartSpan(ctx, op.String()) 	defer span.End() 	info, err := p.storage.Info(ctx, mod, ver) 	var newVer string 	if errors.IsNotFoundErr(err) {+		lggr.Warnf("missing info file for module: %s restoring entire module from vcs this will overwrite anything existing for version: %s of module: %s in storage", mod, ver, mod)

Also just for reference I added a log message to the top of fs.Exists and then replicated the situation we are talking about running into here and I never see fs.Exists being called. Any help understanding this a bit more would be greatly appreciated.

cByst

comment created time in 10 days

Pull request review commentgomods/athens

add warning logs for situations where files are missing from a packag…

 func (p *protocol) Latest(ctx context.Context, mod string) (*storage.RevInfo, er 	return lr, nil } -func (p *protocol) Info(ctx context.Context, mod, ver string) ([]byte, error) {+func (p *protocol) Info(ctx context.Context, mod, ver string, lggr log.Entry) ([]byte, error) { 	const op errors.Op = "protocol.Info" 	ctx, span := observ.StartSpan(ctx, op.String()) 	defer span.End() 	info, err := p.storage.Info(ctx, mod, ver) 	var newVer string 	if errors.IsNotFoundErr(err) {+		lggr.Warnf("missing info file for module: %s restoring entire module from vcs this will overwrite anything existing for version: %s of module: %s in storage", mod, ver, mod)

@marwan-at-work thanks for the feedback. I was originally looking at fs.Exists to do the logging but I'm having some trouble understanding what fs.Exists is really used for. From what I can tell the only time fs.Exists is called is after the module has been fetched from VCS and only if semver doesn't equal the requested version.

cByst

comment created time in 10 days

push eventcByst/athens

Marwan Sulaiman

commit sha 76fb786324959043c7be7e7184bffac9309397ca

downloadProtocol: support multi-proxy environments with DownloadFile (#1230) * downloadProtocol: support multi-proxy environments with DownloadFile * remove debugging lines * update config tests * download/mode: add tests for DownloadFile and friends * add documentation to Download File

view details

push time in 10 days

Pull request review commentgomods/athens

add one liner to get started to docs

 date: 2018-12-07T11:44:36+00:00  在这个站点上,我们详细地记录了 Athens 的细节。我们将会告诉您它都做了什么,它为什么有意义,你可以用它来做什么,以及你如何运行它。下面是简单的概要。 +#### 如何开始?+    运行 `docker run -p '3000:3000' gomods/athens:latest`++然后,设置你的 `GOPROXY` 和 `go get` 去!

@Xuanwo if you have some time can you take a look at the change I made? I was a little confused but I think I made the change you were referring to.

cByst

comment created time in 10 days

push eventcByst/athens

Chris Bystrek

commit sha 0dfe2d60b280c9c961fa47034a4ff0273f5633df

Updates based on spanish review.

view details

Chris Bystrek

commit sha 41eaea7d1b87353393f6eab0a602cf885c6ba1c9

Updates based on chinese review.

view details

Chris Bystrek

commit sha 0a552672fcc6e0081c4bac44ee0aae91e144e7e7

Merge branch 'oneLiner' of https://github.com/cByst/athens into oneLiner

view details

push time in 10 days

push eventcByst/athens

Chris Bystrek

commit sha 00f39d6605d1f612e42695c7d408296aa25ba649

add warning logs for situations where files are missing from a package in athens storage

view details

push time in 10 days

PR opened gomods/athens

add warning logs for situations where files are missing from a packag…

…e in athens storage

What is the problem I am trying to address?

The file system storage currently checks for all three files (.mod, .zip, .info) exist and fails any one endpoint if they don't all exist. This results in the entire module being refreshed from vcs overwriting what ever is currently in Athens storage for this version of this module.

How is the fix applied?

The solution is to log a warning about what is happening when this one of these situations occurs.

Mention the issue number it fixes or add the details of the changes if it doesn't have a specific issue.

Fixes # 1171

<!-- example: Fixes #123 -->

+40 -26

0 comment

7 changed files

pr created time in 18 days

push eventcByst/athens

Chris Bystrek

commit sha 00f39d6605d1f612e42695c7d408296aa25ba649

add warning logs for situations where files are missing from a package in athens storage

view details

push time in 18 days

push eventcByst/athens

Chris Bystrek

commit sha 21fbd430c8b8ae2becb0ad2e9e62ab1cfa67e4a0

add warning logs for situations where files are missing from a package in athens storage

view details

push time in 18 days

create barnchcByst/athens

branch : modCheck

created branch time in 18 days

PR opened gomods/athens

add one liner to get started to docs

What is the problem I am trying to address?

Adding a one liner command to the docs to get new users up and running quickly.

How is the fix applied?

Added this one liner command to the main docs page.

Mention the issue number it fixes or add the details of the changes if it doesn't have a specific issue.

Fixes #1135

<!-- example: Fixes #123 -->

+21 -0

0 comment

3 changed files

pr created time in 19 days

create barnchcByst/athens

branch : oneLiner

created branch time in 19 days

fork cByst/athens

A Go module datastore and proxy

https://docs.gomods.io

fork in 19 days

issue commentgomods/athens

Add logs to warn when not all 3 files (mod, info and zip) are present

Scratch all that above I've been reading through the code base and see how it works now. It appears that when go get reaches out to the proxy for the first of the 3 files, if that first file doesn't exist all files are replaced from vcs and the file requested is then served. This pattern continues for all 3 files. Since we don't know if either of the other 2 files exist at the point of checking in the handler for each file do you think it makes sense to just log out that file x of the module was not found so we are going to vcs overwriting anything in storage for this version of this module? Or should I add some logic to get the files in the directory and log out which ones existed and which didn't? Not sure that the extra info of what other files didn't exist is all that helpful and it would add a bit of complexity to the code base, but it shouldn't be to bad if someone thinks that info is worth having. @arschles what do you think?

arschles

comment created time in 19 days

issue commentgomods/athens

Add a "one liner" to the home page

@arschles definitely agree it makes the most sense to go on docs.gomods.io for some reason I was thinking the issue had stated readme but must have been miss remembering. I agree after thinking about it I don't think the readme would be the right place as the readme is more around project status contributing in building from a dev/contributing perspective. Thanks for your help with this one I'll get a pr out adding this to docs.gomods.io. I am assuming I would just add this to the markdown files in the docs folder of this repo and that gets deployed to docs.gomods.io by CI or something?

arschles

comment created time in 19 days

issue commentgomods/athens

Add logs to warn when not all 3 files (mod, info and zip) are present

@arschles @sterlingdeng yeah I'd like to continue working on this one. Sorry about the delay kinda lost track of this one. Based upon what I was looking at a little while ago, I think it would make sense to change checker.go in the fs package. Would you guys agree?

It looks like currently the Exists func checks the directory just for the number of file in it. If it has 3 files all is good if not it returns false (it always return nil for the error unless there was an error passed from afero). Do you think it makes senses to add this detailed information as the error in the return when one of the files is missing? if len(files) != 3 then return false and an error with the detailed information you described in the issue?

arschles

comment created time in a month

issue commentgomods/athens

Add a "one liner" to the home page

@arschles no worries I lost track of this as well. Yeah I think that makes sense were you thinking just add a section to the current readme like:

Getting Started

Run docker run -p '3000:3000' gomods/athens:latest

Then, set up your GOPROXY and go get going!

export GOPROXY=http://localhost:3000 && go get module@v1

If you think that makes sense where in the readme do you think it fits in? I would assume somewhere near the top as we would want users first stumbling across the project to easily get up and running and trying Athens out.

arschles

comment created time in a month

push eventcByst/CereBRO

Chris Bystrek

commit sha 698adcc362e6c4d2f1265e027136b8b8815cb33a

Initial repo setup.

view details

Chris Bystrek

commit sha 5c5e37a5c204c4583be582520b4322f2c21414f2

Adding gitignore

view details

push time in a month

create barnchcByst/CereBRO

branch : master

created branch time in a month

created repositorycByst/CereBRO

created time in a month

issue commentgomods/athens

Add a "one liner" to the home page

@arschles is this is what you were thinking? I can submit a PR if it was.

arschles

comment created time in 2 months

startedgomods/athens

started time in 2 months

create barnchcByst/statline

branch : master

created branch time in 2 months

created repositorycByst/statline

created time in 2 months

fork cByst/powerline-go

A beautiful and useful low-latency prompt for your shell, written in go

fork in 2 months

issue commentgomods/athens

Add a "one liner" to the home page

I'd like to work on this. Are you think adding a section to the readme that looked something like:

Running A Local Athens Proxy

Starting Athens Proxy Locally

You will need docker installed on your machine. Then run:

docker run -p '3000:3000' gomods/athens:latest

This command will pull the latest athens docker image and start the Athens proxy on port 3000.

Pointing go get To The Local Proxy

GOPROXY=http://localhost:3000 go get github.com/pkg/errors@latest

If this is what you were looking for let me know and I can submit a PR.

arschles

comment created time in 2 months

issue commentgomods/athens

Add logs to warn when not all 3 files (mod, info and zip) are present

I'd like to work on this one.

arschles

comment created time in 2 months

more