Closed Bug 1003361 Opened 10 years ago Closed 10 years ago

b2g tagging script

Categories

(Release Engineering :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mozilla, Assigned: mozilla)

References

()

Details

(Whiteboard: [mozharness][b2g])

Attachments

(3 files, 1 obsolete file)

Whiteboard: [mozharness][b2g]
Attached patch b2g_tagSplinter Review
Attachment #8420481 - Attachment is obsolete: true
Attachment #8421240 - Flags: review?(rail)
Comment on attachment 8421240 [details] [diff] [review]
b2g_tag

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

::: scripts/merge_day/b2g_tag.py
@@ +98,5 @@
> +            By default everything in self.config['b2g_branches'],
> +            but we can override that list with --gecko-repos.
> +            """
> +        if self.gecko_repos:
> +            return self.gecko_repos

Just a random idea, not related to the current review.

I see this pattern (if self.prop: return prop) almost everywhere in mozharness. We could use @property and use (or implement) LRU cache (like in https://docs.python.org/3/library/functools.html#functools.lru_cache) to get rid of the boilerplate and make the code more readable.

Something like this:

@property
@lru_cache()
def gecko_repos(self):
    gecko_repos = self.config.get("gecko_repos", self.config['b2g_branches'].keys())
    gecko_repos.sort()
    return gecko_repos

And later in the code reference as self.gecko_repos.

@@ +191,5 @@
> +        if self.run_command(cmd, cwd=hg_dir, error_list=HgErrorList):
> +            raise VCSException("Can't tag %s with %s" % (repo_name, tag_name))
> +        # Debugging! Echo only for now.
> +        # cmd = hg + ["push", push_url]
> +        cmd = ["echo"] + hg + ["push", push_url]

Do you still need to "echo"?

@@ +229,5 @@
> +        ):
> +            raise VCSException("Can't tag gaia for %s!" % hg_repo_name)
> +        if self.run_command(
> +            # Debugging! Echo only for now.
> +            ["echo"] + git + ["push", "--tags"],

the same here

@@ +269,5 @@
> +                git + ["pull"],
> +                cwd=dirs['abs_gaia_dir'],
> +                error_list=GitErrorList,
> +                halt_on_failure=True,
> +            )

Feature request: add something like "hg strip --no-backup 'outgoing()'" here. Not critical.
Attachment #8421240 - Flags: review?(rail) → review+
Comment on attachment 8421240 [details] [diff] [review]
b2g_tag

https://hg.mozilla.org/build/mozharness/rev/7b6bc80e7c15

Landed, with the echos for now... I'm going to be a bit cautious until this works properly next merge day.
Attachment #8421240 - Flags: checked-in+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
I'm going to keep this open til I see it working properly on merge day.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch fix_b2g_tagSplinter Review
This:

* adds some load_json_from_url output
* fixes query_gecko_repos() (can't sort a tuple)
* adds a clean-repos action that strips the gecko repos and |git tag -d|s the gaia repo.
Attachment #8421443 - Flags: review?(rail)
Comment on attachment 8421443 [details] [diff] [review]
fix_b2g_tag

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

lgtm
Attachment #8421443 - Flags: review?(rail) → review+
Attached patch b2g_tag.diffSplinter Review
as run today.
Attachment #8437361 - Flags: review?(rail)
Attachment #8437361 - Flags: review?(rail) → review+
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Live with reconfig on 2014-06-11 08:47 PT
Component: Tools → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: