If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

allow for "git clean" to be run as part of a gittool checkout/update

RESOLVED FIXED

Status

Release Engineering
General Automation
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bhearsum, Assigned: bhearsum)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 attachments, 2 obsolete attachments)

(Assignee)

Description

4 years ago
We'd like to do this at the start of Servo builds. LOoks like we need to update gittool.py, Mozharness' gittool integration, and Servo's build script.
(Assignee)

Comment 1

4 years ago
Created attachment 752924 [details] [diff] [review]
be more clean!
Attachment #752924 - Flags: review?(catlee)
(Assignee)

Comment 2

4 years ago
Created attachment 752964 [details] [diff] [review]
do error checking!
Attachment #752924 - Attachment is obsolete: true
Attachment #752924 - Flags: review?(catlee)
Attachment #752964 - Flags: review?(catlee)
(Assignee)

Comment 3

4 years ago
Created attachment 752971 [details] [diff] [review]
add support for --clean to mozharness gittool interface; use it for servo
Attachment #752971 - Flags: review?(aki)

Comment 4

4 years ago
Comment on attachment 752971 [details] [diff] [review]
add support for --clean to mozharness gittool interface; use it for servo

A -U8 would be helpful, but I always forget in git diffs too.  I'm guessing git doesn't have an |hg --config defaults.diff=-p -U8| equivalent?
Attachment #752971 - Flags: review?(aki) → review+

Comment 5

4 years ago
git config --global diff.context 8
Comment on attachment 752964 [details] [diff] [review]
do error checking!

Review of attachment 752964 [details] [diff] [review]:
-----------------------------------------------------------------

::: lib/python/util/git.py
@@ +120,5 @@
>          f.write("%s\n" % share_objects)
>  
>  
> +def clean(repo):
> +    subprocess.check_call(['git', 'clean', '-f', '-d'], cwd=repo, stdout=subprocess.PIPE)

do we need stdout=subprocess.PIPE here if we're not interested in the output?
Attachment #752964 - Flags: review?(catlee) → review+
(Assignee)

Updated

4 years ago
Attachment #752964 - Flags: checked-in+
(Assignee)

Comment 7

4 years ago
Comment on attachment 752971 [details] [diff] [review]
add support for --clean to mozharness gittool interface; use it for servo

Landed on production, too.
Attachment #752971 - Flags: checked-in+
(Assignee)

Comment 8

4 years ago
Comment on attachment 752971 [details] [diff] [review]
add support for --clean to mozharness gittool interface; use it for servo

Backed this out because I need to deploy the new gittool first.
Attachment #752971 - Flags: checked-in+ → checked-in-
(Assignee)

Comment 9

4 years ago
Created attachment 755386 [details] [diff] [review]
update gittool in puppetagain
Attachment #755386 - Flags: review?(rail)
Comment on attachment 755386 [details] [diff] [review]
update gittool in puppetagain

lgtm, esp module_sources :)
Attachment #755386 - Flags: review?(rail) → review+
(Assignee)

Comment 11

4 years ago
Comment on attachment 755386 [details] [diff] [review]
update gittool in puppetagain

Landed:
https://hg.mozilla.org/build/puppet/rev/c7dce0f8cb02
https://hg.mozilla.org/users/dmitchell_mozilla.com/puppet320/rev/aeaca50d879f

Will wait ~30min-1h before redeploying the mozharness change.
Attachment #755386 - Flags: checked-in+
(Assignee)

Comment 12

4 years ago
Created attachment 755432 [details] [diff] [review]
fix clean argument

Forgot to make it a true/false, oops.
Attachment #755432 - Flags: review?(rail)
Attachment #755432 - Flags: review?(rail) → review+
(Assignee)

Comment 13

4 years ago
Comment on attachment 755432 [details] [diff] [review]
fix clean argument

Landed to tools, puppet, and puppet320. (No need to remake the entire gittool.py, because no modules have changed.)
Attachment #755432 - Flags: checked-in+
(Assignee)

Updated

4 years ago
Attachment #752971 - Flags: checked-in- → checked-in+
(Assignee)

Comment 14

4 years ago
Created attachment 755462 [details] [diff] [review]
use run_cmd

*sigh*. Last thing. I just noticed that we're not logging the clean command because I used check_call directly instead of run_cmd.
Attachment #755462 - Flags: review?(catlee)
(Assignee)

Comment 15

4 years ago
Turns out this doesn't work for submodules either. We need "git clean -f -f" for that. Grrr.
(Assignee)

Comment 16

4 years ago
Created attachment 755605 [details] [diff] [review]
clean!!!!!
Attachment #755462 - Attachment is obsolete: true
Attachment #755462 - Flags: review?(catlee)
Attachment #755605 - Flags: review?(rail)
Attachment #755605 - Flags: review?(rail) → review+
(Assignee)

Updated

4 years ago
Attachment #755605 - Flags: checked-in+
(Assignee)

Comment 17

4 years ago
Pushed this to puppet and puppet320.
(Assignee)

Comment 18

4 years ago
This looks like it's working fine now.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
You need to log in before you can comment on or make changes to this bug.