Closed
Bug 1139066
Opened 11 years ago
Closed 11 years ago
Support for git gecko repos
Categories
(Release Engineering :: Applications: MozharnessCore, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: wcosta, Assigned: wcosta)
References
Details
Attachments
(2 files, 2 obsolete files)
Today, mozharness can only download configs from mercurial remotes.
| Assignee | ||
Comment 1•11 years ago
|
||
/r/4623 - [PATCH 1/2] Bug 1139066 part 1: Use tc-vcs checkout command.
/r/4625 - [PATCH 2/2] Bug 1139066 part 2: Add support to download configs from git remotes.
Pull down these commits:
hg pull review -r b36bf949fca309ea8314676ec47a040cb350043a
Attachment #8572351 -
Flags: review?(sphink)
Attachment #8572351 -
Flags: review?(jlund)
Attachment #8572351 -
Flags: review?(jlal)
Comment 2•11 years ago
|
||
Comment on attachment 8572351 [details]
MozReview Request: bz://1139066/wcosta
vague r+ from me ... I only know some of these bits well. I am somewhat sad we end up duplicating this logic between tc-vcs and mozharness but I am not sure how to unify them yet.
Attachment #8572351 -
Flags: review?(jlal) → review+
Comment 3•11 years ago
|
||
Comment on attachment 8572351 [details]
MozReview Request: bz://1139066/wcosta
https://reviewboard.mozilla.org/r/4621/#review3853
this looks pretty good to me. Again I'm leaning on jlal for the correct behaviour logic for tcvcs
since all of mozharness/mozharness/mozilla/building/detect_repo.py is filled with static functions, do not avail of mozharness' logging/configs, and is a copy of another tool outside of mh, I think a more appropriate home is somewhere like mozharness/external_tools/detect_repo.py. what do you think? I'm open to your thoughts.
::: mozharness/base/vcs/tcvcs.py
(Diff revision 1)
> -
> + if revision is None:
I think the above c.get('revision', '') should handle the default assignment of an empty string if c['revision'] equates to None.
::: mozharness/base/vcs/tcvcs.py
(Diff revision 1)
> - branch = c.get('branch')
> + branch = c.get('branch', '')
do we need branch anymore? were you planning on using it?
::: mozharness/mozilla/building/buildb2gbase.py
(Diff revision 1)
> - return json.load(open(config_path, "r"))
> + return self.retry(self.load_json_from_url, args=(url,))
nice, good call using self.retry
Attachment #8572351 -
Flags: review?(jlund)
| Assignee | ||
Comment 4•11 years ago
|
||
(In reply to Jordan Lund (:jlund) from comment #3)
> Comment on attachment 8572351 [details]
> MozReview Request: bz://1139066/wcosta
>
> https://reviewboard.mozilla.org/r/4621/#review3853
>
> this looks pretty good to me. Again I'm leaning on jlal for the correct
> behaviour logic for tcvcs
>
> since all of mozharness/mozharness/mozilla/building/detect_repo.py is filled
> with static functions, do not avail of mozharness' logging/configs, and is a
> copy of another tool outside of mh, I think a more appropriate home is
> somewhere like mozharness/external_tools/detect_repo.py. what do you think?
> I'm open to your thoughts.
>
Sure, I am going to move this module to there.
> ::: mozharness/base/vcs/tcvcs.py
> (Diff revision 1)
> > -
> > + if revision is None:
>
> I think the above c.get('revision', '') should handle the default assignment
> of an empty string if c['revision'] equates to None.
>
The current behavior of query_revision() is to return None if it fails. mozharness try to query the local repo revision, and if the repo doesn't exist, it will return None and this value will be assigned to config['revision']. So, c['revision'] will be found with value None, and None will be returned. That's why the if is necessary. I could change the query_revision() behavior to return an empty string, but I was afraid to break other stuff.
> ::: mozharness/base/vcs/tcvcs.py
> (Diff revision 1)
> > - branch = c.get('branch')
> > + branch = c.get('branch', '')
>
> do we need branch anymore? were you planning on using it?
>
Ops, I forgot that.
> ::: mozharness/mozilla/building/buildb2gbase.py
> (Diff revision 1)
> > - return json.load(open(config_path, "r"))
> > + return self.retry(self.load_json_from_url, args=(url,))
>
> nice, good call using self.retry
| Assignee | ||
Comment 5•11 years ago
|
||
/r/4773 - Bug 1139066 part 1: Use tc-vcs checkout command.
/r/4775 - Bug 1139066 part 2: Add support to download configs from git remotes.
Pull down these commits:
hg pull review -r 6c5144bd4c38257376aa9303d5f233ab2a9aa9ac
Attachment #8573285 -
Flags: review?(sphink)
Attachment #8573285 -
Flags: review?(jlund)
| Assignee | ||
Updated•11 years ago
|
Attachment #8572351 -
Flags: review+ → review?(jlund)
| Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 8572351 [details]
MozReview Request: bz://1139066/wcosta
/r/4623 - Bug 1139066 part 1: Use tc-vcs checkout command.
/r/4625 - Bug 1139066 part 2: Add support to download configs from git remotes.
Pull down these commits:
hg pull review -r 6c5144bd4c38257376aa9303d5f233ab2a9aa9ac
| Assignee | ||
Updated•11 years ago
|
Attachment #8573285 -
Attachment is obsolete: true
Attachment #8573285 -
Flags: review?(sphink)
Attachment #8573285 -
Flags: review?(jlund)
Comment 7•11 years ago
|
||
Comment on attachment 8572351 [details]
MozReview Request: bz://1139066/wcosta
https://reviewboard.mozilla.org/r/4621/#review3921
::: mozharness/mozilla/building/buildb2gbase.py
(Diff revision 2)
> +sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..', 'external_tools'))
so I think we already:
sys.path.insert(1, os.path.dirname(sys.path[0]))
hence why we can do things like:
from mozharness.base.log import WARNING
This makes me think we don't need to modify the path further and instead just do:
from external_tools.detect_repo import foo, bar
If I'm right, I don't think that's a blocker to you landing but just an fyi
Attachment #8572351 -
Flags: review?(jlund)
Comment 8•11 years ago
|
||
So, c['revision'] will be found with value None, and
> None will be returned. That's why the if is necessary. I could change the
> query_revision() behavior to return an empty string, but I was afraid to
> break other stuff.
makes sense
Comment 9•11 years ago
|
||
Comment on attachment 8572351 [details]
MozReview Request: bz://1139066/wcosta
https://reviewboard.mozilla.org/r/4621/#review3923
lgtm :) how much of this have you tested?
Attachment #8572351 -
Flags: review+
| Assignee | ||
Comment 10•11 years ago
|
||
(In reply to Jordan Lund (:jlund) from comment #9)
> Comment on attachment 8572351 [details]
> MozReview Request: bz://1139066/wcosta
>
> https://reviewboard.mozilla.org/r/4621/#review3923
>
> lgtm :) how much of this have you tested?
I have tried combinations of local and taskcluster builds with git and hg repositories. Any further test I can perform to avoid breaking existing stuff?
| Assignee | ||
Comment 11•11 years ago
|
||
(In reply to Jordan Lund (:jlund) from comment #7)
> Comment on attachment 8572351 [details]
> MozReview Request: bz://1139066/wcosta
>
> https://reviewboard.mozilla.org/r/4621/#review3921
>
> ::: mozharness/mozilla/building/buildb2gbase.py
> (Diff revision 2)
> > +sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..', 'external_tools'))
>
> so I think we already:
> sys.path.insert(1, os.path.dirname(sys.path[0]))
>
> hence why we can do things like:
> from mozharness.base.log import WARNING
>
> This makes me think we don't need to modify the path further and instead
> just do:
> from external_tools.detect_repo import foo, bar
>
> If I'm right, I don't think that's a blocker to you landing but just an fyi
Makes sense, I will update the patch.
| Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 8572351 [details]
MozReview Request: bz://1139066/wcosta
/r/4623 - Bug 1139066 part 1: Use tc-vcs checkout command.
/r/4625 - Bug 1139066 part 2: Add support to download configs from git remotes.
Pull down these commits:
hg pull review -r 34823757addcf582918913896e604ac9ddd48735
Attachment #8572351 -
Flags: review?(sphink)
Attachment #8572351 -
Flags: review?(jlund)
Attachment #8572351 -
Flags: review+
| Assignee | ||
Comment 13•11 years ago
|
||
I updated the patch based on the last comments, plus two small updates:
1) I noticed that a change piece in part 2 actually belongs to part 1
2) The query_gecko_config function was broken for git.m.o, I fixed it.
Comment 14•11 years ago
|
||
Comment on attachment 8572351 [details]
MozReview Request: bz://1139066/wcosta
https://reviewboard.mozilla.org/r/4621/#review3953
Ship It!
Attachment #8572351 -
Flags: review?(jlund) → review+
| Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 15•11 years ago
|
||
(In reply to Wander Lairson Costa [:wcosta] from comment #10)
> (In reply to Jordan Lund (:jlund) from comment #9)
> > Comment on attachment 8572351 [details]
> > MozReview Request: bz://1139066/wcosta
> >
> > https://reviewboard.mozilla.org/r/4621/#review3923
> >
> > lgtm :) how much of this have you tested?
>
> I have tried combinations of local and taskcluster builds with git and hg
> repositories. Any further test I can perform to avoid breaking existing
> stuff?
sounds sufficient. I wonder if there will be an odd buildbot issue that I'm not seeing. However, since mh is pinned on each branch, I'm fine with landing this and trying it out.
lgtm :)
Comment 16•11 years ago
|
||
I'm guessing this must be source of the (nonfatal) AttributeError: 'GitConfig' object has no attribute 'json' I'm seeing here in https://treeherder.mozilla.org/#/jobs?repo=try&revision=97c1a52ce860 :
14:31:53 INFO - Deleting broken projects...
14:31:53 INFO - Running command: ['./repo', 'forall', '-c', 'git show-ref -q --head HEAD || rm -rfv $PWD'] in /builds/slave/b2g_try_l64-b2g-haz_dep-000000/build
14:31:53 INFO - Copy/paste: ./repo forall -c "git show-ref -q --head HEAD || rm -rfv $PWD"
14:31:53 INFO - Traceback (most recent call last):
14:31:53 INFO - File "/builds/slave/b2g_try_l64-b2g-haz_dep-000000/build/.repo/repo/main.py", line 506, in <module>
14:31:53 INFO - _Main(sys.argv[1:])
14:31:53 INFO - File "/builds/slave/b2g_try_l64-b2g-haz_dep-000000/build/.repo/repo/main.py", line 482, in _Main
14:31:53 INFO - result = repo._Run(argv) or 0
14:31:53 INFO - File "/builds/slave/b2g_try_l64-b2g-haz_dep-000000/build/.repo/repo/main.py", line 161, in _Run
14:31:53 INFO - result = cmd.Execute(copts, cargs)
14:31:53 INFO - File "/builds/git-shared/repo/repo/subcmds/forall.py", line 200, in Execute
14:31:53 INFO - mirror = self.manifest.IsMirror
14:31:53 INFO - File "/builds/git-shared/repo/repo/manifest_xml.py", line 358, in IsMirror
14:31:53 INFO - return self.manifestProject.config.GetBoolean('repo.mirror')
14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py", line 112, in GetBoolean
14:31:53 INFO - v = self.GetString(name)
14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py", line 129, in GetString
14:31:53 INFO - v = self._cache[_key(name)]
14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py", line 246, in _cache
14:31:53 INFO - self._cache_dict = self._Read()
14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py", line 253, in _Read
14:31:53 INFO - self._SaveJson(d)
14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py", line 283, in _SaveJson
14:31:53 INFO - if os.path.exists(self.json):
14:31:53 INFO - AttributeError: 'GitConfig' object has no attribute 'json'
| Assignee | ||
Comment 17•11 years ago
|
||
(In reply to Steve Fink [:sfink, :s:] from comment #16)
> I'm guessing this must be source of the (nonfatal) AttributeError:
> 'GitConfig' object has no attribute 'json' I'm seeing here in
> https://treeherder.mozilla.org/#/jobs?repo=try&revision=97c1a52ce860 :
>
> 14:31:53 INFO - Deleting broken projects...
> 14:31:53 INFO - Running command: ['./repo', 'forall', '-c', 'git
> show-ref -q --head HEAD || rm -rfv $PWD'] in
> /builds/slave/b2g_try_l64-b2g-haz_dep-000000/build
> 14:31:53 INFO - Copy/paste: ./repo forall -c "git show-ref -q --head
> HEAD || rm -rfv $PWD"
> 14:31:53 INFO - Traceback (most recent call last):
> 14:31:53 INFO - File
> "/builds/slave/b2g_try_l64-b2g-haz_dep-000000/build/.repo/repo/main.py",
> line 506, in <module>
> 14:31:53 INFO - _Main(sys.argv[1:])
> 14:31:53 INFO - File
> "/builds/slave/b2g_try_l64-b2g-haz_dep-000000/build/.repo/repo/main.py",
> line 482, in _Main
> 14:31:53 INFO - result = repo._Run(argv) or 0
> 14:31:53 INFO - File
> "/builds/slave/b2g_try_l64-b2g-haz_dep-000000/build/.repo/repo/main.py",
> line 161, in _Run
> 14:31:53 INFO - result = cmd.Execute(copts, cargs)
> 14:31:53 INFO - File
> "/builds/git-shared/repo/repo/subcmds/forall.py", line 200, in Execute
> 14:31:53 INFO - mirror = self.manifest.IsMirror
> 14:31:53 INFO - File "/builds/git-shared/repo/repo/manifest_xml.py",
> line 358, in IsMirror
> 14:31:53 INFO - return
> self.manifestProject.config.GetBoolean('repo.mirror')
> 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> line 112, in GetBoolean
> 14:31:53 INFO - v = self.GetString(name)
> 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> line 129, in GetString
> 14:31:53 INFO - v = self._cache[_key(name)]
> 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> line 246, in _cache
> 14:31:53 INFO - self._cache_dict = self._Read()
> 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> line 253, in _Read
> 14:31:53 INFO - self._SaveJson(d)
> 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> line 283, in _SaveJson
> 14:31:53 INFO - if os.path.exists(self.json):
> 14:31:53 INFO - AttributeError: 'GitConfig' object has no attribute
> 'json'
This happens when you run b2g_build.py in a fresh clone of B2G repo. I tried here and even mozharness master has this error. It then runs config.sh to clone the repos in the manifest file. I ignored because this error looked expect in the code flow.
| Assignee | ||
Comment 18•11 years ago
|
||
(In reply to Wander Lairson Costa [:wcosta] from comment #17)
> (In reply to Steve Fink [:sfink, :s:] from comment #16)
> > I'm guessing this must be source of the (nonfatal) AttributeError:
> > 'GitConfig' object has no attribute 'json' I'm seeing here in
> > https://treeherder.mozilla.org/#/jobs?repo=try&revision=97c1a52ce860 :
> >
> > 14:31:53 INFO - Deleting broken projects...
> > 14:31:53 INFO - Running command: ['./repo', 'forall', '-c', 'git
> > show-ref -q --head HEAD || rm -rfv $PWD'] in
> > /builds/slave/b2g_try_l64-b2g-haz_dep-000000/build
> > 14:31:53 INFO - Copy/paste: ./repo forall -c "git show-ref -q --head
> > HEAD || rm -rfv $PWD"
> > 14:31:53 INFO - Traceback (most recent call last):
> > 14:31:53 INFO - File
> > "/builds/slave/b2g_try_l64-b2g-haz_dep-000000/build/.repo/repo/main.py",
> > line 506, in <module>
> > 14:31:53 INFO - _Main(sys.argv[1:])
> > 14:31:53 INFO - File
> > "/builds/slave/b2g_try_l64-b2g-haz_dep-000000/build/.repo/repo/main.py",
> > line 482, in _Main
> > 14:31:53 INFO - result = repo._Run(argv) or 0
> > 14:31:53 INFO - File
> > "/builds/slave/b2g_try_l64-b2g-haz_dep-000000/build/.repo/repo/main.py",
> > line 161, in _Run
> > 14:31:53 INFO - result = cmd.Execute(copts, cargs)
> > 14:31:53 INFO - File
> > "/builds/git-shared/repo/repo/subcmds/forall.py", line 200, in Execute
> > 14:31:53 INFO - mirror = self.manifest.IsMirror
> > 14:31:53 INFO - File "/builds/git-shared/repo/repo/manifest_xml.py",
> > line 358, in IsMirror
> > 14:31:53 INFO - return
> > self.manifestProject.config.GetBoolean('repo.mirror')
> > 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> > line 112, in GetBoolean
> > 14:31:53 INFO - v = self.GetString(name)
> > 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> > line 129, in GetString
> > 14:31:53 INFO - v = self._cache[_key(name)]
> > 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> > line 246, in _cache
> > 14:31:53 INFO - self._cache_dict = self._Read()
> > 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> > line 253, in _Read
> > 14:31:53 INFO - self._SaveJson(d)
> > 14:31:53 INFO - File "/builds/git-shared/repo/repo/git_config.py",
> > line 283, in _SaveJson
> > 14:31:53 INFO - if os.path.exists(self.json):
> > 14:31:53 INFO - AttributeError: 'GitConfig' object has no attribute
> > 'json'
>
> This happens when you run b2g_build.py in a fresh clone of B2G repo. I tried
> here and even mozharness master has this error. It then runs config.sh to
> clone the repos in the manifest file. I ignored because this error looked
> expect in the code flow.
I went a bit further into this, and it feels like the problem is that "repo forall" is called before "repo init". If I understood the code piece correctly [1], this behavior is expected. Is this a blocker to land this bug?
[1] https://github.com/mozilla/build-mozharness/blob/master/mozharness/mozilla/building/buildb2gbase.py#L396-L417
Flags: needinfo?(sphink)
Comment 21•11 years ago
|
||
No, I would not block landing for it. It is disturbing, though, since when you click on a clean hazard build on TH it shows an error message. But that's not the end of the world.
Flags: needinfo?(sphink)
| Assignee | ||
Comment 22•11 years ago
|
||
Comment on attachment 8572351 [details]
MozReview Request: bz://1139066/wcosta
/r/4623 - Bug 1139066 part 1: Use tc-vcs checkout command.
/r/4625 - Bug 1139066 part 2: Add support to download configs from git remotes.
Pull down these commits:
hg pull review -r 14efdd6647b528075dc7cf8ea9366223238da47d
Attachment #8572351 -
Flags: review+ → review?(sphink)
| Assignee | ||
Comment 23•11 years ago
|
||
According to what we talked on irc, we modified patch 2 to fix 3 problems:
- Remove the braino "if True:"
- Make the patches pyflakes clean
- Make query_revision return None when the local repository doesn't exist.
Comment 24•11 years ago
|
||
Comment 25•11 years ago
|
||
Comment 26•11 years ago
|
||
mozharness production tag moved to: https://hg.mozilla.org/build/mozharness/rev/6b7d8d086e8a
Comment 27•11 years ago
|
||
mozharness production tag moved to: https://hg.mozilla.org/build/mozharness/rev/14efdd6647b5
Comment 29•11 years ago
|
||
(In reply to Wander Lairson Costa [:wcosta] from comment #28)
> Can the bug be closed?
That depends. If the trees you care about have in-tree pinning for mozharness, you will need to update the revision they point to if you have not already done so. Otherwise, yes, you can close the bug.
Flags: needinfo?(coop)
| Assignee | ||
Updated•11 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Keywords: checkin-needed
Comment 30•11 years ago
|
||
Comment 31•11 years ago
|
||
Comment on attachment 8572351 [details]
MozReview Request: bz://1139066/wcosta
https://reviewboard.mozilla.org/r/4621/#review8191
Ship It!
Attachment #8572351 -
Flags: review?(sphink) → review+
Comment 32•11 years ago
|
||
(Sorry for the bug spam; I had just long ago left this one at r?me because I wanted to come back sometime to see if I could understand why reviewboard never marked it r+.)
| Assignee | ||
Comment 33•11 years ago
|
||
Attachment #8572351 -
Attachment is obsolete: true
Attachment #8619650 -
Flags: review+
Attachment #8619651 -
Flags: review+
| Assignee | ||
Comment 34•11 years ago
|
||
| Assignee | ||
Comment 35•11 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•