Closed Bug 984166 Opened 10 years ago Closed 10 years ago

Support multiple products in a permission options

Categories

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

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nthomas, Unassigned)

References

Details

Attachments

(1 file)

I attempted to add a new permission for ffxbld in production:
 perm: /releases/:name
 options: {"product": "Fennec", "method": "POST"}
but got back
 ERROR: Must provide the data version when updating an existing permission.

Which seems rather odd, data_version is irrelevant when adding a new perm.
Works fine on 9ff17bd (tip), using 'python admin.py' locally. I managed to shred my vagrant setup, which makes testing with apache+mysql hard (and anyway it had a different error to the one above).
Ok, so going down the wrong track here. Really we want to set something like
 perm: /releases/:name
 options: {"product": ["Firefox, "Fennec"], "method": "POST"}
Need to verify if we support this and what the correct syntax is.
Summary: Can't add new permissions using UI → Can't add new permissions on aus4-admin
Ok, we don't have support for multiple products yet. Were going to do that in bug 749297 but it got scoped down to sec fix.
OS: Mac OS X → All
Summary: Can't add new permissions on aus4-admin → Support multiple products in a permission options
I threw this together very quickly, there might be extra tests we could add.
Attachment #8391977 - Flags: review?(bhearsum)
(In reply to Nick Thomas [:nthomas] from comment #0)
> I attempted to add a new permission for ffxbld in production:
>  perm: /releases/:name
>  options: {"product": "Fennec", "method": "POST"}
> but got back
>  ERROR: Must provide the data version when updating an existing permission.
> 
> Which seems rather odd, data_version is irrelevant when adding a new perm.

As you probably realized, this is because ffxbld+/releases/:name already exists as a perf. I guess the web layer and/or database layer is trying to update that rather than throw the right error. That's rather confusing.

In any case, this patch looks pretty reasonable. I'm going to do some more testing and look at adding more tests. Thanks so much for your work here.
Commit pushed to master at https://github.com/mozilla/balrog

https://github.com/mozilla/balrog/commit/ead9377b9bf1e0d2c1f9f9de44945b01f7ff4518
bug 984166: Support multiple products in a permission options. r=bhearsum
Comment on attachment 8391977 [details] [diff] [review]
[balrog] Add support for multiple products

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

OK, this looked fine in my local tests. I updated some other tests to make product plural and landed in https://github.com/mozilla/balrog/commit/ead9377b9bf1e0d2c1f9f9de44945b01f7ff4518. I'll test some more in dev before asking for a push to prod.
Attachment #8391977 - Flags: review?(bhearsum)
Attachment #8391977 - Flags: review+
Attachment #8391977 - Flags: checked-in+
OK, this tested fine in staging. Here's what I did to verify it:
* Tried to rerun a nightly submission against dev. Failed, because the new code was incompatible with the permissions.
* Changed stage-ffxbld's permissions to have a list products.
* Reran nightly submission again, succeeded.
* Tried to run the same nightly submission against the Thunderbird product. Failed, because stage-ffxbld isn't allowed to submit to Thunderbird.

Going to file a bug to get this in prod, and then I'll have to update the permissions there.
Depends on: 984391
This is fixed now, and I've adjusted the permissions in the databases to use lists of products. Thanks again for debugging & fixing this, Nick.
Status: NEW → RESOLVED
Closed: 10 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: