Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: commit f9a8a85 #487

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 3 additions & 41 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,6 @@ on:

jobs:
Tests:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.9", "3.12"]
cache-service: [redis]
db-service: [postgresql14, mysql8]
search-service: [opensearch2]

include:
- db-service: postgresql14
DB_EXTRAS: "postgresql"

- db-service: mysql8
DB_EXTRAS: "mysql"

env:
CACHE: ${{ matrix.cache-service }}
DB: ${{ matrix.db-service }}
SEARCH: ${{ matrix.search-service }}
EXTRAS: tests,admin,${{ matrix.DB_EXTRAS }},${{ matrix.search-service }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.cfg

- name: Install dependencies
run: |
pip install ".[$EXTRAS]"
pip freeze
docker --version
docker-compose --version

- name: Run tests
run: |
./run-tests.sh
uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master
with:
extras: "tests,admin,postgresql"
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
Changes
=======

Version 5.1.1 (released 2024-08-08)

- revert: commit f9a8a85

Version 5.1.0 (released 2024-07-30)

- feat(cli): add command for group creation
Expand Down
2 changes: 1 addition & 1 deletion invenio_accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
from .ext import InvenioAccounts, InvenioAccountsREST, InvenioAccountsUI
from .proxies import current_accounts

__version__ = "5.1.0"
__version__ = "5.1.1"

__all__ = (
"__version__",
Expand Down
18 changes: 0 additions & 18 deletions invenio_accounts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
from flask.cli import with_appcontext
from flask_security.forms import ConfirmRegisterForm
from flask_security.utils import hash_password
from invenio_access.permissions import system_identity
from invenio_db import db
from invenio_users_resources.proxies import current_groups_service
from werkzeug.datastructures import MultiDict
from werkzeug.local import LocalProxy

Expand Down Expand Up @@ -55,11 +53,6 @@ def domains():
"""Domain commands."""


@click.group()
def groups():
"""Group commands."""


@users.command("create")
@click.argument("email")
@click.password_option()
Expand Down Expand Up @@ -185,14 +178,3 @@ def domains_create(domain):
click.secho(f"Domain {domain} creating failed with {error}", fg="red")
else:
click.secho(f"Domain {domain} created successfully", fg="green")


@groups.command("create")
@click.argument("name")
@with_appcontext
@commit
def groups_create(name):
"""Create group."""
_datastore.create_role(id=name, name=name, is_managed=False)
current_groups_service.rebuild_index(system_identity)
click.secho(f'Role "({name})s" created successfully.', fg="green")
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fi
python -m check_manifest
python -m setup extract_messages --output-file /dev/null
python -m sphinx.cmd.build -qnN docs docs/_build/html
eval "$(docker-services-cli up --db ${DB:-postgresql} --search ${SEARCH:-opensearch} --cache ${CACHE:-redis} --env)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should stay no? Otherwise, we cannot test search no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was an addition of the commit i will revert. i thought to remove all what was added in the utnapischtim@f9a8a85

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep that... Basically instead of git revert <commit> you can just push a new one with only removing the necessary parts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we add that to the tests then a container will be started which is not used. that consumes resources which are unnecessary
since it was not there before in my opinion we should save resources

eval "$(docker-services-cli up --db ${DB:-postgresql} --cache ${CACHE:-redis} --env)"
# Note: expansion of pytest_args looks like below to not cause an unbound
# variable error when 1) "nounset" and 2) the array is empty.
python -m pytest ${pytest_args[@]+"${pytest_args[@]}"}
Expand Down
8 changes: 0 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ install_requires =
cryptography>=3.0.0
Flask-KVSession-Invenio>=0.6.3
Flask-Security-Invenio>=3.2.0
invenio_access>=2.0.0
invenio-celery>=1.2.3
invenio-i18n>=2.0.0
invenio-mail>=1.0.2
invenio-rest>=1.2.4
invenio-theme>=2.0.0
invenio_users_resources>=5.0.0
maxminddb-geolite2>=2017.404
pyjwt>=1.5.0
simplekv>=0.11.2
Expand All @@ -52,10 +50,6 @@ mysql =
invenio-db[mysql]>=1.0.14
sqlite =
invenio-db>=1.0.14
opensearch1 =
invenio-search[opensearch1]>=2.1.0,<3.0.0
opensearch2 =
invenio-search[opensearch2]>=2.1.0,<3.0.0
tests =
mock>=1.3.0
invenio-app>=1.4.0
Expand All @@ -68,8 +62,6 @@ flask.commands =
roles = invenio_accounts.cli:roles
users = invenio_accounts.cli:users
domains = invenio_accounts.cli:domains
groups = invenio_accounts.cli:groups

invenio_admin.views =
invenio_accounts_user = invenio_accounts.admin:user_adminview
invenio_accounts_role = invenio_accounts.admin:role_adminview
Expand Down