Closed Bug 1113475 Opened 10 years ago Closed 9 years ago

Add support for faking extVersion in schema_version 1

Categories

(Release Engineering Graveyard :: Applications: Balrog (backend), defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nthomas, Assigned: bhearsum)

References

Details

Attachments

(1 file, 1 obsolete file)

Bug 998721 requests we try to get really old users up to 12.0, and hopefully onwards. We need to fake the extVersion to be the same as the version in the request, so the user isn't shown Incompatible Extensions dialog.

The code to change is at
 https://github.com/mozilla/balrog/blob/master/auslib/blobs/apprelease.py#L337
and where it's called.
I think this patch addressed this bug. It's not pretty, but I think it's okay for something like this?
Assignee: nobody → bhearsum
Status: NEW → ASSIGNED
Attachment #8562945 - Flags: review?(nthomas)
Blocks: 998721
Comment on attachment 8562945 [details] [diff] [review]
add support for faking extv in schema 1 blobs

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

::: auslib/blobs/apprelease.py
@@ +354,5 @@
>  
> +    def createXML(self, updateQuery, *args, **kwargs):
> +        xml = super(ReleaseBlobV1, self).createXML(updateQuery, *args, **kwargs)
> +        if self.get("setExtvToIncomingVersion"):
> +            xml = re.sub('extensionVersion="[\w.]+"', 'extensionVersion="%s"' % updateQuery["version"], xml)

I'd rather see this done in ReleaseBlobV1._getUpdateLineXML() at
  https://github.com/mozilla/balrog/blob/master/auslib/blobs/apprelease.py#L337
to avoid a regexp call. eg changing the value of extv if setExtvToIncomingVersion is True.

The test looks fine.
Attachment #8562945 - Flags: review?(nthomas) → review-
(In reply to Nick Thomas [:nthomas] from comment #2)
> Comment on attachment 8562945 [details] [diff] [review]
> add support for faking extv in schema 1 blobs
> 
> Review of attachment 8562945 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: auslib/blobs/apprelease.py
> @@ +354,5 @@
> >  
> > +    def createXML(self, updateQuery, *args, **kwargs):
> > +        xml = super(ReleaseBlobV1, self).createXML(updateQuery, *args, **kwargs)
> > +        if self.get("setExtvToIncomingVersion"):
> > +            xml = re.sub('extensionVersion="[\w.]+"', 'extensionVersion="%s"' % updateQuery["version"], xml)
> 
> I'd rather see this done in ReleaseBlobV1._getUpdateLineXML() at
>  
> https://github.com/mozilla/balrog/blob/master/auslib/blobs/apprelease.py#L337
> to avoid a regexp call. eg changing the value of extv if
> setExtvToIncomingVersion is True.
> 
> The test looks fine.

I went down that road too, but that method doesn't have access to the incoming extv. I could pass it down (which would mean supporting it as an arg to all such methods, or maybe do something like use ext=%OLDVERSION% and have the overridden createXML sub that - both of those are a bit nasty IMO though.

How about this? It still overrides createXML but I found a way to avoid the regex.
Attachment #8562945 - Attachment is obsolete: true
Attachment #8563404 - Flags: review?(nthomas)
Comment on attachment 8563404 [details] [diff] [review]
schema 1 extv hack without regex

The mega-comment block at https://github.com/mozilla/balrog/blob/master/auslib/blobs/apprelease.py#L100 needs a little tweak.
Attachment #8563404 - Flags: review?(nthomas) → review+
Commit pushed to master at https://github.com/mozilla/balrog

https://github.com/mozilla/balrog/commit/a264bf63954041ebcb8f6352cd77b3692bb0db2c
bug 1113475: Add support for faking extVersion in schema_version 1. r=nthomas
Comment on attachment 8563404 [details] [diff] [review]
schema 1 extv hack without regex

Landed with an update to the comment block.
Attachment #8563404 - Flags: checked-in+
This is in production now.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Release Engineering → Release Engineering Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: