Detect missing db/cur arguments in 'nested' calls and raise an error.
We often forget these (eg. swh-storage!359 (closed)); this diff should prevent most mistakes in the future.
On the other hand, it's not fool-proof and is a terrible hack...
Migrated from D2846 (view on Phabricator)
Merge request reports
Activity
Build is green See https://jenkins.softwareheritage.org/job/DCORE/job/tox/433/ for more details.
Build is green See https://jenkins.softwareheritage.org/job/DCORE/job/tox/434/ for more details.
assigned to @lunar
Jenkins job DCORE/gitlab-builds #117 failed .
See Console Output and Coverage Report for more details.added 231 commits
-
9444422c...b58b0776 - 230 commits from branch
master
- 348a9487 - Merge branch 'master' into generated-differential-D2846-source
-
9444422c...b58b0776 - 230 commits from branch
Jenkins job DCORE/gitlab-builds #118 succeeded .
See Console Output and Coverage Report for more details.Jenkins job DCORE/gitlab-builds #119 succeeded .
See Console Output and Coverage Report for more details.Jenkins job DCORE/gitlab-builds #120 succeeded .
See Console Output and Coverage Report for more details.There's a false positive in many vault tests:
# Set a display name with swh_storage.db() as db: with db.transaction() as cur: cur.execute( "UPDATE person set displayname = %s where fullname = %s", (current_person.fullname, legacy_person.fullname), ) # Check the display name did apply in the storage assert swh_storage.revision_get([revision.id])[0] == attr.evolve( revision, author=current_person, committer=current_person, )
because
db
andcur
are still in scope when callingswh_storage.revision_get
.- Resolved by Jérémy Bobbio (Lunar)
- Resolved by vlorentz
added mr-reviewed-fall-2023 label
added 1 commit
- 6032fc3d - Checking if the cursor is closed helps with false positive
Jenkins job DCORE/gitlab-builds #121 failed .
See Console Output and Coverage Report for more details.