mozharness gecko migration merge day script

RESOLVED FIXED

Status

Release Engineering
Mozharness
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: aki, Assigned: aki)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
http://hg.mozilla.org/build/tools/file/63b5e2229f1c/release/merge_helper.py

https://wiki.mozilla.org/ReleaseEngineering/Merge_Duty/Steps#Perform_mozilla-aurora_-.3E_mozilla-beta_and_mozilla-central_-.3E_mozilla-aurora_migrations

CLOBBER file support!
(Assignee)

Updated

3 years ago
Depends on: 1003634
(Assignee)

Comment 1

3 years ago
We may require separate aurora + beta steps at some point.
(Assignee)

Updated

3 years ago
Assignee: nobody → aki
(Assignee)

Comment 2

3 years ago
Created attachment 8447385 [details] [diff] [review]
mergeday.diff

This review can definitely wait til you're not on pto.

This is a single script and 4 config files.
gecko_migration.py can handle all 4 types of migrations: beta_to_release, aurora_to_beta, central_to_aurora, and staging_beta_migration.  This is handled by "migration_behavior" which specifies which workflow to use after tagging and merging.

This also fixes a couple other bugs:  the debugsetparents method tries to preserve old tags, and we now touch the CLOBBER file per bug 1003634.  This handles the release migration in bug 1011794, but not the release l10n migration.
Attachment #8447385 - Flags: review?(rail)
Comment on attachment 8447385 [details] [diff] [review]
mergeday.diff

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

What can possibly go wrong?! :)

::: scripts/merge_day/gecko_migration.py
@@ +80,5 @@
> +        if self.config['migration_behavior'] not in VALID_MIGRATION_BEHAVIORS:
> +            message += "%s must be one of %s!\n" % (self.config['migration_behavior'], VALID_MIGRATION_BEHAVIORS)
> +        if self.config['migration_behavior'] == 'beta_to_release':
> +            if self.config.get("require_remove_locales") and not self.config.get("remove_locales") and 'migrate' in self.actions:
> +                message += "You must specify --remove-locale!\n"

I like this! :)

@@ +207,5 @@
> +            # I don't know how to do this elegantly.
> +            # I'm reverting .hgtags to old_head, then appending the new tags
> +            # from new_head to .hgtags, and hoping nothing goes wrong.
> +            # I'd rather not write patch files from scratch, so this seems
> +            # like a slightly more complex but less objectionable method?

Yeah, sounds hacky. :(

@@ +216,5 @@
> +                subprocess.list2cmdline(hg + ['diff', '-r', old_head, '.hgtags', '-U9', '>', patch_file]),
> +                cwd=cwd
> +            )
> +            self.run_command(
> +                'patch -R -p1 < %s' % patch_file,

["patch", "-R", "-i", patch_file] should work too. No need to go through shell in this case.

@@ +227,5 @@
> +                    self.fatal("Can't append to .hgtags!")
> +                for line in tag_diff.splitlines():
> +                    if not line.startswith('+'):
> +                        continue
> +                    line = line.replace('+', '')

Ooooh. Sounds like this has to be double checked manually when we run this script.

@@ +271,5 @@
> +        for line in contents.splitlines():
> +            if line.startswith("#") or line == '':
> +                new_contents += "%s\n" % line
> +        new_contents += "Merge day clobber"
> +        self.write_to_file(clobber_file, new_contents)

Nice!
Attachment #8447385 - Flags: review?(rail) → review+
(Assignee)

Comment 4

3 years ago
Comment on attachment 8447385 [details] [diff] [review]
mergeday.diff

https://hg.mozilla.org/build/mozharness/rev/411aed63044e
Attachment #8447385 - Flags: checked-in+
(Assignee)

Comment 5

3 years ago
Todo: docs, remove old scripts once we've used this script on merge day.
(Assignee)

Updated

3 years ago
Summary: mozharness mozilla-beta + mozilla-aurora merge day script → mozharness gecko migration merge day script
(Assignee)

Comment 6

3 years ago
Doc updates here: https://wiki.mozilla.org/index.php?title=ReleaseEngineering/Merge_Duty/Steps&diff=995616&oldid=995606

Going to resolve this.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
(Assignee)

Comment 7

3 years ago
https://wiki.mozilla.org/index.php?title=ReleaseEngineering%2FMerge_Duty%2FSteps&diff=995616&oldid=992106 for the full set.

Updated

3 years ago
Component: Tools → Mozharness
You need to log in before you can comment on or make changes to this bug.