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

fix tomlv because it doesn't read from stdin #10872

Merged
merged 1 commit into from Feb 20, 2015
Merged

Conversation

jessfraz
Copy link
Contributor

No description provided.

@LK4D4
Copy link
Contributor

LK4D4 commented Feb 18, 2015

Hahaha
LGTM

if [ "$(git show "$VALIDATE_HEAD:$f" | tomlv)" ]; then
badFiles+=( "$f" )
fi
tomlv $f || badFiles+=( "$f" )
Copy link
Member

Choose a reason for hiding this comment

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

That first $f needs double quotes around it. 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed!

Copy link
Member

Choose a reason for hiding this comment

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

Hah, interesting: our comments came back because the same diff as when they were made is back.

Copy link
Member

Choose a reason for hiding this comment

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

(ie, this needs to be git show "$VALIDATE_HEAD:$f" | tomlv /proc/self/fd/0 || badFiles+=("$f"))

Copy link
Member

Choose a reason for hiding this comment

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

(or your expanded if which is probably easier to read and understand)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah it's because I was on my other computer facepalm

On Wednesday, February 18, 2015, Tianon Gravi notifications@github.com
wrote:

In project/make/validate-toml
#10872 (comment):

@@ -9,9 +9,7 @@ unset IFS
badFiles=()
for f in "${files[@]}"; do
# we use "git show" here to validate that what's committed is formatted

  • if [ "$(git show "$VALIDATE_HEAD:$f" | tomlv)" ]; then
  •   badFiles+=( "$f" )
    
  • fi
  • tomlv $f || badFiles+=( "$f" )

(or your expanded if which is probably easier to read and understand)


Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/10872/files#r24970663.

@tianon
Copy link
Member

tianon commented Feb 18, 2015

I wonder if it'd work if we passed in /dev/stdin or something like that, so that we could validate the contents of the index directly instead of what's currently on-disk?

@jessfraz
Copy link
Contributor Author

hmm let me try

@jessfraz
Copy link
Contributor Author

nah that doesnt work :(

@tianon
Copy link
Member

tianon commented Feb 18, 2015

@tianon
Copy link
Member

tianon commented Feb 18, 2015

Try /pc/self/fd/0 instead.

@jessfraz
Copy link
Contributor Author

Error in '/pc/self/fd/0': open /pc/self/fd/0: no such file or directory

@tianon
Copy link
Member

tianon commented Feb 18, 2015

oh wtf how did I mistype that, /proc/self/fd/0

@tianon
Copy link
Member

tianon commented Feb 18, 2015

that's bizarre, because I copy pasted from my terminal

shakes fist at bash TTY handling

@jessfraz
Copy link
Contributor Author

it would help if i used common sense too

@tianon
Copy link
Member

tianon commented Feb 18, 2015

👍

@tianon
Copy link
Member

tianon commented Feb 18, 2015

root@d1182ee8fee5:/go/src/github.com/docker/docker# cat MAINTAINERS | tomlv /proc/self/fd/0
Error in '/proc/self/fd/0': Near line 17, key 'Rules.maintainers': Near line 17: Expected a top-level item to end with a new line, comment or EOF, but got '"' instead.

@jessfraz
Copy link
Contributor Author

it works! and updated!

@tianon
Copy link
Member

tianon commented Feb 18, 2015

LGTM

@tianon
Copy link
Member

tianon commented Feb 18, 2015

I think we should probably fix the current syntax, shouldn't we?

Error in 'MAINTAINERS': Near line 17, key 'Rules.maintainers': Near line 17: Expected a top-level item to end with a new line, comment or EOF, but got '"' instead.

@@ -9,7 +9,7 @@ unset IFS
badFiles=()
for f in "${files[@]}"; do
# we use "git show" here to validate that what's committed is formatted
if [ "$(git show "$VALIDATE_HEAD:$f" | tomlv)" ]; then
if [ "$(git show "$VALIDATE_HEAD:$f" | tomlv /proc/self/fd/0)" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Actually, this should probably even be checking the return value of tomlv instead, ie:

if ! git show ...... | tomlv ... ]; then

@jessfraz
Copy link
Contributor Author

how can i sed replace stderr because its not working :(

@jessfraz
Copy link
Contributor Author

that is the actual error from tomlv because it thinks /proc/... is the file lol

@jessfraz jessfraz force-pushed the ugh-tomlv branch 2 times, most recently from 6c6e21b to b7b1e93 Compare February 19, 2015 07:12
@jessfraz
Copy link
Contributor Author

Turns out with the version of tomlv we were using we were missing the commits for multiline strings BurntSushi/toml@1956abe

so bumped the version and fixed the current files.

@jessfraz jessfraz force-pushed the ugh-tomlv branch 2 times, most recently from d3857ab to c802a34 Compare February 19, 2015 07:21
RUN set -x \
&& git clone https://github.com/BurntSushi/toml.git /go/src/github.com/BurntSushi/toml \
&& (cd /go/src/github.com/BurntSushi/toml && git checkout -q $TOMLV_COMMIT) \
&& go install -v github.com/BurntSushi/toml/cmd/tomlv
Copy link
Member

Choose a reason for hiding this comment

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

I'm not going to let it block this PR, but I've filed BurntSushi/toml#74 to request a new version tag on toml upstream to make sure we're being good citizens. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice i was going to do that too

@jessfraz
Copy link
Contributor Author

ok updated hopefully for the last time ;)

@jessfraz
Copy link
Contributor Author

@thaJeztah added the GitHub username and realphabetized here :)

@thaJeztah
Copy link
Member

@jfrazelle are you psychic? I was reading this when your comment popped up 🙀

<----- puts on tinfoil hat

[people.mary]
Name = "Mary Anthony"
Email = "mary.anthony@docker.com"
GitHub = "moxiegirl"
Copy link
Member

Choose a reason for hiding this comment

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

Mixed tabs/spaces? Indenting looks off

Copy link
Contributor Author

Choose a reason for hiding this comment

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

omg my vim config gooooood catch

On Thu, Feb 19, 2015 at 1:12 PM, Sebastiaan van Stijn <
notifications@github.com> wrote:

In MAINTAINERS
#10872 (comment):

@@ -531,6 +531,11 @@ made through a pull request.
Email = "lk4d4@docker.com"
GitHub = "lk4d4"

Mixed tabs/spaces? Indenting looks off


Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/10872/files#r25025967.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
@tianon
Copy link
Member

tianon commented Feb 20, 2015

LGTM

@jessfraz
Copy link
Contributor Author

ping @crosbymichael or @LK4D4 :)

@LK4D4
Copy link
Contributor

LK4D4 commented Feb 20, 2015

LGTM

LK4D4 added a commit that referenced this pull request Feb 20, 2015
fix tomlv because it doesn't read from stdin
@LK4D4 LK4D4 merged commit a78ce5c into moby:master Feb 20, 2015
@jessfraz jessfraz deleted the ugh-tomlv branch February 20, 2015 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants