Skip to content

Commit 37d80fb

Browse files
authored
Merge branch 'master' into prevent-self-actions
2 parents 1c0db76 + 1943393 commit 37d80fb

File tree

16 files changed

+806
-99
lines changed

16 files changed

+806
-99
lines changed

.github/workflows/tests.yml

+9-55
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This file is part of Invenio.
44
# Copyright (C) 2020 CERN.
55
# Copyright (C) 2022 Graz University of Technology.
6+
# Copyright (C) 2024 KTH Royal Institute of Technology.
67
#
78
# Invenio is free software; you can redistribute it and/or modify it
89
# under the terms of the MIT License; see LICENSE file for more details.
@@ -11,9 +12,11 @@ name: CI
1112

1213
on:
1314
push:
14-
branches: master
15+
branches:
16+
- master
1517
pull_request:
16-
branches: master
18+
branches:
19+
- master
1720
schedule:
1821
# * is a special character in YAML so you have to quote this string
1922
- cron: "0 3 * * 6"
@@ -25,56 +28,7 @@ on:
2528
default: "Manual trigger"
2629

2730
jobs:
28-
Tests:
29-
runs-on: ubuntu-20.04
30-
strategy:
31-
matrix:
32-
# You can add/remove combinations e.g. `dev` requirements or `postgresql13` by adding
33-
# a new item to the following lists.
34-
# You can see the complete list of services and versions that are available at:
35-
# https://docker-services-cli.readthedocs.io/en/latest/configuration.html
36-
python-version: [3.8, 3.9]
37-
requirements-level: [pypi]
38-
cache-service: [redis]
39-
db-service: [postgresql14]
40-
mq-service: [rabbitmq]
41-
search-service: [opensearch2]
42-
43-
env:
44-
CACHE: ${{ matrix.cache-service }}
45-
DB: ${{ matrix.db-service }}
46-
MQ: ${{ matrix.mq-service }}
47-
SEARCH: ${{ matrix.search-service }}
48-
EXTRAS: tests,${{matrix.search-service}}
49-
50-
steps:
51-
- name: Checkout
52-
uses: actions/checkout@v2
53-
54-
- name: Set up Python ${{ matrix.python-version }}
55-
uses: actions/setup-python@v2
56-
with:
57-
python-version: ${{ matrix.python-version }}
58-
59-
- name: Generate dependencies
60-
run: |
61-
pip install wheel requirements-builder
62-
requirements-builder -e "$EXTRAS" --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
63-
64-
- name: Cache pip
65-
uses: actions/cache@v2
66-
with:
67-
path: ~/.cache/pip
68-
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}
69-
70-
- name: Install dependencies
71-
run: |
72-
pip install -r .${{matrix.requirements-level}}-${{ matrix.python-version }}-requirements.txt
73-
pip install ".[$EXTRAS]"
74-
pip freeze
75-
docker --version
76-
docker-compose --version
77-
78-
- name: Run tests
79-
run: |
80-
./run-tests.sh
31+
Python:
32+
uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master
33+
with:
34+
extras: "tests"

CHANGES.rst

+17
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@
88
Changes
99
=======
1010

11+
Version 6.0.0 (released 2024-08-22)
12+
13+
- mappings: add analyzers and filters to improve results when searching users
14+
15+
Version 5.4.0 (released 2024-08-09)
16+
17+
- resources: use and adjust vnd.inveniordm.v1+json http accept header
18+
19+
Version 5.3.1 (released 2024-07-30)
20+
21+
- config: Update records_html link
22+
- moderation: fix admin record / draft links
23+
24+
Version 5.3.0 (released 2024-06-04)
25+
26+
- installation: bump invenio-records-resources
27+
1128
Version 5.2.0 (released 2024-05-07)
1229

1330
- groups: add permissions and config to control groups feature flag

invenio_users_resources/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
#
33
# Copyright (C) 2022-2024 CERN.
44
# Copyright (C) 2022-2023 TU Wien.
5+
# Copyright (C) 2024 Graz University of Technology.
56
#
67
# Invenio-Users-Resources is free software; you can redistribute it and/or
78
# modify it under the terms of the MIT License; see LICENSE file for more
89
# details.
910

1011
"""Invenio module providing management APIs for users and roles/groups."""
1112

12-
__version__ = "5.2.0"
13+
__version__ = "6.0.0"
1314

1415
__all__ = ("__version__",)

invenio_users_resources/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
),
6363
"username": dict(
6464
title=_("Username"),
65-
fields=["username", "-created"],
65+
fields=["username.keyword", "-created"],
6666
),
6767
"email": dict(
6868
title=_("Email"),

invenio_users_resources/records/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class UserAggregate(BaseAggregate):
131131
)
132132
"""Search dumper with configured extensions."""
133133

134-
index = IndexField("users-user-v2.0.0", search_alias="users")
134+
index = IndexField("users-user-v3.0.0", search_alias="users")
135135
"""The search engine index to use."""
136136

137137
id = ModelField("id", dump_type=int)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
{
2+
"settings": {
3+
"analysis": {
4+
"char_filter": {
5+
"strip_special_chars": {
6+
"type": "pattern_replace",
7+
"pattern": "[\\p{Punct}\\p{S}]",
8+
"replacement": ""
9+
}
10+
},
11+
"analyzer": {
12+
"edge_analyzer": {
13+
"tokenizer": "uax_url_email",
14+
"type": "custom",
15+
"filter": [
16+
"lowercase",
17+
"edgegrams"
18+
]
19+
},
20+
"accent_edge_analyzer": {
21+
"tokenizer": "uax_url_email",
22+
"type": "custom",
23+
"filter": [
24+
"lowercase",
25+
"asciifolding",
26+
"edgegrams"
27+
]
28+
},
29+
"accent_analyzer": {
30+
"tokenizer": "standard",
31+
"type": "custom",
32+
"char_filter": ["strip_special_chars"],
33+
"filter": [
34+
"lowercase",
35+
"asciifolding"
36+
]
37+
}
38+
},
39+
"filter": {
40+
"lowercase": {
41+
"type": "lowercase",
42+
"preserve_original": true
43+
},
44+
"asciifolding": {
45+
"type": "asciifolding",
46+
"preserve_original": true
47+
},
48+
"edgegrams": {
49+
"type": "edge_ngram",
50+
"min_gram": 2,
51+
"max_gram": 20
52+
}
53+
}
54+
}
55+
},
56+
"mappings": {
57+
"dynamic": "strict",
58+
"dynamic_templates": [
59+
{
60+
"profile": {
61+
"path_match": "profile.*",
62+
"mapping": {
63+
"type": "keyword"
64+
}
65+
}
66+
},
67+
{
68+
"preferences": {
69+
"path_match": "preferences.*",
70+
"mapping": {
71+
"type": "keyword"
72+
}
73+
}
74+
},
75+
{
76+
"identities": {
77+
"path_match": "identities.*",
78+
"mapping": {
79+
"type": "keyword"
80+
}
81+
}
82+
}
83+
],
84+
"properties": {
85+
"$schema": {
86+
"type": "keyword",
87+
"index": "false"
88+
},
89+
"id": {
90+
"type": "keyword"
91+
},
92+
"version_id": {
93+
"type": "integer"
94+
},
95+
"uuid": {
96+
"type": "keyword"
97+
},
98+
"created": {
99+
"type": "date"
100+
},
101+
"updated": {
102+
"type": "date"
103+
},
104+
"current_login_at": {
105+
"type": "date"
106+
},
107+
"active": {
108+
"type": "boolean"
109+
},
110+
"confirmed_at": {
111+
"type": "date"
112+
},
113+
"indexed_at": {
114+
"type": "date"
115+
},
116+
"confirmed": {
117+
"type": "boolean"
118+
},
119+
"blocked_at": {
120+
"type": "date"
121+
},
122+
"blocked": {
123+
"type": "boolean"
124+
},
125+
"verified_at": {
126+
"type": "date"
127+
},
128+
"verified": {
129+
"type": "boolean"
130+
},
131+
"username": {
132+
"type": "text",
133+
"analyzer": "accent_edge_analyzer",
134+
"search_analyzer": "accent_analyzer",
135+
"fields": {
136+
"keyword": {
137+
"type": "keyword"
138+
}
139+
}
140+
},
141+
"email": {
142+
"type": "text",
143+
"analyzer": "edge_analyzer",
144+
"search_analyzer": "standard",
145+
"fields": {
146+
"keyword": {
147+
"type": "keyword"
148+
}
149+
}
150+
},
151+
"email_hidden": {
152+
"type": "keyword"
153+
},
154+
"domain": {
155+
"type": "keyword"
156+
},
157+
"domaininfo": {
158+
"properties": {
159+
"status": {
160+
"type": "integer"
161+
},
162+
"flagged": {
163+
"type": "boolean"
164+
},
165+
"category": {
166+
"type": "integer"
167+
},
168+
"tld": {
169+
"type": "keyword"
170+
}
171+
}
172+
},
173+
"identities": {
174+
"type": "object",
175+
"properties": {},
176+
"dynamic": "true"
177+
},
178+
"profile": {
179+
"properties": {
180+
"full_name": {
181+
"type": "text",
182+
"analyzer": "accent_edge_analyzer",
183+
"search_analyzer": "accent_analyzer"
184+
},
185+
"affiliations": {
186+
"type": "text",
187+
"analyzer": "accent_edge_analyzer",
188+
"search_analyzer": "accent_analyzer"
189+
}
190+
},
191+
"dynamic": "true"
192+
},
193+
"preferences": {
194+
"properties": {
195+
"visibility": {
196+
"type": "keyword"
197+
},
198+
"email_visibility": {
199+
"type": "keyword"
200+
},
201+
"locale": {
202+
"type": "keyword"
203+
},
204+
"timezone": {
205+
"type": "keyword"
206+
},
207+
"notifications": {
208+
"properties": {
209+
"enabled": {
210+
"type": "boolean"
211+
}
212+
}
213+
}
214+
},
215+
"dynamic": "true"
216+
},
217+
"status": {
218+
"type": "keyword"
219+
},
220+
"visibility": {
221+
"type": "keyword"
222+
}
223+
}
224+
}
225+
}

0 commit comments

Comments
 (0)