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

Update README. #414

Merged
merged 6 commits into from
May 7, 2020
Merged

Update README. #414

merged 6 commits into from
May 7, 2020

Conversation

MichaelRybak
Copy link
Contributor

No description provided.

README.md Outdated
@@ -31,13 +31,18 @@ own and can obtain certificates for.

##### Manual installation

1. Install Go version 1.10 or higher. Optionally, set
1. Install Go version 1.10. Optionally, set
Copy link
Contributor Author

@MichaelRybak MichaelRybak Apr 30, 2020

Choose a reason for hiding this comment

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

Google will validate all contributions with Travis running Go 1.10, so should we suggest installing specifically this version?

I've installed Go 1.14, used strings.ReplaceAll (that's not available in Go 1.10) and got a build error from Travis:
https://travis-ci.org/github/ampproject/amppackager/builds/680776394

Copy link
Collaborator

Choose a reason for hiding this comment

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

@twifkak perhaps it's time to update travis.yml? What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't remove the "or higher" unless there's a known breakage at higher versions. Don't want to make installation unnecessarily hard. I guess I have to exclude -mod=vendor from that rule. :)

Re: updating travis.yml, SGTM. It may even be possible to test on multiple versions? e.g. https://github.com/streadway/amqp/blob/master/.travis.yml

README.md Outdated
[$GOPATH](https://github.com/golang/go/wiki/GOPATH) to something (default
is `~/go`) and/or add `$GOPATH/bin` to `$PATH`.
2. `go get -u -mod=vendor github.com/ampproject/amppackager/cmd/amppkg`
1. `go get -u github.com/ampproject/amppackager/cmd/amppkg`
Copy link
Contributor Author

@MichaelRybak MichaelRybak Apr 30, 2020

Choose a reason for hiding this comment

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

-mod=vendor is not available in Go 1.14: GoogleContainerTools/skaffold#3699

I've tested it today with Go 1.10 and it didn't work for me either (but it did work when I removed -mod=vendor). Here's the error I got:

michaelrybak$ go get -u -mod=vendor github.com/ampproject/amppackager/cmd/amppkg
flag provided but not defined: -mod
usage: get [-d] [-f] [-fix] [-insecure] [-t] [-u] [-v] [build flags] [packages]
Run 'go help get' for details.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@twifkak, do we still need to generate the vendor directory?

Copy link
Member

Choose a reason for hiding this comment

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

Oof. They're not making it easy. I guess we should list two command lines: with -mod=vendor if 1.10-1.13, and without if 1.14+. I think it's too soon to up our minimum version to 1.14 -- e.g. it's not even in the Ubuntu release from 7 days ago: https://packages.ubuntu.com/focal/golang-any, let alone in the previous LTS version.

We could just do as you've suggested, which AFAIK means that the vendor directory will be ignored on Go 1.10-1.13. I'm not wild about that, for two reasons:

  1. I think it's slow? Involves a lot of git clones.
  2. I'm just not knowledgeable enough in how go modules work. After doing all those git clones, does Go verify against go.sum? I would prefer some safety check that users are getting the version of the libs that we tested against.

I could easily be convinced on both fronts.

(To make things more confusing, it seems the official documentation is incorrect. https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away and https://golang.org/doc/go1.14#go-command seem to suggest continued support for -mod=vendor. But the commit that you link to is unequivocal.)

--enable-features=SignedHTTPExchange
'data:text/html,<a href="https://localhost:8080/priv/doc/https://amppackageexample.com/">click me'
alias chrome = [FULL PATH TO CHROME BINARY]
PATH_TO_FULLCHAIN_PEM = [FULL PATH TO fullchain.pem]
Copy link
Contributor Author

@MichaelRybak MichaelRybak Apr 30, 2020

Choose a reason for hiding this comment

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

I didn't notice "path/to/fullchain.pem" template in the command below:

--ignore-certificate-errors-spki-list=$(openssl x509
-pubkey -noout -in path/to/fullchain.pem 

Added a dedicated variable PATH_TO_FULLCHAIN_PEM so the requirement to insert the user cert path becomes explicit.

Copy link
Member

Choose a reason for hiding this comment

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

LGTM

alias chrome = [FULL PATH TO CHROME BINARY]
PATH_TO_FULLCHAIN_PEM = [FULL PATH TO fullchain.pem]
chrome --user-data-dir=/tmp/udd\
--ignore-certificate-errors-spki-list=$(\
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added line breaks for readability.

Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@MichaelRybak MichaelRybak marked this pull request as ready for review April 30, 2020 00:28
@MichaelRybak MichaelRybak requested review from twifkak and banaag April 30, 2020 00:48
@banaag
Copy link
Collaborator

banaag commented Apr 30, 2020

The changes look reasonable to me but you should wait for twifkak@ to bless.

README.md Outdated
@@ -31,13 +31,18 @@ own and can obtain certificates for.

##### Manual installation

1. Install Go version 1.10 or higher. Optionally, set
1. Install Go version 1.10. Optionally, set
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't remove the "or higher" unless there's a known breakage at higher versions. Don't want to make installation unnecessarily hard. I guess I have to exclude -mod=vendor from that rule. :)

Re: updating travis.yml, SGTM. It may even be possible to test on multiple versions? e.g. https://github.com/streadway/amqp/blob/master/.travis.yml

README.md Outdated
[$GOPATH](https://github.com/golang/go/wiki/GOPATH) to something (default
is `~/go`) and/or add `$GOPATH/bin` to `$PATH`.
2. `go get -u -mod=vendor github.com/ampproject/amppackager/cmd/amppkg`
1. `go get -u github.com/ampproject/amppackager/cmd/amppkg`
Copy link
Member

Choose a reason for hiding this comment

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

Oof. They're not making it easy. I guess we should list two command lines: with -mod=vendor if 1.10-1.13, and without if 1.14+. I think it's too soon to up our minimum version to 1.14 -- e.g. it's not even in the Ubuntu release from 7 days ago: https://packages.ubuntu.com/focal/golang-any, let alone in the previous LTS version.

We could just do as you've suggested, which AFAIK means that the vendor directory will be ignored on Go 1.10-1.13. I'm not wild about that, for two reasons:

  1. I think it's slow? Involves a lot of git clones.
  2. I'm just not knowledgeable enough in how go modules work. After doing all those git clones, does Go verify against go.sum? I would prefer some safety check that users are getting the version of the libs that we tested against.

I could easily be convinced on both fronts.

(To make things more confusing, it seems the official documentation is incorrect. https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away and https://golang.org/doc/go1.14#go-command seem to suggest continued support for -mod=vendor. But the commit that you link to is unequivocal.)

--enable-features=SignedHTTPExchange
'data:text/html,<a href="https://localhost:8080/priv/doc/https://amppackageexample.com/">click me'
alias chrome = [FULL PATH TO CHROME BINARY]
PATH_TO_FULLCHAIN_PEM = [FULL PATH TO fullchain.pem]
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

alias chrome = [FULL PATH TO CHROME BINARY]
PATH_TO_FULLCHAIN_PEM = [FULL PATH TO fullchain.pem]
chrome --user-data-dir=/tmp/udd\
--ignore-certificate-errors-spki-list=$(\
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@MichaelRybak
Copy link
Contributor Author

MichaelRybak commented May 7, 2020

@twifkak @banaag Devin, Allan, I've removed "mod=vendor" and "1.10 or higher" updates - could you re-LGTM the remaining changes? We can have this PR pulled in, and update the version/modules stuff later.

@MichaelRybak MichaelRybak requested a review from twifkak May 7, 2020 19:37
README.md Outdated
@@ -34,10 +34,15 @@ own and can obtain certificates for.
1. Install Go version 1.10 or higher. Optionally, set
[$GOPATH](https://github.com/golang/go/wiki/GOPATH) to something (default
is `~/go`) and/or add `$GOPATH/bin` to `$PATH`.
2. `go get -u -mod=vendor github.com/ampproject/amppackager/cmd/amppkg`
1. `go get -u -mod=vendor github.com/ampproject/amppackager/cmd/amppkg`
Copy link
Member

Choose a reason for hiding this comment

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

(optional) For now, I'd be OK with putting an if statement here based on go version, until we work out the details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@twifkak twifkak left a comment

Choose a reason for hiding this comment

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

Thanks!

@MichaelRybak MichaelRybak merged commit 106947c into ampproject:master May 7, 2020
@MichaelRybak MichaelRybak deleted the setup4 branch May 15, 2020 17:52
cpapazian pushed a commit to cpapazian/amppackager that referenced this pull request May 19, 2020
Update setup instructions in README.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants