Closed
Bug 1361184
Opened 9 years ago
Closed 8 years ago
Write script to remap milestones and versions
Categories
(bugzilla.mozilla.org :: General, enhancement)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: dylan, Assigned: dylan)
References
Details
Attachments
(1 file, 2 obsolete files)
Before moving bugs between components with movebugs.pl, we historically sync flags and versions. This is good enough for graveyarding things, but for reorganization efforts it is ugly. For instance, bug 1360080.
Rather than go through that trouble, it would be preferable if movebugs.pl could map between the source milestone/versions and the destination milestone/versions.
| Assignee | ||
Updated•9 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Updated•9 years ago
|
Summary: Allow movebugs.pl to remap milestones and versions for the target product/component → Write script to remap milestones and versions
| Assignee | ||
Comment 1•9 years ago
|
||
Example usage:
I will write docs too, but it took all day to get this working as is:
perl scripts/rewrite_milestones_and_versions.pl \
--product 'Android Background Services' \
-V 'Firefox * -> * Branch!' \
-M 'mozilla* -> Firefox *!'
Attachment #8865685 -
Flags: review?(glob)
Comment on attachment 8865685 [details]
rewrite_milestones_and_versions.pl
please reattach as a patch so i can use review tools.
Attachment #8865685 -
Flags: review?(glob)
| Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8865685 -
Attachment is obsolete: true
Attachment #8865739 -
Flags: review?(glob)
Comment on attachment 8865739 [details] [diff] [review]
1361184_1.patch
Review of attachment 8865739 [details] [diff] [review]:
-----------------------------------------------------------------
::: scripts/rewrite_milestones_and_versions.pl
@@ +111,5 @@
> +
> + my $from_like = do { my $f = $from; $f =~ s/\*/%/g; $f };
> + my $from_re = do { my $f = quotemeta $from; $f =~ s/\\\*/(.+)/g; qr/^$f$/ };
> + my $to_sub = sub { my $t = $to; $t =~ s/\*/shift @_/ge; $t; };
> + my $translate = sub { my ($s) = @_; $to_sub->($s =~ $from_re); };
this is neat, and i do like globs, but i'm concerned that a typo in the "to" field could result in pain.
as per irc let's split this into a two phase process:
- generate a 1:1 mapping file using globs/whatever
- apply mappings
Attachment #8865739 -
Flags: review?(glob) → review-
| Assignee | ||
Updated•9 years ago
|
Attachment #8865739 -
Attachment is patch: false
Attachment #8865739 -
Flags: review-
| Assignee | ||
Updated•9 years ago
|
Attachment #8865739 -
Attachment is obsolete: true
Attachment #8865739 -
Attachment is patch: true
| Assignee | ||
Comment 5•9 years ago
|
||
Almost have something to review, needs testing by a non-sleepy mind. Usage:
perl scripts/rewrite_milestones_and_versions.pl \
--product 'Android Background Services' -V '*->VER *!' -M 'Firefox *->Fireforks *!'
--save-to changes.json
perl scripts/change_set.pl changes.json
Sample output:
changes to be made by automation@bmo.tld
create Bugzilla::Version (VER 12 Branch)
...
Update Bugzilla::Bug id = 1237880
version :: unspecified => VER unspecified
target_milestone :: Firefox 46 => Fireforks 46
If that looks good, then:
perl scripts/change_set.pl --apply changes.json
Although I haven't implemented --revert, there is enough information saved in the .json to always do a revert.
Blocks: 1372280
| Assignee | ||
Comment 6•9 years ago
|
||
I forgot what else this is missing, but we'll discuss it in 1:1 next week if possible.
Attachment #8884174 -
Flags: feedback?(glob)
Comment on attachment 8884174 [details] [review]
PR
as per discussion on irc.
Attachment #8884174 -
Flags: feedback?(glob) → feedback-
| Assignee | ||
Updated•8 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•