launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #28907
[Merge] ~jugmac00/launchpad:run-pre-commit-in-ci into launchpad:master
Jürgen Gmach has proposed merging ~jugmac00/launchpad:run-pre-commit-in-ci into launchpad:master.
Commit message:
Run linters via pre-commit and build docs on CI
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jugmac00/launchpad/+git/launchpad/+merge/427516
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/launchpad:run-pre-commit-in-ci into launchpad:master.
diff --git a/.launchpad.yaml b/.launchpad.yaml
new file mode 100644
index 0000000..d2bcceb
--- /dev/null
+++ b/.launchpad.yaml
@@ -0,0 +1,19 @@
+pipeline:
+ - docs
+ - lint
+
+jobs:
+ docs:
+ architectures: amd64
+ packages:
+ - tox
+ run: "tox -e docs"
+ series: jammy
+ lint:
+ architectures: amd64
+ packages:
+ - tox
+ - git
+ - golang
+ run: "tox -e lint"
+ series: jammy
diff --git a/lib/lp/registry/personmerge.py b/lib/lp/registry/personmerge.py
index 66b19b3..8ae203a 100644
--- a/lib/lp/registry/personmerge.py
+++ b/lib/lp/registry/personmerge.py
@@ -895,7 +895,8 @@ def _mergeOCIRecipeSubscription(cur, from_id, to_id):
def _mergeVulnerabilitySubscription(cur, from_id, to_id):
# Update only the VulnerabilitySubscription that will not conflict.
- cur.execute('''
+ cur.execute(
+ """
UPDATE VulnerabilitySubscription
SET person=%(to_id)d
WHERE person=%(from_id)d AND vulnerability NOT IN
@@ -904,11 +905,16 @@ def _mergeVulnerabilitySubscription(cur, from_id, to_id):
FROM VulnerabilitySubscription
WHERE person = %(to_id)d
)
- ''' % vars())
+ """
+ % vars()
+ )
# and delete those left over.
- cur.execute('''
+ cur.execute(
+ """
DELETE FROM VulnerabilitySubscription WHERE person=%(from_id)d
- ''' % vars())
+ """
+ % vars()
+ )
def _mergeCharmRecipe(cur, from_person, to_person):
@@ -1181,7 +1187,7 @@ def merge_people(from_person, to_person, reviewer, delete=False):
skip.append(("charmrecipe", "owner"))
_mergeVulnerabilitySubscription(cur, from_id, to_id)
- skip.append(('vulnerabilitysubscription', 'person'))
+ skip.append(("vulnerabilitysubscription", "person"))
# Sanity check. If we have a reference that participates in a
# UNIQUE index, it must have already been handled by this point.
diff --git a/tox.ini b/tox.ini
index 2bf5ee3..5bd4f59 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,4 +1,13 @@
[tox]
+envlist =
+ lint
+ docs
+
+[testenv:lint]
+skip_install = true
+deps = pre-commit
+commands = pre-commit run --all-files --show-diff-on-failure
+passenv = HOME
[testenv:docs]
basepython = python3
Follow ups