update_shared_repos exits non zero if find returns no repos



5 years ago
11 months ago


(Reporter: rail, Assigned: pmoore)


Firefox Tracking Flags

(Not tracked)



(1 attachment, 3 obsolete attachments)



5 years ago
Updating hg repos in /builds/hg-shared
hg pull -R 
hg pull: option -R requires argument
hg pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]

pull changes from the specified source


 -u --update                update to new branch head if changesets were
 -f --force                 run even when remote repository is unrelated
 -r --rev REV [+]           a remote changeset intended to be added
 -B --bookmark BOOKMARK [+] bookmark to pull
 -b --branch BRANCH [+]     a specific branch you would like to pull
 -e --ssh CMD               specify ssh command to use
    --remotecmd CMD         specify hg command to run on the remote side
    --insecure              do not verify server certificate (ignoring
                            web.cacerts config)
    --rebase                rebase working directory to branch head
 -t --tool VALUE            specify merge tool for rebase
    --mq                    operate on patch repository

[+] marked option can be specified multiple times

use "hg help pull" to show the full help text
xargs: hg: exited with status 255; aborting
2014-09-19 10:03:32,514 - WARNING - maximum attempts reached

Comment 1

5 years ago
Posted patch runner-puppet.diff (obsolete) — Splinter Review
xargs all the things!
Attachment #8493146 - Flags: review?(dustin)


5 years ago
Attachment #8493146 - Flags: review?(dustin) → review?(pmoore)

Comment 2

5 years ago
Comment on attachment 8493146 [details] [diff] [review]

Review of attachment 8493146 [details] [diff] [review]:

Looks good to me! Since all buildbot masters run on linux, it shouldn't be a problem that --no-run-if-empty is not mac-compatible. However, if we start using runner on non-linux machines, we may need to tweak it - but I don't think there are any plans to use it on anything other than buildbot masters at the moment, which are all linux, afaik.

If I'm wrong about this, let me know!

Thanks Rail!
Attachment #8493146 - Flags: review?(pmoore) → review+

Comment 3

5 years ago
Ruh, roh. Thanks for the catch... Bad Mac, bad!
Probably it's not a good idea to land a not portable change. Need to rethink...

Comment 4

5 years ago
Posted patch update_shared_repos.diff (obsolete) — Splinter Review
how about this?
Attachment #8493146 - Attachment is obsolete: true
Attachment #8494160 - Flags: review?(pmoore)

Comment 5

5 years ago
Comment on attachment 8494160 [details] [diff] [review]

Review of attachment 8494160 [details] [diff] [review]:

::: modules/runner/templates/tasks/update_shared_repos.erb
@@ +28,5 @@
>      fi
> +    if [ -z $hgrc_found ]; then
> +        echo "No valid mercurial repos found. Exiting early"
> +        exit 0
> +    fi

I think this might not work, because the if condition is inside the loop, and the unsetting of hgrc_found is also inside the loop, and both would need to be outside.

However, I think there may be another way, I'll attach a counter patch with my idea.
Attachment #8494160 - Flags: review?(pmoore) → review-

Comment 6

5 years ago
Posted patch bug1070037_puppet_v1.patch (obsolete) — Splinter Review
I think this should be mac and linux compatible. Haven't considered windows! Maybe it is, not sure - would need to test.
Attachment #8494160 - Attachment is obsolete: true
Attachment #8494513 - Flags: review?(rail)

Comment 7

5 years ago
Comment on attachment 8494513 [details] [diff] [review]

A nit. Can you use "rm -f" to make sure there no user interaction.
Attachment #8494513 - Flags: review?(rail) → review+

Comment 8

5 years ago
So out of curiosity, I tested on Mac, and it seems sed actually adds a line ending on mac, even though the input has no line ending. On linux this works fine, but also this does not work on Mac as desired, due to the difference in the sed implementation! For example:

pmoore@Elisandra:~ $ echo -n 'hi' | sed 's/hi/hello/'
pmoore@Elisandra:~ $ 

[cltbld@b-linux64-hp-0012.try.releng.scl3.mozilla.com ~]$ echo -n 'hi' | sed 's/hi/hello/'
hello[cltbld@b-linux64-hp-0012.try.releng.scl3.mozilla.com ~]$ 

So I'll tweak it again just so slightly to get it working on both.

Comment 9

5 years ago
This time I tested on both mac and linux when there are both results and not results. :)
Attachment #8494513 - Attachment is obsolete: true
Attachment #8494622 - Flags: review?(rail)


5 years ago
Attachment #8494622 - Flags: review?(rail) → review+

Comment 11

5 years ago
Pete, thanks for fixing this!
Assignee: rail → pmoore
Last Resolved: 5 years ago
Resolution: --- → FIXED
Component: General Automation → General
Product: Release Engineering → Release Engineering
You need to log in before you can comment on or make changes to this bug.