Add subcommunity checks #264
Annotations
21 errors and 10 warnings
|
Tests / Tests (3.11, postgresql14, opensearch2)
Process completed with exit code 1.
|
|
Tests / Tests (3.11, postgresql14, opensearch2):
invenio_checks/components.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/components.py 2026-04-30 16:57:51.565249+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/components.py 2026-04-30 16:59:44.232368+00:00
@@ -174,13 +174,13 @@
"""Subcommunity checks component."""
def update(self, identity, data=None, record=None, **kwargs):
"""Rerun checks if this community is a subcommunity."""
open_requests = RequestMetadata.query.filter(
- RequestMetadata.json.op('->>')('type') == "subcommunity",
- RequestMetadata.json.op('->>')('status') == "submitted",
- RequestMetadata.json['topic'].op('->>')('community') == str(record.id),
+ RequestMetadata.json.op("->>")("type") == "subcommunity",
+ RequestMetadata.json.op("->>")("status") == "submitted",
+ RequestMetadata.json["topic"].op("->>")("community") == str(record.id),
).all()
if not open_requests:
return
for req_model in open_requests:
@@ -202,13 +202,13 @@
community_id = member.community_id
if not community_id:
return
open_requests = RequestMetadata.query.filter(
- RequestMetadata.json.op('->>')('type') == "subcommunity",
- RequestMetadata.json.op('->>')('status') == "submitted",
- RequestMetadata.json['topic'].op('->>')('community') == str(community_id),
+ RequestMetadata.json.op("->>")("type") == "subcommunity",
+ RequestMetadata.json.op("->>")("status") == "submitted",
+ RequestMetadata.json["topic"].op("->>")("community") == str(community_id),
).all()
if not open_requests:
return
for req_model in open_requests:
|
|
Tests / Tests (3.11, postgresql14, opensearch2):
invenio_checks/api.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/api.py 2026-04-30 16:57:51.565249+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/api.py 2026-04-30 16:59:43.728699+00:00
@@ -38,11 +38,13 @@
CheckConfig.community_id.in_(community_ids),
CheckConfig.enabled.is_(True),
)
if target_type is not None:
- query = query.filter(CheckConfig.params["target_type"].as_string() == target_type)
+ query = query.filter(
+ CheckConfig.params["target_type"].as_string() == target_type
+ )
return query.all()
@classmethod
def run_check(cls, config, record, uow, is_draft=None):
@@ -78,14 +80,16 @@
"status": CheckRunStatus.COMPLETED,
"state": "",
"result": res.to_dict(),
}
if config.params["target_type"] == "record":
- check_run.update({
- "is_draft": is_draft,
- "revision_id": record.revision_id,
- })
+ check_run.update(
+ {
+ "is_draft": is_draft,
+ "revision_id": record.revision_id,
+ }
+ )
result_run = CheckRun(**check_run)
else:
result_run = previous_run
result_run.start_time = start_time
result_run.end_time = end_time
@@ -122,6 +126,5 @@
"context": {"community": str(run.config.community_id)},
}
)
return errors
-
|
|
Tests / Tests (3.11, postgresql14, opensearch2):
invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py 2026-04-30 16:57:51.565117+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py 2026-04-30 16:59:43.488818+00:00
@@ -14,12 +14,12 @@
from sqlalchemy_utils import JSONType
from invenio_checks.models import CheckRunStatus, Severity
# revision identifiers, used by Alembic.
-revision = 'e8bd906e5da8'
-down_revision = 'c39b06b59667'
+revision = "e8bd906e5da8"
+down_revision = "c39b06b59667"
branch_labels = ()
depends_on = None
def upgrade():
|
|
Tests / Tests (3.11, postgresql14, opensearch2):
invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py#L0
pydocstyle-check
/home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py:8 at module level:
D400: First line should end with a period (not 'e')
|
|
Tests / Tests (3.11, postgresql14, opensearch2):
invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py 2026-04-30 16:57:51.565117+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py 2026-04-30 16:59:43.122995+00:00
@@ -14,12 +14,12 @@
from sqlalchemy_utils import JSONType
from invenio_checks.models import CheckRunStatus, Severity
# revision identifiers, used by Alembic.
-revision = '9d47b33c7b74'
-down_revision = 'e8bd906e5da8'
+revision = "9d47b33c7b74"
+down_revision = "e8bd906e5da8"
branch_labels = ()
depends_on = None
def upgrade():
|
|
Tests / Tests (3.11, postgresql14, opensearch2):
invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py#L0
pydocstyle-check
/home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py:8 at module level:
D400: First line should end with a period (not 'd')
|
|
Tests / Tests (3.9, postgresql14, opensearch2)
Process completed with exit code 1.
|
|
Tests / Tests (3.9, postgresql14, opensearch2):
invenio_checks/components.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/components.py 2026-04-30 16:57:57.735313+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/components.py 2026-04-30 16:59:44.118168+00:00
@@ -174,13 +174,13 @@
"""Subcommunity checks component."""
def update(self, identity, data=None, record=None, **kwargs):
"""Rerun checks if this community is a subcommunity."""
open_requests = RequestMetadata.query.filter(
- RequestMetadata.json.op('->>')('type') == "subcommunity",
- RequestMetadata.json.op('->>')('status') == "submitted",
- RequestMetadata.json['topic'].op('->>')('community') == str(record.id),
+ RequestMetadata.json.op("->>")("type") == "subcommunity",
+ RequestMetadata.json.op("->>")("status") == "submitted",
+ RequestMetadata.json["topic"].op("->>")("community") == str(record.id),
).all()
if not open_requests:
return
for req_model in open_requests:
@@ -202,13 +202,13 @@
community_id = member.community_id
if not community_id:
return
open_requests = RequestMetadata.query.filter(
- RequestMetadata.json.op('->>')('type') == "subcommunity",
- RequestMetadata.json.op('->>')('status') == "submitted",
- RequestMetadata.json['topic'].op('->>')('community') == str(community_id),
+ RequestMetadata.json.op("->>")("type") == "subcommunity",
+ RequestMetadata.json.op("->>")("status") == "submitted",
+ RequestMetadata.json["topic"].op("->>")("community") == str(community_id),
).all()
if not open_requests:
return
for req_model in open_requests:
|
|
Tests / Tests (3.9, postgresql14, opensearch2):
invenio_checks/api.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/api.py 2026-04-30 16:57:57.735313+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/api.py 2026-04-30 16:59:43.560122+00:00
@@ -38,11 +38,13 @@
CheckConfig.community_id.in_(community_ids),
CheckConfig.enabled.is_(True),
)
if target_type is not None:
- query = query.filter(CheckConfig.params["target_type"].as_string() == target_type)
+ query = query.filter(
+ CheckConfig.params["target_type"].as_string() == target_type
+ )
return query.all()
@classmethod
def run_check(cls, config, record, uow, is_draft=None):
@@ -78,14 +80,16 @@
"status": CheckRunStatus.COMPLETED,
"state": "",
"result": res.to_dict(),
}
if config.params["target_type"] == "record":
- check_run.update({
- "is_draft": is_draft,
- "revision_id": record.revision_id,
- })
+ check_run.update(
+ {
+ "is_draft": is_draft,
+ "revision_id": record.revision_id,
+ }
+ )
result_run = CheckRun(**check_run)
else:
result_run = previous_run
result_run.start_time = start_time
result_run.end_time = end_time
@@ -122,6 +126,5 @@
"context": {"community": str(run.config.community_id)},
}
)
return errors
-
|
|
Tests / Tests (3.9, postgresql14, opensearch2):
invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py 2026-04-30 16:57:57.735313+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py 2026-04-30 16:59:43.303164+00:00
@@ -14,12 +14,12 @@
from sqlalchemy_utils import JSONType
from invenio_checks.models import CheckRunStatus, Severity
# revision identifiers, used by Alembic.
-revision = 'e8bd906e5da8'
-down_revision = 'c39b06b59667'
+revision = "e8bd906e5da8"
+down_revision = "c39b06b59667"
branch_labels = ()
depends_on = None
def upgrade():
|
|
Tests / Tests (3.9, postgresql14, opensearch2):
invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py#L0
pydocstyle-check
/home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py:8 at module level:
D400: First line should end with a period (not 'e')
|
|
Tests / Tests (3.9, postgresql14, opensearch2):
invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py 2026-04-30 16:57:57.735313+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py 2026-04-30 16:59:42.897375+00:00
@@ -14,28 +14,32 @@
from sqlalchemy_utils import JSONType
from invenio_checks.models import CheckRunStatus, Severity
# revision identifiers, used by Alembic.
-revision = '9d47b33c7b74'
-down_revision = 'e8bd906e5da8'
+revision = "9d47b33c7b74"
+down_revision = "e8bd906e5da8"
branch_labels = ()
depends_on = None
def upgrade():
"""Upgrade database."""
- op.execute("""
+ op.execute(
+ """
UPDATE checks_config
SET params = params || '{"target_type": "record"}'::jsonb
WHERE params->>'target_type' IS NULL
- """)
+ """
+ )
op.alter_column("checks_run", "revision_id", nullable=True)
def downgrade():
"""Downgrade database."""
- op.execute("""
+ op.execute(
+ """
UPDATE checks_config
SET params = params - 'target_type'
- """)
+ """
+ )
# ### end Alembic commands ###
|
|
Tests / Tests (3.9, postgresql14, opensearch2):
invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py#L0
pydocstyle-check
/home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py:8 at module level:
D400: First line should end with a period (not 'd')
|
|
Tests / Tests (3.14, postgresql14, opensearch2)
Process completed with exit code 1.
|
|
Tests / Tests (3.14, postgresql14, opensearch2):
invenio_checks/components.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/components.py 2026-04-30 16:57:51.509103+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/components.py 2026-04-30 17:00:14.817522+00:00
@@ -174,13 +174,13 @@
"""Subcommunity checks component."""
def update(self, identity, data=None, record=None, **kwargs):
"""Rerun checks if this community is a subcommunity."""
open_requests = RequestMetadata.query.filter(
- RequestMetadata.json.op('->>')('type') == "subcommunity",
- RequestMetadata.json.op('->>')('status') == "submitted",
- RequestMetadata.json['topic'].op('->>')('community') == str(record.id),
+ RequestMetadata.json.op("->>")("type") == "subcommunity",
+ RequestMetadata.json.op("->>")("status") == "submitted",
+ RequestMetadata.json["topic"].op("->>")("community") == str(record.id),
).all()
if not open_requests:
return
for req_model in open_requests:
@@ -202,13 +202,13 @@
community_id = member.community_id
if not community_id:
return
open_requests = RequestMetadata.query.filter(
- RequestMetadata.json.op('->>')('type') == "subcommunity",
- RequestMetadata.json.op('->>')('status') == "submitted",
- RequestMetadata.json['topic'].op('->>')('community') == str(community_id),
+ RequestMetadata.json.op("->>")("type") == "subcommunity",
+ RequestMetadata.json.op("->>")("status") == "submitted",
+ RequestMetadata.json["topic"].op("->>")("community") == str(community_id),
).all()
if not open_requests:
return
for req_model in open_requests:
|
|
Tests / Tests (3.14, postgresql14, opensearch2):
invenio_checks/api.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/api.py 2026-04-30 16:57:51.509103+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/api.py 2026-04-30 17:00:14.273537+00:00
@@ -38,11 +38,13 @@
CheckConfig.community_id.in_(community_ids),
CheckConfig.enabled.is_(True),
)
if target_type is not None:
- query = query.filter(CheckConfig.params["target_type"].as_string() == target_type)
+ query = query.filter(
+ CheckConfig.params["target_type"].as_string() == target_type
+ )
return query.all()
@classmethod
def run_check(cls, config, record, uow, is_draft=None):
@@ -78,14 +80,16 @@
"status": CheckRunStatus.COMPLETED,
"state": "",
"result": res.to_dict(),
}
if config.params["target_type"] == "record":
- check_run.update({
- "is_draft": is_draft,
- "revision_id": record.revision_id,
- })
+ check_run.update(
+ {
+ "is_draft": is_draft,
+ "revision_id": record.revision_id,
+ }
+ )
result_run = CheckRun(**check_run)
else:
result_run = previous_run
result_run.start_time = start_time
result_run.end_time = end_time
@@ -122,6 +126,5 @@
"context": {"community": str(run.config.community_id)},
}
)
return errors
-
|
|
Tests / Tests (3.14, postgresql14, opensearch2):
invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py 2026-04-30 16:57:51.509103+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py 2026-04-30 17:00:14.016065+00:00
@@ -14,12 +14,12 @@
from sqlalchemy_utils import JSONType
from invenio_checks.models import CheckRunStatus, Severity
# revision identifiers, used by Alembic.
-revision = 'e8bd906e5da8'
-down_revision = 'c39b06b59667'
+revision = "e8bd906e5da8"
+down_revision = "c39b06b59667"
branch_labels = ()
depends_on = None
def upgrade():
|
|
Tests / Tests (3.14, postgresql14, opensearch2):
invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py#L0
pydocstyle-check
/home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/e8bd906e5da8_make_checkrun_fields_nullable.py:8 at module level:
D400: First line should end with a period (not 'e')
|
|
Tests / Tests (3.14, postgresql14, opensearch2):
invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py#L0
Black format check
--- /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py 2026-04-30 16:57:51.509103+00:00
+++ /home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py 2026-04-30 17:00:13.621492+00:00
@@ -14,12 +14,12 @@
from sqlalchemy_utils import JSONType
from invenio_checks.models import CheckRunStatus, Severity
# revision identifiers, used by Alembic.
-revision = '9d47b33c7b74'
-down_revision = 'e8bd906e5da8'
+revision = "9d47b33c7b74"
+down_revision = "e8bd906e5da8"
branch_labels = ()
depends_on = None
def upgrade():
|
|
Tests / Tests (3.14, postgresql14, opensearch2):
invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py#L0
pydocstyle-check
/home/runner/work/invenio-checks/invenio-checks/invenio_checks/alembic/9d47b33c7b74_add_target_type_record.py:8 at module level:
D400: First line should end with a period (not 'd')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tests / Tests (3.9, postgresql14, opensearch2):
/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/edtf/parser/grammar.py#L9
'enablePackrat' deprecated - use 'enable_packrat'
|