#5156 Add "access" field to "project.user.removed" notification.
Opened 2 years ago by zpagure. Modified 2 years ago
zpagure/pagure forgefed  into  master

file modified
+4
@@ -5871,6 +5871,9 @@ 

              "User does not have any access on the repo"

          )

  

+     # Retrieve the access level of the user before it's removed

+     access_level = get_obj_access(session, project, user).access

+ 

      for u in project.users:

          if u.id == user.id:

              user = u
@@ -5888,6 +5891,7 @@ 

          msg=dict(

              project=project.to_json(public=True),

              removed_user=user.username,

+             access=access_level,

              agent=agent,

          ),

      )

The "project.user.removed" does not send out the "access" level that was revoked, unlike "project.user.added"

"The following steps that have been detected may have insecure interpolation of sensitive variables"

Is this a bug in Jenkins?

pretty please pagure-ci rebuild

2 years ago

Pretty sure there will be a few tests that will be impacted by this change. Did you run the tests locally?

I have all the pagure/requirements* installed but I get this error when running pytest tests. How can I fix this?

$ pytest  tests/
=================================================== test session starts ===================================================
platform linux -- Python 3.7.3, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /home/user/Desktop/pagure/pagure
plugins: xdist-2.2.1, cov-2.11.1, forked-1.3.0
collected 1699 items / 1 error / 1 skipped / 1697 selected                                                                

========================================================= ERRORS ==========================================================
____________________________________ ERROR collecting tests/test_pagure_flask_docs.py _____________________________________
tests/test_pagure_flask_docs.py:27: in <module>
    import pagure.docs_server
pagure/docs_server.py:44: in <module>
    SESSION = pagure.lib.model_base.create_session(APP.config["DB_URL"])
pagure/lib/model_base.py:51: in create_session
    db_url and db_url != ("%s" % SESSIONMAKER.kw["bind"].engine.url)
E   TypeError: not all arguments converted during string formatting
==================================================== warnings summary =====================================================
tests/__init__.py:13
  /home/user/Desktop/pagure/pagure/tests/__init__.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp

../pagure_env/lib/python3.7/site-packages/kombu/utils/compat.py:93
  /home/user/Desktop/pagure/pagure_env/lib/python3.7/site-packages/kombu/utils/compat.py:93: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
    for ep in importlib_metadata.entry_points().get(namespace, [])

../pagure_env/lib/python3.7/site-packages/markdown/util.py:87
  /home/user/Desktop/pagure/pagure_env/lib/python3.7/site-packages/markdown/util.py:87: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
    INSTALLED_EXTENSIONS = metadata.entry_points().get('markdown.extensions', ())

pagure/forms.py:338
  /home/user/Desktop/pagure/pagure/tests/../pagure/forms.py:338: DeprecationWarning: Required is going away in WTForms 3.0, use DataRequired
    [wtforms.validators.Required()],

pagure/forms.py:967
  /home/user/Desktop/pagure/pagure/tests/../pagure/forms.py:967: DeprecationWarning: Required is going away in WTForms 3.0, use DataRequired
    "comment", [wtforms.validators.Required()], choices=[]

tests/test_style.py:90
  /home/user/Desktop/pagure/pagure/tests/test_style.py:90: DeprecationWarning: invalid escape sequence \.
    '"/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist)/"',

-- Docs: https://docs.pytest.org/en/stable/warnings.html
================================================= short test summary info =================================================
ERROR tests/test_pagure_flask_docs.py - TypeError: not all arguments converted during string formatting
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================= 1 skipped, 6 warnings, 1 error in 6.88s =========================================

EDIT: does this test require to run on an existing installation of Pagure? I tried to run it just after "git clone".

Anyway, running all the tests locally is a problem for me because there are 1700 of them and it takes days to finish. I rely on Jenkins because it can return an answer in a few hours and then I can check locally only the ones that broke. But this time it wasn't very useful.

By the way, is "alembic-3" a Fedora thing? When I install alembic from Debian or PIP, all I see is "alembic" in PATH. Symlinking alembic-3 to alembic fixes some errors, but I still get the same error as above TypeError: not all arguments converted during string formatting in many other tests.

pretty please pagure-ci rebuild

2 years ago

By the way, is "alembic-3" a Fedora thing? When I install alembic from Debian or PIP, all I see is "alembic" in PATH. Symlinking alembic-3 to alembic fixes some errors, but I still get the same error as above TypeError: not all arguments converted during string formatting in many other tests.

Debian uses alternatives to manage python2 vs python3 variants, Fedora renames the binaries and has the preferred one statically symlinked.

pretty please pagure-ci rebuild

2 years ago

pretty please pagure-ci rebuild

2 years ago

pretty please pagure-ci rebuild

2 years ago

pretty please pagure-ci rebuild

2 years ago

pretty please pagure-ci rebuild

2 years ago

pretty please pagure-ci rebuild

2 years ago

pretty please pagure-ci rebuild

2 years ago

pretty please pagure-ci rebuild

2 years ago

pretty please pagure-ci rebuild

2 years ago

pretty please pagure-ci rebuild

2 years ago

@zpagure This needs rebasing, please.

Metadata