Remove permissions checking from balrog's db.py

RESOLVED FIXED

Status

Release Engineering
General
RESOLVED FIXED
6 years ago
19 days ago

People

(Reporter: edransch, Assigned: edransch)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
The Permissions table in db.py currently checks permissions. We already check permissions at the web layer. To be consistent with other Tables, we should *only* check for permissions at the web layer.
(Assignee)

Comment 1

6 years ago
Created attachment 605949 [details] [diff] [review]
Remove permissions checking in db.py

Remove permissions checking for modification of the permissions table. The assumption is that the permissions will be checked on the web ui side.
Attachment #605949 - Flags: review?(bhearsum)
Comment on attachment 605949 [details] [diff] [review]
Remove permissions checking in db.py

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

It looks like there's some references left to these methods in the tests, can you remove them too? You can use a simple "make test" command in the root of the repository to run the tests.
Attachment #605949 - Flags: review?(bhearsum) → review-
(Assignee)

Comment 3

6 years ago
Created attachment 606198 [details] [diff] [review]
Update patch to remove tests for removed code
Attachment #605949 - Attachment is obsolete: true
Attachment #606198 - Flags: review?(bhearsum)
Attachment #606198 - Flags: review?(bhearsum) → review+
(Assignee)

Comment 4

6 years ago
Patch still applies cleanly.
Comment on attachment 606198 [details] [diff] [review]
Update patch to remove tests for removed code

I landed this patch along with bug 733478, and the first Jenkins run burned with:
======================================================================
FAIL: testAddRelease (auslib.test.test_db.TestReleases)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/Balrog/workspace/auslib/test/test_db.py", line 458, in testAddRelease
    self.assertEquals(self.releases.t.select().where(self.releases.name=='d').execute().fetchall(), expected)
AssertionError: [] != [('d', 'd', 'd', '{"name": 4}', 1)]
-------------------- >> begin captured logging << --------------------
auslib.db: DEBUG: AUSTable._prepareInsert: Executing query: 'INSERT INTO releases (name, product, version, data, data_version) VALUES (?, ?, ?, ?, ?)' with values: {'data_version': 1, 'product': 'd', 'version': 'd', 'data': '{"name": 4}', 'name': 'd'}
auslib.db: DEBUG: History.getTimestamp: returning 1332533253657
--------------------- >> end captured logging << ---------------------

I can't repro locally, or on Jenkins, so I left it. However, I'd like to dig into it some more...I don't like having random orange :(.
Attachment #606198 - Flags: checked-in+
Filed https://bugzilla.mozilla.org/show_bug.cgi?id=738773 to track the intermittent orange.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
Component: General Automation → General
Product: Release Engineering → Release Engineering
You need to log in before you can comment on or make changes to this bug.