Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
9a9dba52
Verified
Commit
9a9dba52
authored
Oct 16, 2021
by
Mattia Rizzolo
Browse files
Merge branch 'gpg-utf8' of salsa.debian.org:lyknode/debexpo into live
MR:
!184
Signed-off-by:
Mattia Rizzolo
<
mattia@debian.org
>
parents
49b90282
2e881f6c
Pipeline
#303238
passed with stage
in 9 minutes and 49 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
9a9dba52
...
@@ -26,6 +26,7 @@ before_script:
...
@@ -26,6 +26,7 @@ before_script:
python3-django-filters
python3-django-filters
python3-django-redis
python3-django-redis
ca-certificates
ca-certificates
locales-all
libjs-jquery
libjs-jquery
libjs-jquery-throttle-debounce
libjs-jquery-throttle-debounce
libjs-jquery-isonscreen
libjs-jquery-isonscreen
...
...
debexpo/base/views.py
View file @
9a9dba52
...
@@ -63,8 +63,7 @@ def get_debexpo_version():
...
@@ -63,8 +63,7 @@ def get_debexpo_version():
# currently are in a git reposirtory. Hence, this is tested manually.
# currently are in a git reposirtory. Hence, this is tested manually.
try
:
try
:
output
=
debexpo_exec
(
command
,
args
,
output
=
debexpo_exec
(
command
,
args
,
cwd
=
dirname
(
abspath
(
__file__
)),
cwd
=
dirname
(
abspath
(
__file__
)))
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
log
.
debug
(
'git not found, skip revision detection.'
)
log
.
debug
(
'git not found, skip revision detection.'
)
except
CalledProcessError
:
# pragma: no cover
except
CalledProcessError
:
# pragma: no cover
...
...
debexpo/plugins/diffclean.py
View file @
9a9dba52
...
@@ -43,8 +43,7 @@ class PluginDiffClean(BasePlugin):
...
@@ -43,8 +43,7 @@ class PluginDiffClean(BasePlugin):
def
_run_diffstat
(
self
,
diff_file
):
def
_run_diffstat
(
self
,
diff_file
):
try
:
try
:
output
=
debexpo_exec
(
"diffstat"
,
[
"-p1"
,
diff_file
],
output
=
debexpo_exec
(
"diffstat"
,
[
"-p1"
,
diff_file
],
cwd
=
dirname
(
diff_file
),
cwd
=
dirname
(
diff_file
))
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
self
.
failed
(
'diffstat not found'
)
self
.
failed
(
'diffstat not found'
)
# Looking at diffstat code, it only exit with a return code different
# Looking at diffstat code, it only exit with a return code different
...
...
debexpo/plugins/lintian.py
View file @
9a9dba52
...
@@ -68,8 +68,7 @@ class PluginLintian(BasePlugin):
...
@@ -68,8 +68,7 @@ class PluginLintian(BasePlugin):
# run as root in CI.
# run as root in CI.
"--allow-root"
,
"--allow-root"
,
str
(
changes
)],
str
(
changes
)],
cwd
=
dirname
(
changes
.
filename
),
cwd
=
dirname
(
changes
.
filename
))
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
self
.
failed
(
'lintian not found'
)
self
.
failed
(
'lintian not found'
)
except
TimeoutExpired
:
except
TimeoutExpired
:
...
...
debexpo/plugins/watch-file.py
View file @
9a9dba52
...
@@ -48,8 +48,7 @@ class PluginWatchFile(BasePlugin):
...
@@ -48,8 +48,7 @@ class PluginWatchFile(BasePlugin):
def
_run_uscan
(
self
,
source
):
def
_run_uscan
(
self
,
source
):
try
:
try
:
output
=
debexpo_exec
(
"uscan"
,
[
"--dehs"
,
'--report'
],
output
=
debexpo_exec
(
"uscan"
,
[
"--dehs"
,
'--report'
],
cwd
=
source
.
get_source_dir
(),
cwd
=
source
.
get_source_dir
())
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
self
.
failed
(
'uscan not found'
)
self
.
failed
(
'uscan not found'
)
except
CalledProcessError
as
e
:
except
CalledProcessError
as
e
:
...
...
debexpo/tools/debian/source.py
View file @
9a9dba52
...
@@ -57,8 +57,7 @@ class Source():
...
@@ -57,8 +57,7 @@ class Source():
try
:
try
:
debexpo_exec
(
'dpkg-source'
,
args
,
debexpo_exec
(
'dpkg-source'
,
args
,
stderr
=
STDOUT
,
stderr
=
STDOUT
,
cwd
=
dirname
(
self
.
dsc
.
filename
),
cwd
=
dirname
(
self
.
dsc
.
filename
))
text
=
True
)
except
FileNotFoundError
:
# pragma: no cover
except
FileNotFoundError
:
# pragma: no cover
log
.
error
(
'dpkg-source not found'
)
log
.
error
(
'dpkg-source not found'
)
raise
ExceptionSource
(
'Internal error. Please contact debexpo '
raise
ExceptionSource
(
'Internal error. Please contact debexpo '
...
...
debexpo/tools/gnupg.py
View file @
9a9dba52
...
@@ -225,7 +225,7 @@ class GnuPG():
...
@@ -225,7 +225,7 @@ class GnuPG():
try
:
try
:
output
=
debexpo_exec
(
self
.
gpg_path
,
cmd
,
env
=
env
,
output
=
debexpo_exec
(
self
.
gpg_path
,
cmd
,
env
=
env
,
stderr
=
subprocess
.
STDOUT
,
stderr
=
subprocess
.
STDOUT
,
input
=
str
(
stdin
)
,
text
=
True
)
input
=
str
(
stdin
))
except
subprocess
.
CalledProcessError
as
e
:
except
subprocess
.
CalledProcessError
as
e
:
return
(
e
.
output
,
e
.
returncode
)
return
(
e
.
output
,
e
.
returncode
)
except
subprocess
.
TimeoutExpired
:
except
subprocess
.
TimeoutExpired
:
...
...
debexpo/tools/proc.py
View file @
9a9dba52
...
@@ -38,4 +38,8 @@ def debexpo_exec(command, args, **kwargs):
...
@@ -38,4 +38,8 @@ def debexpo_exec(command, args, **kwargs):
f
'
{
basename
(
command
).
replace
(
"-"
,
"_"
).
upper
()
}
'
,
f
'
{
basename
(
command
).
replace
(
"-"
,
"_"
).
upper
()
}
'
,
getattr
(
settings
,
'SUBPROCESS_TIMEOUT'
,
None
))
getattr
(
settings
,
'SUBPROCESS_TIMEOUT'
,
None
))
return
check_output
([
command
]
+
args
,
timeout
=
timeout
,
**
kwargs
)
return
check_output
([
command
]
+
args
,
timeout
=
timeout
,
encoding
=
'utf-8'
,
text
=
True
,
**
kwargs
)
tests/functional/accounts/test_profile.py
View file @
9a9dba52
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
# OTHER DEALINGS IN THE SOFTWARE.
# OTHER DEALINGS IN THE SOFTWARE.
from
tests
import
TransactionTestController
from
tests
import
TransactionTestController
from
locale
import
getlocale
,
setlocale
,
LC_CTYPE
from
django.urls
import
reverse
from
django.urls
import
reverse
# from debexpo.lib import constants
# from debexpo.lib import constants
# from debexpo.model import meta
# from debexpo.model import meta
...
@@ -153,25 +154,29 @@ xOwJ1heEnfmgPkuiz7jFCAo=
...
@@ -153,25 +154,29 @@ xOwJ1heEnfmgPkuiz7jFCAo=
_GPGKEY_2
=
"""-----BEGIN PGP PUBLIC KEY BLOCK-----
_GPGKEY_2
=
"""-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEW/GBqhYJKwYBBAHaRw8BAQdA+6hBA4PcdcPwgMsKGQXrqwbJemLBgS1PkKZg
mDMEW/GBqhYJKwYBBAHaRw8BAQdA+6hBA4PcdcPwgMsKGQXrqwbJemLBgS1PkKZg
RFlKdKi0IHByaW1hcnkgaWQgPHByaW1hcnlAZXhhbXBsZS5vcmc+iJAEExYIADgC
RFlKdKi0HVRlc3QgdXNlciA8ZW1haWxAZXhhbXBsZS5jb20+iJMEExYIADsCGwMF
GwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQRVkwbu4cjBst0cc7HENHgc6HHz
CwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQRVkwbu4cjBst0cc7HENHgc6HHz3wUC
3wUCXyxWUwAKCRDENHgc6HHz3zxDAQCB9zEqs0mWmriFqhXtRSwjhLhbprWxpAqk
XyxWUwIZAQAKCRDENHgc6HHz30lxAP9Zvb7ssZ0bg94u2y1G3zbh8+5svSmGp3HT
WTat6AU6XgD+MDVYYgKEHeLuKqJ1MiR+x53f5ypxtA5eHJZdbs5O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""
# def _setup_gpg_env(self):
# def _setup_gpg_env(self):
...
@@ -183,12 +188,14 @@ Xcgnuh6Rlywt6uiaFIGYnGefYPGXRAA=
...
@@ -183,12 +188,14 @@ Xcgnuh6Rlywt6uiaFIGYnGefYPGXRAA=
# shutil.rmtree(self.homedir)
# shutil.rmtree(self.homedir)
#
#
def
setUp
(
self
):
def
setUp
(
self
):
self
.
locale
=
getlocale
(
LC_CTYPE
)
self
.
_setup_example_user
()
self
.
_setup_example_user
()
# self._setup_gpg_env()
# self._setup_gpg_env()
# self._setup_models()
# self._setup_models()
# self._setup_example_countries()
# self._setup_example_countries()
def
tearDown
(
self
):
def
tearDown
(
self
):
setlocale
(
LC_CTYPE
,
self
.
locale
)
self
.
_remove_example_user
()
self
.
_remove_example_user
()
# self._remove_example_countries()
# self._remove_example_countries()
# self._cleanup_gpg_env()
# self._cleanup_gpg_env()
...
@@ -246,6 +253,20 @@ Xcgnuh6Rlywt6uiaFIGYnGefYPGXRAA=
...
@@ -246,6 +253,20 @@ Xcgnuh6Rlywt6uiaFIGYnGefYPGXRAA=
self
.
assertEquals
(
response
.
status_code
,
302
)
self
.
assertEquals
(
response
.
status_code
,
302
)
self
.
assertIn
(
reverse
(
'login'
),
response
.
url
)
self
.
assertIn
(
reverse
(
'login'
),
response
.
url
)
def
test_gpg_encoding
(
self
):
setlocale
(
LC_CTYPE
,
'C'
)
self
.
client
.
post
(
reverse
(
'login'
),
self
.
_AUTHDATA
)
response
=
self
.
client
.
post
(
reverse
(
'profile'
),
{
'key'
:
self
.
_GPGKEY_2
,
'commit_gpg'
:
'submit'
})
self
.
assertEquals
(
response
.
status_code
,
200
)
self
.
assertNotIn
(
'errorlist'
,
str
(
response
.
content
))
user
=
User
.
objects
.
get
(
email
=
'email@example.com'
)
self
.
assertEquals
(
user
.
key
.
key
,
self
.
_GPGKEY_2
)
def
test__gpg
(
self
):
def
test__gpg
(
self
):
# Anonymous access to the form is denined
# Anonymous access to the form is denined
response
=
self
.
client
.
post
(
reverse
(
'profile'
),
{
'form'
:
'gpg'
})
response
=
self
.
client
.
post
(
reverse
(
'profile'
),
{
'form'
:
'gpg'
})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment