Closed
Bug 1410121
Opened 7 years ago
Closed 6 years ago
Make a WNP helper script
Categories
(Release Engineering :: Release Automation: Other, enhancement)
Release Engineering
Release Automation: Other
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: Callek, Assigned: Callek)
References
Details
Attachments
(2 files)
5.54 KB,
patch
|
jlorenzo
:
feedback+
jlund
:
feedback+
|
Details | Diff | Splinter Review |
887 bytes,
patch
|
jlund
:
review+
jlorenzo
:
checked-in+
|
Details | Diff | Splinter Review |
We seem to be doing WNP's a lot lately, I'm creating a WNP helper script to facilitate needs here.
Assignee | ||
Comment 1•7 years ago
|
||
Attachment #8920197 -
Flags: feedback?(jlund)
Attachment #8920197 -
Flags: feedback?(jlorenzo)
Comment 2•7 years ago
|
||
Comment on attachment 8920197 [details] [diff] [review]
Skeleton of a WNP support script
Review of attachment 8920197 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great to me! Glad to see this automated \o/
::: releases-related/create_wnp_blob.py
@@ +9,5 @@
> +
> +from copy import deepcopy
> +
> +
> +BALROG_API_ROOT = 'https://aus5.mozilla.org/api/v1'
Yay public API!
@@ +19,5 @@
> + 'product', type=parser_product_type,
> + help="Product to create a WNP for, abbreviations ok.")
> + parser.add_argument(
> + 'version', action=VersionAction,
> + help="Version of the product")
Nit: Display an example of what's expected (like 57.0b9build1 as opposed to 57.0b9). The latter raises "Must include a build number"
@@ +26,5 @@
> + return parser.parse_args()
> +
> +
> +def parser_product_type(product):
> + VALID_PRODUCTS = ["firefox", "thunderbird", "devedition"]
Improvement: Expose VALID_PRODUCTS and ABBREV_PRODUCT to --help thanks to:
parser.add_argument('product', choices=(*VALID_PRODUCTS, *ABBREV_PRODUCTS.keys()), ...)
https://docs.python.org/3/library/argparse.html#choices
@@ +33,5 @@
> + "tb": "thunderbird",
> + "de": "devedition"}
> + if ABBREV_PRODUCTS.get(product.lower()):
> + return ABBREV_PRODUCTS[product]
> + for valid in VALID_PRODUCTS:
Improvement: This loop and the raise operation won't be necessary anymore thanks to choices=(...)
@@ +62,5 @@
> + setattr(namespace, self.dest, return_value)
> +
> +
> +def get_release_blob_name(options):
> + if options.version.beta_string:
Nit: This function can be simplified into:
```
extra_version = '' if not options.version.beta_string and not options.version.esr_string else options.version.beta_string or options.version.esr_string
full_version = ''.join((options.version.version, extra_version))
return '-'.join((options.product.capitalize(), full_version, options.version.build_string))
```
Attachment #8920197 -
Flags: feedback?(jlorenzo) → feedback+
Comment 3•7 years ago
|
||
(In reply to Johan Lorenzo [:jlorenzo] from comment #2)
> Nit: This function can be simplified into:
s/simplified/shrunk
Assignee | ||
Comment 4•7 years ago
|
||
(In reply to Johan Lorenzo [:jlorenzo] from comment #2)
> Comment on attachment 8920197 [details] [diff] [review]
> Skeleton of a WNP support script
> @@ +33,5 @@
> > + "tb": "thunderbird",
> > + "de": "devedition"}
> > + if ABBREV_PRODUCTS.get(product.lower()):
> > + return ABBREV_PRODUCTS[product]
> > + for valid in VALID_PRODUCTS:
>
> Improvement: This loop and the raise operation won't be necessary anymore
> thanks to choices=(...)
If I leave the type= validator (which allows for abbreviations like "fire" instead of merely "fx") then it is still necessary because argparse won't abort on "seamon" for example.
> @@ +62,5 @@
> > + setattr(namespace, self.dest, return_value)
> > +
> > +
> > +def get_release_blob_name(options):
> > + if options.version.beta_string:
>
> Nit: This function can be simplified into:
> ```
> extra_version = '' if not options.version.beta_string and not
> options.version.esr_string else options.version.beta_string or
> options.version.esr_string
> full_version = ''.join((options.version.version, extra_version))
> return '-'.join((options.product.capitalize(), full_version,
> options.version.build_string))
> ```
I took this advice, but modified it slightly. ;-)
Assignee | ||
Comment 5•7 years ago
|
||
https://hg.mozilla.org/build/braindump/rev/ba9227b46faffad67447623a31bb404981dfcaf1
You can call it like:
$ ./create_wnp_blob.py fire 56.0.1build2 foo_wnp
Where in this specific case it will fail with a message like the following:
Traceback (most recent call last):
File "./create_wnp_blob.py", line 141, in <module>
retc = main()
File "./create_wnp_blob.py", line 130, in main
validate_blob_name(blob_name, generated=True)
File "./create_wnp_blob.py", line 105, in validate_blob_name
" (specify with --blob): {}".format(releases)
Exception: Multiple releases found, which one do you want? (specify with --blob): ['Firefox-56.0.1-build2', 'Firefox-56.0.1-build2-original', 'Firefox-56.0.1-build2-win64-migration', 'Firefox-56.0.1-build2-win64-migration-only-completes', 'Firefox-56.0.1-build2-win64-migration-WNP']
(So we avoid surprises!)
rerun with something like $ ./create_wnp_blob.py fire 56.0.1build2 foo_wnp --blob Firefox-56.0.1-build2
And it does its magic.
There is no need to be on VPN to run it, and the script outputs the new blob as stdout. (todo: output as file, and/or upload new release blob to balrog)
Comment 6•7 years ago
|
||
\o/ I'll try this out this week as we prep for 57.0
Updated•7 years ago
|
Attachment #8920197 -
Flags: feedback?(jlund) → feedback+
Comment 7•7 years ago
|
||
Simple nit that I discovered while uploading the WNP of Devedition 57.0b12.
Attachment #8922796 -
Flags: review?(jlund)
Comment 8•7 years ago
|
||
Comment on attachment 8922796 [details] [diff] [review]
Bug 1410121 - part2: WNP helper: Allow 2-digit beta numbers
Review of attachment 8922796 [details] [diff] [review]:
-----------------------------------------------------------------
++ on the +
Attachment #8922796 -
Flags: review?(jlund) → review+
Comment 9•7 years ago
|
||
Comment on attachment 8922796 [details] [diff] [review]
Bug 1410121 - part2: WNP helper: Allow 2-digit beta numbers
https://hg.mozilla.org/build/braindump/rev/149580d393706be984a5e70764a97716a4c84528
Attachment #8922796 -
Flags: checked-in+
Comment 10•6 years ago
|
||
This was fixed 8 months ago. Let's track the modifications in bug 1473356.
Updated•6 years ago
|
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•