Skip to content

[GRDM-57695] プロジェクト・コンポーネントの作成・フォーク時に所属機関を付与する#9

Draft
tma-ntphat wants to merge 5 commits into
developfrom
feature/nii_grdm_202603_step4/2.3_create_projects_affiliated_institutions
Draft

[GRDM-57695] プロジェクト・コンポーネントの作成・フォーク時に所属機関を付与する#9
tma-ntphat wants to merge 5 commits into
developfrom
feature/nii_grdm_202603_step4/2.3_create_projects_affiliated_institutions

Conversation

@tma-ntphat

@tma-ntphat tma-ntphat commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Purpose

  • Added logic to add affiliated institutions to the new project/component after it's created.

Changes

  • grdmcli/grdm_client/users.py
    • Add the _users_institutions() function to retrieve the list of institutions for the current user via GET users/{user_id}/relationships/institutions/.
    • Handle errors using a best-effort approach when ignore_error=True (log a warning and return an empty list).
  • grdmcli/grdm_client/projects.py
    • Add _prepare_institutions_relationship_data() to normalize the institutions' payload.
    • Add _add_node_institutions() to call POST nodes/{node_id}/relationships/institutions/ using a best-effort policy (log a warning and do not block the flow if ignore_error=True).
    • In projects_create(), fetch institutions once using _users_institutions() and pass the context throughout the flow.
    • Propagate the affiliated_institutions parameter across recursive/branch creation functions:
      • _create_or_update_project()
      • _add_project_components()
      • _projects_add_component()
      • _overwrite_node_link_update_component()
      • _update_project_component()
    • When creating a new project/component (i.e., when the ID does not yet exist), call _add_node_institutions() to attach institutions.
    • In the component update branch with an existing ID (PUT), do not add an “overwrite institutions” step; only ensure that newly created nodes within the update branch still receive the institutions' context.
  • grdmcli/constants.py
    • Clean up duplicate definition of MAX_THREADS_CALL_API (remove the redundant declaration).

QA Notes

None.

Documentation

None.

Side Effects

None.

Ticket

  • 57695

@tma-ntphat tma-ntphat changed the title 2.3.所属機関がないプロジェクトに関する調査・対応 2.3.所属機関がないプロジェクトに関する Apr 13, 2026
@tma-ntphat tma-ntphat changed the title 2.3.所属機関がないプロジェクトに関する [GRDM-57695] 2.3.所属機関がないプロジェクトに関する Apr 13, 2026
@tma-ntphat tma-ntphat changed the title [GRDM-57695] 2.3.所属機関がないプロジェクトに関する [GRDM-57695] プロジェクト・コンポーネントの作成・フォーク時に所属機関を付与する Apr 16, 2026
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.

2 participants