Skip to content

feat(components): Auto submit public records to cern research#837

Open
sakshamarora1 wants to merge 1 commit into
CERNDocumentServer:masterfrom
sakshamarora1:feat/auto-submit-publications
Open

feat(components): Auto submit public records to cern research#837
sakshamarora1 wants to merge 1 commit into
CERNDocumentServer:masterfrom
sakshamarora1:feat/auto-submit-publications

Conversation

@sakshamarora1

Copy link
Copy Markdown
Contributor

closes: #830

@sakshamarora1 sakshamarora1 force-pushed the feat/auto-submit-publications branch 2 times, most recently from dae678a to f7663b6 Compare June 30, 2026 15:08
Comment thread site/cds_rdm/components.py Outdated
return False

resource_type = draft["metadata"]["resource_type"]["id"]
public_research_types = current_app.config.get(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
public_research_types = current_app.config.get(
research_types = current_app.config.get(

this is a bit confusing as a variable name. Do we have anything like public research types? did you mean research resource types?

Comment thread site/cds_rdm/components.py Outdated

csc_community_id = current_app.config.get("CDS_CERN_SCIENTIFIC_COMMUNITY_ID")
if not csc_community_id:
current_app.logger.warning(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this should be an error not a warning and we want this popping up sentry as an exception, this variable is very important and if it is not configured, we should know

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Alright, updated!


return True

def publish(self, identity, draft=None, record=None, **kwargs):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we auto accept it? or it needs to be accepted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the task, there is "require_review": True
It only submits for review

Comment thread site/cds_rdm/tasks.py Outdated
"""Create and submit a community inclusion request to the CERN Scientific Community after a public record satisfies the criteria."""
csc_community_id = current_app.config.get("CDS_CERN_SCIENTIFIC_COMMUNITY_ID")
if not csc_community_id:
current_app.logger.warning(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above, also since the task is checking it here, do we need to do the same in the component? isn't it redundant in the component?

Comment thread site/cds_rdm/tasks.py Outdated
"require_review": True,
"comment": {
"payload": {
"content": "<p>This record was automatically submitted to the CERN Research Community because it satisfies the criteria for inclusion.</p>",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"content": "<p>This record was automatically submitted to the CERN Research Community because it satisfies the criteria for inclusion.</p>",
"content": "<p>This record was automatically submitted to the CERN Research Community by the system because it satisfies the criteria for inclusion (resource type identified as research related) </p>",

Comment thread site/cds_rdm/tasks.py

try:
with UnitOfWork() as uow:
processed, errors = current_record_communities_service.add(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

doesn't it automatically add the community to the record without requiring the review? We discussed that initially we should go through approval, we might switch to automatic approval later on

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If that happens, later on we can remove the require_review flag from the data being passed to this service method.

@sakshamarora1 sakshamarora1 force-pushed the feat/auto-submit-publications branch 3 times, most recently from 7131a57 to 28ec1dc Compare July 2, 2026 13:55
@sakshamarora1 sakshamarora1 force-pushed the feat/auto-submit-publications branch from 28ec1dc to a69b2e5 Compare July 3, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

submit automatic inclusion request to CERN Scientific community for submissions of public research type records

2 participants